exercise 3.5, closes #44

This commit is contained in:
Michael Zhang 2024-10-28 18:56:55 -05:00
parent fd5b32c47f
commit 4c435f3764

View file

@ -0,0 +1,23 @@
{-# OPTIONS --cubical #-}
module CubicalHott.Exercise3-5 where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
exercise : {A : Type} isProp A (A isContr A)
exercise {A} = isoToEquiv (iso f g fg gf) where
f : isProp A A isContr A
f isPropA a = a , (λ y isPropA a y)
g : (A isContr A) isProp A
g p x y =
let z = snd (p x) in
sym (z x) z y
fg : section f g
fg ff = funExt λ x isPropIsContr (f (g ff) x) (ff x)
gf : retract f g
gf prop = funExt (λ x funExt (λ y isProp→isSet prop x y (g (f prop) x y) (prop x y)))