-
Notifications
You must be signed in to change notification settings - Fork 0
/
hott3.ctt
57 lines (49 loc) · 2.06 KB
/
hott3.ctt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module hott3 where
import definitions3
-- exercise 3.1
setFromEquiv (A B : U) (set : isSet A) (equiv : Equiv A B) : isSet B =
transport (<i> isSet (ua A B equiv @ i)) set
-- exercise 3.4
idContrImpliesProp (A : U) (contr : isContr (A -> A)) : isProp A =
\(x y : A) -> <i>
(propFromContr (A -> A) contr (\(_ : A) -> x) (\(_ : A) -> y) @ i) x
propImpliesIdContr (A : U) (p : isProp A) : isContr (A -> A) =
(idfun A, \(f : A -> A) -> <i> \(x : A) -> p x (f x) @ i)
-- weak iff
iff (A B : U) : U = Tuple (A -> B) (B -> A)
-- proof, that this is analogues for not-Prop
iffFromFuncs (A B : Prop) (f : A.1 -> B.1) (g : B.1 -> A.1) : Iff A.1 B.1 =
ua A.1 B.1 (equivFromBiinvEquiv A.1 B.1 (propBiinvEquiv A B f g))
idContrIffProp (A : U) : iff (isContr (A -> A)) (isProp A) =
pair (idContrImpliesProp A) (propImpliesIdContr A)
-- exercise 3.6
propImpliesCoproductProp (A : U) (p : isProp A) :
isProp (Coproduct A (not A)) = split
inl x -> split@((y : Coproduct A (A -> Empty)) ->
Path (Coproduct A (A -> Empty)) (inl x) y) with
inl y -> <i> inl (p x y @ i)
inr y -> recEmpty (Path (Coproduct A (A -> Empty)) (inl x) (inr y)) (y x)
inr x -> split@((y : Coproduct A (A -> Empty)) ->
Path (Coproduct A (A -> Empty)) (inr x) y) with
inl y -> recEmpty (Path (Coproduct A (A -> Empty)) (inr x) (inl y)) (x y)
inr y -> <i> inr (\(a : A) -> recEmpty (Path Empty (x a) (y a)) (x a) @ i)
-- exercise 3.9
propEquivBool (h : LEM) : BiinvEquiv Prop Bool =
(lem2,
pair (lem3, lem4) (lem3, lem5))
where
lem1 (A : U) : Coproduct A (not A) -> Bool = split
inl a -> true
inr b -> false
lem2 (p : Prop) : Bool = lem1 p.1 (h p)
lem3 : Bool -> Prop = split
false -> (Empty, \(x : Empty) ->
recEmpty ((y : Empty) -> Path Empty x y) x)
true -> (Unit, unitIsProp)
lem4 : (x : Bool) -> Path Bool (lem2 (lem3 x)) x = split
false -> ?
true -> ?
lem5 (p : Prop) : Path Prop (lem3 (lem2 p)) p = ?
-- exercise 3.11
cannotConstructFromTrunc (A : U) : not (trunc A -> A) =
\(f : trunc A -> A) -> ?