Home

Displayed category

module category-theory.displayed-category where
Imports
open import foundations.universe
open import foundations.identity-type
open import foundations.set
open import foundations.transport
open import category-theory.category
record DisplayedCategoryData {o h} (π’ž : CategoryData o h) oβ€² hβ€² : Type (o βŠ” h βŠ” lsuc oβ€² βŠ” lsuc hβ€²) where
  private module π’ž = CategoryData π’ž
  field
    Ob : π’ž.Ob β†’ Type oβ€²
    Hom : βˆ€ {A B : π’ž.Ob} (f : π’ž.Hom A B) (X : Ob A) (Y : Ob B) β†’ Type hβ€²

    id : βˆ€ {A} (X : Ob A) β†’ Hom (π’ž.id A) X X
    _∘_ : βˆ€ {A B C} {g : π’ž.Hom B C} {f : π’ž.Hom A B}
      β†’ βˆ€ {X : Ob A} {Y : Ob B} {Z : Ob C}
      β†’ (gβ€² : Hom g Y Z)
      β†’ (fβ€² : Hom f X Y)
      β†’ Hom (g π’ž.∘ f) X Z

  infix 35 _∘_

record isDisplayedCategory {o h} (π’ž : Category o h)
  {oβ€² hβ€²} (π’Ÿ : DisplayedCategoryData (Category.π’ž π’ž) oβ€² hβ€²) : Type (o βŠ” h βŠ” oβ€² βŠ” hβ€²) where
  open DisplayedCategoryData π’Ÿ
  private module π’ž = Category π’ž
  field
    identΛ‘ : βˆ€ {A B} {f : π’ž.Hom A B} {X Y} (fβ€² : Hom f X Y)
      β†’ subst (Ξ» x β†’ Hom x X Y) (π’ž.identΛ‘ f) (id Y ∘ fβ€²) = fβ€²
    identΚ³ : βˆ€ {A B} {f : π’ž.Hom A B} {X Y} (fβ€² : Hom f X Y)
      β†’ subst (Ξ» x β†’ Hom x X Y) (π’ž.identΚ³ f) (fβ€² ∘ id X) = fβ€²
    identΒ² : βˆ€ {A} X
      β†’ subst (Ξ» x β†’ Hom x X X) (π’ž.identΒ² A) (id X ∘ id X) = id X

    assoc : βˆ€ {A B C D} {f : π’ž.Hom A B} {g : π’ž.Hom B C} {h : π’ž.Hom C D}
      β†’ βˆ€ {X Y Z W} {fβ€² : Hom f X Y} {gβ€² : Hom g Y Z} {hβ€² : Hom h Z W}
      β†’ subst (Ξ» x β†’ Hom x X W) π’ž.assoc ((hβ€² ∘ gβ€²) ∘ fβ€²) = hβ€² ∘ (gβ€² ∘ fβ€²)
    sym-assoc : βˆ€ {A B C D} {f : π’ž.Hom A B} {g : π’ž.Hom B C} {h : π’ž.Hom C D}
      β†’ βˆ€ {X Y Z W} {fβ€² : Hom f X Y} {gβ€² : Hom g Y Z} {hβ€² : Hom h Z W}
      β†’ subst (Ξ» x β†’ Hom x X W) π’ž.sym-assoc (hβ€² ∘ (gβ€² ∘ fβ€²)) = (hβ€² ∘ gβ€²) ∘ fβ€²

    is-set-hom : βˆ€ {A B} {f : π’ž.Hom A B} {X Y}
      β†’ isSet (Hom f X Y)

record DisplayedCategory {o h} (π’ž : Category o h) oβ€² hβ€² : Type (o βŠ” h βŠ” lsuc oβ€² βŠ” lsuc hβ€²) where
  field
    π’Ÿ : DisplayedCategoryData (Category.π’ž π’ž) oβ€² hβ€²
    is-displayed-category : isDisplayedCategory π’ž π’Ÿ

  open DisplayedCategoryData π’Ÿ public
  open isDisplayedCategory is-displayed-category public
private variable
  o h : Level
  π’ž : Category o h

oppositeDispCat : DisplayedCategory π’ž o h β†’ DisplayedCategory (oppositeCat π’ž) o h
oppositeDispCat π’Ÿ = record
  { π’Ÿ = record
    { Ob = Ob
    ; Hom = Ξ» f X Y β†’ Hom f Y X
    ; id = id
    ; _∘_ = Ξ» gβ€² fβ€² β†’ fβ€² ∘ gβ€²
    }
  ; is-displayed-category = record
    { identΛ‘ = identΚ³
    ; identΚ³ = identΛ‘
    ; identΒ² = identΒ²
    ; assoc = sym-assoc
    ; sym-assoc = assoc
    ; is-set-hom = is-set-hom
    }
  }
  where
    open DisplayedCategory π’Ÿ
_ : βˆ€ {o h} {π’ž : Category o h} {oβ€² hβ€²} {π’Ÿ : DisplayedCategory π’ž oβ€² hβ€²}
  β†’ oppositeDispCat (oppositeDispCat π’Ÿ) = π’Ÿ
_ = refl