research38 min studyLesson 997 in Mathematics

Normalization, canonicity, and decidable checking

State metatheorems for an explicit total fragment and separate termination, canonical results, checking, and theorem discovery.

On this page

What you’ll understand

  • State strong normalization and Boolean canonicity for a specified simply typed calculus.
  • Explain why normalization plus confluence decides its declared term conversion.
  • Identify how unrestricted recursion or opaque axioms change computational conclusions.

A type system can support several distinct metatheorems: reduction may terminate, closed data may have canonical shapes, and proposed terms may be checkable by an algorithm. These claims require a precise syntax and rule set. They are not interchangeable slogans about all dependent type theories or proof assistants. We will establish the relationships in a deliberately small total calculus, evaluate one closed Boolean expression, and inspect two extensions that invalidate an unqualified transfer of its computational guarantees.

Fix the fragment before naming the theorem

For this lesson, use simply typed lambda calculus with function types, binary products, unit, and Booleans. Terms have variable and binder annotations where required; reduction consists of beta reduction, pair projections, Boolean case computation, and their closure inside terms. There is no general fixed-point operator, no extra opaque constants, and no added equations or eta laws. This standard total fragment has preservation, confluence, and strong normalization. These are metatheorems about its well-typed syntax, proved by methods such as reducibility rather than by testing examples.

Strong normalization says that every reduction sequence starting from a well-typed term is finite. Weak normalization would assert only that at least one terminating sequence exists. Confluence says that different reduction choices can be joined. Together they give a unique normal form up to renaming bound variables. Boolean canonicity adds a shape statement: a closed normal term of Boolean type is true or false. An open term may instead be blocked by a variable, so the closedness requirement is essential.

Γ⊢t:A ⟹ t is strongly normalizing,∅⊢t:Bool ⟹ t⟶∗true or false.\Gamma\vdash t:A\ \Longrightarrow\ t\text{ is strongly normalizing},\qquad \varnothing\vdash t:\mathrm{Bool}\ \Longrightarrow\ t\longrightarrow^*\mathrm{true}\ \text{or}\ \mathrm{false}.
These assertions apply only to the annotated total fragment and its reduction rules specified in the accompanying text.↔ Scroll wide equations horizontally.

Checking a supplied term differs from finding a proof

In this simply typed syntax, checking a fully supplied annotated term follows its finite syntax tree and compares the explicitly formed simple types. Types do not contain term indices, so that checking task does not itself require evaluating arbitrary programs inside types. Separately, judgmental equality generated by the stated computation rules is decidable by normalizing both well-typed terms and comparing the normal forms up to bound-variable renaming. Finite terminating normalization makes that comparison an algorithm, while confluence makes it complete for this conversion relation.

Dependent theories introduce additional conversion obligations because types may contain terms. Proving decidable checking there requires specifying the universe hierarchy, identity rules, inductive types, annotations, and equality algorithm of that theory. This lesson does not transfer its simply typed theorem to every such extension. Nor does decidable checking mean an algorithm can discover a proof of every true mathematical statement: checking a proposed finite certificate and solving unrestricted proof search are different problems, especially once arithmetic or stronger axioms enter the language.

t≡u⟺nf⁡(t)=αnf⁡(u)for the declared conversion on well-typed terms.t\equiv u\quad\Longleftrightarrow\quad \operatorname{nf}(t)=_\alpha\operatorname{nf}(u)\qquad\text{for the declared conversion on well-typed terms}.
No extra extensional or Boolean eta equation is included in this normal-form criterion.↔ Scroll wide equations horizontally.

Extensions need new computational theorems

An unrestricted fixed-point operator permits a term that repeatedly unfolds to itself, so the strong-normalization conclusion fails. An opaque postulated Boolean constant gives a different example: it may be a closed normal Boolean term that is neither constructor, even without introducing an infinite reduction. Such a constant need not be inconsistent, but the original constructor-canonicity statement no longer describes the enlarged syntax. Termination and canonicity therefore fail for different reasons and should be audited separately.

Postulating univalence in ordinary intensional type theory similarly does not automatically add executable transport rules. Cubical type theories supply additional computational structure and require their own proofs. Huber's cited canonicity result concerns natural-number terms in the specified cubical calculus with only dimension-name variables in the context. That theorem is not, by itself, a normalization or decidable-checking theorem for every cubical extension. Reporting the actual calculus and conclusion is more informative than claiming that one foundational label guarantees every desirable computational property.

c:Bool opaque⟹c is closed and normal, but not a Boolean constructor.c:\mathrm{Bool}\ \text{opaque}\quad\Longrightarrow\quad c\text{ is closed and normal, but not a Boolean constructor}.
This changes the language's constants and invalidates constructor canonicity without proving inconsistency.↔ Scroll wide equations horizontally.

Normalize a projected Boolean computation

In the declared fragment, normalize the second projection of (λx:Bool.(x, if x then false else true)) applied to true. Give the type before computing and identify the three reductions.

  1. Under x:Bool, both x and its Boolean negation have type Bool, so the pair has type Bool×Bool. The abstraction therefore has type Bool→(Bool×Bool), its application has the pair type, and the second projection has type Bool.

  2. Beta reduction substitutes true for x, producing the second projection of the pair (true, if true then false else true). The substitution is closed and introduces no capture problem.

  3. Projection reduction returns the second component. Boolean case reduction then returns false. The final expression is a Boolean constructor, exactly as the closed-term canonicity statement predicts. Other reduction orders reach the same normal form by confluence.

π2((λx.(x,if⁡ x then⁡ false else⁡ true)) true)⟶∗false.\pi_2\bigl((\lambda x.(x,\operatorname{if}\ x\ \operatorname{then}\ \mathrm{false}\ \operatorname{else}\ \mathrm{true}))\,\mathrm{true}\bigr)\longrightarrow^*\mathrm{false}.
The chosen order has three computational steps; reductions under subterms can give another order with the same normal result.↔ Scroll wide equations horizontally.
The result

The term is well typed at Bool and reduces to false by one beta step, one projection step, and one Boolean case step.

Explore the model

Interactive lab

Interactive lab · optimization

Keep numerical convergence separate from syntactic normalization

Pause and Reset, then set step size to 1 and initial position to 1: one Step reaches position 0 exactly. For a fresh comparison Reset and set step size to 0.5 and initial position to 1: after three Steps predict position 0.125. The latter exact-real recurrence approaches zero without reaching it in finitely many iterations, unlike finite syntactic reduction to a normal form. This model is quadratic descent, not a lambda evaluator or a proof of normalization. Edits retain time; Reset and both controls are required for each run.

Keep numerical convergence separate from syntactic normalizationGradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Current readings: Position x0: 2; Objective x²/2: 2; Iteration behavior: Stable step. All parameters are adjustable with the labeled controls below.−4−202402.174.356.528.7Parameter xf(x) = x²/2n = 0
ObjectiveDiscrete iterate
Position x0
2
Objective x²/2
2
Iteration behavior
Stable step
n = 0 · t = 0 s

Gradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA limiting numerical process and a terminating syntactic computation have different specifications.

Check your understanding

What follows from adding an opaque constant c:Bool without a reduction rule to the stated total fragment?

Try it yourself

In context x:Bool, compare if x then true else false with x. Are they judgmentally equal under exactly the beta, projection, and Boolean computation rules declared here? How can one establish that their values agree for each Boolean input?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

A Boolean case expression computes only when its scrutinee is a visible constructor; no Boolean eta rule was included.

Compare with the solution

Both terms are normal in this open context: the case expression is blocked on x, while x is a variable. Their normal forms differ, so they are not judgmentally equal for the declared conversion. A case analysis on the input verifies agreement at true and at false. In a dependent setting this yields pointwise identity evidence; converting pointwise equality to equality of functions would additionally use a suitable extensionality principle. No such extra equality rule was part of the normalization example.

Take it with you

  • Normalization, closed canonicity, and decidable checking are distinct scoped claims.
  • Confluence and terminating reduction decide the declared conversion, not arbitrary theorem discovery.
  • Opaque axioms, general recursion, and cubical rules require a fresh computational analysis.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.