fact
stringlengths
5
876
statement
stringlengths
5
595
proof
stringlengths
0
691
type
stringclasses
2 values
symbolic_name
stringlengths
1
27
library
stringclasses
1 value
filename
stringclasses
32 values
imports
listlengths
0
2
deps
listlengths
0
8
docstring
stringclasses
32 values
line_start
int64
1
228
line_end
int64
1
229
has_proof
bool
2 classes
source_url
stringclasses
1 value
commit
stringclasses
1 value
+ : nat → nat → nat := elim [ | zero => n => n | suc {_ => ih} => n => suc {ih n} ]
+ : nat → nat → nat
:= elim [ | zero => n => n | suc {_ => ih} => n => suc {ih n} ]
def
+
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[]
null
6
10
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
+0L : (x : nat) → path nat {+ 0 x} x := x _ => x
+0L : (x : nat) → path nat {+ 0 x} x
:= x _ => x
def
+0L
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "path" ]
null
14
15
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
+SL : (x y : nat) → path nat {+ {suc x} y} {suc {+ x y}} := x y _ => suc {+ x y}
+SL : (x y : nat) → path nat {+ {suc x} y} {suc {+ x y}}
:= x y _ => suc {+ x y}
def
+SL
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "path" ]
null
19
20
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
+0R : (x : nat) → path nat {+ x 0} x := elim [ | zero => +0L 0 | suc {x => ih} => equation nat begin + {suc x} 0 =[ +SL x 0 ] suc {+ x 0} =[ i => suc {ih i} ] suc x end ]
+0R : (x : nat) → path nat {+ x 0} x
:= elim [ | zero => +0L 0 | suc {x => ih} => equation nat begin + {suc x} 0 =[ +SL x 0 ] suc {+ x 0} =[ i => suc {ih i} ] suc x end ]
def
+0R
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "+0L", "+SL", "path" ]
null
23
32
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
+SR : (x y : nat) → path nat {+ x {suc y}} {suc {+ x y}} := elim [ | zero => y => equation nat begin + 0 {suc y} =[ +0L {suc y} ] suc y =[ i => suc {symm nat {+0L y} i} ] suc {+ 0 y} end | suc {x => ih} => y => equation nat begin + {suc x} {suc y} =[ +SL x {suc y} ] ...
+SR : (x y : nat) → path nat {+ x {suc y}} {suc {+ x y}}
:= elim [ | zero => y => equation nat begin + 0 {suc y} =[ +0L {suc y} ] suc y =[ i => suc {symm nat {+0L y} i} ] suc {+ 0 y} end | suc {x => ih} => y => equation nat begin + {suc x} {suc y} =[ +SL x {suc y} ] suc {+ x {suc y}} =[ i => suc {ih y i} ] suc {su...
def
+SR
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "+0L", "+SL", "path", "symm" ]
null
35
52
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
+A : (x y z : nat) → path nat {+ {+ x y} z} {+ x {+ y z}} := elim [ | zero => y z => equation nat begin + {+ 0 y} z =[ i => + {+0L y i} z ] + y z =[ symm nat {+0L {+ y z}} ] + 0 {+ y z} end | suc {x => ih} => y z => equation nat begin + {+ {suc x} y} z =[ i => + {+SL x ...
+A : (x y z : nat) → path nat {+ {+ x y} z} {+ x {+ y z}}
:= elim [ | zero => y z => equation nat begin + {+ 0 y} z =[ i => + {+0L y i} z ] + y z =[ symm nat {+0L {+ y z}} ] + 0 {+ y z} end | suc {x => ih} => y z => equation nat begin + {+ {suc x} y} z =[ i => + {+SL x y i} z ] + {suc {+ x y}} z =[ +SL {+ x y} z ] ...
def
+A
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "+0L", "+SL", "path", "symm" ]
null
55
73
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
nat∷set : set # [tp := nat]
nat∷set : set # [tp := nat]
axiom
nat∷set
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "set" ]
null
79
79
false
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
foo (p : path nat {+ 0 0} 0) : unfold + in path {path nat {+ 0 0} 0} p {_ => 0} := unfold + has-hlevel in nat∷set 0 0 p {_ => 0}
foo (p : path nat {+ 0 0} 0) : unfold + in path {path nat {+ 0 0} 0} p {_ => 0}
:= unfold + has-hlevel in nat∷set 0 0 p {_ => 0}
def
foo
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "has-hlevel", "nat∷set", "path" ]
null
81
83
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
two : nat := + 1 1
two : nat
:= + 1 1
def
two
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+" ]
null
87
87
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
test : path nat two 2 := unfold two + in i => 2
test : path nat two 2
:= unfold two + in i => 2
def
test
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "path", "two" ]
null
89
91
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
test2 : path-p {i => path nat two {test i}} {_ => two} test := i j => unfold two + in 2
test2 : path-p {i => path nat two {test i}} {_ => two} test
:= i j => unfold two + in 2
def
test2
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[ "+", "path", "path-p", "test", "two" ]
null
94
97
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
abs-test : nat := suc {abstract abs-test::foo ← 41}
abs-test : nat
:= suc {abstract abs-test::foo ← 41}
def
abs-test
test
test/abstract.cooltt
[ "hlevel", "prelude" ]
[]
null
101
102
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
monoid : type := sig def t : type def op : t → t → t def emp : t def opL : (u : t) → path t {op emp u} u def opR : (u : t) → path t {op u emp} u def opA : (u v w : t) → path t {op {op u v} w} {op u {op v w}} end
monoid : type
:= sig def t : type def op : t → t → t def emp : t def opL : (u : t) → path t {op emp u} u def opR : (u : t) → path t {op u emp} u def opA : (u v w : t) → path t {op {op u v} w} {op u {op v w}} end
def
monoid
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "path" ]
null
5
13
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
commutative-monoid : type := sig include monoid def opC : (u v : t) → path t {op u v} {op v u} end
commutative-monoid : type
:= sig include monoid def opC : (u v : t) → path t {op u v} {op v u} end
def
commutative-monoid
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "monoid", "path" ]
null
16
20
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
multiplicative-monoid : type := sig include monoid renaming [op → mul; emp → one; opL → mulL; opR → mulR; opA → mulA] end
multiplicative-monoid : type
:= sig include monoid renaming [op → mul; emp → one; opL → mulL; opR → mulR; opA → mulA] end
def
multiplicative-monoid
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "monoid" ]
null
22
26
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
additive-monoid : type := sig include monoid renaming [op → add; emp → zer; opL → addL; opR → addR; opA → addA] end
additive-monoid : type
:= sig include monoid renaming [op → add; emp → zer; opL → addL; opR → addR; opA → addA] end
def
additive-monoid
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "monoid" ]
null
28
32
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
abelian-group : type := sig include additive-monoid def neg : t → t def addC : (u v : t) → path t {add u v} {add v u} def add-neg : (u : t) → path t {add {neg u} u} zer end
abelian-group : type
:= sig include additive-monoid def neg : t → t def addC : (u v : t) → path t {add u v} {add v u} def add-neg : (u : t) → path t {add {neg u} u} zer end
def
abelian-group
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "additive-monoid", "path" ]
null
34
40
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
ring : type := sig def t : type include abelian-group # [ t ::= t ] include multiplicative-monoid # [ t ::= t ] end
ring : type
:= sig def t : type include abelian-group # [ t ::= t ] include multiplicative-monoid # [ t ::= t ] end
def
ring
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "abelian-group", "multiplicative-monoid" ]
null
42
47
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
monoid/nat : monoid # [t := nat] := struct def op := + def emp := 0 def opL := +-left-unit def opR := +-right-unit def opA := +-assoc end
monoid/nat : monoid # [t := nat]
:= struct def op := + def emp := 0 def opL := +-left-unit def opR := +-right-unit def opA := +-assoc end
def
monoid/nat
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "+", "+-assoc", "+-left-unit", "+-right-unit", "monoid" ]
null
49
56
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
monoid/nat/+ : monoid # [t := nat, op := +] := struct def emp := 0 def opL := +-left-unit def opR := +-right-unit def opA := +-assoc end
monoid/nat/+ : monoid # [t := nat, op := +]
:= struct def emp := 0 def opL := +-left-unit def opR := +-right-unit def opA := +-assoc end
def
monoid/nat/+
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "+", "+-assoc", "+-left-unit", "+-right-unit", "monoid" ]
null
60
66
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
additive-monoid/nat : additive-monoid # [ t := nat ] := struct include monoid/nat renaming [op → add; emp → zer; opL → addL; opR → addR; opA → addA] end
additive-monoid/nat : additive-monoid # [ t := nat ]
:= struct include monoid/nat renaming [op → add; emp → zer; opL → addL; opR → addR; opA → addA] end
def
additive-monoid/nat
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "additive-monoid", "monoid/nat" ]
null
68
72
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
monoid/unit : monoid # [t := unit] := struct def op := _ _ => 0 def emp := 0 def opL := _ _ => 0 def opR := _ _ => 0 def opA := _ _ _ _ => 0 end
monoid/unit : monoid # [t := unit]
:= struct def op := _ _ => 0 def emp := 0 def opL := _ _ => 0 def opR := _ _ => 0 def opA := _ _ _ _ => 0 end
def
monoid/unit
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "monoid", "unit" ]
null
76
83
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
abelian-group/unit : abelian-group # [t := unit] := struct include monoid/unit renaming [op → add; emp → zer; opL → addL; opR → addR; opA → addA] def neg := _ => 0 def addC := _ _ _ => 0 def add-neg := _ _ => 0 end
abelian-group/unit : abelian-group # [t := unit]
:= struct include monoid/unit renaming [op → add; emp → zer; opL → addL; opR → addR; opA → addA] def neg := _ => 0 def addC := _ _ _ => 0 def add-neg := _ _ => 0 end
def
abelian-group/unit
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "abelian-group", "monoid/unit", "unit" ]
null
85
92
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
ring/unit : ring # [t := unit] := struct include abelian-group/unit include monoid/unit renaming [op → mul; emp → one; opL → mulL; opR → mulR; opA → mulA] end
ring/unit : ring # [t := unit]
:= struct include abelian-group/unit include monoid/unit renaming [op → mul; emp → one; opL → mulL; opR → mulR; opA → mulA] end
def
ring/unit
test
test/algebra.cooltt
[ "nat", "prelude" ]
[ "abelian-group/unit", "monoid/unit", "ring", "unit" ]
null
94
99
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
empty : type := path nat 0 1
empty : type
:= path nat 0 1
def
empty
test
test/base-types.cooltt
[ "prelude" ]
[ "path" ]
null
4
4
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
abort (P : empty -> type) (e : empty) : P e := unfold empty in let myelim : nat -> type := elim [ zero => unit | suc _ => P e ] in coe {i => myelim {e i}} 0 1 ⋆
abort (P : empty -> type) (e : empty) : P e
:= unfold empty in let myelim : nat -> type := elim [ zero => unit | suc _ => P e ] in coe {i => myelim {e i}} 0 1 ⋆
def
abort
test
test/base-types.cooltt
[ "prelude" ]
[ "empty", "unit", "⋆" ]
null
7
10
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
sum (A B : type) : type := let fam∷shifted : nat -> type := elim [ zero => B | suc _ => empty ] in let fam : nat -> type := elim [ zero => A | suc n => fam∷shifted n ] in (n : nat) * fam n
sum (A B : type) : type
:= let fam∷shifted : nat -> type := elim [ zero => B | suc _ => empty ] in let fam : nat -> type := elim [ zero => A | suc n => fam∷shifted n ] in (n : nat) * fam n
def
sum
test
test/base-types.cooltt
[ "prelude" ]
[ "empty" ]
null
13
16
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
inl (A B : type) (x : A) : sum A B := [ 0 , x ]
inl (A B : type) (x : A) : sum A B
:= [ 0 , x ]
def
inl
test
test/base-types.cooltt
[ "prelude" ]
[ "sum" ]
null
19
20
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
inr (A B : type) (y : B) : sum A B := [ 1 , y ]
inr (A B : type) (y : B) : sum A B
:= [ 1 , y ]
def
inr
test
test/base-types.cooltt
[ "prelude" ]
[ "sum" ]
null
23
24
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
case (A B : type) (P : sum A B -> type) (P/inl : (a : A) -> P {inl A B a}) (P/inr : (b : B) -> P {inr A B b}) (s : sum A B) : P s := let fam/shifted : nat -> type := elim [ zero => B | suc _ => empty ] in let curried/shifted : (n : nat) (e : fam/shifted n) -> unfold sum in P [ suc n , e ] := unfold inr ...
case (A B : type) (P : sum A B -> type) (P/inl : (a : A) -> P {inl A B a}) (P/inr : (b : B) -> P {inr A B b}) (s : sum A B) : P s
:= let fam/shifted : nat -> type := elim [ zero => B | suc _ => empty ] in let curried/shifted : (n : nat) (e : fam/shifted n) -> unfold sum in P [ suc n , e ] := unfold inr in elim [ zero => P/inr | suc n => e => abort {_ => P [ suc {suc n} , e ]} e ] in let fam : nat -> type := elim [ zero => A | suc ...
def
case
test
test/base-types.cooltt
[ "prelude" ]
[ "abort", "empty", "inl", "inr", "sum" ]
null
26
42
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
refl≡refl¯¹ (A : type) (x : A) : path {path A x x} {refl A x} {symm A {refl A x}} := j i => unfold symm in symm/filler A {refl A x} i j
refl≡refl¯¹ (A : type) (x : A) : path {path A x x} {refl A x} {symm A {refl A x}}
:= j i => unfold symm in symm/filler A {refl A x} i j
def
refl≡refl¯¹
test
test/bruno.cooltt
[ "prelude" ]
[ "path", "refl", "symm", "symm/filler" ]
Lemma 3.2.1 (inversion unit)
6
9
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
refl≡refl∘refl (A : type) (x : A) : path {path A x x} {refl A x} {trans A {refl A x} {refl A x}} := unfold trans in trans/filler A {refl A x} {refl A x}
refl≡refl∘refl (A : type) (x : A) : path {path A x x} {refl A x} {trans A {refl A x} {refl A x}}
:= unfold trans in trans/filler A {refl A x} {refl A x}
def
refl≡refl∘refl
test
test/bruno.cooltt
[ "prelude" ]
[ "path", "refl", "trans", "trans/filler" ]
Lemma 3.2.2 (composition unit)
12
14
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
p≡p∘refl (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 1}} p {trans A p {refl A {p 1}}} := unfold trans in trans/filler A p {refl A {p 1}}
p≡p∘refl (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 1}} p {trans A p {refl A {p 1}}}
:= unfold trans in trans/filler A p {refl A {p 1}}
def
p≡p∘refl
test
test/bruno.cooltt
[ "prelude" ]
[ "path", "refl", "trans", "trans/filler" ]
Lemma 3.2.3 (right unit)
17
19
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
refl≡p∘p¯¹ (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 0}} {refl A {p 0}} {trans A p {symm A p}} := k i => unfold trans symm in hcom 0 1 {j => [ j=0 ∨ i=0 => p i | i=1 ∨ k=0 => symm/filler A p j i | k=1 => trans/filler A p {symm A p} j i ] }
refl≡p∘p¯¹ (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 0}} {refl A {p 0}} {trans A p {symm A p}}
:= k i => unfold trans symm in hcom 0 1 {j => [ j=0 ∨ i=0 => p i | i=1 ∨ k=0 => symm/filler A p j i | k=1 => trans/filler A p {symm A p} j i ] }
def
refl≡p∘p¯¹
test
test/bruno.cooltt
[ "prelude" ]
[ "path", "refl", "symm", "symm/filler", "trans", "trans/filler" ]
Lemma 3.2.4 (right cancellation)
22
30
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
square (A : type) : type := sig def top : ext i => A with [] def bot : ext i => A with [] def left : ext i => A with [i=0 => top 0 | i=1 => bot 0] def right : ext i => A with [i=0 => top 1 | i=1 => bot 1] def filler : ext i j => A with [i=0 => top j | i=1 => bot j | j=0 => left i | j=1 => right i]...
square (A : type) : type
:= sig def top : ext i => A with [] def bot : ext i => A with [] def left : ext i => A with [i=0 => top 0 | i=1 => bot 0] def right : ext i => A with [i=0 => top 1 | i=1 => bot 1] def filler : ext i j => A with [i=0 => top j | i=1 => bot j | j=0 => left i | j=1 => right i] end
def
square
test
test/bruno.cooltt
[ "prelude" ]
[]
null
32
39
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
swap (A : type) (sq : square A) : square A # [top := sq.bot, bot := sq.top, left := symm A {sq.left}, right := symm A {sq.right}] := unfold symm in struct def filler := i k => hcom 0 1 {j => [ i=0 => sq.filler j k | i=1 ∨ j=0 => sq.top k | k=0 => symm/filler A ...
swap (A : type) (sq : square A) : square A # [top := sq.bot, bot := sq.top, left := symm A {sq.left}, right := symm A {sq.right}]
:= unfold symm in struct def filler := i k => hcom 0 1 {j => [ i=0 => sq.filler j k | i=1 ∨ j=0 => sq.top k | k=0 => symm/filler A {sq.left} i j | k=1 => symm/filler A {sq.right} i j ] } end
def
swap
test
test/bruno.cooltt
[ "prelude" ]
[ "square", "symm", "symm/filler" ]
Lemma 3.2.5 (square swap)
42
58
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
symm-invol (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 1}} p {symm A {symm A p}} := let a : A := p 0 in let b : A := p 1 in let true-at-refl : path {path A b b} {refl A b} {symm A {symm A {refl A b}}} := trans {path A b b} {refl≡refl¯¹ A b} {i => symm A {refl≡refl¯¹ A b i}} in let back : square A := ...
symm-invol (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 1}} p {symm A {symm A p}}
:= let a : A := p 0 in let b : A := p 1 in let true-at-refl : path {path A b b} {refl A b} {symm A {symm A {refl A b}}} := trans {path A b b} {refl≡refl¯¹ A b} {i => symm A {refl≡refl¯¹ A b i}} in let back : square A := unfold trans in struct def top := symm A p def bot := trans A {sym...
def
symm-invol
test
test/bruno.cooltt
[ "prelude" ]
[ "path", "refl", "refl≡refl¯¹", "square", "swap", "symm", "trans", "trans/filler" ]
Lemma 3.2.6 (inversability)
61
87
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
op₁ (A : type) (p : 𝕀 → A) : path-p {i => path A {p 0} {symm A p i}} p {refl A {p 0}} := k i => unfold trans in hcom 0 1 {j => [ i=0 => p 0 | i=1 => symm A p k | j=0 => trans/filler A p {symm A p} k i | k=0 => p i | k=1 => symm {path A {p 0} {p 0}} {refl≡p∘p¯¹ A p} j i ] }
op₁ (A : type) (p : 𝕀 → A) : path-p {i => path A {p 0} {symm A p i}} p {refl A {p 0}}
:= k i => unfold trans in hcom 0 1 {j => [ i=0 => p 0 | i=1 => symm A p k | j=0 => trans/filler A p {symm A p} k i | k=0 => p i | k=1 => symm {path A {p 0} {p 0}} {refl≡p∘p¯¹ A p} j i ] }
def
op₁
test
test/bruno.cooltt
[ "prelude" ]
[ "path", "path-p", "refl", "refl≡p∘p¯¹", "symm", "trans", "trans/filler" ]
Lemma 3.2.7(i) (opposite identification)
90
100
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
refl≡p¯¹∘p (A : type) (p : 𝕀 → A) : path {path A {p 1} {p 1}} {refl A {p 1}} {trans A {symm A p} p} := k i => unfold trans in hcom 0 1 {j => [ i=0 => p 1 | i=1 => symm {path A {p 0} {p 1}} {symm-invol A p} k j | j=0 => symm A p i | k=0 => op₁ A {symm A p} j i | k=1 => trans/filler A {symm A p...
refl≡p¯¹∘p (A : type) (p : 𝕀 → A) : path {path A {p 1} {p 1}} {refl A {p 1}} {trans A {symm A p} p}
:= k i => unfold trans in hcom 0 1 {j => [ i=0 => p 1 | i=1 => symm {path A {p 0} {p 1}} {symm-invol A p} k j | j=0 => symm A p i | k=0 => op₁ A {symm A p} j i | k=1 => trans/filler A {symm A p} p j i ] }
def
refl≡p¯¹∘p
test
test/bruno.cooltt
[ "prelude" ]
[ "op₁", "path", "refl", "symm", "symm-invol", "trans", "trans/filler" ]
Lemma 3.2.8 (left cancellation)
103
113
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
op₂ (A : type) (p : 𝕀 → A) : path-p {i => path A {p 1} {p i}} {symm A p} {refl A {p 1}} := k i => unfold trans in hcom 0 1 {j => [ i=0 => p 1 | i=1 => p k | j=0 => trans/filler A {symm A p} p k i | k=0 => symm A p i | k=1 => symm {path A {p 1} {p 1}} {refl≡p¯¹∘p A p} j i ] }
op₂ (A : type) (p : 𝕀 → A) : path-p {i => path A {p 1} {p i}} {symm A p} {refl A {p 1}}
:= k i => unfold trans in hcom 0 1 {j => [ i=0 => p 1 | i=1 => p k | j=0 => trans/filler A {symm A p} p k i | k=0 => symm A p i | k=1 => symm {path A {p 1} {p 1}} {refl≡p¯¹∘p A p} j i ] }
def
op₂
test
test/bruno.cooltt
[ "prelude" ]
[ "path", "path-p", "refl", "refl≡p¯¹∘p", "symm", "trans", "trans/filler" ]
Lemma 3.2.7(ii) (opposite identification) the paper mentions that this can be solved in a "similar argument" to 3.2.7(i), but for the truly symmetric proof (nearly identical to op₁) you need 3.2.8. so this is kind of nonlinear and might not be how the author intended?
120
130
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
p≡refl∘p (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 1}} p {trans A {refl A {p 0}} p} := k i => unfold trans in hcom 0 1 {j => [ i=0 => p 0 | i=1 => op₂ A p j k | j=0 => op₁ A p k i | k=0 => p i | k=1 => trans/filler A {refl A {p 0}} p j i ] }
p≡refl∘p (A : type) (p : 𝕀 → A) : path {path A {p 0} {p 1}} p {trans A {refl A {p 0}} p}
:= k i => unfold trans in hcom 0 1 {j => [ i=0 => p 0 | i=1 => op₂ A p j k | j=0 => op₁ A p k i | k=0 => p i | k=1 => trans/filler A {refl A {p 0}} p j i ] }
def
p≡refl∘p
test
test/bruno.cooltt
[ "prelude" ]
[ "op₁", "op₂", "path", "refl", "trans", "trans/filler" ]
Lemma 3.2.9 (left unit)
133
143
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
bottom-id (A : type) (α : 𝕀 → 𝕀 → A) (β : (i j : 𝕀) → sub A {∂ j ∨ i=0} {α i j}) : path {path A {α 1 0} {β 1 1}} {α 1} {β 1} := k i => hcom 0 1 {j => [ ∂ i ∨ j=0 ∨ k=0 => α j i | k=1 => β j i ] }
bottom-id (A : type) (α : 𝕀 → 𝕀 → A) (β : (i j : 𝕀) → sub A {∂ j ∨ i=0} {α i j}) : path {path A {α 1 0} {β 1 1}} {α 1} {β 1}
:= k i => hcom 0 1 {j => [ ∂ i ∨ j=0 ∨ k=0 => α j i | k=1 => β j i ] }
def
bottom-id
test
test/bruno.cooltt
[ "prelude" ]
[ "path" ]
Lemma 3.2.10 (bottom identification) we represent squares as just their filler here, not the struct
147
153
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
assoc (A : type) (p : 𝕀 → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) : path {path A {p 0} {r 1}} {trans A {trans A p q} r} {trans A p {trans A q r}} := unfold trans in let α : square A := struct def top := p def bot := trans A {trans A p q} r def left := ...
assoc (A : type) (p : 𝕀 → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) : path {path A {p 0} {r 1}} {trans A {trans A p q} r} {trans A p {trans A q r}}
:= unfold trans in let α : square A := struct def top := p def bot := trans A {trans A p q} r def left := refl A {p 0} def right := trans A q r def filler := k i => hcom 0 1 {j => [ i=0 => p 0 | i=1 => trans/filler A q r j k | j=0 => trans/fill...
def
assoc
test
test/bruno.cooltt
[ "prelude" ]
[ "bottom-id", "path", "refl", "square", "trans", "trans/filler" ]
Lemma 3.2.11 (associativity)
156
189
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
hsymm (A : 𝕀 → type) (p : (i : 𝕀) → A i) : path-p {symm type A} {p 1} {p 0} := i => unfold symm in com {symm/filler type A i} 0 1 {∂ i} {j => [ i=0 => p j | i=1 ∨ j=0 => p 0 ] }
hsymm (A : 𝕀 → type) (p : (i : 𝕀) → A i) : path-p {symm type A} {p 1} {p 0}
:= i => unfold symm in com {symm/filler type A i} 0 1 {∂ i} {j => [ i=0 => p j | i=1 ∨ j=0 => p 0 ] }
def
hsymm
test
test/bruno.cooltt
[ "prelude" ]
[ "path-p", "symm", "symm/filler" ]
Lemma 3.3.1 (heterogeneous inversion)
192
199
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
htrans (A : 𝕀 → type) (B : (i : 𝕀) → sub type {i=0} {A 1}) (p : (i : 𝕀) → A i) (q : (i : 𝕀) → sub {B i} {i=0} {p 1}) : path-p {trans type A B} {p 0} {q 1} := i => unfold trans in com {j => trans/filler type A B j i} 0 1 {∂ i} {j => [ j=0 ∨ i=0 => p i | i=1 => q j ] }
htrans (A : 𝕀 → type) (B : (i : 𝕀) → sub type {i=0} {A 1}) (p : (i : 𝕀) → A i) (q : (i : 𝕀) → sub {B i} {i=0} {p 1}) : path-p {trans type A B} {p 0} {q 1}
:= i => unfold trans in com {j => trans/filler type A B j i} 0 1 {∂ i} {j => [ j=0 ∨ i=0 => p i | i=1 => q j ] }
def
htrans
test
test/bruno.cooltt
[ "prelude" ]
[ "path-p", "trans", "trans/filler" ]
Lemma 3.3.2 (heterogeneous composition)
202
214
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
is-refl (A : type) (p : 𝕀 → A) : path-p {i => path A {p 0} {p i}} {refl A {p 0}} p := k i => hcom 0 1 {j => [ i=0 => p 0 | i=1 => op₂ A p k j | j=0 => p≡p∘refl A p k i | k=0 => op₁ A p j i | k=1 => symm {path A {p 0} {p 1}} {p≡p∘refl A p} j i ] }
is-refl (A : type) (p : 𝕀 → A) : path-p {i => path A {p 0} {p i}} {refl A {p 0}} p
:= k i => hcom 0 1 {j => [ i=0 => p 0 | i=1 => op₂ A p k j | j=0 => p≡p∘refl A p k i | k=0 => op₁ A p j i | k=1 => symm {path A {p 0} {p 1}} {p≡p∘refl A p} j i ] }
def
is-refl
test
test/bruno.cooltt
[ "prelude" ]
[ "op₁", "op₂", "path", "path-p", "p≡p∘refl", "refl", "symm" ]
Theorem 4.1.1 (path induction)
217
226
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
J (A : type) (a : A) (P : (x : A) → {path A a x} → type) (u : P a {refl A a}) (p : (i : 𝕀) → sub A {i=0} a) : P {p 1} p := coe {i => P {p i} {is-refl A p i}} 0 1 u
J (A : type) (a : A) (P : (x : A) → {path A a x} → type) (u : P a {refl A a}) (p : (i : 𝕀) → sub A {i=0} a) : P {p 1} p
:= coe {i => P {p i} {is-refl A p i}} 0 1 u
def
J
test
test/bruno.cooltt
[ "prelude" ]
[ "is-refl", "path", "refl" ]
null
228
229
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
path (A : type) (a b : A) : type := ext i => A with [i=0 => a | i=1 => b]
path (A : type) (a b : A) : type
:= ext i => A with [i=0 => a | i=1 => b]
def
path
test
test/circle.cooltt
[]
[]
null
1
2
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
Ω1s1 : type := path circle base base
Ω1s1 : type
:= path circle base base
def
Ω1s1
test
test/circle.cooltt
[]
[ "path" ]
null
4
5
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
loopn : nat -> Ω1s1 := elim [ | zero => _ => base | suc {n => loopn} => i => hcom circle 0 1 {∂ i} {k => [ k=0 => loopn i | i=0 => base | i=1 => loop k ] } ]
loopn : nat -> Ω1s1
:= elim [ | zero => _ => base | suc {n => loopn} => i => hcom circle 0 1 {∂ i} {k => [ k=0 => loopn i | i=0 => base | i=1 => loop k ] } ]
def
loopn
test
test/circle.cooltt
[]
[ "Ω1s1" ]
null
7
18
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
_ (A : 𝕀 → type) (src : 𝕀) (trg : 𝕀) (x : A src) : sub {A trg} {src=trg} x := coe A src trg x
_ (A : 𝕀 → type) (src : 𝕀) (trg : 𝕀) (x : A src) : sub {A trg} {src=trg} x
:= coe A src trg x
def
_
test
test/coercion.cooltt
[ "prelude" ]
[]
This is the Cartesian coercion operator.
4
5
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
coe/fwd (A : 𝕀 → type) (x : A 0) : A 1 := coe A 0 1 x
coe/fwd (A : 𝕀 → type) (x : A 0) : A 1
:= coe A 0 1 x
def
coe/fwd
test
test/coercion.cooltt
[ "prelude" ]
[]
A special case of coercion is that if we have a path of types A0 = A1, we can cast/coerce (x : A0) to an element of A1.
9
10
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
coe/bwd (A : 𝕀 → type) (x : A 1) : A 0 := coe A 1 0 x
coe/bwd (A : 𝕀 → type) (x : A 1) : A 0
:= coe A 1 0 x
def
coe/bwd
test
test/coercion.cooltt
[ "prelude" ]
[]
...and conversely.
13
14
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
transport/fwd (A : type) (B : A → type) (p : 𝕀 → A) (x : B {p 0}) : B {p 1} := coe/fwd {i => B {p i}} x
transport/fwd (A : type) (B : A → type) (p : 𝕀 → A) (x : B {p 0}) : B {p 1}
:= coe/fwd {i => B {p i}} x
def
transport/fwd
test
test/coercion.cooltt
[ "prelude" ]
[ "coe/fwd" ]
By combining coe with ap (the fact that functions respect paths), we can show that if we have a path (a0 = a1 : A) and an A-indexed family B of types, then we can transport (x : B a0) to an element of (B a1).
19
20
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
_ (A : 𝕀 → type) (x : A 0) : path-p A x {coe/fwd A x} := i => coe A 0 i x
_ (A : 𝕀 → type) (x : A 0) : path-p A x {coe/fwd A x}
:= i => coe A 0 i x
def
_
test
test/coercion.cooltt
[ "prelude" ]
[ "coe/fwd", "path-p" ]
If we coerce (x : A0) to an interval variable, we get a dependent path from x to the coercion of x. That's because of the side condition that coe is the identity function when src=trg.
25
26
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
heterogenize (A : 𝕀 → type) (p : 𝕀 → A 0) : path-p A {p 0} {coe/fwd A {p 1}} := i => coe A 0 i {p i}
heterogenize (A : 𝕀 → type) (p : 𝕀 → A 0) : path-p A {p 0} {coe/fwd A {p 1}}
:= i => coe A 0 i {p i}
def
heterogenize
test
test/coercion.cooltt
[ "prelude" ]
[ "coe/fwd", "path-p" ]
Here's another use of coercing to an interval variable. If we have a homogeneous path in A0, we can turn it into a heterogeneous path in A from its left endpoint to the coercion of its right endpoint.
31
32
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
homogenize (A : 𝕀 → type) (p : (i : 𝕀) → A i) : path {A 1} {coe/fwd A {p 0}} {p 1} := i => coe A i 1 {p i}
homogenize (A : 𝕀 → type) (p : (i : 𝕀) → A i) : path {A 1} {coe/fwd A {p 0}} {p 1}
:= i => coe A i 1 {p i}
def
homogenize
test
test/coercion.cooltt
[ "prelude" ]
[ "coe/fwd", "path" ]
Dually, we can coerce *from* an interval variable to turn a heterogeneous path into a homogeneous one.
36
37
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
mycoe/fun (A : (i : 𝕀) → type) (B : (i: 𝕀) → type) (coe/A : (r : 𝕀) (x : A r) (i : 𝕀) → sub {A i} {i=r} x) (coe/B : (r : 𝕀) (x : B r) (i : 𝕀) → sub {B i} {i=r} x) (r : 𝕀) (f : (_ : A r) → B r) (i : 𝕀) : sub {(_ : A i) → B i} {i=r} f := x => coe/B r {f {coe/A i x r}} i
mycoe/fun (A : (i : 𝕀) → type) (B : (i: 𝕀) → type) (coe/A : (r : 𝕀) (x : A r) (i : 𝕀) → sub {A i} {i=r} x) (coe/B : (r : 𝕀) (x : B r) (i : 𝕀) → sub {B i} {i=r} x) (r : 𝕀) (f : (_ : A r) → B r) (i : 𝕀) : sub {(_ : A i) → B i} {i=r} f
:= x => coe/B r {f {coe/A i x r}} i
def
mycoe/fun
test
test/com.cooltt
[]
[]
null
1
9
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
mycom/fun (A B : 𝕀 → type) (com/A : (r : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i) (i : 𝕀) → sub {A i} {i=r ∨ φ} {p i}) (com/B : (r : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → B i) (i : 𝕀) → sub {B i} {i=r ∨ φ} {p i}) (r : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i → B i) (i : 𝕀) : sub {(_ : A i) → B...
mycom/fun (A B : 𝕀 → type) (com/A : (r : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i) (i : 𝕀) → sub {A i} {i=r ∨ φ} {p i}) (com/B : (r : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → B i) (i : 𝕀) → sub {B i} {i=r ∨ φ} {p i}) (r : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i → B i) (i : 𝕀) : sub {(_ : A i) → B...
:= x => com/B r φ {j => p j {com/A i ⊥ {_ => x} j}} i
def
mycom/fun
test
test/com.cooltt
[]
[]
null
11
19
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
coe/intro (A : 𝕀 → type) (r r' : 𝕀) (x : A r) : sub {A r'} {r=r'} x := coe A r r' x
coe/intro (A : 𝕀 → type) (r r' : 𝕀) (x : A r) : sub {A r'} {r=r'} x
:= coe A r r' x
def
coe/intro
test
test/com.cooltt
[]
[]
null
23
24
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
coe/pi (A : 𝕀 → type) (B : (i : 𝕀) → A i → type) (r r' : 𝕀) (f : (x : A r) → B r x) : sub {(x : A r') → B r' x} ⊤ {x => coe {i => B i {coe A r' i x}} r r' {f {coe A r' r x}}} := coe {i => (x : A i) → B i x} r r' f
coe/pi (A : 𝕀 → type) (B : (i : 𝕀) → A i → type) (r r' : 𝕀) (f : (x : A r) → B r x) : sub {(x : A r') → B r' x} ⊤ {x => coe {i => B i {coe A r' i x}} r r' {f {coe A r' r x}}}
:= coe {i => (x : A i) → B i x} r r' f
def
coe/pi
test
test/com.cooltt
[]
[]
null
26
32
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
coe/sigma (A : 𝕀 → type) (B : (i : 𝕀) → A i → type) (r r' : 𝕀) (p : (x : A r) × B r x) : sub {(x : A r') × B r' x} ⊤ [coe A r r' {fst p}, coe {i => B i {coe A r i {fst p}}} r r' {snd p}] := coe {i => (x : A i) × B i x} r r' p
coe/sigma (A : 𝕀 → type) (B : (i : 𝕀) → A i → type) (r r' : 𝕀) (p : (x : A r) × B r x) : sub {(x : A r') × B r' x} ⊤ [coe A r r' {fst p}, coe {i => B i {coe A r i {fst p}}} r r' {snd p}]
:= coe {i => (x : A i) × B i x} r r' p
def
coe/sigma
test
test/com.cooltt
[]
[]
null
36
42
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
pathd (A : 𝕀 → type) (a : A 0) (b : A 1) : type := ext i => A i with [i=0 => a | i=1 => b]
pathd (A : 𝕀 → type) (a : A 0) (b : A 1) : type
:= ext i => A i with [i=0 => a | i=1 => b]
def
pathd
test
test/com.cooltt
[]
[]
null
46
47
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
coe/pathd (A : 𝕀 -> 𝕀 -> type) (r r' : 𝕀) (a : (i : 𝕀) -> A i 0) (b : (i : 𝕀) -> A i 1) (m : pathd {A r} {a r} {b r}) : sub {pathd {A r'} {a r'} {b r'}} ⊤ {j => com {i => A i j} r r' {∂ j} {i => [j=0 => a i | j=1 => b i | i=r => m j] } } := coe {i => pathd {A i} {a i} {b i}}...
coe/pathd (A : 𝕀 -> 𝕀 -> type) (r r' : 𝕀) (a : (i : 𝕀) -> A i 0) (b : (i : 𝕀) -> A i 1) (m : pathd {A r} {a r} {b r}) : sub {pathd {A r'} {a r'} {b r'}} ⊤ {j => com {i => A i j} r r' {∂ j} {i => [j=0 => a i | j=1 => b i | i=r => m j] } }
:= coe {i => pathd {A i} {a i} {b i}} r r' m
def
coe/pathd
test
test/com.cooltt
[]
[ "pathd" ]
null
50
62
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
hcom/intro (A : type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A) : sub A {r=r' ∨ φ} {p r'} := hcom A r r' φ p
hcom/intro (A : type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A) : sub A {r=r' ∨ φ} {p r'}
:= hcom A r r' φ p
def
hcom/intro
test
test/com.cooltt
[]
[]
null
66
71
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
hcom/fun (A B : type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A → B) : sub {A → B} ⊤ {x => hcom B r r' φ {j => p j x}} := hcom {A → B} r r' φ p
hcom/fun (A B : type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A → B) : sub {A → B} ⊤ {x => hcom B r r' φ {j => p j x}}
:= hcom {A → B} r r' φ p
def
hcom/fun
test
test/com.cooltt
[]
[]
null
73
78
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
com/intro (A : 𝕀 → type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i) : sub {A r'} {r=r' ∨ φ} {p r'} := com A r r' φ p
com/intro (A : 𝕀 → type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i) : sub {A r'} {r=r' ∨ φ} {p r'}
:= com A r r' φ p
def
com/intro
test
test/com.cooltt
[]
[]
null
82
87
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
com/decomposition (A : 𝕀 → type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i) : sub {A r'} ⊤ {hcom {A r'} r r' φ {j => coe A j r' {p j}}} := com A r r' φ p
com/decomposition (A : 𝕀 → type) (r r' : 𝕀) (φ : 𝔽) (p : (i : 𝕀) → [i=r ∨ φ] → A i) : sub {A r'} ⊤ {hcom {A r'} r r' φ {j => coe A j r' {p j}}}
:= com A r r' φ p
def
com/decomposition
test
test/com.cooltt
[]
[]
null
91
96
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
fully-patched (fam : sig [x : nat] -> type) (fib : fam {struct [x := 0]}) : fam # [x := 0] := fib
fully-patched (fam : sig [x : nat] -> type) (fib : fam {struct [x := 0]}) : fam # [x := 0]
:= fib
def
fully-patched
test
test/cool-total-space.cooltt
[]
[]
null
4
5
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
not-fully-patched (fam : sig [x : nat] -> type) (fib : fam {struct [x := 0]}) : fam := struct [x := 0, fib := fib]
not-fully-patched (fam : sig [x : nat] -> type) (fib : fam {struct [x := 0]}) : fam
:= struct [x := 0, fib := fib]
def
not-fully-patched
test
test/cool-total-space.cooltt
[]
[]
null
8
9
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
no-insert-fib (fam : sig [x : nat] -> type) (total : fam) : nat := total.x
no-insert-fib (fam : sig [x : nat] -> type) (total : fam) : nat
:= total.x
def
no-insert-fib
test
test/cool-total-space.cooltt
[]
[]
null
12
13
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
insert-fib-plain (fam : sig [x : nat] -> type) (total : fam) : fam {struct [x := total.x]} := total
insert-fib-plain (fam : sig [x : nat] -> type) (total : fam) : fam {struct [x := total.x]}
:= total
def
insert-fib-plain
test
test/cool-total-space.cooltt
[]
[]
null
16
17
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
insert-fib-pi : sig [fam : sig [x : nat] -> type, test : fam -> nat] := struct def fam := _ => nat -> nat def test := total => total 0 end
insert-fib-pi : sig [fam : sig [x : nat] -> type, test : fam -> nat]
:= struct def fam := _ => nat -> nat def test := total => total 0 end
def
insert-fib-pi
test
test/cool-total-space.cooltt
[]
[ "test" ]
null
20
24
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
insert-fib-sg : sig [fam : sig [x : nat] -> type, test : fam -> nat] := struct def fam := _ => nat * nat def test := total => fst total end
insert-fib-sg : sig [fam : sig [x : nat] -> type, test : fam -> nat]
:= struct def fam := _ => nat * nat def test := total => fst total end
def
insert-fib-sg
test
test/cool-total-space.cooltt
[]
[ "test" ]
null
27
31
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
no-insert-fib-record : sig [fam : sig [x : nat] -> type, test : fam -> nat] := struct def fam := _ => sig [y : nat] def test := total => total.fib.y end
no-insert-fib-record : sig [fam : sig [x : nat] -> type, test : fam -> nat]
:= struct def fam := _ => sig [y : nat] def test := total => total.fib.y end
def
no-insert-fib-record
test
test/cool-total-space.cooltt
[]
[ "test" ]
null
34
38
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
test-hole (fam : sig [x : nat] -> type) : fam # [x := 0] := ?
test-hole (fam : sig [x : nat] -> type) : fam # [x := 0]
:= ?
def
test-hole
test
test/cool-total-space.cooltt
[]
[]
null
42
42
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
boundary-test : (i : 𝕀) → [∂ i] → nat := i => [ i=1 => 5 | i=0 => 19 ]
boundary-test : (i : 𝕀) → [∂ i] → nat
:= i => [ i=1 => 5 | i=0 => 19 ]
def
boundary-test
test
test/elab.cooltt
[]
[]
null
1
5
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
reflexivity : (A : type) (a : A) (i : 𝕀) → A := A a _ => a
reflexivity : (A : type) (a : A) (i : 𝕀) → A
:= A a _ => a
def
reflexivity
test
test/elab.cooltt
[]
[]
null
9
10
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
pi-code-test : type := (x : nat) → nat
pi-code-test : type
:= (x : nat) → nat
def
pi-code-test
test
test/elab.cooltt
[]
[]
null
13
13
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
foo : pi-code-test := x => x
foo : pi-code-test
:= x => x
def
foo
test
test/elab.cooltt
[]
[ "pi-code-test" ]
null
15
16
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
simple-let : (A : type) (a : A) -> A := A a => let b : A := a in b
simple-let : (A : type) (a : A) -> A
:= A a => let b : A := a in b
def
simple-let
test
test/elab.cooltt
[]
[]
null
21
26
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
hole-in-type : (x y z : nat) → ?tyhole := y z => ?tmhole
hole-in-type : (x y z : nat) → ?tyhole
:= y z => ?tmhole
def
hole-in-type
test
test/elab.cooltt
[]
[]
null
31
35
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
path (A : type) (a b : A) : type := ext i => A with [i=0 => a | i=1 => b]
path (A : type) (a b : A) : type
:= ext i => A with [i=0 => a | i=1 => b]
def
path
test
test/elab.cooltt
[]
[]
null
37
38
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
bar : (x : nat) → (y : nat) × path nat x y := x => [x, ?hole1]
bar : (x : nat) → (y : nat) × path nat x y
:= x => [x, ?hole1]
def
bar
test
test/elab.cooltt
[]
[ "path" ]
null
40
42
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
equational/trans (a : type) (x y z : a) (p : path a x y) (q : path a y z) : path a x z := equation a begin x =[ p ] y =[ q ] z end
equational/trans (a : type) (x y z : a) (p : path a x y) (q : path a y z) : path a x z
:= equation a begin x =[ p ] y =[ q ] z end
def
equational/trans
test
test/equation.cooltt
[ "prelude" ]
[ "path" ]
null
3
8
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
equational/refl/nat : path nat 4 4 := equation nat begin 4 =[] 4 end
equational/refl/nat : path nat 4 4
:= equation nat begin 4 =[] 4 end
def
equational/refl/nat
test
test/equation.cooltt
[ "prelude" ]
[ "path" ]
null
12
16
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
refl2 (A : type) (p : (i : 𝕀) → A) : sub {path {path A {p 0} {p 1}} p p} ⊤ {_ => p} := _ => p
refl2 (A : type) (p : (i : 𝕀) → A) : sub {path {path A {p 0} {p 1}} p p} ⊤ {_ => p}
:= _ => p
def
refl2
test
test/evan.cooltt
[ "prelude" ]
[ "path" ]
null
3
5
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
test (A : type) (p : (i : 𝕀) → A) : (j : 𝕀) → path A {p 0} {p 1} := j => refl2 A p j
test (A : type) (p : (i : 𝕀) → A) : (j : 𝕀) → path A {p 0} {p 1}
:= j => refl2 A p j
def
test
test
test/evan.cooltt
[ "prelude" ]
[ "path", "refl2" ]
null
7
9
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
a1 : nat := 0
a1 : nat
:= 0
def
a1
test
test/export.cooltt
[]
[]
null
1
1
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
a2 : nat := 10
a2 : nat
:= 10
def
a2
test
test/export.cooltt
[]
[]
null
2
2
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
a3 : nat := 20
a3 : nat
:= 20
def
a3
test
test/export.cooltt
[]
[]
null
3
3
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
special-j (A : type) (x : A) (B : (φ : 𝔽) → {(i : 𝕀) → sub A {i=0 ∨ φ} x} → type) (d : B ⊤ {_ => x}) (φ : 𝔽) (p : (i : 𝕀) → sub A {i=0 ∨ φ} x) : sub {B φ p} φ d := let filler : 𝕀 → 𝕀 → A := j i => hcom A 0 i {∂ j ∨ φ} {i => [ i=0 ∨ j=0 ∨ φ => p 0 | j=1 => p i ] } in com...
special-j (A : type) (x : A) (B : (φ : 𝔽) → {(i : 𝕀) → sub A {i=0 ∨ φ} x} → type) (d : B ⊤ {_ => x}) (φ : 𝔽) (p : (i : 𝕀) → sub A {i=0 ∨ φ} x) : sub {B φ p} φ d
:= let filler : 𝕀 → 𝕀 → A := j i => hcom A 0 i {∂ j ∨ φ} {i => [ i=0 ∨ j=0 ∨ φ => p 0 | j=1 => p i ] } in com {j => B {φ ∨ j=0} {filler j}} 0 1 {φ} {j => d}
def
special-j
test
test/groupoid-laws.cooltt
[ "prelude" ]
[]
null
7
20
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
trans (A : type) (p : (i : 𝕀) → A) : (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) → sub {path A {p 0} {q 1}} φ p := special-j A {p 1} {_ q => path A {p 0} {q 1}} p
trans (A : type) (p : (i : 𝕀) → A) : (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) → sub {path A {p 0} {q 1}} φ p
:= special-j A {p 1} {_ q => path A {p 0} {q 1}} p
def
trans
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "path", "special-j" ]
null
22
26
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
assoc (A : type) (p : (i : 𝕀) → A) (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) : (ψ : 𝔽) (r : (i : 𝕀) → sub A {i=0 ∨ ψ} {q 1}) → sub {path {path A {p 0} {r 1}} {trans A {trans A p φ q} ψ r} {trans A p {φ ∧ ψ} {trans A q ψ r}}} ψ {_ => trans A p φ q} := special-j A {q 1} {ψ r => path {path A {...
assoc (A : type) (p : (i : 𝕀) → A) (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) : (ψ : 𝔽) (r : (i : 𝕀) → sub A {i=0 ∨ ψ} {q 1}) → sub {path {path A {p 0} {r 1}} {trans A {trans A p φ q} ψ r} {trans A p {φ ∧ ψ} {trans A q ψ r}}} ψ {_ => trans A p φ q}
:= special-j A {q 1} {ψ r => path {path A {p 0} {r 1}} {trans A {trans A p φ q} ψ r} {trans A p {φ ∧ ψ} {trans A q ψ r}}} {_ => trans A p φ q}
def
assoc
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "path", "special-j", "trans" ]
null
29
38
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
pentagonType (A : type) (p : (i : 𝕀) → A) (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) (ψ : 𝔽) (r : (i : 𝕀) → sub A {i=0 ∨ ψ} {q 1}) (χ : 𝔽) (s : (i : 𝕀) → sub A {i=0 ∨ χ} {r 1}) : type := path {path {path A {p 0} {s 1}} {trans A {trans A {trans A p φ q} ψ r} χ s} {trans ...
pentagonType (A : type) (p : (i : 𝕀) → A) (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) (ψ : 𝔽) (r : (i : 𝕀) → sub A {i=0 ∨ ψ} {q 1}) (χ : 𝔽) (s : (i : 𝕀) → sub A {i=0 ∨ χ} {r 1}) : type
:= path {path {path A {p 0} {s 1}} {trans A {trans A {trans A p φ q} ψ r} χ s} {trans A p {φ ∧ ψ ∧ χ} {trans A q {ψ ∧ χ} {trans A r χ s}}}} {trans {path A {p 0} {s 1}} {assoc A {trans A p φ q} ψ r χ s} {ψ ∧ χ} {assoc A p φ q {ψ ∧ χ} {trans A r χ s}}} {trans {path A ...
def
pentagonType
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "assoc", "path", "trans" ]
null
40
62
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
pentagon (A : type) (p : (i : 𝕀) → A) (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) (ψ : 𝔽) (r : (i : 𝕀) → sub A {i=0 ∨ ψ} {q 1}) : (χ : 𝔽) (s : (i : 𝕀) → sub A {i=0 ∨ χ} {r 1}) → pentagonType A p φ q ψ r χ s := special-j A {r 1} {pentagonType A p φ q ψ r} {special-j A {q 1} {ψ r => p...
pentagon (A : type) (p : (i : 𝕀) → A) (φ : 𝔽) (q : (i : 𝕀) → sub A {i=0 ∨ φ} {p 1}) (ψ : 𝔽) (r : (i : 𝕀) → sub A {i=0 ∨ ψ} {q 1}) : (χ : 𝔽) (s : (i : 𝕀) → sub A {i=0 ∨ χ} {r 1}) → pentagonType A p φ q ψ r χ s
:= special-j A {r 1} {pentagonType A p φ q ψ r} {special-j A {q 1} {ψ r => pentagonType A p φ q ψ r ⊤ {_ => r 1}} {special-j A {p 1} {φ q => pentagonType A p φ q ⊤ {_ => q 1} ⊤ {_ => q 1}} {_ _ => p} φ q} ψ r}
def
pentagon
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "pentagonType", "special-j" ]
null
64
79
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
trans' (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) : path A {p 0} {q 1} := trans A p ⊥ q
trans' (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) : path A {p 0} {q 1}
:= trans A p ⊥ q
def
trans'
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "path", "trans" ]
null
83
86
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
assoc' (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) : path {path A {p 0} {r 1}} {trans' A {trans' A p q} r} {trans' A p {trans' A q r}} := assoc A p ⊥ q ⊥ r
assoc' (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) : path {path A {p 0} {r 1}} {trans' A {trans' A p q} r} {trans' A p {trans' A q r}}
:= assoc A p ⊥ q ⊥ r
def
assoc'
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "assoc", "path", "trans'" ]
null
89
95
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
pentagon' (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) (s : (i : 𝕀) → sub A {i=0} {r 1}) : path {path {path A {p 0} {s 1}} {trans' A {trans' A {trans' A p q} r} s} {trans' A p {trans' A q {trans' A r s}}}} {trans' {path A {p...
pentagon' (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) (s : (i : 𝕀) → sub A {i=0} {r 1}) : path {path {path A {p 0} {s 1}} {trans' A {trans' A {trans' A p q} r} s} {trans' A p {trans' A q {trans' A r s}}}} {trans' {path A {p...
:= pentagon A p ⊥ q ⊥ r ⊥ s
def
pentagon'
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "assoc'", "path", "pentagon", "trans'" ]
null
98
117
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935
test (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) (s : (i : 𝕀) → sub A {i=0} {r 1}) : (j : 𝕀) → path A {p 0} {r 1} := j => assoc A p ⊥ q ⊥ r j
test (A : type) (p : (i : 𝕀) → A) (q : (i : 𝕀) → sub A {i=0} {p 1}) (r : (i : 𝕀) → sub A {i=0} {q 1}) (s : (i : 𝕀) → sub A {i=0} {r 1}) : (j : 𝕀) → path A {p 0} {r 1}
:= j => assoc A p ⊥ q ⊥ r j
def
test
test
test/groupoid-laws.cooltt
[ "prelude" ]
[ "assoc", "path" ]
null
119
126
true
https://github.com/RedPRL/cooltt
b39bf29900451cb43ae6fbd9af5aa33d59e18935