Ian Ray, 23 July 2024
Minor modifications by Tom de Jong on 4 September 2024
Modifications made by Ian Ray on 26th September 2024.
Modifications made by Ian Ray on 17th December 2024.
Using records we define the general truncation of a type; this will include
a constructor, an induction principle and a computation rule
(up to identification). We then proceed to develop some machinery derived from
the induction principle and explore relationships, closure properties and
finally characterize the identity type of truncations. We explicitly assume
univalence locally for the characterization of identity types but not
globally as many important properties hold in the absence of univalence.
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import UF.FunExt
module UF.Truncations
(fe : Fun-Ext)
where
open import MLTT.Spartan hiding (_+_)
open import UF.Base
open import UF.Equiv
open import UF.EquivalenceExamples
open import UF.PropTrunc
open import UF.Retracts
open import UF.Sets
open import UF.Size
open import UF.Subsingletons
open import UF.TruncationLevels
open import UF.TruncatedTypes fe
open import UF.Univalence
open import UF.Yoneda
open import Notation.Decimal
\end{code}
We define the general notion of truncation using record types.
\begin{code}
record general-truncations-exist : π€Ο where
field
β₯_β₯[_] : π€ Μ β βββ β π€ Μ
β₯β₯β-is-truncated : {X : π€ Μ } {n : βββ} β β₯ X β₯[ n ] is n truncated
β£_β£[_] : {X : π€ Μ } β X β (n : βββ) β β₯ X β₯[ n ]
β₯β₯β-ind : {X : π€ Μ } {n : βββ} {P : β₯ X β₯[ n ] β π₯ Μ }
β ((s : β₯ X β₯[ n ]) β (P s) is n truncated)
β ((x : X) β P (β£ x β£[ n ]))
β (s : β₯ X β₯[ n ]) β P s
β₯β₯β-ind-comp : {X : π€ Μ } {n : βββ} {P : β₯ X β₯[ n ] β π₯ Μ }
β (m : (s : β₯ X β₯[ n ]) β (P s) is n truncated)
β (g : (x : X) β P (β£ x β£[ n ]))
β (x : X) β β₯β₯β-ind m g (β£ x β£[ n ]) οΌ g x
infix 0 β₯_β₯[_]
infix 0 β£_β£[_]
\end{code}
We now add some some machinery that will prove useful: truncation recursion
and uniqueness, induction/recursion for two arguments and all associated
computation rules.
\begin{code}
β₯β₯β-rec : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β Y is n truncated
β (X β Y)
β β₯ X β₯[ n ] β Y
β₯β₯β-rec m f s = β₯β₯β-ind (Ξ» - β m) f s
β₯β₯β-uniqueness : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β Y is n truncated
β (f g : β₯ X β₯[ n ] β Y)
β ((x : X) β f (β£ x β£[ n ]) οΌ g (β£ x β£[ n ]))
β f βΌ g
β₯β₯β-uniqueness m f g =
β₯β₯β-ind (Ξ» s β truncation-levels-closed-under-Id m (f s) (g s))
β₯β₯β-universal-property : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β Y is n truncated
β (β₯ X β₯[ n ] β Y) β (X β Y)
β₯β₯β-universal-property {_} {_} {X} {Y} {n} Y-trunc =
(foreward , qinvs-are-equivs foreward (backward , H , G))
where
foreward : (β₯ X β₯[ n ] β Y) β (X β Y)
foreward g = g β β£_β£[ n ]
backward : (X β Y) β (β₯ X β₯[ n ] β Y)
backward = β₯β₯β-rec Y-trunc
H : backward β foreward βΌ id
H g = dfunext fe (β₯β₯β-ind (Ξ» - β truncation-levels-are-upper-closed Y-trunc
((backward β foreward) g -) (g -))
H')
where
H' : (x : X)
β backward (foreward (g)) β£ x β£[ n ] οΌ g β£ x β£[ n ]
H' = β₯β₯β-ind-comp (Ξ» - β Y-trunc) (g β β£_β£[ n ])
G : foreward β backward βΌ id
G f = dfunext fe (β₯β₯β-ind-comp (Ξ» - β Y-trunc) f)
to-βΌ-of-maps-between-truncated-types : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (f g : β₯ X β₯[ n ] β β₯ Y β₯[ n ])
β ((x : X)
β f (β£ x β£[ n ]) οΌ g (β£ x β£[ n ]))
β f βΌ g
to-βΌ-of-maps-between-truncated-types {π€} {π₯} {X} {Y} {n} f g =
β₯β₯β-uniqueness β₯β₯β-is-truncated f g
β₯β₯β-rec-comp : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (m : Y is n truncated)
β (g : X β Y)
β (x : X) β β₯β₯β-rec m g β£ x β£[ n ] οΌ g x
β₯β₯β-rec-comp m = β₯β₯β-ind-comp (Ξ» - β m)
β£_β£β : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (X β Y)
β X β β₯ Y β₯[ n ]
β£_β£β {_} {_} {_} {_} {n} f = β£_β£[ n ] β f
β₯_β₯β : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (X β Y)
β β₯ X β₯[ n ] β β₯ Y β₯[ n ]
β₯ f β₯β = β₯β₯β-rec β₯β₯β-is-truncated (β£ f β£β)
β₯β₯β-id-functorial : {X : π€ Μ } {n : βββ}
β β₯ id β₯β βΌ id
β₯β₯β-id-functorial {_} {X} {n} =
β₯β₯β-uniqueness β₯β₯β-is-truncated β₯ id β₯β id H
where
H : (x : X) β β₯ id β₯β β£ x β£[ n ] οΌ β£ x β£[ n ]
H = β₯β₯β-rec-comp β₯β₯β-is-truncated β£_β£[ n ]
β₯β₯β-composition-functorial : {X : π€ Μ } {Y : π₯ Μ } {Z : π¦ Μ } {n : βββ}
β (f : X β Y)
β (g : Y β Z)
β β₯ g β f β₯β βΌ β₯ g β₯β β β₯ f β₯β
β₯β₯β-composition-functorial {_} {_} {_} {X} {_} {_} {n} f g =
β₯β₯β-uniqueness β₯β₯β-is-truncated β₯ g β f β₯β (β₯ g β₯β β β₯ f β₯β) H
where
H : (x : X) β β₯ g β f β₯β β£ x β£[ n ] οΌ β₯ g β₯β (β₯ f β₯β β£ x β£[ n ])
H x = β₯ g β f β₯β β£ x β£[ n ] οΌβ¨ I β©
β£ g (f x) β£[ n ] οΌβ¨ II β©
β₯ g β₯β β£ f x β£[ n ] οΌβ¨ III β©
β₯ g β₯β (β₯ f β₯β β£ x β£[ n ]) β
where
I = β₯β₯β-rec-comp β₯β₯β-is-truncated β£ g β f β£β x
II = β₯β₯β-rec-comp β₯β₯β-is-truncated β£ g β£β (f x) β»ΒΉ
III = ap β₯ g β₯β (β₯β₯β-rec-comp β₯β₯β-is-truncated β£ f β£β x) β»ΒΉ
β₯β₯β-preserves-homotopy' : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (f g : X β Y)
β f βΌ g
β β₯ f β₯β β β£_β£[ n ] βΌ β₯ g β₯β β β£_β£[ n ]
β₯β₯β-preserves-homotopy' {_} {_} {X} {_} {n} f g H x =
β₯ f β₯β β£ x β£[ n ] οΌβ¨ I β©
β£ f x β£[ n ] οΌβ¨ II β©
β£ g x β£[ n ] οΌβ¨ III β©
β₯ g β₯β β£ x β£[ n ] β
where
I = β₯β₯β-rec-comp β₯β₯β-is-truncated β£ f β£β x
II = ap β£_β£[ n ] (H x)
III = β₯β₯β-rec-comp β₯β₯β-is-truncated β£ g β£β x β»ΒΉ
β₯β₯β-preserves-homotopy : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (f g : X β Y)
β f βΌ g
β β₯ f β₯β βΌ β₯ g β₯β
β₯β₯β-preserves-homotopy {_} {_} {X} {_} {n} f g H = G
where
G : (x : β₯ X β₯[ n ]) β β₯ f β₯β x οΌ β₯ g β₯β x
G = β₯β₯β-uniqueness β₯β₯β-is-truncated β₯ f β₯β β₯ g β₯β
(β₯β₯β-preserves-homotopy' f g H)
β₯β₯β-recβ : {X : π€ Μ } {Y : π₯ Μ } {Z : π¦ Μ } {n : βββ}
β Z is n truncated
β (X β Y β Z)
β β₯ X β₯[ n ] β β₯ Y β₯[ n ] β Z
β₯β₯β-recβ m g = β₯β₯β-rec (truncated-types-closed-under-β m)
(Ξ» x β β₯β₯β-rec m (g x))
β₯β₯β-rec-compβ : {X : π€ Μ } {Y : π₯ Μ } {Z : π¦ Μ } {n : βββ}
β (m : Z is n truncated)
β (g : X β Y β Z)
β (x : X) β (y : Y)
β β₯β₯β-recβ m g β£ x β£[ n ] β£ y β£[ n ] οΌ g x y
β₯β₯β-rec-compβ {π€} {π₯} {π¦} {X} {Y} {Z} {n} m g x y =
β₯β₯β-recβ m g β£ x β£[ n ] β£ y β£[ n ] οΌβ¨ I β©
β₯β₯β-rec m (g x) β£ y β£[ n ] οΌβ¨ β₯β₯β-rec-comp m (g x) y β©
g x y β
where
I = happly (β₯β₯β-rec-comp (truncated-types-closed-under-β m)
(Ξ» x β β₯β₯β-rec m (g x)) x)
β£ y β£[ n ]
abstract
β₯β₯β-indβ : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (P : β₯ X β₯[ n ] β β₯ Y β₯[ n ] β π¦ Μ )
β ((u : β₯ X β₯[ n ]) β (v : β₯ Y β₯[ n ]) β (P u v) is n truncated)
β ((x : X) β (y : Y) β P (β£ x β£[ n ]) (β£ y β£[ n ]))
β (u : β₯ X β₯[ n ]) β (v : β₯ Y β₯[ n ]) β P u v
β₯β₯β-indβ {π€} {π₯} {π¦} {X} {Y} {n} P m f =
β₯β₯β-ind (Ξ» u β truncated-types-closed-under-Ξ (P u) (m u))
(Ξ» x β β₯β₯β-ind (Ξ» v β m β£ x β£[ n ] v) (f x))
β₯β₯β-ind-compβ : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β (P : β₯ X β₯[ n ] β β₯ Y β₯[ n ] β π¦ Μ )
β (m : (u : β₯ X β₯[ n ]) β (v : β₯ Y β₯[ n ])
β (P u v) is n truncated)
β (g : (x : X) β (y : Y) β P (β£ x β£[ n ]) (β£ y β£[ n ]))
β (x : X) β (y : Y)
β β₯β₯β-indβ P m g β£ x β£[ n ] β£ y β£[ n ] οΌ g x y
β₯β₯β-ind-compβ {π€} {π₯} {π¦} {X} {Y} {n} P m g x y =
β₯β₯β-indβ P m g β£ x β£[ n ] β£ y β£[ n ] οΌβ¨ I β©
β₯β₯β-ind (m β£ x β£[ n ]) (g x) β£ y β£[ n ] οΌβ¨ II β©
g x y β
where
I : β₯β₯β-indβ P m g β£ x β£[ n ] β£ y β£[ n ]
οΌ β₯β₯β-ind (m β£ x β£[ n ]) (g x) β£ y β£[ n ]
I = happly
(β₯β₯β-ind-comp (Ξ» u β truncated-types-closed-under-Ξ (P u) (m u))
(Ξ» x' β β₯β₯β-ind (m β£ x' β£[ n ]) (g x')) x)
β£ y β£[ n ]
II : β₯β₯β-ind (m β£ x β£[ n ]) (g x) β£ y β£[ n ] οΌ g x y
II = β₯β₯β-ind-comp (m β£ x β£[ n ]) (g x) y
\end{code}
We characterize the first couple truncation levels.
(TODO: 1-type is a groupoid).
\begin{code}
β2-trunc-is-contr : {X : π€ Μ } β is-contr (β₯ X β₯[ β2 ])
β2-trunc-is-contr = β₯β₯β-is-truncated
β1-trunc-is-prop : {X : π€ Μ } β is-prop (β₯ X β₯[ β1 ])
β1-trunc-is-prop = is-prop'-implies-is-prop β₯β₯β-is-truncated
0-trunc-is-set : {X : π€ Μ } β is-set (β₯ X β₯[ 0 ])
0-trunc-is-set {π€} {X} {x} {y} =
is-prop'-implies-is-prop (β₯β₯β-is-truncated x y)
\end{code}
We demonstrate the equivalence of -1-truncation and propositional truncation:
β₯ X β₯[ β1 ] β β₯ X β₯
\begin{code}
module _ (pt : propositional-truncations-exist)
where
open propositional-truncations-exist pt
β1-trunc-to-prop-trunc : {X : π€ Μ } β β₯ X β₯[ β1 ] β β₯ X β₯
β1-trunc-to-prop-trunc = β₯β₯β-rec (is-prop-implies-is-prop' β₯β₯-is-prop) β£_β£
prop-trunc-to-β1-trunc : {X : π€ Μ } β β₯ X β₯ β β₯ X β₯[ β1 ]
prop-trunc-to-β1-trunc = β₯β₯-rec β1-trunc-is-prop (β£_β£[ β1 ])
β1-trunc-β-prop-trunc : {X : π€ Μ }
β (β₯ X β₯[ β1 ]) β β₯ X β₯
β1-trunc-β-prop-trunc =
logically-equivalent-props-are-equivalent β1-trunc-is-prop β₯β₯-is-prop
β1-trunc-to-prop-trunc
prop-trunc-to-β1-trunc
props-are-truncated : {X : π€ Μ } {n : βββ}
β is-prop X
β X is (n + 1) truncated
props-are-truncated {_} {_} {β2} = is-prop-implies-is-prop'
props-are-truncated {_} {_} {succ n} X-is-prop =
truncation-levels-are-upper-closed
(Ξ» x x' β props-are-truncated X-is-prop x x')
\end{code}
We define the canonical predecessor map and give a computation rule.
\begin{code}
canonical-pred-map : {X : π€ Μ } {n : βββ}
β β₯ X β₯[ n + 1 ] β β₯ X β₯[ n ]
canonical-pred-map {π€} {X} {n} =
β₯β₯β-rec (truncation-levels-are-upper-closed β₯β₯β-is-truncated) β£_β£[ n ]
canonical-pred-map-comp : {X : π€ Μ } {n : βββ} (x : X)
β canonical-pred-map (β£ x β£[ n + 1 ]) οΌ (β£ x β£[ n ])
canonical-pred-map-comp {π€} {X} {n} =
β₯β₯β-rec-comp (truncation-levels-are-upper-closed β₯β₯β-is-truncated) β£_β£[ n ]
\end{code}
We show truncations are closed under equivalence and successive applications
of truncation.
TODO: closure under retracts, embeddings, etc. Note closure under equivalence
can be refactored to use closure under retracts.
\begin{code}
truncation-closed-under-retract : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β retract Y of X
β retract β₯ Y β₯[ n ] of β₯ X β₯[ n ]
truncation-closed-under-retract {_} {_} {X} {Y} {n} (r , s , H) =
(β₯ r β₯β , β₯ s β₯β , G)
where
G : β₯ r β₯β β β₯ s β₯β βΌ id
G y = (β₯ r β₯β β β₯ s β₯β) y οΌβ¨ I β©
β₯ r β s β₯β y οΌβ¨ II β©
β₯ id β₯β y οΌβ¨ III β©
y β
where
I = β₯β₯β-composition-functorial s r y β»ΒΉ
II = β₯β₯β-preserves-homotopy (r β s) id H y
III = β₯β₯β-id-functorial y
truncation-closed-under-equiv : {X : π€ Μ } {Y : π₯ Μ } {n : βββ}
β X β Y
β β₯ X β₯[ n ] β β₯ Y β₯[ n ]
truncation-closed-under-equiv {π€} {π₯} {X} {Y} {n} e = (f , (b , G) , (b , H))
where
f : β₯ X β₯[ n ] β β₯ Y β₯[ n ]
f = β₯β₯β-rec β₯β₯β-is-truncated (Ξ» x β β£ β e β x β£[ n ])
b : β₯ Y β₯[ n ] β β₯ X β₯[ n ]
b = β₯β₯β-rec β₯β₯β-is-truncated (Ξ» y β β£ β e ββ»ΒΉ y β£[ n ])
H : b β f βΌ id
H = to-βΌ-of-maps-between-truncated-types (b β f) id H'
where
H' : (x : X) β b (f (β£ x β£[ n ])) οΌ (β£ x β£[ n ])
H' x = b (f (β£ x β£[ n ])) οΌβ¨ I β©
b (β£ β e β x β£[ n ]) οΌβ¨ II β©
(β£ β e ββ»ΒΉ (β e β x) β£[ n ]) οΌβ¨ III β©
(β£ x β£[ n ]) β
where
I = ap b (β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» x β β£ (β e β x) β£[ n ]) x)
II = β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» y β β£ (β e ββ»ΒΉ y) β£[ n ]) (β e β x)
III = ap (Ξ» x β β£ x β£[ n ]) (inverses-are-retractions' e x)
G : f β b βΌ id
G = to-βΌ-of-maps-between-truncated-types (f β b) id G'
where
G' : (y : Y) β f (b (β£ y β£[ n ])) οΌ (β£ y β£[ n ])
G' y = f (b (β£ y β£[ n ])) οΌβ¨ I β©
f (β£ (β e ββ»ΒΉ y) β£[ n ]) οΌβ¨ II β©
(β£ β e β (β e ββ»ΒΉ y) β£[ n ]) οΌβ¨ III β©
(β£ y β£[ n ]) β
where
I = ap f (β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» y β β£ (β e ββ»ΒΉ y) β£[ n ]) y)
II = β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» x β β£ β e β x β£[ n ]) (β e ββ»ΒΉ y)
III = ap β£_β£[ n ] (inverses-are-sections' e y)
truncations-of-small-types-are-small : {X : π€ Μ } {n : βββ}
β X is π₯ small
β β₯ X β₯[ n ] is π₯ small
truncations-of-small-types-are-small {_} {_} {_} {n} (Y , e) =
(β₯ Y β₯[ n ] , truncation-closed-under-equiv e)
successive-truncations-equiv : {X : π€ Μ } {n : βββ}
β (β₯ X β₯[ n ]) β (β₯ (β₯ X β₯[ n + 1 ]) β₯[ n ])
successive-truncations-equiv {π€} {X} {n} = (f , (b , G) , (b , H))
where
f : β₯ X β₯[ n ] β β₯ β₯ X β₯[ n + 1 ] β₯[ n ]
f = β₯β₯β-rec β₯β₯β-is-truncated (Ξ» _ β β£ β£ _ β£[ n + 1 ] β£[ n ])
b : β₯ β₯ X β₯[ succ n ] β₯[ n ] β β₯ X β₯[ n ]
b = β₯β₯β-rec β₯β₯β-is-truncated canonical-pred-map
G : f β b βΌ id
G = β₯β₯β-uniqueness β₯β₯β-is-truncated (f β b) id
(β₯β₯β-uniqueness
(truncation-levels-are-upper-closed β₯β₯β-is-truncated)
(f β b β β£_β£[ n ])
β£_β£[ n ]
G')
where
G' : (x : X)
β f (b (β£ β£ x β£[ n + 1 ] β£[ n ])) οΌ (β£ β£ x β£[ n + 1 ] β£[ n ])
G' x = f (b (β£ β£ x β£[ n + 1 ] β£[ n ])) οΌβ¨ I β©
f (canonical-pred-map (β£ x β£[ n + 1 ])) οΌβ¨ II β©
f (β£ x β£[ n ]) οΌβ¨ III β©
(β£ β£ x β£[ n + 1 ] β£[ n ]) β
where
I = ap f (β₯β₯β-rec-comp β₯β₯β-is-truncated canonical-pred-map
(β£ x β£[ n + 1 ]))
II = ap f (canonical-pred-map-comp x)
III = β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» _ β β£ β£ _ β£[ n + 1 ] β£[ n ]) x
H : b β f βΌ id
H = β₯β₯β-uniqueness β₯β₯β-is-truncated (b β f) id H'
where
H' : (x : X) β b (f (β£ x β£[ n ])) οΌ (β£ x β£[ n ])
H' x = b (f (β£ x β£[ n ])) οΌβ¨ I β©
b (β£ β£ x β£[ n + 1 ] β£[ n ]) οΌβ¨ II β©
canonical-pred-map (β£ x β£[ n + 1 ]) οΌβ¨ canonical-pred-map-comp x β©
(β£ x β£[ n ]) β
where
I = ap b (β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» _ β β£ β£ _ β£[ n + 1 ] β£[ n ]) x)
II = β₯β₯β-rec-comp β₯β₯β-is-truncated canonical-pred-map (β£ x β£[ n + 1 ])
truncated-Ξ£-β : {X : π€ Μ } {P : X β π¦ Μ } {n : βββ}
β β₯ Ξ£ x κ X , β₯ P x β₯[ n ] β₯[ n ] β β₯ Ξ£ x κ X , P x β₯[ n ]
truncated-Ξ£-β {_} {_} {X} {P} {n} = (f , (b , G) , (b , H))
where
f : β₯ Ξ£ x κ X , β₯ P x β₯[ n ] β₯[ n ] β β₯ Ξ£ x κ X , P x β₯[ n ]
f = β₯β₯β-rec β₯β₯β-is-truncated
(uncurry (Ξ» x β β₯β₯β-rec β₯β₯β-is-truncated (Ξ» p β β£ (x , p) β£[ n ])))
b : β₯ Ξ£ x κ X , P x β₯[ n ] β β₯ Ξ£ x κ X , β₯ P x β₯[ n ] β₯[ n ]
b = β₯β₯β-rec β₯β₯β-is-truncated (Ξ» (x , p) β β£ (x , β£ p β£[ n ]) β£[ n ])
G : f β b βΌ id
G = β₯β₯β-uniqueness β₯β₯β-is-truncated (f β b) id G'
where
G' : (z : Ξ£ x κ X , P x) β f (b β£ z β£[ n ]) οΌ β£ z β£[ n ]
G' (x , p) = f (b β£ (x , p) β£[ n ]) οΌβ¨ I β©
f β£ (x , β£ p β£[ n ]) β£[ n ] οΌβ¨ II β©
f' (x , β£ p β£[ n ]) οΌβ¨ III β©
β£ (x , p) β£[ n ] β
where
I = ap f (β₯β₯β-rec-comp β₯β₯β-is-truncated
(Ξ» (x , p) β β£ (x , β£ p β£[ n ]) β£[ n ])
(x , p))
f' = uncurry (Ξ» x β β₯β₯β-rec β₯β₯β-is-truncated (Ξ» p β β£ x , p β£[ n ]))
II = β₯β₯β-rec-comp β₯β₯β-is-truncated f' (x , β£ p β£[ n ])
III = β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» p β β£ (x , p) β£[ n ]) p
H : b β f βΌ id
H = β₯β₯β-uniqueness β₯β₯β-is-truncated (b β f) id H'
where
H'' : (x : X)
β (p : P x)
β b (f β£ (x , β£ p β£[ n ]) β£[ n ]) οΌ β£ (x , β£ p β£[ n ]) β£[ n ]
H'' x p = b (f β£ (x , β£ p β£[ n ]) β£[ n ]) οΌβ¨ I β©
b (f' (x , β£ p β£[ n ])) οΌβ¨ II β©
b β£ (x , p) β£[ n ] οΌβ¨ III β©
β£ (x , β£ p β£[ n ]) β£[ n ] β
where
f' = uncurry (Ξ» x β β₯β₯β-rec β₯β₯β-is-truncated (Ξ» p β β£ x , p β£[ n ]))
I = ap b (β₯β₯β-rec-comp β₯β₯β-is-truncated f' (x , β£ p β£[ n ]))
II = ap b (β₯β₯β-rec-comp β₯β₯β-is-truncated (Ξ» p β β£ x , p β£[ n ]) p)
III = β₯β₯β-rec-comp β₯β₯β-is-truncated
(Ξ» (x , p) β β£ (x , β£ p β£[ n ]) β£[ n ])
(x , p)
H''' : (x : X)
β (p : β₯ P x β₯[ n ])
β b (f β£ (x , p) β£[ n ]) οΌ β£ (x , p) β£[ n ]
H''' x = β₯β₯β-ind (Ξ» p β truncation-levels-closed-under-Id β₯β₯β-is-truncated
(b (f β£ (x , p) β£[ n ])) β£ (x , p) β£[ n ])
(H'' x)
H' : (z : Ξ£ x κ X , β₯ P x β₯[ n ]) β b (f β£ z β£[ n ]) οΌ β£ z β£[ n ]
H' (x , p) = H''' x p
\end{code}
We now define an equivalence that characterizes the truncated identity type
under the assumption of univalence. The following proof was inspired by
the agda unimath library -- although the development there is more thorough --
for details see: https://unimath.github.io/agda-unimath/foundation.truncations.
\begin{code}
canonical-identity-trunc-map : {X : π€ Μ } {x x' : X} {n : βββ}
β β₯ x οΌ x' β₯[ n ]
β β£ x β£[ n + 1 ] οΌ β£ x' β£[ n + 1 ]
canonical-identity-trunc-map {π€} {X} {x} {x'} {n} =
β₯β₯β-rec (β₯β₯β-is-truncated β£ x β£[ n + 1 ] β£ x' β£[ n + 1 ])
(ap β£_β£[ n + 1 ])
module _ {X : π€ Μ } {n : βββ}
(ua : is-univalent π€) (x : X)
where
trunc-id-family : β₯ X β₯[ n + 1 ] β π n π€
trunc-id-family = β₯β₯β-rec (π-is-of-next-truncation-level ua)
(Ξ» x' β (β₯ x οΌ x' β₯[ n ] , β₯β₯β-is-truncated))
trunc-id-family-type : β₯ X β₯[ n + 1 ] β π€ Μ
trunc-id-family-type = prβ β trunc-id-family
trunc-id-family-level : (v : β₯ X β₯[ n + 1 ])
β (trunc-id-family-type v) is n truncated
trunc-id-family-level = prβ β trunc-id-family
trunc-id-family-computes : (x' : X)
β trunc-id-family-type β£ x' β£[ n + 1 ]
οΌ β₯ x οΌ x' β₯[ n ]
trunc-id-family-computes x' =
ap prβ (β₯β₯β-rec-comp (π-is-of-next-truncation-level ua)
(Ξ» x' β (β₯ x οΌ x' β₯[ n ] , β₯β₯β-is-truncated))
x')
trunc-id-forward-map : (x' : X)
β trunc-id-family-type β£ x' β£[ n + 1 ]
β β₯ x οΌ x' β₯[ n ]
trunc-id-forward-map x' = transport id (trunc-id-family-computes x')
trunc-id-backward-map : (x' : X)
β β₯ x οΌ x' β₯[ n ]
β trunc-id-family-type β£ x' β£[ n + 1 ]
trunc-id-backward-map x' = transportβ»ΒΉ id (trunc-id-family-computes x')
trunc-id-back-is-retraction
: (x' : X)
β trunc-id-backward-map x' β trunc-id-forward-map x' βΌ id
trunc-id-back-is-retraction x' q =
forth-and-back-transport (trunc-id-family-computes x')
refl-trunc-id-family : trunc-id-family-type β£ x β£[ n + 1 ]
refl-trunc-id-family = trunc-id-backward-map x β£ refl β£[ n ]
identity-on-trunc-to-family : (v : β₯ X β₯[ n + 1 ])
β β£ x β£[ n + 1 ] οΌ v
β trunc-id-family-type v
identity-on-trunc-to-family .(β£ x β£[ n + 1 ]) refl = refl-trunc-id-family
trunc-id-family-is-identity-system : is-contr (Ξ£ trunc-id-family-type)
trunc-id-family-is-identity-system =
((β£ x β£[ n + 1 ] , refl-trunc-id-family) , trunc-id-fam-is-central)
where
I : (x' : X) (p : x οΌ x')
β (β£ x β£[ n + 1 ] , refl-trunc-id-family)
οΌ[ Ξ£ trunc-id-family-type ]
(β£ x' β£[ n + 1 ] , trunc-id-backward-map x' β£ p β£[ n ])
I x' refl = refl
II : (x' : X) (q' : β₯ x οΌ x' β₯[ n ])
β (β£ x β£[ n + 1 ] , refl-trunc-id-family)
οΌ[ Ξ£ trunc-id-family-type ]
(β£ x' β£[ n + 1 ] , trunc-id-backward-map x' q')
II x' = β₯β₯β-ind (Ξ» s β truncated-types-closed-under-Ξ£
trunc-id-family-type
β₯β₯β-is-truncated
(Ξ» v β truncation-levels-are-upper-closed
(trunc-id-family-level v))
(β£ x β£[ n + 1 ] , refl-trunc-id-family)
(β£ x' β£[ n + 1 ] , trunc-id-backward-map x' s))
(I x')
III : (x' : X) (q : trunc-id-family-type β£ x' β£[ n + 1 ])
β (β£ x β£[ n + 1 ] , refl-trunc-id-family)
οΌ[ Ξ£ trunc-id-family-type ]
(β£ x' β£[ n + 1 ] , q)
III x' q = transport (Ξ» - β (β£ x β£[ n + 1 ] , refl-trunc-id-family)
οΌ[ Ξ£ trunc-id-family-type ]
(β£ x' β£[ n + 1 ] , -))
(trunc-id-back-is-retraction x' q)
(II x' (trunc-id-forward-map x' q))
IV : (v : β₯ X β₯[ n + 1 ]) (q : trunc-id-family-type v)
β (β£ x β£[ n + 1 ] , refl-trunc-id-family) οΌ (v , q)
IV =
β₯β₯β-ind
(Ξ» s β truncated-types-closed-under-Ξ
(Ξ» q β (β£ x β£[ n + 1 ] , refl-trunc-id-family) οΌ (s , q))
(Ξ» q β truncated-types-closed-under-Ξ£
trunc-id-family-type
(truncation-levels-are-upper-closed β₯β₯β-is-truncated)
(Ξ» v β truncation-levels-are-upper-closed
(truncation-levels-are-upper-closed
(trunc-id-family-level v)))
(β£ x β£[ n + 1 ] , refl-trunc-id-family)
(s , q)))
III
trunc-id-fam-is-central : is-central (Ξ£ trunc-id-family-type)
(β£ x β£[ n + 1 ] , refl-trunc-id-family)
trunc-id-fam-is-central (v , q) = IV v q
trunc-identity-characterization : {X : π€ Μ } {n : βββ}
β (ua : is-univalent π€)
β (x : X) (v : β₯ X β₯[ n + 1 ])
β (β£ x β£[ n + 1 ] οΌ v)
β trunc-id-family-type ua x v
trunc-identity-characterization {π€} {X} {n} ua x v =
(identity-on-trunc-to-family ua x v ,
Yoneda-Theorem-forth β£ x β£[ n + 1 ]
(identity-on-trunc-to-family ua x)
(trunc-id-family-is-identity-system ua x) v)
eliminated-trunc-identity-char : {X : π€ Μ } {x x' : X} {n : βββ}
β (ua : is-univalent π€)
β β₯ x οΌ x' β₯[ n ]
β (β£ x β£[ n + 1 ] οΌ β£ x' β£[ n + 1 ])
eliminated-trunc-identity-char {π€} {X} {x} {x'} {n} ua =
β-comp (idtoeq β₯ x οΌ x' β₯[ n ]
(trunc-id-family-type ua x β£ x' β£[ n + 1 ])
(trunc-id-family-computes ua x x' β»ΒΉ))
(β-sym (trunc-identity-characterization ua x β£ x' β£[ n + 1 ]))
forth-trunc-id-char : {X : π€ Μ } {x x' : X} {n : βββ}
β (ua : is-univalent π€)
β β₯ x οΌ x' β₯[ n ]
β (β£ x β£[ n + 1 ] οΌ β£ x' β£[ n + 1 ])
forth-trunc-id-char ua = β eliminated-trunc-identity-char ua β
\end{code}
We show that the existence of propositional truncation follows from the existence
of general truncations. Notice this implication manifests as a function between
record types.
\begin{code}
general-truncations-give-propositional-truncations : general-truncations-exist
β propositional-truncations-exist
general-truncations-give-propositional-truncations te = record
{ β₯_β₯ = β₯_β₯[ β1 ]
; β₯β₯-is-prop = is-prop'-implies-is-prop β₯β₯β-is-truncated
; β£_β£ = β£_β£[ β1 ]
; β₯β₯-rec = Ξ» - β β₯β₯β-rec (is-prop-implies-is-prop' -)
}
where
open general-truncations-exist te
\end{code}