11Canonicity
22==========
33
4- # Prolog
4+ ## Prolog
55
66I describe this process as the three states of cognitive viscosity—syntactic,
77propositional, and homotopical—each of which manifests across four levels of
@@ -38,9 +38,9 @@ to the idea of a reality whose structure is perfectly captured by these refined,
3838mathematical models, unencumbered by the computational and cognitive limitations that
3939typically obscure such understanding.
4040
41- # Definitions
41+ ## Definitions
4242
43- ## 1.1 Syntactic Canonicity
43+ ### 1.1 Syntactic Canonicity
4444
4545Syntactic canonicity (sometimes referred to as computational canonicity)
4646states that every closed term of a certain type reduces to a canonical
@@ -50,7 +50,7 @@ every closed term t : Nat reduces to a numeral n (i.e., `t ⇓ n` where `n ∈
5050
5151Formally: ` Π (t: ℕ), Σ (n: ℕ), t ->* n `
5252
53- ## 1.2 Propositional canonicity
53+ ### 1.2 Propositional canonicity
5454
5555Propositional canonicity weakens syntactic canonicity by allowing
5656the equality between a closed term and a numeral to hold only up
@@ -61,7 +61,7 @@ Formally: `Π (t: ℕ), Σ (n: ℕ), t ≡ n`
6161This means that, while t may not reduce directly to n, there
6262exists a derivable equality proof ` p : t ≡ n ` in the type theory.
6363
64- ## 1.3 Homotopy Canonicity
64+ ### 1.3 Homotopy Canonicity
6565
6666Homotopy canonicity is even weaker. Instead of requiring a definitional
6767or propositional equality, it only guarantees that every closed term is
@@ -71,31 +71,38 @@ behave coherently up to homotopy.
7171
7272Formally, in HoTT: ` Π (t: ℕ), Σ (n: ℕ), Path ℕ t n `
7373
74- # Canonicity Across Type Theories
74+ ## Canonicity Across Type Theories
7575
7676| Type Theory| Syntactical| Propositional| Homotopy |
7777| -----------| -----------| -------------| -----------------------------------|
7878| MLTT | Yes| Yes | Yes |
7979| HoTT | No| Yes | Yes (Bocquet, Kapulkin, Sattler) |
8080| CCHM | Yes| Yes | Yes (Coquand, Huber, Sattler) |
8181
82- # Proof Sketches of Canonicity Results
82+ ## Proof Sketches of Canonicity Results
8383
84- ## Failure of Syntactic Canonicity in HoTT
84+ Different type-theoretic frameworks impose different levels of canonicity.
85+ While MLTT has full syntactic, propositional, and homotopy canonicity, HoTT
86+ lacks syntactic canonicity but retains homotopy canonicity. Cubical HoTT
87+ restores full canonicity using its explicit cubical structure. Understanding
88+ these distinctions is crucial for developing computational and proof-theoretic
89+ applications of type theory.
90+
91+ ### Failure of Syntactic Canonicity in HoTT
8592
8693In Homotopy Type Theory, function extensionality and univalence introduce
8794higher-inductive types, making reduction ambiguous for closed terms.
8895Specifically, closed terms of Nat may contain elements that do not
8996normalize to a numeral but are still provably equal to one in homotopy.
9097
91- ## Proof Idea for Propositional Canonicity in HoTT
98+ ### Proof Idea for Propositional Canonicity in HoTT
9299
93100Bocquet and Kapulkin-Sattler established that every term of Nat is
94101propositionally equal to a numeral. The idea is to use a strict Rezk
95102completion of the syntactic model to construct a fibrant replacement
96103where each closed term can be shown to be propositionally equal to a numeral.
97104
98- ## Proof Idea for Homotopy Canonicity in Cubical Type Theory
105+ ### Proof Idea for Homotopy Canonicity in Cubical Type Theory
99106
100107Coquand, Huber, and Sattler proved homotopy canonicity using cubical models,
101108where paths (identity types) are explicitly represented as maps over the
@@ -111,16 +118,7 @@ Table 2: Mechanisms Ensuring Canonicity in Different Type Theories
111118| HoTT | Homotopical fibrant replacement (propositional & homotopy canonicity) |
112119| CCHM | Cubical paths + hcomp enforcing structured identity types |
113120
114- # Conclusion
115-
116- Different type-theoretic frameworks impose different levels of canonicity.
117- While MLTT has full syntactic, propositional, and homotopy canonicity, HoTT
118- lacks syntactic canonicity but retains homotopy canonicity. Cubical HoTT
119- restores full canonicity using its explicit cubical structure. Understanding
120- these distinctions is crucial for developing computational and proof-theoretic
121- applications of type theory.
122-
123- # Example of Violating Syntactic Canonicity
121+ ## Example of Violating Syntactic Canonicity
124122
125123` ℕ ` defined in CCHM through ` W ` , ` 0 ` , ` 1 ` , ` 2 ` doesn't compute numerals expressions to same terms,
126124however they are propotionally canonical in CCHM though ` hcomp ` .
@@ -144,7 +142,7 @@ def ℕ-ind (C : ℕ → U) (z : C zero) (s : Π (n : ℕ), C n → C (succ n))
144142 (λ (f : 𝟏 → ℕ) (g : Π (x : 𝟏), C (f x)), 𝟏⟶ℕ C f (s (f ★) (g ★))))
145143```
146144
147- ## The Code
145+ ### The Code
148146
149147* ` ℕ-ctor ` is defined as a two-point inductive type,
150148 which is essentially the structure of natural numbers,
@@ -160,7 +158,7 @@ def ℕ-ind (C : ℕ → U) (z : C zero) (s : Π (n : ℕ), C n → C (succ n))
160158* The terms ` 𝟎⟶ℕ ` and ` 𝟏⟶ℕ ` define the transport functions for zero and successor cases,
161159 respectively, using transposition (transp).
162160
163- ## Syntactic Canonicity
161+ ### Syntactic Canonicity
164162
165163In the case of natural numbers through ` W ` , ` 0 ` , ` 1 ` , ` 2 ` , this would mean that terms involving
166164natural numbers reduce to either 0 or succ n for some n. In this case,
@@ -178,7 +176,7 @@ they involve higher inductive types and path spaces.
178176 terms due to the nature of the recursion and the transport between
179177 different levels of the inductive structure.
180178
181- ## Failures in Canonicity
179+ ### Failures in Canonicity
182180
183181* Non-normalizing terms: Because of the presence of path-dependent
184182 types ` PathP ` and recursive definitions involving higher inductive
@@ -190,7 +188,7 @@ they involve higher inductive types and path spaces.
190188 to their normal form, especially if the path spaces themselves
191189 are complicated or not trivially reducible.
192190
193- ## Reformulating Canonicity for Natural Numbers
191+ ### Reformulating Canonicity for Natural Numbers
194192
195193To reformulate canonicity for natural numbers built using this approach, consider the following:
196194
0 commit comments