Lecture 8: Categories in 2-level type theory, Fibrations and co-Fibrations

Category in 2-level type theory

  • $≡$ strict equality (UIP)
  • $=$ univalent equality which can be eliminated only over fibrant predicate

$𝒰ℱ_i$ universe of fibrant types forms a category.

Model structure on a category $𝒞$:

  • 3 classes of morphisms $W, F, C$

    • $W$ satsifies 2-out-of-3 property
    • $(AC, F)$ and $(C, AF)$ are weak factorization systems, where

      AC ≝ C ∩ W \\ AF ≝ F ∩ W

      and

      \begin{cases} AC = LLP(F) \\ C = LLP(AF) \end{cases}

First factorization system on $𝒰ℱ_i$:

\begin{xy} \xymatrix{ A \ar[rr]^f \ar[rd]_{\overset{φ}{≃}} && B \\ & \sum\limits_{ y: B } fib_f \, y \ar[ru]_{π_1} & } \end{xy}

Retracts

$f$ is a retract of $g$:

we can find maps such that the following diagram commutes:

\begin{xy} \xymatrix{ X \ar@/^1cm/[rr]^{id} \ar[r]^s \ar[d]_f & X' \ar[d]^g \ar[r]^r & X \ar[d]^f & \\ Y \ar@/_1cm/[rr]^{id} \ar[r]_{s'} & Y' \ar[r]_{r'} & Y \\ } \end{xy}

NB: $f$ is “almost” isomorphic to $g$

Recall that

φ ≝ \begin{cases} A &⟶ \sum\limits_{ y: B } fib_f \, y \\ a &\mapsto (f \, a, a, refl) \end{cases}

Fibrations

$f∈F$ is a fibration:

if there exists a fibrant predicate $P: A’ ⟶ 𝒰ℱ_i$ s.t.

  • $f$ is a retract of $π_1: \sum\limits_{ a’: A’ } P \, a’ ⟶ A’$

  • \begin{xy} \xymatrix{ A \ar[r]^h \ar[d] & X \ar[d]^f \ar[r]^s & \sum\limits_{ y':Y' } P \, y' \ar[r]^r \ar[d]^{π_1} & X \ar[d]^f & \\ \sum\limits_{ y: B } fib_f \, y \ar@/^1cm/[u]^{i} \ar@{.>}[ru]^{? α} \ar@{.>}[rru] \ar[r]_{h'} & Y \ar[r]_{s'} & Y' \ar[r]_{r'} & X' \\ } \end{xy}
X = (y, x, e: f \, x = y) ⟼ (s' \circ h'(X); π_2(s \circ h(x)): P(π_1(s(h(x)))) ≡ s'(h'(i \, x)))

NB: $\sum\limits_{ y: B } fib_f \, y$ is the pullback of $F$ along $id_B$:

\begin{xy} \xymatrix { X \ar@/_/[ddr]_{h'} \ar@{.>}[dr] \ar@/^/[drr]^h \\ & \sum\limits_{ y: B } fib_f \, y \ar[d]^{π_{2,1}} \ar[r]_{π_1} & X \ar[d]^{id_B} \\ & A \ar[r]^F & B } \end{xy}
x: X ⟼ (h \, x; \underbrace{h' \, x, e \, x}_{fib_g(h \, x)})\\ C: id_{B} \circ h = f \circ h'

The following diagram is a pushout:

\begin{xy} \xymatrix{ A \ar[r]^{id_A} \ar[d]_f & A \ar[d] \ar@/^/[ddr]^{h} \\ B \ar[r]_g \ar@/_/[drr]_{h'} & \sum\limits_{ y:B } Cyl_f \, y \ar@{.>}[rd]_f \\ && X } \end{xy}

Cylinder: HIT: $Cyl_f: B ⟶ Type$:

  • $top: \prod\limits_{ x:A } Cyl_f (f \, x)$

  • $base: \prod\limits_{ y:B } Cyl_f \, y$

  • $Cyl_eq: \prod\limits_{ x:A } top \, x = base (f \, x)$

\cfrac{P: \prod\limits_{ y: B } Cyl_f \, y ⟶ 𝒰ℱ_i \\ top': \prod\limits_{ x:A } P \, (f \, x) \, (top \, x) \\ base': \prod\limits_{ y:B } P \, y \, (base \, y)\\ Cyl\_{eq}': \prod\limits_{ x:A } (Cyl\_eq \, x) \# top' \, x = base' \, (f \, x) } {Cyl\_ind \, P \, top' \, base' \, Cyl\_eq': \prod\limits_{ \substack{y:B \\ c: Cyl_f \, y} } P \, y \, c }

\sum\limits_{ y:B } Cyl_f \, y ⟶ X \\ top': A ⟶ X ≝ h\\ base': B ⟶ X ≝ h' \\ Cyl\_eq': \prod\limits_{ x:A } \underbrace{top' \, x = base' \, (f \, x) }_{h \, x = h' \, (f \, x)}

Acyclic fibrations (AF)

$f$ is an acyclic fibration (AF):

if there exists a fibrant predicate $P: A’ ⟶ 𝒰ℱ_i$ s.t. $f$ is a retract of $π_1: \sum\limits_{ a’:A’ } P \, a’ ⟶ A’$ and $P \, a’$ is contractible for all $a’:A’$

\begin{xy} \xymatrix{ A \ar[rr]^f \ar[rd]|{a ⟼ (f \, a, top \, a)} && B \\ & \sum\limits_{ y: B } Cyl_f \, y \ar[ru]_{π_1} & } \end{xy}

For all $y:B$, $Cyl_f \, y$ is contractible.

Proof:

  • $center: base \, y$
\prod\limits_{ \substack{y:B \\ c: Cyl_f \, y} } c = base \, y\\ P ≝ λy, c. c = base \, y
  • $top’: \prod\limits_{ x:A } top \, x = base \, (f \, x)$

    • $top’ \, x ≝ Cyl_eq \, x$
  • $base’: \prod\limits_{ y:B } base \, y = base y$

    • $base’ \, y ≝ refl_{base \, y}$
  • $Cyl_eq’: x:A$

    • (Cyl\_eq \, x) \# Cyl\_eq \, x = refl = (Cyl\_eq \, x)^{-1} @ Cyl\_eq \, x = refl

So the naive definition

  • $i_A: A ⟶ C$
  • $i_B: B ⟶ C$
  • $i_{eq}: ∀x:A, i_A \, x = i_B \, (f \, x)$

obtained naively from the pushout (and that type checks) is not a good one.

The Fibrancy Structure in Coq

cf. model structure.v

For the Cylinder HIT:

(* in a Module: *)

Private Inductive Cyl f : B -> Type :=
    | top: forall x:A, Cyl f (f x)
    | base: forall y:B, Cyl f y

Axiom Cyl_eq: forall x:A, top x = base (f x)

Definition Cyl_ind P top' base' Cyl_eq': forall y:B, (c: Cyl f y), P y c

Then, we define fibrancy (the trick is to add an axiom in the theory):

Axiom Fibrant: Type -> Type

so that the only way to show that a type is fibrant will be to use the axioms.

Definition Type F := exists T:Type, Fibrant T

Axiom Fibrant_forall: forall A (B: A -> Type),
    Fibrant A
    -> forall x: A, Fibrant (B x)
    -> Fibrant (forall x:A, B x)
\cfrac{Γ ⊢ A \, Fib \qquad Γ, x:A ⊢ B \, Fib}{Γ ⊢ ∀x:A, B \, Fib}

NB: In Haskell for instance, there’s no way of talking of dependent type as a family of the form $A ⟶ Type$

(* In another Module *)

Private Inductive Path A (x:A): A -> Type
    | id_path := Path A x x (* := x = x *)

Definition path_ind A (x:A)
                    (P: forall y:A, x=y -> Type)
                    (P_idpath P x (id_path x)) (y: A) (e: x=y)
                    (Fib A : Fibrant A)
                    (Fib P : forall y e, Fibrant (P y e)):
                        forall y e, P y e

We declare “Fibrant” as a type class, so that when we will want to show Fibrant A, Coq will do automatic proof search (by looking at all the rules to construct Fibrant types), and backtrack whenever it fails.

The only type that we declare as fibrant is the cylinder (other inductive types are not mentioned).

Back to the Model Structure

To define the model structure, we’ve showed that

\begin{xy} \xymatrix{ A \ar[rr]^f \ar[rd]_{≃} && B \\ & \sum\limits_{ y: B } fib_f \, y \ar[ru]_{π_1} & } \end{xy}

and

\begin{xy} \xymatrix{ A \ar[rr]^f \ar[rd] && B \\ & \sum\limits_{ y: B } Cyl_f \, y \ar[ru]_{≃} & } \end{xy}

which leads us to:

Epi-mono factorization system

When $B$ is a $n$-type:

\Vert A \Vert_n : (A ⟶ B) ⟶ (\Vert A \Vert ⟶ B)
\begin{xy} \xymatrix{ A \ar[rr]^f \ar[rd]|{a ⟼ (f \, a, tr_n(a, refl))} && B \\ & \sum\limits_{ y: B } \Vert fib_f \, y \Vert_n \ar[ru]_{π_1} & } \end{xy}

where

tr_n: A ⟶ \Vert A \Vert_n

Image of a function

Naive attempt at defining the image of a function:

Im \, f ≝ \sum\limits_{ y:B } fib_f \, y

But the right notion is rather:

Im \, f ≝ \sum\limits_{ y:B } \Vert fib_f \, y \Vert_{-1}

so that it’s no longer equivalent to $A$: you have a witness of the image, but you cannot look at it.

Moreover, in the epi-mono factorization, $π_1$ will need to be a mono(morphism).

Mono/Embedding

$f$ is a mono/an embedding:

if $(ap \, f)$ is an equivalence:

ap \, f: x=y \overset{≃}{⟶} f \, x = f \, y

$π_1$ is a mono

Indeed:

ap \, π_1: (y, p) = (y', p') ⟶ π_1 (y, p) = π_1 (y', p')
  • $e: y=y’$

  • By proof irrelevance: e': e \# p = p'

$n$-truncated maps

$f: A ⟶ B$ is $n$-truncated:

iff for all $y:B$, $fib_f \, y$ is $n$-truncated (i.e. is an $n$-type)

Prop:

f \text{ is a mono } ⟺ f \text{ is } (-1)\text{-truncated}

Proof: For all $(x, e), (x’, e’): fib_f \, y$

  • $e: f \, x = y$
  • $e’: f \, x’ = y$

Let’s construct $e_x: x=x’$:

e_x ≝ (ap \, f)^{-1} (e @ e'^{-1}): x=x'

And

\underbrace{e_x \# e}_{(e @ e'^{-1})^{-1} @ e} = e'

Conversely: $fib_f \, y$ is (-1)-truncated.

for all $x, y, (e: f \, x = f\, y) ⟶ x = y$

fib_f \, (f \, x) \ni (x, refl) = (y, e^{-1})\\ ⟹ x = y

$fib_{π_1} \, y$ is $n$-truncated

Proof:

$\sum\limits_{ (y’, p’) } y’ = y$ is $n$-truncated

\sum\limits_{ y' : B} \sum\limits_{ p: \Vert fib_f \, y' \Vert_n} y' = y \; ≃ \; \sum\limits_{ p: \Vert fib_f \, y' \Vert_n} y' \underbrace{\sum\limits_{ y' : B} y = y'}_{\text{contractible} ⟹ ≃ 1}

$n$-connectedness

It’s the dual notion of $n$-truncatedness

$f: A ⟶B$ is $n$-connected:

if for all $y:B$, $\Vert fib_f \, y \Vert_n$ is contractible

The map

i: \begin{cases} A &⟶ \sum\limits_{ y:B } \Vert fib_f \, y \Vert_n \\ a &⟼ (f \, a, tr_n(a, refl)) \end{cases}

is $n$-connected

$p = (x, e: f\, x = y)$ $a ≝ x$ $e: f\, a = y$

  • $\Vert fib_i \, (y, p) \Vert_n$ is contractible

  • $\Vert \sum\limits_{ a:A } (f \, a, tr(a, refl) = (y, p)) \Vert_n$

Leave a comment