Begin by downloading the file FunExtPostulate.agda and
put it in your working folder.
Create a file named HLevels.agda and make it begin
with
{-# OPTIONS --without-K #-}
open import Prelude
open import Path
open import FunExtPostulate
private variable
ℓ ℓ' : LevelDefine the predicate of being contractible by
isContr : Type ℓ → Type ℓ
isContr A = Σ A (λ x → (y : A) → x ≡ y)Show that the terminal type ⊤ is contractible
isContr⊤ : isContr ⊤Show that booleans are not contractible
¬isContrBool : ¬ (isContr Bool)Show that the product of contractible types is contractible
isContr× : {A : Type ℓ} {B : Type ℓ'} → isContr A → isContr B → isContr (A × B)Show that contractible types have contractible path types
isContr→isContrPath : {A : Type ℓ} → isContr A → (x y : A) → isContr (x ≡ y)We define singleton types as
singl : {A : Type ℓ} → A → Type ℓ
singl {A = A} a = Σ A λ x → a ≡ xShow that singleton types are contractible
isContrSingl : {A : Type ℓ} (a : A) → isContr (singl a)
isContrSingl a = (a , refl) , λ { (x , p) → Σ≡ p (substInPathsL refl p ∙ sym (lUnit _)) }TODO: propositional truncation