Anna Williams 14 February 2026

Notation for displayed precategories.

\begin{code}

{-# OPTIONS --safe --without-K #-}

open import MLTT.Spartan
open import UF.Sets
open import UF.DependentEquality
open import Categories.Pre
open import Categories.Notation.Pre
open import Categories.Displayed.Pre

module Categories.Displayed.Notation.Pre where

\end{code}

We now define some notation for displayed precategories similarly to that of
categories.

\begin{code}

record DOBJ (A : ๐“ค ฬ‡ ) (B : ๐“ฅ ฬ‡ ) (C : ๐“ฆ ฬ‡ ) : (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ) ฬ‡ where
 field
  obj[_] : A โ†’ B โ†’ C

open DOBJ {{...}} public

instance
 d-pre-obj : {P : Precategory ๐“ฆ ๐“ฃ} โ†’ DOBJ (obj P) (DisplayedPrecategory ๐“ค ๐“ฅ P) (๐“ค ฬ‡ )
 obj[_] {{d-pre-obj}} = ฮป a b โ†’ DisplayedPrecategory.obj[ b ] a

module _ {๐“ค ๐“ฅ : Universe}
         {P : Precategory ๐“ฆ ๐“ฃ}
         (D : DisplayedPrecategory ๐“ค ๐“ฅ P) where
 open PrecategoryNotation P

 record DHOM  : (๐“ฆ โŠ” ๐“ฃ โŠ” ๐“ค โŠ” ๐“ฅ)โบ ฬ‡  where
  field
   hom[_] : {a b : obj P} โ†’ hom a b โ†’ obj[ a ] D โ†’ obj[ b ] D โ†’ ๐“ฅ ฬ‡

 open DHOM {{...}} public

 instance
  d-hom-m : DHOM
  hom[_] {{d-hom-m}} = DisplayedPrecategory.hom[_] D

 record DCOMP : ((๐“ฆ โŠ” ๐“ฃ) โŠ” (๐“ค โŠ” ๐“ฅ))โบ ฬ‡  where
  field
   _โ—‹_ : {a b c : obj P}
         {g : hom b c}
         {f : hom a b}
         {x : obj[ a ] D}
         {y : obj[ b ] D}
         {z : obj[ c ] D}
       โ†’ hom[ g ] y z
       โ†’ hom[ f ] x y
       โ†’ hom[ g โ—ฆ f ] x z

 open DCOMP {{...}} public

 record DID : ((๐“ฆ โŠ” ๐“ฃ) โŠ” (๐“ค โŠ” ๐“ฅ))โบ ฬ‡  where
  field
   D-๐’Š๐’… : {p : obj P}
          {x : obj[ p ] D}
        โ†’ hom[ ๐’Š๐’… ] x x

 open DID {{...}} public

 instance
  dcomp-m : DCOMP 
  _โ—‹_ {{dcomp-m}} = DisplayedPrecategory._โ—‹_ D

 instance
  d-id-m : DID
  D-๐’Š๐’… {{d-id-m}} = DisplayedPrecategory.D-๐’Š๐’… D

 record DNotation : ((๐“ฆ โŠ” ๐“ฃ) โŠ” (๐“ค โŠ” ๐“ฅ))โบ ฬ‡  where
  field
   hom[-]-is-set : {a b : obj P}
                   {f : hom a b}
                   {x : obj[ a ] D}
                   {y : obj[ b ] D}
                 โ†’ is-set (hom[ f ] x y)
                 
   D-๐’Š๐’…-is-right-neutral : {a b : obj P}
                  {f : hom a b}
                  {x : obj[ a ] D}
                  {y : obj[ b ] D}
                  (๐•— : hom[ f ] x y)
                โ†’ ๐•— โ—‹ D-๐’Š๐’…
                ๏ผโŸฆ (ฮป - โ†’ hom[ - ] x y) , ๐’Š๐’…-is-right-neutral f โŸง
                  ๐•—

   D-๐’Š๐’…-is-left-neutral : {a b : obj P}
                 {f : hom a b}
                 {x : obj[ a ] D}
                 {y : obj[ b ] D}
                 (๐•— : hom[ f ] x y)
               โ†’ D-๐’Š๐’… โ—‹ ๐•—
               ๏ผโŸฆ (ฮป - โ†’ hom[ - ] x y) , ๐’Š๐’…-is-left-neutral f โŸง
                 ๐•—
  
   D-assoc : {a b c d : obj P}
             {f : hom a b}
             {g : hom b c}
             {h : hom c d}
             {x : obj[ a ] D}
             {y : obj[ b ] D}
             {z : obj[ c ] D}
             {w : obj[ d ] D}
             {๐•— : hom[ f ] x y}
             {๐•˜ : hom[ g ] y z}
             {๐•™ : hom[ h ] z w}
           โ†’ ๐•™ โ—‹ (๐•˜ โ—‹ ๐•—)
           ๏ผโŸฆ (ฮป - โ†’ hom[ - ] x w) , assoc f g h โŸง
             (๐•™ โ—‹ ๐•˜) โ—‹ ๐•—

   D-inverse : {a b : obj P}
               {x : obj[ a ] D}
               {y : obj[ b ] D}
               (f : a โ‰… b)
               (๐•— : hom[ โŒœ f โŒ ] x y)
             โ†’ ๐“ฅ ฬ‡
   _โ‰…[_]_ : {a b : obj P}
            (x : obj[ a ] D)
            (f : a โ‰… b)
            (y : obj[ b ] D)
          โ†’ ๐“ฅ ฬ‡
   D-โŒœ_โŒ : {a b : obj P}
           {x : obj[ a ] D}
           {f : a โ‰… b}
           {y : obj[ b ] D}
         โ†’ x โ‰…[ f ] y
         โ†’ hom[ โŒœ f โŒ ] x y

   D-morphism-is-isomorphism : {a b : obj P}
                               {x : obj[ a ] D}
                               {f : a โ‰… b}
                               {y : obj[ b ] D}
                             โ†’ (๐•— : x โ‰…[ f ] y)
                             โ†’ D-inverse f D-โŒœ ๐•— โŒ

   D-โŒž_โŒŸ : {a  b : obj P}
           {x : obj[ a ] D}
           {y : obj[ b ] D}
           {f : a โ‰… b}
           {๐•— : hom[ โŒœ f โŒ ] x y}
         โ†’ D-inverse f ๐•—
         โ†’ hom[ โŒž underlying-morphism-is-isomorphism f โŒŸ ] y x

   D-โŒž_โŒŸ-is-left-inverse : {a  b : obj P}
           {x : obj[ a ] D}
           {y : obj[ b ] D}
           {f : a โ‰… b}
           {๐•— : hom[ โŒœ f โŒ ] x y}
         โ†’ (๐•—โปยน : D-inverse f ๐•—)
         โ†’ D-โŒž ๐•—โปยน โŒŸ  โ—‹ ๐•—
         ๏ผโŸฆ (ฮป - โ†’ hom[ - ] x x)
           , โŒž underlying-morphism-is-isomorphism f โŒŸ-is-left-inverse โŸง
           D-๐’Š๐’…

   D-โŒž_โŒŸ-is-right-inverse : {a  b : obj P}
           {x : obj[ a ] D}
           {y : obj[ b ] D}
           {f : a โ‰… b}
           {๐•— : hom[ โŒœ f โŒ ] x y}
         โ†’ (๐•—โปยน : D-inverse f ๐•—)
         โ†’ ๐•— โ—‹ D-โŒž ๐•—โปยน โŒŸ
         ๏ผโŸฆ (ฮป - โ†’ hom[ - ] y y)
           , โŒž underlying-morphism-is-isomorphism f โŒŸ-is-right-inverse โŸง
           D-๐’Š๐’…
   to-โ‰…[-]-๏ผ : {a b : obj P}
                {x : obj[ a ] D}
                {y : obj[ b ] D}
                {f : a โ‰… b}
                {๐•— ๐•—' : x โ‰…[ f ] y}
              โ†’ D-โŒœ ๐•— โŒ ๏ผ D-โŒœ ๐•—' โŒ
              โ†’ ๐•— ๏ผ ๐•—'
       
 open DNotation {{...}} public

module DisplayedPrecategoryNotation {๐“ฆ ๐“ฃ : Universe}
                                    {P : Precategory ๐“ฆ ๐“ฃ}
                                    (D : DisplayedPrecategory ๐“ค ๐“ฅ P) where
 instance
  d-hom : DHOM D
  hom[_] {{d-hom}} = DisplayedPrecategory.hom[_] D

 instance
  d-id : DID D
  D-๐’Š๐’… {{d-id}} = DisplayedPrecategory.D-๐’Š๐’… D

 instance
  d-comp : DCOMP D
  _โ—‹_ {{d-comp}} = DisplayedPrecategory._โ—‹_ D

 instance
  d-notation : DNotation D
  hom[-]-is-set {{d-notation}} = DisplayedPrecategory.hom[-]-is-set D
  D-๐’Š๐’…-is-right-neutral {{d-notation}}
   = DisplayedPrecategory.D-๐’Š๐’…-is-right-neutral D
  D-๐’Š๐’…-is-left-neutral {{d-notation}}
   = DisplayedPrecategory.D-๐’Š๐’…-is-left-neutral D
  D-assoc {{d-notation}} = DisplayedPrecategory.D-assoc D
  D-inverse {{d-notation}} = DisplayedPrecategory.D-inverse D
  _โ‰…[_]_ {{d-notation}} = DisplayedPrecategory._โ‰…[_]_ D
  D-โŒœ_โŒ {{d-notation}} = DisplayedPrecategory.D-โŒœ_โŒ D
  D-โŒž_โŒŸ {{d-notation}} = DisplayedPrecategory.D-โŒž_โŒŸ D
  D-โŒž_โŒŸ-is-left-inverse {{d-notation}}
   = DisplayedPrecategory.D-โŒž_โŒŸ-is-left-inverse D
  D-โŒž_โŒŸ-is-right-inverse {{d-notation}}
   = DisplayedPrecategory.D-โŒž_โŒŸ-is-right-inverse D
  D-morphism-is-isomorphism {{d-notation}}
   = DisplayedPrecategory.D-morphism-is-isomorphism D
  to-โ‰…[-]-๏ผ {{d-notation}} = DisplayedPrecategory.to-โ‰…[-]-๏ผ D
  
\end{code}