Current section
Files
Jump to
Current section
Files
priv/per/foundations/inductive.per
module inductive where
option irrelevance true
def Β¬ (A : U) : U := A β π
def βα΅ (A B C: U) : U := (B β C) β (A β B) β (A β C)
def β (A B C : U) : βα΅ A B C := Ξ» (g : B β C) (f : A β B) (x : A), g (f x)
def idα΅ (A : U) : U := A β A
def id (A : U) (a : A) : A := a
def const (A B : U) : A β B β A := Ξ» (a : A) (b : B), a
def constβ (A : U) : A β π := const π A β
def LineP (A : I β U) : V := Ξ (i : I), A i
def Path (A : U) (x y : A) : U := PathP (<_> A) x y
def idp (A : U) (x : A) : Path A x x := <_> x
def + (A B: U) : U := Ξ£ (x : π), indβ (Ξ» (_ : π), U) A B x
def 0-ind (C: π β U) (z: π) : C z := ind-empty (C z) z
def 1-rec (C: U) (x: C) : π β C := indβ (\(_:π), C) x
def 1-ind (C: π β U) (x: C β
) : Π (z: π), C z := indβ C x
def 1-Ξ² (C: U) (c: C): Path C (1-rec C c β
) c := idp C c
def 1-Ξ· (z: π) : Path π β
z := idp π β
def 2-ind (C: π β U) (x: C 0β) (y: C 1β) : Π (z: π), C z := indβ C x y
def 2-rec (C: U) (x y: C) : Π (z: bool), C := indβ (\(_:π), C) x y
def 2-Ξ²β (C : π β U) (f : Ξ (x : π), C 0β) (g : Ξ (y : π), C 1β) : PathP (<_>C 0β) (f 0β) (indβ (Ξ» (x : π), C x) (f 0β) (g 1β) 0β) := <_> f 0β
def 2-Ξ²β (C : π β U) (f : Ξ (x : π), C 0β) (g : Ξ (y : π), C 1β) : PathP (<_>C 1β) (g 1β) (indβ (Ξ» (x : π), C x) (f 0β) (g 1β) 1β) := <_> g 1β
def 2-Ξ· (c : π) : + (PathP (<_> π) c 0β) (PathP (<_> π) c 1β) := indβ (Ξ» (c : π), + (PathP (<_> π) c 0β) (PathP (<_> π) c 1β)) (0β, <_> 0β) (1β, <_> 1β) c
def Wβ² (A : U) (B : A β U) : U := W (x: A), B x
def supβ² (A : U) (B : A β U) (x : A) (f : B x β Wβ² A B) : Wβ² A B := sup A B x f
def W-ind (A : U) (B : A β U) (C : (W (x : A), B x) β U)
(g : Ξ (x : A) (f : B x β (W (x : A), B x)), (Ξ (b : B x), C (f b)) β C (sup A B x f))
(w : W (x : A), B x)
: C w := indα΅ A B C g w
def W-rec (A : U) (B : A β U) (C : U)
(g : Ξ (x : A) (f : B x β (W (x : A), B x)), (B x β C) β C)
(w : W (x : A), B x)
: C := indα΅ A B (Ξ» (_ : W (x : A), B x), C) g w
def W-indβ² (A : U) (B : A β U) (C : (W (x : A), B x) β U)
(Ο : Ξ (x : A) (f : B x β (W (x : A), B x)), C (sup A B x f))
: Ξ (w : W (x : A), B x), C w
:= indα΅ A B C (Ξ» (x : A) (f : B x β (W (x : A), B x)) (g : Ξ (b : B x), C (f b)), Ο x f)
def W-case (A : U) (B : A β U) (C : U) (g : Ξ (x : A) (f : B x β (W (x : A), B x)), C)
: (W (x : A), B x) β C
:= W-indβ² A B (Ξ» (_ : W (x : A), B x), C) g
def W-projβ (A : U) (B : A β U) : (W (x : A), B x) β A
:= W-case A B A (Ξ» (x : A) (f : B x β (W (x : A), B x)), x)
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)
:= 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)
def indα΅-Ξ² (A : U) (B : A β U) (C : (W (x : A), B x) β U)
(g : Ξ (x : A) (f : B x β (W (x : A), B x)), (Ξ (b : B x), C (f b)) β C (sup A B x f))
(a : A) (f : B a β (W (x : A), B x))
: PathP (<_> C (sup A B a f)) (indα΅ A B C g (sup A B a f)) (g a f (Ξ» (b : B a), indα΅ A B C g (f b)))
:= <_> g a f (Ξ» (b : B a), indα΅ A B C g (f b))
--def W-Ξ· (A : U) (B : A β U)
-- : Ξ (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
-- := 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)
--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
-- := 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)