-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exercise.agda
73 lines (53 loc) · 1.65 KB
/
Exercise.agda
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{-# OPTIONS --without-K --type-in-type #-}
module _ where
data Bool : Set where
true false : Bool
Bool-elim
: (P : Bool → Set)
→ P true → P false
→ ∀ (b : Bool) → P b
Bool-elim P Pt Pf true = Pt
Bool-elim P Pt Pf false = Pf
data Unit : Set where
it : Unit
data Void : Set where
¬_ : Set → Set
¬ A = A → Void
open import MiniHoTT1
module BoolIsNotContractible where
F : Bool → Set
F = Bool-elim (λ _ → Set) Unit Void
true≢false : ¬ (true ≡ false)
true≢false p = coe (cong F p) it
-------------------------------------------------------------------------
U : Set _
U = Set
open import MiniHoTT2
module UniverseIsNotSet where
not : Bool → Bool
not = Bool-elim (λ _ → Bool) false true
notNot : ∀ b → not (not b) ≡ b
notNot = Bool-elim (λ b → not (not b) ≡ b) refl refl
notIsInj : isInj not
notIsInj b b′ p = -- b
sym (notNot b) ◾ -- not (not b)
cong not p ◾ -- not (not b′)
notNot b′ -- b′
notIsSurj : isSurj not
notIsSurj b = not b , notNot b
notIsEquiv : isEquiv not
notIsEquiv = notIsInj , notIsSurj
notEquiv : Bool ≃ Bool
notEquiv = not , notIsEquiv
notEquiv≢idEquiv : ¬ (ua notEquiv ≡ ua idEquiv)
notEquiv≢idEquiv pEquiv = BoolIsNotContractible.true≢false eq
where
pFun : proj₁ notEquiv ≡ proj₁ idEquiv
pFun = cong proj₁ (ua-inj notEquiv idEquiv pEquiv)
eq : true ≡ false
eq = cong (λ f → f false) pFun
UIsNotSet : ¬ (isSet U)
UIsNotSet prf = notEquiv≢idEquiv pEquiv
where
pEquiv : ua notEquiv ≡ ua idEquiv
pEquiv = prf Bool Bool (ua notEquiv) (ua idEquiv)