Skip to content

Commit

Permalink
hlevel additions (RedPRL#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
clayrat committed Jun 27, 2020
1 parent 134dece commit 92aa1fa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/hlevel.cooltt
Expand Up @@ -20,6 +20,9 @@ def has-hlevel : nat β†’ type β†’ type =
| suc l => aux l
]

def is-set : type β†’ type = has-hlevel 2
def is-groupoid : type β†’ type = has-hlevel 3

def hLevel (n : nat) : type =
(A : type) Γ— has-hlevel n A

Expand All @@ -29,3 +32,26 @@ def hGroupoid : type = hLevel 3

print hProp
normalize hProp

def symm/filler (A : type) (p : 𝕀 β†’ A) (i : 𝕀) : 𝕀 β†’ A =
hfill A 0 {βˆ‚ i} {j _ =>
[ j=0 ∨ i=1 => p 0
| i=0 => p j
]
}

def symm (A : type) (p : 𝕀 β†’ A) : path A {p 1} {p 0} =
i => symm/filler A p i 1

def trans/filler (A : type) (p : 𝕀 β†’ A) (q : (i : 𝕀) β†’ sub A {i=0} {p 1}) (j : 𝕀) (i : 𝕀) : A =
hcom A 0 j {βˆ‚ i} {j _ =>
[ j=0 ∨ i=0 => p i
| i=1 => q j
]
}

def trans (A : type) (p : 𝕀 β†’ A) (q : (i : 𝕀) β†’ sub A {i=0} {p 1}) : path A {p 0} {q 1} =
trans/filler A p q 1

def contr-prop (A : type) (A/contr : is-contr A) : is-prop A =
a a' => trans A {symm A {{snd A/contr} a}} {{snd A/contr} a'}

0 comments on commit 92aa1fa

Please sign in to comment.