Skip to content

Commit 7877553

Browse files
committed
MLTT-73
1 parent b390b72 commit 7877553

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

lib/foundations/mltt/mltt.anders

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
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

88
module mltt where
99
option 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+
1117
def Path (A : U) (x y : A) : U := PathP (<_> A) x y
1218
def idp (A : U) (x : A) : Path A x x := <_> x
1319
def 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
3440
def 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
3541
def D (A : U) : U₁ := Π (x y : A), Path A x y → U
3642

43+
-- constructive J-β
44+
3745
def 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
3947
def 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
4149
def 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

Comments
 (0)