module 1Lab.Biimp where
Biimplicationsπ
A biimplication between a pair of types is a pair of functions
record _β_ {β} {β'} (A : Type β) (B : Type β') : Type (β β β') where no-eta-equality constructor biimp field to : A β B from : B β A open _β_
If and n-types, then the type of biimplications is also an n-type.
β-is-hlevel : β n β is-hlevel A n β is-hlevel B n β is-hlevel (A β B) n β-is-hlevel n A-hl B-hl = Isoβis-hlevel n eqv $ Γ-is-hlevel n (Ξ -is-hlevel n Ξ» _ β B-hl) (Ξ -is-hlevel n Ξ» _ β A-hl)
instance H-Level-β : β {n} β β¦ _ : H-Level A n β¦ β¦ _ : H-Level B n β¦ β H-Level (A β B) n H-Level-β {n = n} .H-Level.has-hlevel = β-is-hlevel n (hlevel n) (hlevel n) instance Extensional-β : β {βr} β β¦ _ : Extensional ((A β B) Γ (B β A)) βr β¦ β Extensional (A β B) βr Extensional-β β¦ e β¦ = isoβextensional eqv e
Working with biimplicationsπ
There is an identity biimplication, and biimplications compose.
idβ : A β A idβ .to = id idβ .from = id _ββ_ : A β B β B β C β A β C (f ββ g) .to = g .to β f .to (f ββ g) .from = f .from β g .from
Moreover, every biimplication induces a biimplication
_ββ»ΒΉ : A β B β B β A (f ββ»ΒΉ) .to = f .from (f ββ»ΒΉ) .from = f .to
Biimplications and equivalencesπ
Every equivalence is a biimplication.
equivβbiimp : A β B β A β B equivβbiimp f .to = Equiv.to f equivβbiimp f .from = Equiv.from f