Martin Escardo, 30th September 2026.

We show that ๐“œ, the initial binary system of BinarySystems.Type, is
initial in the strong sense that the type of homomorphisms from it to
any binary system is a singleton. For this to be possible we have to
consider coherent homomorphisms, defined below.

\begin{code}

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

open import UF.FunExt

module BinarySystems.Initiality (fe : Fun-Ext) where

open import MLTT.Spartan
open import UF.Base
open import UF.Equiv
open import UF.EquivalenceExamples
open import UF.Retracts
open import UF.SIP
open sip
open import UF.Subsingletons hiding (center)

open import BinarySystems.Type

\end{code}

Because the type of binary systems doesn't require the underlying type
to be a set, we would like to prove unique existence as the singleton
property of a ฮฃ type, written โˆƒ! here, as done e.g. for natural number
objects in MGS.Unique-Existence (and with a dependent version in
Naturals.UniversalProperty).

But the notion of homomorphism of BinarySystems.Type will not do for
this, because it doesn't mention the binary system equations, and so
the type

   ฮฃ h ๊ž‰ (๐•„ โ†’ โŸจ ๐“ โŸฉ) , is-hom ๐“œ ๐“ h

is not a singleton in general. Indeed, l L is L by definition, and
therefore the third component of is-hom ๐“œ ๐“ h, applied to L, is an
identification h L ๏ผ f (h L). Once h L is identified with the point a
using the first component, this becomes an element of the identity
type a ๏ผ f a, which is the first axiom of ๐“, and hence is data unless
the underlying type of ๐“ is a set. For the circle with the points a
and b both chosen to be the base point, and the functions f and g both
chosen to be the identity, for instance, the constant map at the base
point has a whole loop space of homomorphism structures.

What is missing is that a homomorphism between structures presented by
equations should also say how it respects the equations. We add this as
three squares, one for each axiom.

The axiom a ๏ผ f a of ๐“ and the axiom a' ๏ผ f' a' of ๐“‘ give the two
routes

                    ap h ฮนโ‚ โˆ™ hl a
          h a ------------------------> f' (h a)
           |                              |
        hL |                              | ap f' hL
           |                              |
           v                              v
           a' ------------------------> f' a'
                         ฮนโ‚'

and the axioms b ๏ผ g b and b' ๏ผ g' b' give the two routes

                    ap h ฮนโ‚ƒ โˆ™ hr b
          h b ------------------------> g' (h b)
           |                              |
        hR |                              | ap g' hR
           |                              |
           v                              v
           b' ------------------------> g' b'
                         ฮนโ‚ƒ'

whereas the axioms f b ๏ผ g a and f' b' ๏ผ g' a', which relate the two
descriptions of the midpoint, give the two routes

                   hl b             ap f' hR         ฮนโ‚‚'
         h (f b) --------> f' (h b) --------> f' b' -----> g' a'
            |                                               ^
   ap h ฮนโ‚‚  |                                               |
            |                                               |
            v                                               |
         h (g a) --------> g' (h a) -------------------------
                   hr a             ap g' hL

We define the notion of coherent homomorphism by requiring that the
two routes are identified in each of these three cases. It turns out
that higher coherences are not needed for the initiality result.

\begin{code}

is-coherent-hom : (๐“ : BS ๐“ค) (๐“‘ : BS ๐“ฅ) โ†’ (โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ) โ†’ ๐“ค โŠ” ๐“ฅ ฬ‡
is-coherent-hom ๐“@(A , (a , b , f , g) , (ฮนโ‚ , ฮนโ‚‚ , ฮนโ‚ƒ))
                ๐“‘@(B , (a' , b' , f' , g') , (ฮนโ‚' , ฮนโ‚‚' , ฮนโ‚ƒ')) h =
 ฮฃ (hL , hR , hl , hr) ๊ž‰ is-hom ๐“ ๐“‘ h ,
   (ap h ฮนโ‚ โˆ™ hl a โˆ™ ap f' hL ๏ผ hL โˆ™ ฮนโ‚')
 ร— (ap h ฮนโ‚‚ โˆ™ hr a โˆ™ ap g' hL ๏ผ hl b โˆ™ ap f' hR โˆ™ ฮนโ‚‚')
 ร— (ap h ฮนโ‚ƒ โˆ™ hr b โˆ™ ap g' hR ๏ผ hR โˆ™ ฮนโ‚ƒ')

\end{code}

For any binary system ๐“, the homomorphism ๐“œ-rec ๐“ recursively defined
in BinarySystems.Type is coherent, and, moreover, the three squares
hold by reflexivity, because the axioms of ๐“œ do, and because the
homomorphism equations of ๐“œ-rec at L, R and l R are the axioms of ๐“
and reflexivities respectively.

\begin{code}

๐“œ-rec-is-coherent-hom : (๐“ : BS ๐“ค) โ†’ is-coherent-hom ๐“œ ๐“ (๐“œ-rec ๐“)
๐“œ-rec-is-coherent-hom ๐“@(A , (a , b , f , g) , ฮน) =
 ๐“œ-rec-is-hom ๐“ , refl , refl , refl

\end{code}

The type ๐”น defined in BinarySystems.Type has no axioms, and so it is
initial for a point and two endomaps with no equations, which we prove
following the strategy of โ„•-is-nno in the module MGS.Unique-Existence.

\begin{code}

module _ (A : ๐“ค ฬ‡ ) (c : A) (f g : A โ†’ A) where

 ๐”น-rec : ๐”น โ†’ A
 ๐”น-rec center    = c
 ๐”น-rec (left x)  = f (๐”น-rec x)
 ๐”น-rec (right x) = g (๐”น-rec x)

 ๐”น-recursive : (๐”น โ†’ A) โ†’ ๐“ค ฬ‡
 ๐”น-recursive w = (w center ๏ผ c) ร— (w โˆ˜ left โˆผ f โˆ˜ w) ร— (w โˆ˜ right โˆผ g โˆ˜ w)

 ๐”น-recursive-retract : (w : ๐”น โ†’ A) โ†’ ๐”น-recursive w โ— (w โˆผ ๐”น-rec)
 ๐”น-recursive-retract w = ฯ , ฯƒ , ฯฯƒ
  where
   ฯ : (w โˆผ ๐”น-rec) โ†’ ๐”น-recursive w
   ฯ H = H center ,
         (ฮป x โ†’ H (left x) โˆ™ (ap f (H x))โปยน) ,
         (ฮป x โ†’ H (right x) โˆ™ (ap g (H x))โปยน)

   ฯƒ : ๐”น-recursive w โ†’ w โˆผ ๐”น-rec
   ฯƒ z@(p , K , ฮ›) center    = p
   ฯƒ z@(p , K , ฮ›) (left x)  = K x โˆ™ ap f (ฯƒ z x)
   ฯƒ z@(p , K , ฮ›) (right x) = ฮ› x โˆ™ ap g (ฯƒ z x)

   cancel : {x y z : A} (k : x ๏ผ y) (q : y ๏ผ z) โ†’ (k โˆ™ q) โˆ™ q โปยน ๏ผ k
   cancel k q = (k โˆ™ q) โˆ™ q โปยน ๏ผโŸจ โˆ™assoc k q (q โปยน) โŸฉ
                k โˆ™ (q โˆ™ q โปยน) ๏ผโŸจ ap (k โˆ™_) (trans-sym' q) โŸฉ
                k              โˆŽ

   ฯฯƒ : (z : ๐”น-recursive w) โ†’ ฯ (ฯƒ z) ๏ผ z
   ฯฯƒ z@(p , K , ฮ›) = to-ร—-๏ผ refl (to-ร—-๏ผ (dfunext fe ฮบ) (dfunext fe ฮบ'))
    where
     ฮบ : (x : ๐”น) โ†’ ฯƒ z (left x) โˆ™ (ap f (ฯƒ z x))โปยน ๏ผ K x
     ฮบ x = cancel (K x) (ap f (ฯƒ z x))

     ฮบ' : (x : ๐”น) โ†’ ฯƒ z (right x) โˆ™ (ap g (ฯƒ z x))โปยน ๏ผ ฮ› x
     ฮบ' x = cancel (ฮ› x) (ap g (ฯƒ z x))

 ๐”น-is-initial : โˆƒ! w ๊ž‰ (๐”น โ†’ A) , ๐”น-recursive w
 ๐”น-is-initial =
  retract-of-singleton
   (ฮฃ-retract _ _
     (ฮป w โ†’ ๐”น-recursive w โ—โŸจ ๐”น-recursive-retract w โŸฉ
            โ‰ƒ-gives-โ–ท (โ‰ƒ-funext fe w ๐”น-rec)))
   (singleton-types'-are-singletons ๐”น-rec)

\end{code}

Before proceeding we state and prove the following technical lemma,
which doesn't refer to binary systems.

\begin{code}

private
 contraction-lemma : {X : ๐“ฅ ฬ‡ } {x y : X} (p : x ๏ผ y) (Y : ๐“ฆ ฬ‡ )
                   โ†’ (ฮฃ q ๊ž‰ x ๏ผ y , (refl โˆ™ q ๏ผ p) ร— Y) โ‰ƒ Y
 contraction-lemma {_} {_} {X} {x} {y} p Y =
  (ฮฃ q ๊ž‰ x ๏ผ y , (refl โˆ™ q ๏ผ p) ร— Y) โ‰ƒโŸจ I โŸฉ
  (ฮฃ q ๊ž‰ x ๏ผ y , (q ๏ผ p) ร— Y)        โ‰ƒโŸจ left-Id-equiv p โŸฉ
  Y                                  โ– 
   where
    I = ฮฃ-cong (ฮป q โ†’ ร—-cong
                       (๏ผ-cong-l (refl โˆ™ q) p refl-left-neutral)
                       (โ‰ƒ-refl Y))

\end{code}

We now fix a binary system ๐“ and analyse the type of coherent
homomorphisms from ๐“œ to it.

\begin{code}

module _ (A : ๐“ค ฬ‡ )
         (a b : A)
         (f g : A โ†’ A)
         (ฮนโ‚ : a ๏ผ f a)
         (ฮนโ‚‚ : f b ๏ผ g a)
         (ฮนโ‚ƒ : b ๏ผ g b)
       where

 ๐“ : BS ๐“ค
 ๐“ = A , (a , b , f , g) , (ฮนโ‚ , ฮนโ‚‚ , ฮนโ‚ƒ)

 ๐“œ-coherence : (h : ๐•„ โ†’ A) โ†’ is-hom ๐“œ ๐“ h โ†’ ๐“ค ฬ‡
 ๐“œ-coherence h (hL , hR , hl , hr) =
    (refl โˆ™ hl L โˆ™ ap f hL ๏ผ hL โˆ™ ฮนโ‚)
  ร— (refl โˆ™ hr L โˆ™ ap g hL ๏ผ hl R โˆ™ ap f hR โˆ™ ฮนโ‚‚)
  ร— (refl โˆ™ hr R โˆ™ ap g hR ๏ผ hR โˆ™ ฮนโ‚ƒ)

 is-coherent-hom-from-๐“œ-explicitly : (h : ๐•„ โ†’ A)
                                   โ†’ is-coherent-hom ๐“œ ๐“ h
                                   ๏ผ (ฮฃ u ๊ž‰ is-hom ๐“œ ๐“ h , ๐“œ-coherence h u)
 is-coherent-hom-from-๐“œ-explicitly h = refl

 glue : A ร— A ร— (๐”น โ†’ A) โ†’ ๐•„ โ†’ A
 glue (u , v , w) L     = u
 glue (u , v , w) R     = v
 glue (u , v , w) (ฮท x) = w x

 unglue : (๐•„ โ†’ A) โ†’ A ร— A ร— (๐”น โ†’ A)
 unglue h = h L , h R , h โˆ˜ ฮท

 glue-unglue : glue โˆ˜ unglue โˆผ id
 glue-unglue h = dfunext fe ฯ•
  where
   ฯ• : glue (unglue h) โˆผ h
   ฯ• L     = refl
   ฯ• R     = refl
   ฯ• (ฮท x) = refl

 unglue-glue : unglue โˆ˜ glue โˆผ id
 unglue-glue _ = refl

 glue-is-equiv : is-equiv glue
 glue-is-equiv = qinvs-are-equivs glue (unglue , unglue-glue , glue-unglue)

\end{code}

We now show that the homomorphism data on glue (u , v , w) is
equivalent to the following data.

\begin{code}

 glue-data : (u v : A) (w : ๐”น โ†’ A) โ†’ ๐“ค ฬ‡
 glue-data u v w = (u ๏ผ a)
                 ร— (v ๏ผ b)
                 ร— ((u ๏ผ f u) ร— (w center ๏ผ f v) ร— (w โˆ˜ left โˆผ f โˆ˜ w))
                 ร— ((w center ๏ผ g u) ร— (v ๏ผ g v) ร— (w โˆ˜ right โˆผ g โˆ˜ w))

 glue-data-to-glue-hom-data : (u v : A) (w : ๐”น โ†’ A)
                            โ†’ glue-data u v w
                            โ†’ is-hom ๐“œ ๐“ (glue (u , v , w))
 glue-data-to-glue-hom-data u v w
  (hL , hR , (hlL , hlR , hlฮท) , (hrL , hrR , hrฮท)) = hL , hR , hl , hr
  where
   h : ๐•„ โ†’ A
   h = glue (u , v , w)

   hl : h โˆ˜ l โˆผ f โˆ˜ h
   hl L     = hlL
   hl R     = hlR
   hl (ฮท x) = hlฮท x

   hr : h โˆ˜ r โˆผ g โˆ˜ h
   hr L     = hrL
   hr R     = hrR
   hr (ฮท x) = hrฮท x

 glue-data-to-glue-hom-data-is-equiv
  : (u v : A) (w : ๐”น โ†’ A)
  โ†’ is-equiv (glue-data-to-glue-hom-data u v w)
 glue-data-to-glue-hom-data-is-equiv u v w
  = qinvs-are-equivs (glue-data-to-glue-hom-data u v w) (ฮ” , ฮ”ฮ“ , ฮ“ฮ”)
  where
   ฮ“ = glue-data-to-glue-hom-data u v w

   ฮ” : codomain ฮ“ โ†’ domain ฮ“
   ฮ” (hL , hR , hl , hr) = hL ,
                           hR ,
                           (hl L , hl R , hl โˆ˜ ฮท) ,
                           (hr L , hr R , hr โˆ˜ ฮท)

   ฮ”ฮ“ : ฮ” โˆ˜ ฮ“ โˆผ id
   ฮ”ฮ“ s = refl

   ฮ“ฮ” : ฮ“ โˆ˜ ฮ” โˆผ id
   ฮ“ฮ” i@(hL , hR , hl , hr) =
    to-ร—-๏ผ refl (to-ร—-๏ผ refl (to-ร—-๏ผ (dfunext fe ฯ•) (dfunext fe ฯˆ)))
    where
     ฯ• : prโ‚ (prโ‚‚ (prโ‚‚ (ฮ“ (ฮ” i)))) โˆผ hl
     ฯ• L     = refl
     ฯ• R     = refl
     ฯ• (ฮท x) = refl

     ฯˆ : prโ‚‚ (prโ‚‚ (prโ‚‚ (ฮ“ (ฮ” i)))) โˆผ hr
     ฯˆ L     = refl
     ฯˆ R     = refl
     ฯˆ (ฮท x) = refl

\end{code}

We now reorder the data so that it becomes possible to contract away
portions of it in the equivalence proved in coherent-homs-โ‰ƒ below.

\begin{code}

 w-data : (u v : A) (hL : u ๏ผ a) (hR : v ๏ผ b) (w : ๐”น โ†’ A) โ†’ ๐“ค ฬ‡
 w-data u v hL hR w =
  ฮฃ hlR ๊ž‰ w center ๏ผ f v ,
  ฮฃ hrL ๊ž‰ w center ๏ผ g u , (refl โˆ™ hrL โˆ™ ap g hL ๏ผ hlR โˆ™ ap f hR โˆ™ ฮนโ‚‚)
                          ร— (w โˆ˜ left โˆผ f โˆ˜ w)
                          ร— (w โˆ˜ right โˆผ g โˆ˜ w)

 v-data : (u : A) (hL : u ๏ผ a) (v : A) โ†’ ๐“ค ฬ‡
 v-data u hL v =
  ฮฃ hR  ๊ž‰ v ๏ผ b ,
  ฮฃ hrR ๊ž‰ v ๏ผ g v , (refl โˆ™ hrR โˆ™ ap g hR ๏ผ hR โˆ™ ฮนโ‚ƒ)
                   ร— (ฮฃ w ๊ž‰ (๐”น โ†’ A) , w-data u v hL hR w)

 reordered-fiber : (u v : A) (w : ๐”น โ†’ A) โ†’ ๐“ค ฬ‡
 reordered-fiber u v w =
  ฮฃ hL  ๊ž‰ u ๏ผ a ,
  ฮฃ hlL ๊ž‰ u ๏ผ f u , (refl โˆ™ hlL โˆ™ ap f hL ๏ผ hL โˆ™ ฮนโ‚)
                   ร— (ฮฃ hR ๊ž‰ v ๏ผ b ,
                      ฮฃ hrR ๊ž‰ v ๏ผ g v , (refl โˆ™ hrR โˆ™ ap g hR ๏ผ hR โˆ™ ฮนโ‚ƒ)
                                       ร— w-data u v hL hR w)

 reordered-fiber-โ‰ƒ
  : (u v : A) (w : ๐”น โ†’ A)
  โ†’ reordered-fiber u v w
  โ‰ƒ (ฮฃ s ๊ž‰ glue-data u v w , ๐“œ-coherence
                               (glue (u , v , w))
                               (glue-data-to-glue-hom-data u v w s))
 reordered-fiber-โ‰ƒ u v w = qinveq ฮฆ (ฮจ , ฮจฮฆ , ฮฆฮจ)
  where
   ฮฆ : reordered-fiber u v w
     โ†’ ฮฃ s ๊ž‰ glue-data u v w , ๐“œ-coherence
                                (glue (u , v , w))
                                (glue-data-to-glue-hom-data u v w s)
   ฮฆ (hL , hlL , sqโ‚ , hR , hrR , sqโ‚ƒ , hlR , hrL , sqโ‚‚ , hlฮท , hrฮท) =
    (hL , hR , (hlL , hlR , hlฮท) , (hrL , hrR , hrฮท)) , sqโ‚ , sqโ‚‚ , sqโ‚ƒ

   ฮจ : codomain ฮฆ โ†’ domain ฮฆ
   ฮจ ((hL , hR , (hlL , hlR , hlฮท) , (hrL , hrR , hrฮท)) , sqโ‚ , sqโ‚‚ , sqโ‚ƒ) =
    hL , hlL , sqโ‚ , hR , hrR , sqโ‚ƒ , hlR , hrL , sqโ‚‚ , hlฮท , hrฮท

   ฮจฮฆ : ฮจ โˆ˜ ฮฆ โˆผ id
   ฮจฮฆ t = refl

   ฮฆฮจ : ฮฆ โˆ˜ ฮจ โˆผ id
   ฮฆฮจ t = refl

 reordered-total-space : ๐“ค ฬ‡
 reordered-total-space =
  ฮฃ u ๊ž‰ A ,
  ฮฃ hL  ๊ž‰ u ๏ผ a ,
  ฮฃ hlL ๊ž‰ u ๏ผ f u , (refl โˆ™ hlL โˆ™ ap f hL ๏ผ hL โˆ™ ฮนโ‚)
                   ร— (ฮฃ v ๊ž‰ A , v-data u hL v)

 reordered-โ‰ƒ : reordered-total-space
             โ‰ƒ (ฮฃ (u , v , w) ๊ž‰ A ร— A ร— (๐”น โ†’ A) , reordered-fiber u v w)
 reordered-โ‰ƒ = qinveq ฮฆ (ฮจ , ฮจฮฆ , ฮฆฮจ)
  where
   ฮฆ : reordered-total-space
     โ†’ ฮฃ (u , v , w) ๊ž‰ A ร— A ร— (๐”น โ†’ A) , reordered-fiber u v w
   ฮฆ (u , hL , hlL , sqโ‚ , v , hR , hrR , sqโ‚ƒ , w , d) =
    (u , v , w) , hL , hlL , sqโ‚ , hR , hrR , sqโ‚ƒ , d

   ฮจ : codomain ฮฆ โ†’ domain ฮฆ
   ฮจ ((u , v , w) , hL , hlL , sqโ‚ , hR , hrR , sqโ‚ƒ , d) =
    u , hL , hlL , sqโ‚ , v , hR , hrR , sqโ‚ƒ , w , d

   ฮจฮฆ : ฮจ โˆ˜ ฮฆ โˆผ id
   ฮจฮฆ t = refl

   ฮฆฮจ : ฮฆ โˆ˜ ฮจ โˆผ id
   ฮฆฮจ t = refl

\end{code}

We now apply this reordering to prove the following equivalence by
contracting the data step by step.

\begin{code}

 coherent-homs-โ‰ƒ : (ฮฃ h ๊ž‰ (๐•„ โ†’ A) , is-coherent-hom ๐“œ ๐“ h)
                 โ‰ƒ (ฮฃ w ๊ž‰ (๐”น โ†’ A) , ๐”น-recursive A (f b) f g w)
 coherent-homs-โ‰ƒ =

  (ฮฃ h ๊ž‰ (๐•„ โ†’ A) , is-coherent-hom ๐“œ ๐“ h)                          โ‰ƒโŸจ I โŸฉ
  (ฮฃ t ๊ž‰ A ร— A ร— (๐”น โ†’ A) , is-coherent-hom ๐“œ ๐“ (glue t))           โ‰ƒโŸจ II โŸฉ
  (ฮฃ (u , v , w) ๊ž‰ A ร— A ร— (๐”น โ†’ A) ,
   ฮฃ s ๊ž‰ glue-data u v w , ๐“œ-coherence (glue (u , v , w))
                             (glue-data-to-glue-hom-data u v w s)) โ‰ƒโŸจ III โŸฉ
  (ฮฃ (u , v , w) ๊ž‰ A ร— A ร— (๐”น โ†’ A) , reordered-fiber u v w)        โ‰ƒโŸจ IV โŸฉ
  reordered-total-space                                            โ‰ƒโŸจ V โŸฉ
  (ฮฃ hlL ๊ž‰ a ๏ผ f a , (refl โˆ™ hlL โˆ™ ap f refl ๏ผ refl โˆ™ ฮนโ‚)
                    ร— (ฮฃ v ๊ž‰ A , v-data a refl v))                 โ‰ƒโŸจ VI โŸฉ
  (ฮฃ v ๊ž‰ A , v-data a refl v)                                      โ‰ƒโŸจ VII โŸฉ
  (ฮฃ hrR ๊ž‰ b ๏ผ g b , (refl โˆ™ hrR โˆ™ ap g refl ๏ผ refl โˆ™ ฮนโ‚ƒ)
                    ร— (ฮฃ w ๊ž‰ (๐”น โ†’ A) , w-data a b refl refl w))    โ‰ƒโŸจ VIII โŸฉ
  (ฮฃ w ๊ž‰ (๐”น โ†’ A) , w-data a b refl refl w)                         โ‰ƒโŸจ IX โŸฉ
  (ฮฃ w ๊ž‰ (๐”น โ†’ A) , ๐”น-recursive A (f b) f g w)                      โ– 

  where
   I = โ‰ƒ-sym (ฮฃ-change-of-variable
               (ฮป h โ†’ is-coherent-hom ๐“œ ๐“ h) glue glue-is-equiv)

   II = ฮฃ-cong' _ _
         (ฮป (u , v , w) โ†’ โ‰ƒ-sym (ฮฃ-change-of-variable
                                  (๐“œ-coherence (glue (u , v , w)))
                                  (glue-data-to-glue-hom-data u v w)
                                  (glue-data-to-glue-hom-data-is-equiv u v w)))

   III = ฮฃ-cong' _ _ (ฮป (u , v , w) โ†’ โ‰ƒ-sym (reordered-fiber-โ‰ƒ u v w))

   IV = โ‰ƒ-sym reordered-โ‰ƒ

   V = based-contraction
        (ฮป u hL โ†’ ฮฃ hlL ๊ž‰ u ๏ผ f u ,
                    (refl โˆ™ hlL โˆ™ ap f hL ๏ผ hL โˆ™ ฮนโ‚)
                  ร— (ฮฃ v ๊ž‰ A , v-data u hL v))

   VI = contraction-lemma (refl โˆ™ ฮนโ‚) (ฮฃ v ๊ž‰ A , v-data a refl v)

   VII = based-contraction
          (ฮป v hR โ†’ ฮฃ hrR ๊ž‰ v ๏ผ g v ,
                      (refl โˆ™ hrR โˆ™ ap g hR ๏ผ hR โˆ™ ฮนโ‚ƒ)
                    ร— (ฮฃ w ๊ž‰ (๐”น โ†’ A) , w-data a v refl hR w))

   VIII = contraction-lemma (refl โˆ™ ฮนโ‚ƒ)
           (ฮฃ w ๊ž‰ (๐”น โ†’ A) , w-data a b refl refl w)

   IX = ฮฃ-cong' _ _
         (ฮป w โ†’ ฮฃ-cong' _ _
                 (ฮป hlR โ†’ contraction-lemma (hlR โˆ™ ฮนโ‚‚)
                           ((w โˆ˜ left โˆผ f โˆ˜ w) ร— (w โˆ˜ right โˆผ g โˆ˜ w))))

\end{code}

So ๐“œ is the initial binary system, in the sense that the type of
coherent homomorphisms from it to any binary system is a singleton.

\begin{code}

๐“œ-is-initial : (๐“ : BS ๐“ค) โ†’ โˆƒ! h ๊ž‰ (๐•„ โ†’ โŸจ ๐“ โŸฉ) , is-coherent-hom ๐“œ ๐“ h
๐“œ-is-initial (A , (a , b , f , g) , (ฮนโ‚ , ฮนโ‚‚ , ฮนโ‚ƒ)) =
 equiv-to-singleton
  (coherent-homs-โ‰ƒ A a b f g ฮนโ‚ ฮนโ‚‚ ฮนโ‚ƒ)
  (๐”น-is-initial A (f b) f g)

\end{code}