module Cat.Displayed.Path where

open Precategory
open Displayed

Paths of displayed categoriesπŸ”—

If you have a pair of displayed categories and over a line of precategories it might be interesting β€” if you, like me, are a lunatic β€” to know when they can be connected by a PathP over This module answers that! A path between displayed categories, over a path of their corresponding bases, is a displayed functor

which is componentwise an equivalence.

The first stepπŸ”—

We write this proof in two steps: First, we write a helper function which abstracts over the contentful part of the path (the displayed object spaces, displayed Hom spaces, etc) and automatically fills in the proofs that the laws are preserved. We have a record displayed-pathp-data which contains paths for all the interesting components:

    record displayed-pathp-data : Type (lsuc (o βŠ” β„“ βŠ” o' βŠ” β„“')) where
      no-eta-equality
      field
        obp  : PathP (Ξ» i β†’ B i .Ob β†’ Type o') E.Ob[_] F.Ob[_]
        homp : PathP
          (Ξ» i β†’ {x y : B i .Ob} (f : B i .Hom x y) β†’ obp i x β†’ obp i y β†’ Type β„“')
          E.Hom[_] F.Hom[_]

The types get increasingly unhinged as we go: The identification between displayed object spaces lies over the identification of objects of the underlying category; The identification between displayed Hom spaces lies over a path in the base category and the path of displayed object spaces we just defined.

The paths between the identity morphisms and composite morphisms lie over both of those, and they have to quantify over every implicit argument inside the path! That’s why this record is in a private helper module, you see.

        idp : PathP (Ξ» i β†’ βˆ€ {x} {x' : obp i x} β†’ homp i (B i .id) x' x') E.id' F.id'
        compp : PathP
          (Ξ» i β†’ βˆ€ {x y z}    {f : B i .Hom y z}    {g : B i .Hom x y}
               β†’ βˆ€ {x' y' z'} (f' : homp i f y' z') (g' : homp i g x' y')
               β†’ homp i (B i ._∘_ f g) x' z')
          E._∘'_ F._∘'_

An instance of this record determines a path of displayed categories,

    displayed-pathp-worker
      : displayed-pathp-data β†’ PathP (Ξ» i β†’ Displayed (B i) o' β„“') E F
    displayed-pathp-worker input = go where
      open displayed-pathp-data input

such that all the interesting components are literal, and the coherence components are, by definition, unimportant.

      go : PathP (Ξ» i β†’ Displayed (B i) o' β„“') E F
      Ob[ go i ] x = obp i x
      Hom[ go i ] = homp i
      Hom[ go i ]-set {a} {b} f x y = homp-set i a b f x y
      go i .id' = idp i
      go i ._∘'_ = compp i
      go i .idr' {a} {b} {x} {y} {f} f' j = is-set→squarep
        (Ξ» i j     β†’ Ξ -is-hlevelΒ³ {A = B i .Ob} {B = Ξ» _ β†’ B i .Ob}      {C = Ξ» a _ β†’ obp i a}      2
          Ξ» a b x  β†’ Ξ -is-hlevelΒ³ {A = obp i b} {B = Ξ» _ β†’ B i .Hom a b} {C = Ξ» y f β†’ homp i f x y} 2
          Ξ» y f f' β†’ homp-set i a b (B i .idr f j) x y)
        (Ξ» i a b x y f f' β†’ compp i f' (idp i))
        (Ξ» i a b x y f f' β†’ E .idr' f' i)
        (Ξ» i a b x y f f' β†’ F .idr' f' i)
        (Ξ» i a b x y f f' β†’ f')
        i j a b x y f f'
      go i .idl' {a} {b} {x} {y} {f} f' j = is-set→squarep
        (Ξ» i j    β†’ Ξ -is-hlevelΒ³ {A = B i .Ob} {B = Ξ» _ β†’ B i .Ob}      {C = Ξ» a _ β†’ obp i a}      2
          Ξ» a b x  β†’ Ξ -is-hlevelΒ³ {A = obp i b} {B = Ξ» _ β†’ B i .Hom a b} {C = Ξ» y f β†’ homp i f x y} 2
          Ξ» y f f' β†’ homp-set i a b (B i .idl f j) x y)
        (Ξ» i a b x y f f' β†’ compp i (idp i) f')
        (Ξ» i a b x y f f' β†’ E .idl' f' i)
        (Ξ» i a b x y f f' β†’ F .idl' f' i)
        (Ξ» i a b x y f f' β†’ f')
        i j a b x y f f'
      go i .assoc' {a} {b} {c} {d} {w} {x} {y} {z} {f} {g} {h} f' g' h' j = is-set→squarep
        (Ξ» i j    β†’ Ξ -is-hlevelΒ³ {A = B i .Ob}      {B = Ξ» _ β†’ B i .Ob}      {C = Ξ» _ _ β†’ B i .Ob}      2
          Ξ» a b c  β†’ Ξ -is-hlevelΒ³ {A = B i .Ob}      {B = Ξ» _ β†’ obp i a}      {C = Ξ» _ _ β†’ obp i b}      2
          Ξ» d w x  β†’ Ξ -is-hlevelΒ³ {A = obp i c}      {B = Ξ» _ β†’ obp i d}      {C = Ξ» _ - β†’ B i .Hom c d} 2
          Ξ» y z f  β†’ Ξ -is-hlevelΒ³ {A = B i .Hom b c} {B = Ξ» _ β†’ B i .Hom a b} {C = Ξ» _ _ β†’ homp i f y z} 2
          Ξ» g h f' β†’ Ξ -is-hlevelΒ² {A = homp i g x y} {B = Ξ» _ β†’ homp i h w x}                            2
          Ξ» g' h'  β†’ homp-set i a d (B i .assoc f g h j) w z)
        (Ξ» i a b c d w x y z f g h f' g' h' β†’ compp i f' (compp i g' h'))
        (Ξ» i a b c d w x y z f g h f' g' h' β†’ E .assoc' f' g' h' i)
        (Ξ» i a b c d w x y z f g h f' g' h' β†’ F .assoc' f' g' h' i)
        (Ξ» i a b c d w x y z f g h f' g' h' β†’ compp i (compp i f' g') h')
        i j a b c d w x y z f g h f' g' h'

Complicating itπŸ”—

Suppose that we have and together with a functor which is an isomorphism of precategories, and a functor over This is the situation in the introduction, but where the line comes from the identity system on precategories given by isomorphisms of precategories.

The functor must be componentwise an isomorphism of types: This is the displayed equivalent of an isomorphism of precategories.

  Displayed-pathp
    : (eqv : is-precat-iso F)
    β†’ (βˆ€ a β†’ is-equiv {A = β„°.Ob[ a ]} G.Fβ‚€')
    β†’ ( βˆ€ {a b} {f} {a' : β„°.Ob[ a ]} {b' : β„°.Ob[ b ]}
      β†’ is-equiv {A = β„°.Hom[ f ] a' b'} G.F₁')
    β†’ PathP (Ξ» i β†’ Displayed (Precategory-path F eqv i) o' β„“') β„° β„±
  Displayed-pathp eqv obeqv homeqv = displayed-pathp-worker input where
    ps = Precategory-path F eqv

We’ll define a displayed-pathp-data. We define the paths between displayed object spaces and displayed path spaces by gluing against the ungluing of the paths in the underlying category, in the right endpoint category Diagrammatically, this looks something like

    p1 : PathP (Ξ» i β†’ ps i .Ob β†’ Type o') β„°.Ob[_] β„±.Ob[_]
    p1 i x = Glue β„±.Ob[ unglue (βˆ‚ i) x ] Ξ» where
      (i = i0) β†’ β„°.Ob[ x ] , G.Fβ‚€' , obeqv x
      (i = i1) β†’ β„±.Ob[ x ] , _ , id-equiv

We glue the type along β€” the action of the displayed functor on objects β€” against the line of types given by applying the space of displayed objects of to the ungluing of giving a line of type families p1 ranging from The situation for Hom spaces is analogous.

    sys : βˆ€ i (x y : ps i .Ob) (f : ps i .Hom x y) (x' : p1 i x) (y' : p1 i y)
        β†’ Partial (i ∨ ~ i) _
    sys i x y f x' y' (i = i0) = β„°.Hom[ f ] x' y' , G.F₁' , homeqv
    sys i x y f x' y' (i = i1) = β„±.Hom[ f ] x' y' , _ , id-equiv

    p2 : PathP
      (Ξ» i β†’ {x y : ps i .Ob} (f : ps i .Hom x y) β†’ p1 i x β†’ p1 i y β†’ Type β„“')
      β„°.Hom[_] β„±.Hom[_]
    p2 i {x} {y} f x' y' = Glue
      (β„±.Hom[ unglue (βˆ‚ i) f ] (unglue (βˆ‚ i) x') (unglue (βˆ‚ i) y'))
      (sys i x y f x' y')

    open displayed-pathp-data
    input : displayed-pathp-data
    input .obp  = p1
    input .homp = p2

We now β€œjust” have to produce inhabitants of p2 along which restrict to and identity morphisms (and composition morphisms) at the endoints of We can do so by gluing, now at the level of terms, against a heterogeneous composition. The details are quite nasty, but the core of it is extending the witness that respects identity to a path, over line given by gluing and ungluing the domain/codomain, between the identity maps in and

    input .idp i {x} {x'} = glue-inc (βˆ‚ i)
      {Tf = sys i x x (ps i .id {x}) x' x'}
      (Ξ» { (i = i0) β†’ β„°.id' ; (i = i1) β†’ β„±.id' })
      (inS (comp (Ξ» j β†’ β„±.Hom[ p (~ j) ] (unglue (βˆ‚ i) x') (unglue (βˆ‚ i) x')) (βˆ‚ i)
        Ξ» { j (j = i0) β†’ β„±.id'
          ; j (i = i0) β†’ G.F-id' (~ j)
          ; j (i = i1) β†’ β„±.id' }))
      where
        p : unglue (βˆ‚ i) (ps i .id {x}) ≑ C.id
        p j = hfill (βˆ‚ i) (~ j) Ξ» where
          k (k = i0) β†’ C.id
          k (i = i0) β†’ F.F-id (~ k)
          k (i = i1) β†’ C.id
The case for compositions is analogous and yet much nastier, so I won’t comment on it. You can’t make me.
    input .compp i {x} {y} {z} {f} {g} {x'} {y'} {z'} f' g' = glue-inc (βˆ‚ i)
        {Tf = sys i x z (ps i ._∘_ {x} {y} {z} f g) x' z'}
        (Ξ» { (i = i0) β†’ f' β„°.∘' g' ; (i = i1) β†’ f' β„±.∘' g' })
        (inS (comp (Ξ» j β†’ β„±.Hom[ p j ] (unglue (βˆ‚ i) x') (unglue (βˆ‚ i) z')) (βˆ‚ i)
          Ξ» { k (k = i0) β†’
                   unglue (βˆ‚ i) {T = Ξ» .βˆ‚i=i1 β†’ sys i y z f y' z' βˆ‚i=i1 .fst} f'
              β„±.∘' unglue (βˆ‚ i) g'
            ; k (i = i0) β†’ G.F-∘' {f' = f'} {g' = g'} (~ k)
            ; k (i = i1) β†’ f' β„±.∘' g' }))
      where
        p : I β†’ C .Hom (unglue (i ∨ ~ i) x) (unglue (i ∨ ~ i) z)
        p j = hfill (βˆ‚ i) j Ξ» where
          k (i = i0) β†’ F.F-∘ f g (~ k)
          k (i = i1) β†’ f C.∘ g
          k (k = i0) β†’ unglue (βˆ‚ i) f C.∘ unglue (βˆ‚ i) g

As one last step, we show that if the functor is displayed over the identity, the path is an actual identity, rather than a PathP.

  Displayed-path
    : (Fβ‚€-eqv : βˆ€ a β†’ is-equiv F.β‚€')
    β†’ (F₁-eqv : βˆ€ {a b} {f : B .Hom a b} {a' : β„°.Ob[ a ]} {b' : β„°.Ob[ b ]}
              β†’ is-equiv (F.₁' {f = f} {a' = a'} {b' = b'}))
    β†’ β„° ≑ β„±
  Displayed-path Fβ‚€-eqv F₁-eqv =
    transport
      (Ξ» i β†’ PathP
        (Ξ» j β†’ Displayed
          (to-path-refl {a = B} Precategory-identity-system i j) o' β„“') β„° β„±)
      (Displayed-pathp Id F (iso id-equiv id-equiv) Fβ‚€-eqv F₁-eqv)