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

      ACCWAFFW

      and

      {AC=LLP(F)C=LLP(AF)

First factorization system on 𝒰i:

AfφBy:Bfibfyπ1

Retracts

f is a retract of g:

we can find maps such that the following diagram commutes:

XidsfXgrXfYidsYrY

NB: f is “almost” isomorphic to g

Recall that

φ{Ay:Bfibfya(fa,a,refl)

Fibrations

fF is a fibration:

if there exists a fibrant predicate P:A𝒰i s.t.

  • f is a retract of π1:a:APaA

  • AhXfsy:YPyrπ1Xfy:Bfibfyi?αhYsYrX
X=(y,x,e:fx=y)(sh(X);π2(sh(x)):P(π1(s(h(x))))s(h(ix)))

NB: y:Bfibfy is the pullback of F along idB:

Xhhy:Bfibfyπ2,1π1XidBAFB x:X(hx;hx,exfibg(hx))C:idBh=fh

The following diagram is a pushout:

AidAfAhBghy:BCylfyfX

Cylinder: HIT: Cylf:BType:

  • top:x:ACylf(fx)

  • base:y:BCylfy

  • Cyleq:x:Atopx=base(fx)

P:y:BCylfy𝒰itop:x:AP(fx)(topx)base:y:BPy(basey)Cyl_eq:x:A(Cyl_eqx)#topx=base(fx)Cyl_indPtopbaseCyl_eq:y:Bc:CylfyPyc
y:BCylfyXtop:AXhbase:BXhCyl_eq:x:Atopx=base(fx)hx=h(fx)

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:a:APaA and Pa is contractible for all a:A

Afa(fa,topa)By:BCylfyπ1

For all y:B, Cylfy is contractible.

Proof:

  • center:basey
y:Bc:Cylfyc=baseyPλy,c.c=basey
  • top:x:Atopx=base(fx)

    • topxCyleqx
  • base:y:Bbasey=basey

    • baseyreflbasey
  • Cyleq:x:A

    • (Cyl_eqx)#Cyl_eqx=refl=(Cyl_eqx)1@Cyl_eqx=refl

So the naive definition

  • iA:AC
  • iB:BC
  • ieq:x:A,iAx=iB(fx)

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)
ΓAFibΓ,x:ABFibΓx:A,BFib

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

(* 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

AfBy:Bfibfyπ1

and

AfBy:BCylfy

which leads us to:

Epi-mono factorization system

When B is a n-type:

An:(AB)(AB) Afa(fa,trn(a,refl))By:Bfibfynπ1

where

trn:AAn

Image of a function

Naive attempt at defining the image of a function:

Imfy:Bfibfy

But the right notion is rather:

Imfy:Bfibfy1

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 (apf) is an equivalence:

apf:x=yfx=fy

π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:AB is n-truncated:

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

Prop:

f is a mono f is (1)-truncated

Proof: For all (x,e),(x,e):fibfy

  • e:fx=y
  • e:fx=y

Let’s construct ex:x=x:

ex(apf)1(e@e1):x=x

And

ex#e(e@e1)1@e=e

Conversely: fibfy is (-1)-truncated.

for all x,y,(e:fx=fy)x=y

fibf(fx)(x,refl)=(y,e1)x=y

fibπ1y is n-truncated

Proof:

(y,p)y=y is n-truncated

y:Bp:fibfyny=yp:fibfynyy:By=ycontractible⟹≃1

n-connectedness

It’s the dual notion of n-truncatedness

f:AB is n-connected:

if for all y:B, fibfyn is contractible

The map

i:{Ay:Bfibfyna(fa,trn(a,refl))

is n-connected

p=(x,e:fx=y) ax e:fa=y

  • fibi(y,p)n is contractible

  • a:A(fa,tr(a,refl)=(y,p))n

Leave a comment