module Cat.Displayed.Instances.CT-Structure {o β} (B : Precategory o β) (has-prods : β X Y β Product B X Y) where open Precategory B open Binary-products B has-prods open Simple B has-prods
CT structuresπ
CT-Structures are a refinement of simple fibrations, which
allow us to model type theories where the contexts arenβt necessarily
representable as types. This is done by defining a CT-Structure
(short for Context
and Type Structure) on our category of contexts, which allows us to
distinguish certain contexts as denoting types (for instance, singleton
contexts, or possibly the empty context if we have unit types). A
CT-structure is quite simple, consisting of only a predicate on contexts
meant to denote which ones are types, along with the restriction that
there is at least one type, to prevent the entire structure from
becoming degenerate.
record CT-Structure (s : Level) : Type (o β lsuc s) where field is-tp : Ob β Prop s β-tp : β[ tp β Ob ] (tp β is-tp) open CT-Structure
We can construct a displayed category over our category of contexts in much the same manner as the simple fibration; the only difference is that we restrict the displayed object to objects that the CT-structure distinguishes as types.
Simple-ct : β {s} β CT-Structure s β Displayed B (o β s) β Simple-ct ct .Displayed.Ob[_] Ξ = Ξ£[ X β Ob ] β£ is-tp ct X β£ Simple-ct ct .Displayed.Hom[_] {Ξ} {Ξ} u X Y = Hom (Ξ ββ X .fst) (Y .fst) Simple-ct ct .Displayed.Hom[_]-set {Ξ} {Ξ} u X Y = Hom-set (Ξ ββ X .fst) (Y .fst) Simple-ct ct .Displayed.id' = Οβ Simple-ct ct .Displayed._β'_ {f = u} {g = v} f g = f β β¨ v β Οβ , g β© Simple-ct ct .Displayed.idr' {f = u} f = f β β¨ (id β Οβ) , Οβ β© β‘β¨ products! B has-prods β©β‘ f β Simple-ct ct .Displayed.idl' {f = u} f = Οβ β β¨ u β Οβ , f β© β‘β¨ products! B has-prods β©β‘ f β Simple-ct ct .Displayed.assoc' {f = u} {g = v} {h = w} f g h = f β β¨ (v β w) β Οβ , g β β¨ w β Οβ , h β© β© β‘β¨ products! B has-prods β©β‘ (f β β¨ v β Οβ , g β©) β β¨ w β Οβ , h β© β
Cartesian mapsπ
If a map is cartesian in the simple fibration, then it is cartesian in a simple CT fibration.
Simple-cartesianβSimple-ct-cartesian : β {s} {Ξ Ξ x y} {Ο : Hom Ξ Ξ} {f : Hom (Ξ ββ x) y} β (ct : CT-Structure s) β (x-tp : x β ct .is-tp) β (y-tp : y β ct .is-tp) β is-cartesian Simple Ο f β is-cartesian (Simple-ct ct) {a' = x , x-tp} {b' = y , y-tp} Ο f Simple-cartesianβSimple-ct-cartesian ct x-tp y-tp cart = ct-cart where open is-cartesian ct-cart : is-cartesian (Simple-ct ct) _ _ ct-cart .universal = cart .universal ct-cart .commutes = cart .commutes ct-cart .unique = cart .unique
Fibration structureπ
Much like the simple fibration, the simple fibration associated to a CT-structure also deserves its name.
open Cartesian-fibration open Cartesian-lift open is-cartesian Simple-ct-fibration : β {s} (ct : CT-Structure s) β Cartesian-fibration (Simple-ct ct) Simple-ct-fibration ct .has-lift u Y .x' = Y Simple-ct-fibration ct .has-lift u Y .lifting = Οβ Simple-ct-fibration ct .has-lift u Y .cartesian .universal _ h = h Simple-ct-fibration ct .has-lift u Y .cartesian .commutes g h = Οβββ¨β© Simple-ct-fibration ct .has-lift u Y .cartesian .unique {m = g} {h' = h} h' p = h' β‘Λβ¨ Οβββ¨β© β©β‘Λ Οβ β β¨ g β Οβ , h' β© β‘β¨ p β©β‘ h β
Embeddingsπ
There is an evident embedding of the simple fibration associated with a CT-structure into the simple fibration.
Simple-ctβSimple : β {s} β (ct : CT-Structure s) β Vertical-functor (Simple-ct ct) Simple Simple-ctβSimple ct .Vertical-functor.Fβ' = fst Simple-ctβSimple ct .Vertical-functor.Fβ' f = f Simple-ctβSimple ct .Vertical-functor.F-id' = refl Simple-ctβSimple ct .Vertical-functor.F-β' = refl
Furthermore, if is (merely) inhabited, then we can construct a CT-Structure that considers every context a type.
All-types : β₯ Ob β₯ β CT-Structure lzero All-types X .is-tp _ = el β€ (hlevel 1) All-types X .β-tp = β₯-β₯-map (Ξ» x β x , tt) X SimpleβSimple-ct : β {X} β Vertical-functor Simple (Simple-ct (All-types X)) SimpleβSimple-ct .Vertical-functor.Fβ' X = X , tt SimpleβSimple-ct .Vertical-functor.Fβ' f = f SimpleβSimple-ct .Vertical-functor.F-id' = refl SimpleβSimple-ct .Vertical-functor.F-β' = refl