Papers
Topics
Authors
Recent
Search
2000 character limit reached

Indexed Graded Monads

Updated 28 January 2026
  • Indexed graded monads are a categorical structure that generalizes graded and indexed monads by internalizing grading over fibers, enabling dependent effect tracking.
  • They support advanced applications such as resource and cost analysis, probabilistic reasoning, temporal safety, and circuit generation in dependently-typed settings.
  • The framework rigorously formalizes coherence laws and reindexing functoriality to ensure that effect annotations vary accurately with contextual parameters.

Indexed graded monads are a categorical structure generalizing graded monads and indexed monads, developed to provide semantics for effect systems and refinement type systems with dependent effects—effects whose quantitative or qualitative characteristics depend on parameters or predicates drawn from the typing context. They unify several strands in the theory of computational effects, supporting value-dependent resource analysis, probabilistic reasoning, and temporal safety properties. As ordinary graded monads model effect systems by grading by a monoid, and indexed monads provide families of monads parameterized over a base category, indexed graded monads internalize graded monads to fibers of a fibration, with the grading varying over the base category. This yields a structural framework capturing both global and context-dependent effect tracking in programming language semantics (Kura et al., 21 Jan 2026, Orchard et al., 2020, Orchard et al., 2014, Sakayori et al., 27 Nov 2025, Fujii, 2019).

1. Foundational Structures: Graded, Indexed, and Indexed Graded Monads

Classical graded monads are defined by a monoidal grading set MM acting on a base category C\mathcal{C}, with a functor T:M×CCT: M \times \mathcal{C} \to \mathcal{C}, together with unit and multiplication operations indexed by MM and satisfying graded coherence laws (Orchard et al., 2020, Orchard et al., 2014, Fujii, 2019). Ordinary indexed monads involve an indexing category BB, forming a functor T:B×CC\mathscr{T} : B \times \mathcal{C} \to \mathcal{C} such that for each bBb \in B, TbT_b is a monad and the assignment is functorial in bb (Orchard et al., 2014, Fujii, 2019).

Indexed graded monads combine these axes. Formally, let p:EBp: \mathcal{E} \to \mathcal{B} be a fibration, and let M:BopPreMonM_{-}: \mathcal{B}^{op} \to \mathrm{PreMon} be a B\mathcal{B}-indexed family of preordered monoids. An indexed MM_{-}-graded monad is a family of graded monads (TI,ηI,μI)(T_I, \eta_I, \mu_I) on each fiber EI\mathcal{E}_I, such that for every u:IJu: I \to J in B\mathcal{B}, the reindexing (u:MJMI, u:EJEI)(u^* : M_J \to M_I,~u^* : \mathcal{E}_J \to \mathcal{E}_I) is a morphism of graded monads, i.e.,

u(TJmX)=TIu(m)(uX),u^*(T_J^m X) = T_I^{u^*(m)}(u^* X),

with preservation of units and multiplications (Kura et al., 21 Jan 2026, Fujii, 2019). If B=1\mathcal{B} = 1, this collapses to an ordinary graded monad.

This framework subsumes the main generalizations:

Structure Indexing Grading Generalizes
Monad constant none Classical effect semantics
Graded Monad none monoid MM Effect systems
Indexed Monad category BB none Program logics
Indexed Graded Monad category BB MM_{-} varying Dependent effect systems

2. Indexed Graded Monads and Dependent Effect Tracking

The principal motivation for indexed graded monads arises from the need to express dependent effects: effect annotations in type systems that may vary with parameters in the context, rather than being chosen uniformly. For example, cost bounds or probabilistic guarantees dependent on program inputs are not expressible using classical graded monads, which grade by a fixed monoid MM (Kura et al., 21 Jan 2026).

In a refinement-type setting, a dependent effect system allows effect terms EE to contain variables from the current typing context. For instance, a type Tmax{0,nx}AT_{{\max\{0, n-x\}}}A describes computations whose cost is determined by program values nn and xx. The semantics requires fibers for each context and a family of monoids MIM_I on each fiber, together with compatible monad structures and monoidal functors reflecting the base context structure (Kura et al., 21 Jan 2026).

Indexed graded monads provide the semantics for such systems: for each context II, the fiber EI\mathcal{E}_I models value and computation types, and each MIM_I is a preordered monoid of effects over II. The monad's grade can thus depend on II, allowing precise effect tracking and relational reasoning in context-sensitive analyses such as resource bounds, security assertions, and temporal properties (Kura et al., 21 Jan 2026, Sakayori et al., 27 Nov 2025).

3. Categorical Semantics and Coherence Laws

Formally, the structure of an indexed graded monad is captured as a monad internal to the 2-category of fibrations, with extra compatibility with the fibered premonoidal structure (Kura et al., 21 Jan 2026, Fujii, 2019). The categorical coherence requires that for every morphism u:IJu: I \to J in B\mathcal{B},

  • uu^* maps effects compatibly: u:MJMIu^*: M_J \to M_I preserves the monoid and preorder,
  • uu^* maps objects in fibers: u:EJEIu^*: \mathcal{E}_J \to \mathcal{E}_I,
  • The monad structure is preserved: uu^* commutes with units and multiplications.

The underlying graded monad structure on each fiber consists of

  • A unit ηX:XT1X\eta_X: X \to T^{1} X,
  • Multiplications μm1,m2,X:Tm1(Tm2X)Tm1m2X\mu_{m_1,m_2, X}: T^{m_1}(T^{m_2} X) \to T^{m_1 m_2} X,
  • Reindexing functoriality linking context changes to effect grading.

Typical coherence diagrams—unit laws, associativity, and compatibility with reindexing—must commute across the fibers (Kura et al., 21 Jan 2026, Fujii, 2019).

4. Examples and Instances

Several concrete semantics instantiate indexed graded monads:

  • Cost analysis: The base category B\mathcal{B} is contexts (predicates) on a category CC (e.g., Set\mathrm{Set} or ωCPO\omega\mathbf{CPO}), and MIM_I assigns to each context II the set of functions INI \to \mathbb{N}_{\infty}, ordered pointwise. The monad acts as TI(f,Xi)=(Xi×{nf(i)})iIT_I(f, X_i) = (X_i \times \{n \leq f(i)\})_{i \in I} [(Kura et al., 21 Jan 2026), Sec. 6.1].
  • Expectation bounds: For probabilistic reasoning, MIM_I assigns value-dependent expectation shift bounds, with the fiberwise monad acting on subspaces of distributions with bounded expectation [(Kura et al., 21 Jan 2026), Sec. 6.2].
  • Temporal safety: The fiberwise graded monad encodes trace languages parameterized by predicates, supporting semantic soundness for temporal contracts [(Kura et al., 21 Jan 2026), App. D.3].
  • Resource-tracking quantum circuits: The monad MM on Mop×M×SetSet\mathcal{M}^{op} \times \mathcal{M} \times \mathrm{Set} \to \mathrm{Set}, M(m1,m2;X)=X×M(m1,m2)M(m_1, m_2; X) = X \times \mathcal{M}(m_1, m_2), is refined using a circuit algebra EE to become an EE-graded monad on Set\mathrm{Set}, modeling resource-aware circuit generation with effect typing (Sakayori et al., 27 Nov 2025).

These examples demonstrate that indexed graded monads subsume both ordinary effect and resource analysis as well as advanced dependent analyses.

5. Typing Discipline and Denotational Semantics

Effect typing with indexed graded monads decorates terms and types with effect annotations dependent on context. Typing judgments take the form

ΓM:A [E],\Gamma \vdash M : A~[E],

where EE is a (possibly dependent) effect annotation in MΓM_{\llbracket \Gamma \rrbracket}. Denotationally, the semantics assigns

M:ΓTΓEA\llbracket M \rrbracket : \llbracket \Gamma \rrbracket \to T^{E}_{\llbracket \Gamma \rrbracket} \llbracket A \rrbracket

for each term MM. This subsumes conventional monadic semantics (MM-graded or otherwise), enabling dependent subeffecting, composition, and refined effect polymorphism (Orchard et al., 2014, Kura et al., 21 Jan 2026, Sakayori et al., 27 Nov 2025). The soundness theorem asserts that syntactically well-typed programs have semantics respecting all effect and resource invariants imposed by the indexings (Kura et al., 21 Jan 2026), Thm 5.8.

Effect typing rules follow the graded monad's structure (e.g., sequencing via μ\mu for let, subeffecting by morphisms in MIM_I, and preservation under context reindexing). For circuit generation, the typing tracks abstract resource usage (e.g., gate count, width) compositionaly, as determined by the base circuit algebra and abstraction functor (Sakayori et al., 27 Nov 2025).

6. 2-Categorical and Lax Functorial Perspectives

Indexed graded monads admit characterization as monads in appropriate 2-categories. Fujii (Fujii, 2019) formalizes this by considering monads internal to certain 2-categories of fibrations, functors, and natural transformations, equipped with grading and indexing structures. Graded and indexed monads are monads in different 2-categorical environments; indexed graded monads combine these, requiring a composite structure with units and multiplications in both grade and index directions, and reindexing/regrading compatibility.

In particular, the composite functor M×B×CCM \times B \times \mathcal{C} \to \mathcal{C}, equipped with the four requisite structure families, is a monad in the relevant double 2-category, with Eilenberg–Moore and Kleisli constructions generalizing those for ordinary and graded monads [(Fujii, 2019), Prop. B.1]. This perspective clarifies the relation of indexed graded monads to parameterized and category-graded monads (Orchard et al., 2020).

7. Applications and Impact

Indexed graded monads provide modular semantics for a wide range of advanced type-and-effect systems, notably enabling

  • Resource and cost analysis in dependently-typed calculi,
  • Formal verification of value-bound probabilities, expectations, and temporal properties,
  • Effect typing for program logics and circuit description languages, including the Proto-Quipper family (Sakayori et al., 27 Nov 2025),
  • Sound and adequate denotational models for dependent effect systems, supporting proof principles such as induction on contexts and effect annotations (Kura et al., 21 Jan 2026).

Soundness and adequacy theorems guarantee that effect annotations in types precisely control the operational cost, probability, or resource usage of program executions, even in the presence of dependent or parametric variation. This leads to verified quantitative properties, compositional reasoning, and supports compiler optimizations and resource-dependent program synthesis (Kura et al., 21 Jan 2026, Sakayori et al., 27 Nov 2025, Orchard et al., 2014).

A plausible implication is that indexed graded monads will become a standard tool in the semantics of effectful, resource-sensitive, and dependently-typed programming languages, with ongoing impact on automated verification, cost analysis, and certified compilation.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Indexed Graded Monads.