Skip to content

Commit 63d187d

Browse files
authored
Formalize Theorem 7.2.2 in the HoTT Book (#1180)
* Formalize Theorem 7.2.2 in the HoTT Book * move Theorem 7.2.2 to Cubical.Relation.Binary.Properties * Remove a few extra spaces This is not really necessary but it looks better
1 parent 06e62f4 commit 63d187d

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

Cubical/Relation/Binary/Properties.agda

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,34 @@ open import Cubical.Functions.FunExtEquiv
1111
open import Cubical.Data.Sigma
1212

1313
open import Cubical.Relation.Binary.Base
14+
open import Cubical.Relation.Nullary
1415

1516
private
1617
variable
1718
ℓ ℓ' : Level
1819
A B : Type ℓ
1920

21+
-- Theorem 7.2.2 in the HoTT Book
22+
module _ (R : Rel A A ℓ') where
23+
open BinaryRelation R
24+
25+
reflPropRelImpliesIdentity→isSet : isRefl
26+
isPropValued
27+
impliesIdentity
28+
isSet A
29+
reflPropRelImpliesIdentity→isSet Rrefl Rprop R→≡ = Collapsible≡→isSet λ where
30+
x y .fst p R→≡ (subst (R x) p (Rrefl x))
31+
x y .snd p q cong R→≡ (Rprop _ _ _ _)
32+
33+
reflPropRelImpliesIdentity→isUnivalent : isRefl
34+
isPropValued
35+
impliesIdentity
36+
isUnivalent
37+
reflPropRelImpliesIdentity→isUnivalent Rrefl Rprop R→≡ x y =
38+
propBiimpl→Equiv (Rprop x y) (Aset x y) R→≡ (λ p subst (R x) p (Rrefl x)) where
39+
40+
Aset : isSet A
41+
Aset = reflPropRelImpliesIdentity→isSet Rrefl Rprop R→≡
2042

2143
-- Pulling back a relation along a function.
2244
-- This can for example be used when restricting an equivalence relation to a subset:
@@ -53,16 +75,16 @@ module _ {A B : Type ℓ} (e : A ≃ B) {_∼_ : Rel A A ℓ'} {_∻_ : Rel B B
5375

5476
RelPathP : PathP (λ i ua e i ua e i Type _)
5577
_∼_ _∻_
56-
RelPathP i x y = Glue (ua-unglue e i x ∻ ua-unglue e i y)
57-
λ { (i = i0) _ , x h y
78+
RelPathP i x y = Glue (ua-unglue e i x ∻ ua-unglue e i y)
79+
λ { (i = i0) _ , x h y
5880
; (i = i1) _ , idEquiv _ }
5981

6082

6183
module _ {ℓ''} {B : Type ℓ} {_∻_ : B B Type ℓ'} where
6284

6385
JRelPathP-Goal : Type _
6486
JRelPathP-Goal = (A : Type ℓ) (e : A ≃ B) (_~_ : A A Type ℓ')
65-
(_h_ : x y x ~ y ≃ (fst e x ∻ fst e y)) Type ℓ''
87+
(_h_ : x y x ~ y ≃ (fst e x ∻ fst e y)) Type ℓ''
6688

6789

6890
EquivJRel : (Goal : JRelPathP-Goal)

0 commit comments

Comments
 (0)