Martin Escardo, 23rd May 2025. Homotopy pullbacks and some basic properties to begin with. This is loosely based on [1] Jeremy Avigad, Chris Kapulkin, Peter LeFanu Lumsdaine. Homotopy limits in type theory, 2015 (first version 2013). https://arxiv.org/abs/1304.0680 \begin{code} {-# OPTIONS --safe --without-K #-} module UF.Pullback where open import MLTT.Spartan open import UF.Embeddings open import UF.Equiv open import UF.Subsingletons \end{code} We assume a cospan Y | | g | v X -------> C f \begin{code} module pullback {๐ค ๐ฅ ๐ฆ : Universe} {X : ๐ค ฬ } {Y : ๐ฅ ฬ } {Z : ๐ฆ ฬ } (f : X โ Z) (g : Y โ Z) where \end{code} And we consider commutative squares of the form q A -------> X | | p | | g | | v v Y -------> Z f completing the cospan. \begin{code} commutative-square : {A : ๐ฃ ฬ } โ (A โ X) ร (A โ Y) โ ๐ฆ โ ๐ฃ ฬ commutative-square (p , q) = f โ p โผ g โ q \end{code} A cone over the cospan is the totality of these data. \begin{code} cone : ๐ฃ ฬ โ ๐ค โ ๐ฅ โ ๐ฆ โ ๐ฃ ฬ cone A = ฮฃ pq ๊ ((A โ X) ร (A โ Y)) , commutative-square pq \end{code} It is convenient to collect all cones in a universe into a single type. \begin{code} Cone : (๐ฃ : Universe) โ ๐ค โ ๐ฅ โ ๐ฆ โ (๐ฃ โบ) ฬ Cone ๐ฃ = ฮฃ A ๊ ๐ฃ ฬ , cone A source : Cone ๐ฃ โ ๐ฃ ฬ source (P , c) = P cone-of : (๐ : Cone ๐ฃ) โ cone (source ๐) cone-of (P , c) = c \end{code} If we have a cone q P -------> Y | | p | | g | | v v X -------> Z f and a map u : A โ P, we get a cone q โ u A -------> Y | | p โ u | | g | | v v X -------> Z f \begin{code} cone-map : {P : ๐ฃ' ฬ } (A : ๐ฃ ฬ ) โ cone P โ (A โ P) โ cone A cone-map X ((p , q) , e) u = (p โ u , q โ u) , e โ u \end{code} We say that a cone q P -------> Y | | p | | g | | v v X -------> Z f is a (homotopy) pullback if the cone map is an equivalence for every A. \begin{code} is-pullback : Cone ๐ฃ โ ๐คฯ is-pullback (P , c) = {๐ฃ' : Universe} (A : ๐ฃ' ฬ ) โ is-equiv (cone-map A c) \end{code} We record the equivalence explicitly. \begin{code} module _ (๐@(P , c@((pโ , pโ) , s)) : Cone ๐ฃ) (i : is-pullback ๐) where pullback-equivalence : (A : ๐ฃ' ฬ ) โ (A โ P) โ cone A pullback-equivalence A = cone-map A c , i A \end{code} And we can formulate the universal property of pullbacks in terms of (homotopy) unique existence. \begin{code} module _ (๐@(A , d@((hโ , hโ) , t)) : Cone ๐ฃ') where universal-property : โ! u ๊ (A โ P) , ((pโ โ u , pโ โ u) , s โ u) ๏ผ ((hโ , hโ) , t) universal-property = equivs-are-vv-equivs (cone-map A c) (i A) d \end{code} It is convenient to name the uniquely existing u as the "mediating map", and record the equations it satisfies. \begin{code} mediating-map : (A โ P) mediating-map = prโ (center universal-property) _ : mediating-map ๏ผ โ pullback-equivalence A โโปยน d _ = refl mediating-map-eqโ : pโ โ mediating-map ๏ผ hโ mediating-map-eqโ = ap (prโ โ prโ) (prโ (center universal-property)) mediating-map-eqโ : pโ โ mediating-map ๏ผ hโ mediating-map-eqโ = ap (prโ โ prโ) (prโ (center universal-property)) \end{code} We now show that pullbacks exist, and call them simply pullbacks, although perhaps we should call them standard pullbacks, or chosen pullbacks. The construction is illustrated in the following diagram. pbโ ฮฃ (x , y) ๊ X ร Y , f x ๏ผ g y -------> Y | | pbโ | | g | | v v X ---------------------------> Z f \begin{code} pullback : ๐ค โ ๐ฅ โ ๐ฆ ฬ pullback = ฮฃ (x , y) ๊ X ร Y , f x ๏ผ g y private P = pullback pbโ : P โ X pbโ ((x , y) , s) = x pbโ : P โ Y pbโ ((x , y) , s) = y pullback-square : commutative-square (pbโ , pbโ) pullback-square ((x , y) , s) = s pullback-cone : cone P pullback-cone = ((pbโ , pbโ) , pullback-square) Pullback-Cone : Cone (๐ค โ ๐ฅ โ ๐ฆ) Pullback-Cone = P , pullback-cone pullback-cone-map : (A : ๐ฃ' ฬ ) โ (A โ P) โ cone A pullback-cone-map A = cone-map A pullback-cone pullback-mediating-map : {A : ๐ฃ ฬ } โ cone A โ (A โ P) pullback-mediating-map ((p , q) , s) a = (p a , q a) , s a pullback-Cone-is-pullback : is-pullback Pullback-Cone pullback-Cone-is-pullback A = qinvs-are-equivs (pullback-cone-map A) (pullback-mediating-map , (ฮป u โ refl) , (ฮป c โ refl)) _ : (A : ๐ฃ' ฬ ) (c : cone A) โ pullback-mediating-map c ๏ผ mediating-map Pullback-Cone pullback-Cone-is-pullback (A , c) _ = ฮป A c โ refl \end{code} Pullbacks of embeddings are embeddings. \begin{code} pbโ-is-embedding : is-embedding f โ is-embedding pbโ pbโ-is-embedding f-is-embedding y = I where I : is-prop (fiber pbโ y) I (((xโ , y) , eโ) , refl) (((xโ , y) , eโ) , refl) = III II where II : (xโ , eโ) ๏ผ (xโ , eโ) II = f-is-embedding (g y) (xโ , eโ) (xโ , eโ) III : {(xโ , eโ) (xโ , eโ) : fiber f (g y)} โ (xโ , eโ) ๏ผ (xโ , eโ) โ (((xโ , y) , eโ) , refl) ๏ผ[ fiber pbโ y ] (((xโ , y) , eโ) , refl) III refl = refl \end{code} We have a pullback fiber f c ----> ๐ | | fiber-point | | c | | v v X ---------> Z f \begin{code} module _ {๐ค ๐ฅ ๐ฆ : Universe} {X : ๐ค ฬ } {Z : ๐ฆ ฬ } (f : X โ Z) (z : Z) where open pullback f (ฮป (_ : ๐ {๐ฅ}) โ z) fiber-is-pullback : is-pullback (fiber f z , (fiber-point , unique-to-๐) , fiber-identification) fiber-is-pullback A = qinvs-are-equivs ฯ (ฮณ , (ฮป u โ refl) , (ฮป c โ refl)) where ฯ : (A โ fiber f z) โ cone A ฯ = cone-map A ((fiber-point , unique-to-๐) , fiber-identification) ฮณ : cone A โ (A โ fiber f z) ฮณ ((p , q) , s) a = p a , s a \end{code} TODO. Implement other results from [1].