1- {- MLTT Reality Module Check: https://groupoid.space/articles/mltt /mltt.pdf
1+ {- MLTT Reality Check: https://groupoid.space/books/vol1 /mltt.pdf
22 — Pi;
33 — Sigma;
44 — Path.
55
6- Copyright (c) Groupoid Infinity, 2014-2023 . -}
6+ Copyright (c) Groupoid Infinity, 2014-2025 . -}
77
88module mltt where
99option girard true
1010
11+ -- Definition. Internalization is sigma record of MLTT-73 type formers instantiated with
12+ -- proof term such that during normalization covers all type checker cases producing output
13+ -- that should be sufficient for syntactical verification of type checker inference rules.
14+
15+ -- built-ins
16+
1117def Path (A : U) (x y : A) : U := PathP (<_> A) x y
1218def idp (A : U) (x : A) : Path A x x := <_> x
1319def Pi (O : 𝟏) (A : U) (B : A → U) : U := Π (x : A), B x
@@ -34,14 +40,19 @@ def subst (A : U) (P : A -> U) (a b : A) (p : Path A a b) (e : P a) : P b := tra
3440def subst-comp (A: U) (P: A → U) (a: A) (e: P a): Path (P a) e (subst A P a a (idp A a) e) := trans_comp (P a) e
3541def D (A : U) : U₁ := Π (x y : A), Path A x y → U
3642
43+ -- constructive J-β
44+
3745def J (A: U) (x: A) (C: D A) (d: C x x (idp A x)) (y: A) (p: Path A x y): C x y p
3846 := subst (singl A x) (\ (z: singl A x), C x (z.1) (z.2)) (eta A x) (y, p) (contr A x y p) d
3947def J-1 (O : 𝟏) (A : U) (x : A) (C: D A) (d: C x x (idp A x)) (y: A) (p: Path A x y): C x y p
4048 := subst (singl A x) (\ (z: singl A x), C x (z.1) (z.2)) (eta A x) (y, p) (contr A x y p) d
4149def J-β (O : 𝟏) (A : U) (a : A) (C : D A) (d: C a a (idp A a)) : Path (C a a (idp A a)) d (J A a C d a (idp A a))
4250 := subst-comp (singl A a) (\ (z: singl A a), C a (z.1) (z.2)) (eta A a) d
4351
44- def MLTT :=
52+
53+ -- Remark. In MLTT signatures only particular combinations of built-ins/context formers can be used.
54+
55+ def MLTT-73 :=
4556 Σ (Π-form : Π (A : U) (B : A → U), U)
4657 (Π-ctor₁ : Π (A : U) (B : A → U), Pi ★ A B → Pi ★ A B)
4758 (Π-elim₁ : Π (A : U) (B : A → U), Pi ★ A B → Pi ★ A B)
@@ -59,10 +70,9 @@ def MLTT :=
5970 (=-elim₁ : Π (A : U) (a : A) (C: D A) (d: C a a (=-ctor₁ A a)) (y: A) (p: Path A a y), C a y p)
6071 (=-comp₁ : Π (A : U) (a : A) (C: D A) (d: C a a (=-ctor₁ A a)), Path (C a a (=-ctor₁ A a)) d (=-elim₁ A a C d a (=-ctor₁ A a))), 𝟏
6172
62- --- Self-aware MLTT:
6373--- Theorem. J-β-rule is derivable from generalized transport
6474
65- def internalizing : MLTT
75+ def internalizing : MLTT-73
6676 := ( Pi ★, Π-lambda ★, Π-apply ★, Π-β ★, Π-η ★,
6777 Sigma ★, pair ★, pr₁ ★, pr₂ ★, Σ-β₁ ★, Σ-β₂ ★, Σ-η ★,
6878 Path-1 ★, idp-1 ★, J-1 ★, J-β ★, ★
0 commit comments