Anna Williams 29 January 2026

\begin{code}

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

open import MLTT.Spartan hiding (id)
open import Categories.Wild

module Categories.Notation.Wild where

\end{code}

We define an object notation such that we can write obj W, obj P and obj C where
W, P and C are wild categories, precategories and categories respectively.

This works similarly to the method used in Notation.UnderlyingType.

\begin{code}

record OBJ {๐“ค} {๐“ฅ} (A : ๐“ค ฬ‡ ) (B : ๐“ฅ ฬ‡ ) : ๐“ค โŠ” ๐“ฅ โบ ฬ‡  where
 field
  obj : A โ†’ B

open OBJ {{...}} public

instance
 wildcatobj : {๐“ค ๐“ฅ : Universe} โ†’ OBJ (WildCategory ๐“ค ๐“ฅ) (๐“ค ฬ‡ )
 obj {{wildcatobj}} = WildCategory.obj

\end{code}

We now define some notation for categories. This way, if we are working with
wild categories C and D. We can simply write "open WildCategoryNotation C" and
"open WildCategoryNotation D" to have all operations available.

This works similarly to Notation.UnderlyingType, where we define records for
each different field. We then define instances of each of the fields we want
specific to the wild category used as input.

\begin{code}

module _ {๐“ค ๐“ฅ : Universe} (W : WildCategory ๐“ค ๐“ฅ) where
 record HOM : ๐“ฅ โบ โŠ” ๐“ค ฬ‡  where
  field
   hom : obj W โ†’ obj W โ†’ ๐“ฅ ฬ‡

 open HOM {{...}} public

 instance
  defnhom : HOM
  hom {{defnhom}} = WildCategory.hom W

 record ID : ๐“ฅ โบ โŠ” ๐“ค ฬ‡  where
  field
   ๐’Š๐’… : {a : obj W} โ†’ hom a a

 open ID {{...}} public

 instance
  defnid : ID
  ๐’Š๐’… {{defnid}} = WildCategory.๐’Š๐’… W

 record COMP : ๐“ค โŠ” ๐“ฅ ฬ‡  where
  field
   _โ—‹_ : {a b c : obj W}
       โ†’ hom b c
       โ†’ hom a b
       โ†’ hom a c

 open COMP {{...}} public

 instance
  comp : COMP
  _โ—‹_ {{comp}} = WildCategory._โ—‹_ W

 record CATNotation : ๐“ฅ โบ โŠ” ๐“ค ฬ‡   where
  field
   ๐’Š๐’…-is-left-neutral : {a b : obj W} (f : hom a b)
           โ†’ ๐’Š๐’… โ—‹ f ๏ผ f
           
   ๐’Š๐’…-is-right-neutral : {a b : obj W} (f : hom a b)
            โ†’ f โ—‹ ๐’Š๐’… ๏ผ f
            
   assoc : {a b c d : obj W}
           (f : hom a b)
           (g : hom b c)
           (h : hom c d)
         โ†’ h โ—‹ (g โ—‹ f) ๏ผ (h โ—‹ g) โ—‹ f

   inverse : {a b : obj W} (f : hom a b) โ†’ ๐“ฅ ฬ‡

   โŒž_โŒŸ : {a b : obj W}
         {f : hom a b}
       โ†’ inverse f
       โ†’ hom b a
  
   at-most-one-inverse : {a b : obj W}
                         {f : hom a b}
                         (๐•˜ ๐•™ : inverse f)
                       โ†’ โŒž ๐•˜ โŒŸ ๏ผ โŒž ๐•™ โŒŸ

   โŒž_โŒŸ-is-left-inverse : {a b : obj W}
                         {f : hom a b}
                         (๐•—โปยน : inverse f)
                       โ†’ โŒž ๐•—โปยน โŒŸ โ—‹ f ๏ผ ๐’Š๐’…

   โŒž_โŒŸ-is-right-inverse : {a b : obj W}
                          {f : hom a b}
                          (๐•—โปยน : inverse f)
                        โ†’ f โ—‹ โŒž ๐•—โปยน โŒŸ ๏ผ ๐’Š๐’…

   _โ‰…_ : (a b : obj W) โ†’ ๐“ฅ ฬ‡
   โŒœ_โŒ : {a b : obj W}
       โ†’ a โ‰… b
       โ†’ hom a b

   underlying-morphism-is-isomorphism : {a b : obj W}
                                        (f : a โ‰… b)
                                      โ†’ ฮฃ fโปยน ๊ž‰ hom b a
                                        , (fโปยน โ—‹ โŒœ f โŒ ๏ผ ๐’Š๐’…)
                                        ร— (โŒœ f โŒ โ—‹ fโปยน ๏ผ ๐’Š๐’…)

   id-to-iso : (a b : obj W)
             โ†’ a ๏ผ b
             โ†’ a โ‰… b

 open CATNotation {{...}} public

module WildCategoryNotation {๐“ค ๐“ฅ : Universe} (W : WildCategory ๐“ค ๐“ฅ) where
 instance
  wildcathomnotation : HOM W
  hom {{wildcathomnotation}} = WildCategory.hom W

  wildcatidnotation : ID W
  ๐’Š๐’… {{wildcatidnotation}} = WildCategory.๐’Š๐’… W

  wildcatcompnotation : COMP W
  _โ—‹_ {{wildcatcompnotation}} = WildCategory._โ—‹_ W

  wildcatnotation : CATNotation W
  ๐’Š๐’…-is-left-neutral {{wildcatnotation}} = WildCategory.๐’Š๐’…-is-left-neutral W
  ๐’Š๐’…-is-right-neutral {{wildcatnotation}} = WildCategory.๐’Š๐’…-is-right-neutral W
  assoc {{wildcatnotation}} = WildCategory.assoc W
  inverse {{wildcatnotation}} = WildCategory.inverse W
  โŒž_โŒŸ {{wildcatnotation}} = WildCategory.โŒž_โŒŸ W
  โŒž_โŒŸ-is-left-inverse {{wildcatnotation}} = WildCategory.โŒž_โŒŸ-is-left-inverse W
  โŒž_โŒŸ-is-right-inverse {{wildcatnotation}} = WildCategory.โŒž_โŒŸ-is-right-inverse W
  at-most-one-inverse {{wildcatnotation}} = WildCategory.at-most-one-inverse W
  _โ‰…_ {{wildcatnotation}} = WildCategory._โ‰…_ W
  โŒœ_โŒ {{wildcatnotation}} = WildCategory.โŒœ_โŒ W
  underlying-morphism-is-isomorphism {{wildcatnotation}} = WildCategory.underlying-morphism-is-isomorphism W
  id-to-iso {{wildcatnotation}} = WildCategory.id-to-iso W

\end{code}