Skip to content

Commit cfde2d0

Browse files
committed
forrmattings
1 parent c36ace3 commit cfde2d0

4 files changed

Lines changed: 15 additions & 26 deletions

File tree

library/foundations/mltt/inductive.anders

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module inductive where
1414
import library/foundations/univalent/path
1515
import library/foundations/mltt/either
1616

17-
1817
-- Steve Awodey, Nicola Gambino, Kristina Sojakova
1918
-- Inductive Types in Homotopy Type Theory
2019
-- https://arxiv.org/pdf/1201.3898.pdf
@@ -48,8 +47,7 @@ def 2-β₂ (C : 𝟐 → U) (f : Π (x : 𝟐), C 0₂) (g : Π (y : 𝟐), C 1
4847
:= <_> g 1₂
4948

5049
def 2-η (c : 𝟐) : + (PathP (<_> 𝟐) c 0₂) (PathP (<_> 𝟐) c 1₂)
51-
:= ind₂ (λ (c : 𝟐), + (PathP (<_> 𝟐) c 0₂) (PathP (<_> 𝟐) c 1₂))
52-
(0₂, <_> 0₂) (1₂, <_> 1₂) c
50+
:= ind₂ (λ (c : 𝟐), + (PathP (<_> 𝟐) c 0₂) (PathP (<_> 𝟐) c 1₂)) (0₂, <_> 0₂) (1₂, <_> 1₂) c
5351

5452
def W′ (A : U) (B : A → U) : U := W (x: A), B x
5553
def sup′ (A : U) (B : A → U) (x : A) (f : B x → W′ A B) : W′ A B := sup A B x f
@@ -83,13 +81,11 @@ def W-proj₁ (A : U) (B : A → U) : (W (x : A), B x) → A
8381
:= W-case A B A (λ (x : A) (f : B x → (W (x : A), B x)), x)
8482

8583
def W-proj₂ (A : U) (B : A → U) : Π (w : W (x : A), B x), B (W-proj₁ A B w) → (W (x : A), B x)
86-
:= W-ind′ A B (λ (w : W (x : A), B x), B (W-proj₁ A B w) → (W (x : A), B x))
87-
(λ (x : A) (f : B x → (W (x : A), B x)), f)
84+
:= W-ind′ A B (λ (w : W (x : A), B x), B (W-proj₁ A B w) → (W (x : A), B x)) (λ (x : A) (f : B x → (W (x : A), B x)), f)
8885

8986
def W-η (A : U) (B : A → U)
9087
: Π (w : W (x : A), B x), Path (W (x : A), B x) (sup A B (W-proj₁ A B w) (W-proj₂ A B w)) w
91-
:= W-ind′ A B (λ (w : W (x : A), B x), Path (W (x : A), B x) (sup A B (W-proj₁ A B w) (W-proj₂ A B w)) w)
92-
(λ (x : A) (f : B x → (W (x : A), B x)), <_> sup A B x f)
88+
:= W-ind′ A B (λ (w : W (x : A), B x), Path (W (x : A), B x) (sup A B (W-proj₁ A B w) (W-proj₂ A B w)) w) (λ (x : A) (f : B x → (W (x : A), B x)), <_> sup A B x f)
9389

9490
def trans-W (A : I → U) (B : Π (i : I), A i → U) (a : A 0) (f : B 0 a → (W (x : A 0), B 0 x)) : W (x : A 1), B 1 x
9591
:= sup (A 1) (B 1) (transp (<i> A i) 0 a) (transp (<i> B i (transFill (A 0) (A 1) (<j> A j) a @ i) → (W (x : A i), B i x)) 0 f)
@@ -117,5 +113,5 @@ def hcomp-W′ (A : U) (B : A → U) (r : I) (a : I → Partial A r)
117113
def hcomp-W-is-correct (A : U) (B : A → U) (r : I) (a : I → Partial A r)
118114
(f : Π (i : I), PartialP [(r = 1) → B (a i 1=1) → (W (x : A), B x)] r)
119115
(a₀ : A[r ↦ a 0]) (f₀ : (B (ouc a₀) → (W (x : A), B x))[r ↦ f 0]) :
120-
Path (W (x : A), B x) (hcomp-W A B r a f a₀ f₀) (hcomp-W′ A B r a f a₀ f₀) :=
121-
<_> hcomp-W A B r a f a₀ f₀
116+
Path (W (x : A), B x) (hcomp-W A B r a f a₀ f₀) (hcomp-W′ A B r a f a₀ f₀)
117+
:= <_> hcomp-W A B r a f a₀ f₀

library/foundations/mltt/nat.anders

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{- Natural Numbers: https://anders.groupoid.space/foundations/mltt/nat/
22
- Nat.
3-
43
Implemented using kernel primitives for judgmental beta-reduction.
5-
Provides standard MLTT rules: Formation, Introduction, Elimination, and Computation.
6-
74
Copyright (c) Groupoid Infinity, 2014-2026. -}
85

96
module nat where

library/foundations/mltt/natw.anders

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{- Homotopy Natural Numbers: https://anders.groupoid.space/foundations/mltt/natw/
2+
- Homotopy Nat.
3+
Implemented using W primitives using transp enforcing Homotopy Canonicity and Losing Strong Canonicity.
4+
Copyright (c) Groupoid Infinity, 2014-2026. -}
5+
16
module natw where
27
import library/foundations/mltt/inductive
38

@@ -18,8 +23,7 @@ def nat-ind (P : natw → U) (p0 : P zerow) (ps : Π (n : natw), P n → P (succ
1823
(λ (f' : 𝟏 → natw) (g' : Π (x : 𝟏), P (f' x)),
1924
transp (<i> P (sup nat-B nat-C 1₂ (λ (u : 𝟏),
2025
ind₁ (λ (v : 𝟏), Path natw (f' ★) (f' v)) (<_> f' ★) u @ i))) 0 (ps (f' ★) (g' ★)))
21-
b f g)
22-
n
26+
b f g) n
2327

2428
def nat-rec (A : U) (a : A) (f : natw → A → A) : natw → A := nat-ind (λ (x : natw), A) a f
2529
def nat-iter (A : U) (a : A) (f : A → A) : natw → A := nat-rec A a (λ (n : natw) (x : A), f x)

library/mathematics/homotopy/KGn.anders

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,18 @@ import library/mathematics/homotopy/Sn
1414
import library/mathematics/homotopy/loop
1515
import library/mathematics/homotopy/KG1
1616

17-
1817
-- K-step: K(G, n+1) = || Σ K(G, n) ||_{n+1}
1918
-- For k=0 (n=1), we use the K(G,1) construction from KG1.
2019
def K-step (G : abgroup) (k : nat) (prev : Pointed) : Pointed
2120
:= ind-nat (λ (_ : nat), Pointed)
22-
(K1 (G.1, G.2.1), K1-point (G.1, G.2.1))
21+
(K1 (G.1, G.2.1), K1-point (G.1, G.2.1)) -- place unit here istead to understand how fast raw type checking is
2322
(λ (m : nat) (_ : Pointed),
2423
(trunc (𝚺 prev.1) (plus (succ (succ zero)) (succ m)),
25-
trunc₁ (𝚺 prev.1) (plus (succ (succ zero)) (succ m)) (𝜎₁ prev.1)))
26-
k
27-
24+
trunc₁ (𝚺 prev.1) (plus (succ (succ zero)) (succ m)) (𝜎₁ prev.1))) k
2825

2926
-- K(G, n) tower construction using primitive ind-nat
3027
def K-Pointed (G : abgroup) (n : nat) : Pointed
31-
:= ind-nat (λ (x : nat), Pointed)
32-
(G.1.1, G.2.1.1.2.2.1)
33-
(λ (k : nat) (prev : Pointed), K-step G k prev)
34-
n
28+
:= ind-nat (λ (x : nat), Pointed) (G.1.1, G.2.1.1.2.2.1) (λ (k : nat) (prev : Pointed), K-step G k prev) n
3529

3630
def K (G : abgroup) (n : nat) : U := (K-Pointed G n).1
3731
def K-point (G : abgroup) (n : nat) : K G n := (K-Pointed G n).2
@@ -66,6 +60,4 @@ def K-η (G : abgroup) (n : nat) (P : Π (k : nat), K G k → U) (h : Π (k : na
6660
:= ind-nat (λ (k : nat), Path (Π (z : K G k), P k z) (h k) (λ (z : K G k), K-ind G k P (λ (g : G.1.1), h zero g) (λ (m : nat) (pr : Π (y : K G m), P m y) (y : K G (succ m)), h (succ m) y) z))
6761
(<_> (h zero))
6862
(λ (k : nat) (prev : Path (Π (z : K G k), P k z) (h k) (λ (z : K G k), K-ind G k P (λ (g : G.1.1), h zero g) (λ (m : nat) (pr : Π (y : K G m), P m y) (y : K G (succ m)), h (succ m) y) z)),
69-
<_> (h (succ k)))
70-
n
71-
63+
<_> (h (succ k))) n

0 commit comments

Comments
 (0)