MugdaA guide to the ideas
A new language for checked algorithms

Why it works.
Why it stops.
What it costs.

Mugda2 explores a programming language in which reusable components carry precise guarantees about their behaviour, termination, and resource use—and people and AI agents can construct the evidence together.

Explicit evidence

Claims come with proofs or checked certificates.

Modular reasoning

Clients use contracts across hidden implementations.

Quantitative guarantees

Cost has a named unit, model, and bound.

Status matters. This is a design guide, not a language reference. Code is schematic. Interactive examples illustrate arithmetic; they do not run a Mugda2 checker.

01 / Introductory · Understand the purpose

A program can carry its reasons.

By the end of this section, you should be able to explain what Mugda2 wants to guarantee—and why each guarantee needs its own evidence.

1.1 / From ordinary types to precise promises

What does “this program is correct” mean?

Imagine a sorting function. A conventional type can say that it consumes a list of numbers and returns another list. That still leaves important questions: Is the result sorted? Does it contain exactly the original elements? Does the function return at all? How many comparisons does it perform?

A dependent type can express a result together with evidence about that result. For sorting, the specification can demand a sorted permutation of the input. Mugda2’s ambition adds compositional termination and cost contracts: you should be able to use a component without reopening all its implementation details.

A specification sketchProposed notation · not executable
sort (xs : List Number)
  returns ys : List Number
  ensures Sorted ys
  ensures Permutation xs ys
  terminates
  comparisons ≤ B(length xs)

The function B must be defined and justified for the chosen sorting algorithm. “Fast” is not a mathematical contract; “at most this many comparisons” can be. A theorem is only as useful as the specification it proves, so choosing the right statement remains a human responsibility.

The continuity with Mugda

Mugda2 grows out of Karl Mehltretter’s Mugda work on sized types and termination. The current Lean implementation of Mugda supplies examples and component metatheory. A complete correctness theorem for the proposed Mugda2 language is future work. The known pattern-matching problems motivate explicit rules and permanent counterexample tests.

1.2 / A first distinction

Stopping and finishing quickly are different.

A program that counts down from a natural number r stops because every recursive call uses a smaller nonnegative value. That argument establishes termination. It does not yet give a small running-time bound in terms of the input’s encoded length.

An n-bit input can store the number 2n − 1. Counting down by one therefore takes 2n − 1 transitions. The numeric rank decreases every time; its number of bits usually does not.

A small input. A long countdown.

Interactive illustration
12bits to encode the initial value
4,095unit-decrement transitions to zero

For an infinite stream, the relevant first guarantee is productivity: each finite observation can be obtained in finite work. A useful response-time guarantee needs an additional bound on that work. “Produces the next item eventually” does not mean “produces it cheaply.”

1.3 / The four quantities

Measure the object, the work, and the evidence separately.

Suppose a short program generates an input on which an algorithm makes an enormous number of steps. A mathematical proof might explain that behaviour using an induction over a compact family of phases. Four different questions arise:

QuantityQuestionPossible unit
Input sizeHow much information represents the instance?Bits, including coefficients and initial state
Construction costHow much work produces that instance?Bit operations of the generator
Execution costHow much work does the studied algorithm perform?Pivots, inspections, arithmetic or bit operations
Evidence size & checking costHow large is the certificate, and how much work verifies it?Encoded certificate bits and checker bit operations

A short certificate for a long execution is possible because it can establish a repeating mathematical structure without listing every step. But compactness, correctness, and cheap verification are three separate claims. Mugda2’s intended science example—the Avis–Friedmann lower bound for Cunningham’s pivot rule—makes these distinctions concrete. The advanced section develops this example.

1.4 / People, agents, and checking

An agent proposes. Evidence earns acceptance.

An LLM can suggest a recursive program, discover a useful invariant, propose a potential function, or search for a counterexample. Its confidence is not the acceptance criterion. The proposed architecture requires an explicit artifact that an independently specified checker can examine.

  1. State a precise goalA person fixes the intended behaviour, assumptions, and cost model.
  2. Explore candidatesA person or agent proposes an implementation and evidence in an isolated snapshot.
  3. Check the evidenceThe core rechecker or a proved certificate checker checks the relevant obligations.
  4. Expose the resultThe workbench shows the theorem, dependencies, assumptions, and any remaining obligations.

The checker must distinguish accepted, rejected, and unknown. If normalization exhausts its budget, that is “unknown”; it is neither a proof nor a counterexample. A failed mutual definition must leave no partially accepted declarations behind.

Lean contributes an architectural example: rich elaboration and tactics produce terms that a smaller kernel checks. Mugda2 also needs its own object-language specification and metatheory; implementing its checker in Lean does not supply those results automatically.

Architecture reference: The Lean language reference: elaboration, kernel checking, and compilation.

Check your understanding

A program is accepted with a termination proof. Have we established that it runs in polynomial time? No. We still need a cost model and a bound related to an explicit input-size measure. The countdown above is a counterexample to that inference.

02 / Intermediate · Follow the mechanisms

Useful guarantees cross interfaces.

This level assumes familiarity with functions, recursion, and data structures. We move from a claim about one program to contracts that survive composition and implementation changes.

2.1 / Sized types and opaque helpers

Make recursive descent visible in the interface.

A simple termination checker recognizes a recursive call on a syntactic subterm: a list’s tail or a tree’s child. But suppose a child first passes through a library function whose implementation is hidden. The resulting expression no longer looks like a subterm. The library’s interface must preserve the information the caller needs.

A sized type attaches a bound to a datatype. In this example, Certificate i means a finite certificate tree whose depth is bounded by size i, using a convention fixed by the eventual calculus. Matching a branch exposes children at smaller sizes j < i. An opaque helper that preserves each child’s bound lets recursion continue.

A modular recursive visitorSchematic · not final Mugda2 syntax
-- The helper is checked once; its body stays hidden.
preprocess : ∀ᵖ i. Certificate i → Certificate i

rewrite (leaf payload) = leaf payload
rewrite (branch children) =
  branch (map (λ child → rewrite (preprocess child)) children)

-- Branch evidence: child : Certificate j, with j < i.
-- Interface evidence: preprocess child : Certificate j.

The proposed ∀ᵖ marks parametric size quantification. Its intended role is to make size arguments usable for typing and termination while constraining how computation can depend on them. Ordinary “for every i” syntax does not by itself provide those uniformity or erasure guarantees; the calculus needs explicit rules and proofs.

The type above supplies a size contract. It does not say that preprocessing preserves the certificate’s meaning, keeps its node count unchanged, or has a particular cost. A real normalizer also needs a semantic preservation contract and a cost contract for the helper. Depth alone does not control branching.

Why this example belongs in the requirements

The client must work using the public interface alone. If a prototype succeeds only by unfolding preprocess, it has not demonstrated the intended modularity. This is also the concrete experiment for deciding whether sized recursion belongs in the core or can be translated into standard recursion.

Background: Abel, MiniAgda; Abel, Vezzosi & Winterhalter, normalization for sized types. These motivate the design; they do not establish the soundness of Mugda2’s proposed combination.

2.2 / Potential functions

Cheap operations can pay for an expensive one.

A queue can be represented by two lists. The front holds items ready to remove, oldest first. New items are pushed onto the rear, newest first. When the front is empty, reverse the rear into the front. Most operations are cheap; an occasional removal transfers several items.

For this teaching model, charge one unit for an enqueue, one for each transferred item, and one for a successful removal. Let the stored potential be the number of rear items: Φ(front, rear) = |rear|. The amortized charge of an operation is:

amortized charge = actual cost + Φ(after) − Φ(before)Potential is a nonnegative mathematical account, not an extra runtime list.

An enqueue costs 1 and adds 1 potential, so its charge is 2. A removal with k items to transfer costs k + 1 but releases k potential, so its charge is 1. Starting from an empty queue, any valid sequence of e enqueues and d successful dequeues costs at most 2e + d in this model.

Watch the potential pay.

Interactive illustration

Try three enqueues, then dequeue. The first removal spends the stored potential on a reversal.

Front · oldest first
empty
Rear · newest first
empty
0total actual cost
0stored potential Φ
0total amortized charge

0 spent + 0 stored = 0 assigned

The queue is empty. Each enqueue will assign two units: one spent now, one stored.

The general proof adds the per-operation inequalities. Intermediate potentials cancel; the final potential is nonnegative. This explains a whole sequence of operations even though one operation can exceed its amortized charge. Persistent branching or parallel clients need an appropriate resource discipline to prevent spending the same credit twice.

Research lineage: Hoffmann, Aehlig & Martin Hofmann, Resource Aware ML. More recent work explores potentials inside dependent type theory, including Potential Functions as Types (2026 preprint).

2.3 / Representation independence

Change the implementation. Keep the client proof.

The mathematical queue is a sequence. The two-list implementation represents it by front ++ reverse rear. That mapping is an abstraction function: it tells us what a concrete state means.

A client should use the public operations and their contracts. A second implementation can replace the first when it satisfies the same behaviour and resource specification. It need not perform exactly the same internal steps or expose the same potential; those belong to the implementation’s proof.

What the client sees

An abstract contract

FIFO behaviour, an empty initial state, operation preconditions, and an upper cost specification. The client’s proof depends only on these facts.

What an implementation proves

A representation theorem

Each operation respects the abstraction function and the agreed cost account. Internal storage and auxiliary invariants remain private.

Equality alone is not a cost theorem. Two implementations can return the same values and perform very different amounts of work. The interface must say which quantitative relation the client can rely on.

One motivation for considering univalent foundations is that they offer expressive ways to organize abstract and concrete views inside types. The Abstraction Functions as Types work develops such a method for behaviour and cost. Mugda2’s experiment asks whether that machinery makes its actual client proofs substantially simpler than explicit simulation records.

Primary source: Grodin, Li & Harper, Abstraction Functions as Types (POPL 2026). Experiment A defines the comparison for Mugda2.

2.4 / Erasure, extraction, and cost

Evidence should justify computation without burdening it.

A verified program may mention a size bound, a proof that a child is smaller, and ghost credits used in a resource argument. The executable often needs none of these at runtime. Erasure removes computationally irrelevant material; extraction produces executable code from the relevant part.

The important question is what remains true after the transformation. A behaviour theorem says that the extracted program produces the corresponding result. A separate cost adequacy theorem relates measured source work to measured target work.

ClaimRequired relation
Correct outputSource evaluation and target evaluation produce corresponding values.
Transferred upper boundTarget cost is bounded by the source account, with an explicit overhead relation if needed.
Transferred lower boundTarget cost dominates the relevant source count, or the chosen observable events are preserved exactly.

A compiler can preserve the answer while optimizing away a computation. An erased “tick” therefore cannot establish a runtime lower bound by itself. Likewise, a source-to-IR theorem proves a claim about the specified intermediate representation. Extending it to native code, machine instructions, or wall-clock time requires additional modelling and refinement.

Schwichtenberg’s work with Ratiu on proof decoration motivates making computational relevance explicit. Mugda2 still has to prove its own erasure and cost theorems for its chosen language.

Primary source: Ratiu & Schwichtenberg, Decorating proofs.

Where do stream processors fit?

A processor’s input demand L(n) bounds how many inputs it inspects to produce its first n outputs. Its work bound W(n) counts computation under a specified evaluation and sharing model. Demand can compose as LF(LG(n)) under appropriate contracts; that formula does not also bound work. A work composition theorem must account for both processors, sharing, and overhead. Guarded or clocked recursion is a later candidate when this becomes a primary use case.

2.5 / A useful design test

Can we replace a component without reopening the client?

For a sized recursive visitor, hide the helper’s body. For the queue client, change the representation. For an extracted program, erase the logical evidence. In each case, ask exactly which theorem allows the boundary to be crossed.

The first complete result

M5A targets one finite-data program using an abstract component, with checked correctness, termination, and an upper cost contract, followed by behaviour- and cost-adequate extraction to the stated IR. Streams, lower bounds, and more ambitious inference are separate extensions. A small complete result supplies a solid base for them.

03 / Advanced · Inspect the foundations

Every boundary needs a theorem.

This level assumes some familiarity with dependent types or formal verification. It explains the proposed proof obligations and the questions that experiments must resolve before the core is fixed.

3.1 / A foundational choice Open decision

Which equality serves the language?

Type checking needs definitional equality: the conversion relation used to identify terms by the calculus’s computation rules. Users also reason with propositional equality or path types. The design of those structures affects transport, pattern matching, normalization, and the shape of the core.

Cubical type theory gives computational content to univalence and higher paths. Homotopy type theory studies types with this richer equality structure. These ideas are relevant when equivalence and transport materially simplify the intended mathematics or abstraction proofs. “More recent” is not a useful ordering of foundations; the relevant question is which capabilities the project needs.

Candidate foundations for the M1.5 comparison—not a list of implemented Mugda2 modes.
CandidateWhat we investigateEquality policy
Minimal intensional IdExplicit abstraction and simulation records as the control.No additional rule deriving unrestricted K/UIP for general object-language identity types.
Observational type theoryExtensional reasoning with the exact computational rules of a specified OTT.In the Pujet–Leray–Tabareau theory, proof irrelevance and the appropriate UIP are intentional.
Cubical / univalentComputational transport and univalent organization of modular abstractions.General paths retain higher structure; unrestricted UIP is not an admissible blanket rule.

UIP means uniqueness of identity proofs; K is a closely related identity-elimination principle. A blanket test requiring every candidate to reject them would contradict the named OTT candidate. Regression expectations must therefore be indexed by the chosen equality theory.

Combining a strict, proof-irrelevant equality with general higher paths is a further design. It needs distinct equality notions and explicit interaction rules. It cannot be obtained by silently using Lean equality for some object-language paths.

The experiment uses the same abstract client, equations, opacity boundaries, and cost contract in each candidate. It records proof effort, generated term size, conversion behaviour, checking cost, and additional semantic obligations. If richer options show no decisive advantage within the experiment, the current plan keeps the intensional control as the provisional target.

Primary sources: Pujet, Leray & Tabareau, Observational Equality Meets CIC, §2.3; Cubical Agda documentation. Protocol: EXP-A.

Parametric, guarded, and directed ideas address different questions

Internal parametricity supports reasoning about uniformity across abstract parameters. Guarded recursion organizes productive recursive behaviour through controlled observations. A directed cost order compares computations quantitatively; in a simple deterministic reading, one computation has the same specified behaviour and costs no more than another. General directed higher type theory has a broader purpose. These are possible research ingredients, not interchangeable successors to cubical type theory.

Each additional ingredient needs a demonstrated use case and a soundness argument for its interaction with the selected fragment. The project’s distinct target is the combination of modular termination, abstraction, and cost.

3.2 / A core design choice Open decision

Does sized recursion need a native rule?

The certificate visitor is a concrete requirement for the surface language. It is not a proof that the trusted core needs a new recursion principle. A translation may encode its descent using standard inductive recursors or accessibility proofs.

The experiment therefore compares two realizations of the same program and interfaces. The translation approach must expose its generated proof arguments and equation lemmas. The native approach must expose its additional typing, size, and computation rules. Both must preserve the opaque helper boundary.

Translation

What does the target already support?

Measure generated evidence, checking effort, erased code, and whether the required equations compute definitionally or require explicit rewriting.

Native rule

What does the core gain?

Identify a required capability or practical improvement, then account for conversion, substitution, size irrelevance, and the new semantic proof burden.

A useful outcome can be “translation meets the requirements.” A useful negative result can be a minimal example where the specified computation rule cannot be delivered without weakening another obligation. An experiment that remains inconclusive does not justify treating a new rule as sound.

Dependent patterns are part of the theory.

Matching exposes constructor information that refines indices and contexts. The elaborator must justify those refinements and preserve first-match semantics. It must not strengthen an index assumption in a way that invents recursive descent. Known exploits become reason-specific regression cases; their rejection complements the metatheorem rather than replacing it.

Further reading: Definitional Proof Irrelevance Made Accessible; Constructing (Co)inductive Types via Large Sizes. Their results concern their stated calculi; the proposed Mugda2 combination has additional obligations. Protocol: EXP-B.

3.3 / The trust contract Planned

Four obligations establish different facts.

Mugda2 is planned as an object language implemented and formalized in Lean. Its HasType judgment describes object-language derivations. Lean checks proofs about that judgment; it does not make an arbitrary choice of object-language rules consistent.

ObligationClaim for a stated fragmentWhy it matters
Checker soundnessAccepted checking in a well-formed environment implies the declarative typing judgment.The algorithm follows the specified rules. Imported environments must also be checked or justified.
Semantic soundnessThe rules support the claimed consistency and normalization result, or the stated productivity property for coinductive observations.The rules themselves justify the promised meaning.
Conversion correctnessAccepted conversion is valid; exhaustion is unknown; well-typed terms in the supported decidable fragment are decidable with sufficient budget.Resource limits are separated from mathematical inequality.
Elaboration correctnessSurface declarations elaborate to typed core terms while preserving the specified semantics and defining equations.A checked core term must still express the source program’s intended meaning.
One of these theorem shapesSchematic Lean notation
theorem recheck_sound
  (env_ok : WfEnv Γ)
  (accepted : recheck Γ t A = .accepted) :
  HasType Γ t A

-- A separate theorem/model must justify HasType's semantics.

The theorem above could also hold for a badly designed declarative calculus. The semantic obligation is therefore essential. Likewise, mathematical sufficient-budget completeness does not promise that every check finishes within a small practical budget.

Each extension is versioned. A new feature either translates into the existing verified fragment with a proved correspondence, or extends its rules and re-establishes the affected obligations. An M2 proof for the initial fragment does not automatically cover later sizes, coinduction, cost modalities, or extraction.

People & agentsSupply programs, annotations, proofs, and candidate certificates.
Elaborator & searchProduce explicit core artifacts; expose obligations and immutable snapshots.
Independent checking boundaryCore artifacts are rechecked under a versioned object calculus. Lean checks its metatheorems and the separate host certificate-checker theorems.
Object-language guaranteesApply only to the supported fragment, stated semantics, and audited assumptions.
Host Lean mathematicsA proved interpretation, translation, or certificate theorem supplies the bridge.

Planned architecture. Adding a Lake dependency makes Lean definitions available; it does not automatically identify them with Mugda2 types or proofs.

A release should name its supported fragment, theorem statements, dependency versions, axiom closure, executable endpoint, and unresolved assumptions. Eliminating sorry is necessary for the stated proof discipline; an explicit dependency and axiom audit tells us more than a source-text search alone.

3.4 / The application programme Planned

Use long executions to stress short explanations.

The Avis–Friedmann work studies exponential lower bounds for Cunningham’s cyclic pivot rule. The project’s existing Lean formalization is the intended application anchor. Mugda2’s M6 must pin that development, inspect the exact theorem and assumptions, and verify its dependency closure before making a release claim about integration.

The state must include memory: a policy or basis together with a cyclic cursor. Two states with the same basis and different cursors can select different next candidates. A simulation that forgets the cursor may preserve feasible solutions while failing to preserve the prescribed execution.

A small symbolic certificate, explained honestly

Consider the teaching recurrence T(0) = 0 and T(k + 1) = 2T(k) + 1. Its solution is T(n) = 2n − 1. A checker can verify n + 1 recurrence records without enumerating the 2n − 1 execution events. If each value T(k) is stored in binary, the record values use O(n²) bits in total, and straightforward doubling checks take O(n²) bit operations.

For a real pivot-rule certificate, verifying the arithmetic is only one part. Phase invariants must establish legal pivots, the correct entry and exit states, cursor updates, and the claimed recurrence. A uniform construction and induction theorem are required for an all-n statement.

What a compact-certificate milestone must prove

Soundness of the restricted checker; a bound on encoded instance and certificate size; a separate construction-cost bound; a bit-cost bound for checking; and a uniform all-parameter theorem. “Polynomial in n” only transfers to polynomial in encoded length after proving the needed relation between those parameters. Termination of the checker is a different property.

Exact values need a uniqueness argument

An executable evaluator may propose a rational policy value vector v. A Lean checker can verify (I − Pπ)v = rπ. To conclude that this is the specified policy value, the system must also have a unique solution—for example, by an invertibility or nonterminal transience theorem. For P = [1] and r = 0, every value solves the equation, so equation checking alone is insufficient.

A complementary upper bound Research target

The roadmap proposes an upper bound of order O(m² H log(2H)) on successful policy switches (pivots). It is a target to formalize, not a theorem established by this guide. The intended setting is a finite maximizing total-reward MDP on nonterminal states, with nonnegative substochastic transitions, exact policy evaluation, strict improving switches, and cyclic sweeps covering all m state-action pairs. Inspections and accepted switches are different events; an inspection-cost claim needs its own statement.

1 ≤ ws ≤ H,   ∑t P(s, a, t)wt ≤ ws − 1For every available action at every nonterminal state; H ≥ 1.

The drift condition supplies a bound on expected remaining transitions. In a one-state illustration, stay with probability 1 − δ and terminate with probability δ. Setting w = H = 1/δ gives (1 − δ)H = H − 1. With δ = 2−n, the horizon is exponential even though the denominator has only n + 1 bits. This one-action illustration has no policy-iteration lower bound; it explains why “polynomial in the horizon” need not mean “polynomial in input bits.”

Combining the proposed upper bound with the existing lower bound requires a proved correspondence of models, schedules, and measured events. General transport, compressed certificates, and the horizon theorem can develop in parallel after the shared interfaces exist.

Application sources: Avis & Friedmann, An Exponential Lower Bound for Cunningham’s Rule; the formalization mission. Proposed work and dependencies: M6–M9.5.

3.5 / Requirements before implementation

Specify the commitments. Investigate the unknowns.

Requirements engineering is particularly valuable here: a single ambiguous rule can invalidate the language’s purpose. We can specify outcomes, interfaces, proof obligations, examples, cost models, and acceptance evidence before production implementation. We cannot predeclare the answer to an open mathematical question.

DocumentQuestion it answersHow it changes
This concept guideWhy does the project exist, and how do its ideas fit together?Examples and explanations evolve with the design.
RequirementsWhat must a supported feature guarantee, and what evidence demonstrates that?Stable IDs; explicit revisions when scope or meaning changes.
Experiment protocolsWhich observations can resolve an open architecture decision?Freeze the comparison before evaluating candidates.
MilestonesWhen do we attempt each result, and what does it depend on?Scheduling responds to evidence without silently weakening gates.

Before a core fragment is implemented, its specification must define syntax, binding and substitution, environments, universes, typing, conversion, computation, and supported recursion. Before the service is implemented, its protocol must define snapshots, outcomes, budgets, diagnostics, and candidate isolation. These are subsequent design artifacts; the educational guide is not a substitute for a formal calculus.

Work proceeds in small complete slices. Specify a tiny fragment and its examples; implement it; establish its proof obligations; exercise the public interface; then extend it under the same discipline. Counterexamples and failed experiments are useful outputs because they identify a boundary the specification must respect.

A requirement an agent can work against

“Improve termination checking” is too vague. A concrete task names the opaque-helper fixture, states which contract must suffice, fixes the expected diagnostic for a false size contract, identifies the supported fragment, and requires independent rechecking of the emitted artifact. A candidate patch may propose a change to the requirement, but it must not silently rewrite the goal to pass.

Carry the practical lessons from Lean into the workbench

The plan pairs the checking boundary with structured goal states, reproducible dependencies, useful diagnostics, and one interface shared by human and agent tools. Reusable libraries should expose small, discoverable contracts and examples. A candidate proof should be replayable from its recorded snapshot. These are concrete product requirements; they do not depend on choosing Lean's object-level equality for Mugda2.

The immediate deliverable is this design baseline. The first language release target is the finite M5A pipeline. A successful research extension must earn its own theorem and integration gate, whether it adds large sizes, higher paths, stream contracts, or probabilistic costs.

Reference / A small vocabulary

Terms worth keeping distinct.

Dependent type
A type that can depend on a value, allowing specifications such as a vector of length n or a result accompanied by evidence.
Size index
Logical information that bounds a datatype approximation or observation depth. Its meaning is fixed by a calculus; it is not automatically runtime or encoded length.
Termination / productivity
Termination guarantees completion of a finite computation. Productivity guarantees that finite observations of a potentially infinite value can be produced.
Potential
A nonnegative mathematical account attached to a state. Changes in potential explain how a sequence pays for expensive operations.
Abstraction function
A map from concrete states to their mathematical meaning. A simulation theorem explains how operations respect that meaning.
Parametricity
A disciplined uniformity property across parameters or representations. Its exact form depends on the quantifier, relation, and calculus.
Elaboration / rechecking
Elaboration constructs an explicit core artifact from surface syntax. Independent rechecking validates the artifact against the core rules.
Conversion
The calculus’s judgment of definitional equality, used during typing. A budgeted implementation may return unknown even when an answer exists mathematically.
Object language / host language
Mugda2 is the language being designed. Lean is the proposed implementation and metatheory host. Crossing between their claims requires an explicit bridge.
Erasure / cost adequacy
Erasure removes irrelevant material. Cost adequacy proves a stated relation between the work measured before and after a transformation.
Certificate
Structured evidence inspected by a checker. Its validity, encoded size, generation cost, and checking cost are separate properties.
Verified fragment
The precise subset of a language covered by named theorems under recorded assumptions. Features outside that subset do not inherit its guarantees.
Reference / Follow the ideas

A reading route into the research.

These are sources and inspirations, not a claim that their calculi have already been combined. Start with the first three lineages; use the later papers to investigate specific design questions.

  1. Andreas Abel — MiniAgda: Integrating Sized and Dependent Types2010. An introduction by example to sized programming and its interaction with dependent patterns.
  2. Jan Hoffmann, Klaus Aehlig & Martin Hofmann — Resource Aware ML2012. Type-based amortized resource analysis. Jan Hoffmann and Martin Hofmann are different researchers.
  3. Diana Ratiu & Helmut Schwichtenberg — Decorating proofsComputational relevance and extraction: identifying proof information that need not survive into execution.
  4. The Lean Language Reference — Elaboration and CompilationOfficial documentation of the separation between surface elaboration, kernel checking, and compilation. The “latest” documentation is a moving reference; implementation work must pin a toolchain.
  5. Niu, Sterling, Grodin & Harper — A Cost-Aware Logical FrameworkCalf. A foundational account of separating computational behaviour from cost.
  6. Grodin, Li & Harper — Abstraction Functions as TypesPOPL 2026. Modular specifications of behaviour and cost in univalent dependent type theory.
  7. Grodin, Chu, Li, Jan Hoffmann & Harper — Potential Functions as Types2026 preprint. Potentials in dependent types and the Giralf approach. A source of research ideas rather than a guarantee of general automatic cost inference.
  8. Grodin, Niu, Sterling & Harper — DecalfA directed, effectful cost-aware framework. Intrinsic ordering supports quantitative comparisons of computations.
  9. Pujet, Leray & Tabareau — Observational Equality Meets CICTOPLAS 2025. The exact observational candidate matters; §2.3 explains its UIP behaviour.
  10. Cubical Agda — Official language documentationPaths, transport, composition, Glue, and higher inductive types. A practical reference for the cubical experiment.
  11. Cavallo & Harper — Internal Parametricity for Cubical Type TheoryHow relational uniformity can become internal language structure. Ordinary polymorphic syntax alone does not provide this full theory.
  12. Laarakker, Otten & van den Berg — Constructing (Co)inductive Types via Large SizesFSCD 2026. A research direction for size semantics; computational and integration obligations must be checked against the exact paper.
  13. Definitional Proof Irrelevance Made AccessibleLICS 2026. A source for two-level recursion and accessibility experiments, with its own stated theory and translation.
  14. Kristensen, Møgelberg & Vezzosi — Greatest HITs: Higher inductive types in coinductive definitions via induction under clocksA possible later direction combining guarded recursion and cubical structure. It is not a prerequisite for the initial finite fragment.
  15. Köpp & Schwichtenberg — Lookahead Analysis in Exact Real Arithmetic with Logical MethodsInput-demand analysis for extracted stream computations. Lookahead and computational work remain separate contracts.
  16. David Avis & Oliver Friedmann — An Exponential Lower Bound for Cunningham’s RuleThe mathematical application anchor. The language must preserve the exact prescribed execution and the event being counted.

Turn the explanation into a checked commitment.

The requirements baseline gives the project stable obligations. The experiment protocols turn open design choices into reproducible comparisons. The milestone plan schedules the work.