module Cat.Monoidal.Instances.Day
  {} {C : Precategory  } (cmon : Monoidal-category C)
  where

The Day convolution product🔗

The Day convolution monoidal structure on is the free cocompletion of a small monoidal category within the context of monoidal categories: its monoidal cocompletion. This uniquely determines the construction of which is perhaps sufficient motivation to a category theorist. However, it’s worth pointing out that the Day convolution comes up in practice surprisingly often, so that the motivation for this page does not rest entirely on abstract nonsense. Here are a few examples, before we get started:

  • Automata theory: If we have a set which we call the alphabet, then, as usual, we call a subset a language on Languages are closed under the generic operations of intersection and union of subsets, but we also have an operation specific to this domain: concatenation, which arises from the free monoid structure on

    More concretely, the concatenation is the subset which, expressed as a predicate, has value

    That is, the words belonging to are precisely those which decompose as a concatenation of a word from followed by a word from The operation of concatenation preserves joins in each variable: We can calculate

    and the other variable is symmetric. To give a concrete example, we can define the Kleene star where denotes the composition. Then our cocontinuity result says that we can compute concatenation with a star as a union of simpler concatenations. For example, an enumeration of starts

  • Algebra: if we have a group and a ring there is a universal way to equip the free module with a multiplication that makes it into a ring, and where this multiplication is also in each variable: the group , which we also refer to as For simplicity, let us assume that is a finite group.

    Note that, since is finite, we can take the elements of to simply be arbitrary functions If we think of as a polynomial, then we associate to it the function that sends each to the element which appears as its coefficient. In the other direction, an assignment of coefficients determines the polynomial

    The multiplication on is determined uniquely by the requirement that it extends the multiplication on in an way: for polynomials we should have

    It is not immediately obvious that we can rewrite this double summation in “coefficient form”. But if we recall the diagonal function defined so that if (and otherwise), then we can express this as

    since, intuitively, we have = since, for each value of if we do not have then the summand is equal to zero.

Drawing a generalisation from the cases above, we can equip the collection of functions with a monoid structure whenever and are monoids, and admits an operation for aggregation over , to play the role of the existential quantifier and summation. Writing for this aggregation operation, the product is given pointwise by

This operation is generally referred to as the convolution product of and and it can be seen as the special case of the Day convolution where the domain is a discrete category.

For those curious but unfamiliar with the abstract nonsense, we should explain what, exactly, is meant by monoidal cocompletion: in addition to showing that is cocomplete, and equipping it with a monoidal structure we must show that these behave nicely together:
  • The tensor product we construct must be cocontinuous in each variable;

  • Our chosen cocompletion which in this case is the Yoneda embedding must be a strong monoidal functor: We should have 1

As usual when we have an object defined by a universal property, the Day convolution monoidal structure is unique: making this particular case explicit, given any other monoidal cocompletion we have a unique equivalence of monoidal categories Among the univalent monoidal categories, we may sharpen this result to saying that has a contractible space of monoidal cocompletions.

The construction🔗

We will interpret the formula above literally, relying on the fact that coends are also written with an integral sign. To generalise away from a discrete domain, we must express the idea of decomposing an object into parts without the use of equality. An obvious idea would be isomorphism, but this turns out to be too strong: we can simply take the product with the into the product:

\ Warning

It’s worth taking a second to read the formalised definition, below, if you are unfamiliar with coends. We must express the “integrand” as a functor This provides us with “polarised” versions of the variables which we write and

We then distribute these variables according to the polarities of each functor. Since is covariant in its second argument, it sees but the presheaves are contravariant, so we have factors and

module Day (X Y :  PSh  C ) where
  open Make-bifunctor

  Day-diagram : Ob  Bifunctor ((C ×ᶜ C) ^op) (C ×ᶜ C) (Sets )
  Day-diagram c = make-bifunctor λ where
    .F₀ (c₁⁻ , c₂⁻) (c₁⁺ , c₂⁺) .∣_∣    Hom c (c₁⁺  c₂⁺) × (X ʻ c₁⁻) × (Y ʻ c₂⁻)
    .F₀ (c₁⁻ , c₂⁻) (c₁⁺ , c₂⁺) .is-tr  hlevel 2
    .lmap (f⁻ , g⁻) (h , x , y)  h , X .F₁ f⁻ x , Y .F₁ g⁻ y
    .rmap (f⁺ , g⁺) (h , x , y)  (f⁺ ⊗₁ g⁺)  h , x , y
    .lmap-id  ext λ h x y  refl ,ₚ X .F-id ·ₚ x ,ₚ Y .F-id ·ₚ y
    .rmap-id  ext λ h x y  eliml (-⊗-.◆-id) ,ₚ refl ,ₚ refl
    .lmap-∘ f g  ext λ h x y  refl ,ₚ X .F-∘ _ _ ·ₚ _ ,ₚ Y .F-∘ _ _ ·ₚ _
    .rmap-∘ f g  ext λ h x y  pushl -⊗-.◆-∘ ,ₚ refl ,ₚ refl
    .lrmap f g   refl
  Day-coend : (c : Ob)  Coend (Day-diagram c)
  Day-coend c = Set-coend (Day-diagram c)

We shall now repeat some of our knowledge about coends valued in sets, but specialised to the case of the Day convolution. First, we note that we can write the elements of the coend (at as triples where and

  day : {i a b : Ob} (h : Hom i (a  b)) (x : X ʻ a) (y : Y ʻ b)  Day₀ i
  day h x y = lift (begin (_ , _) (h , x , y))

Moreover, these triples have identifications generated by letting be whenever these both make sense. More generally, we have equal to whenever

  day-glue
    : {i a b a' b' : Ob} {f : Hom a' a} {g : Hom b' b} {h : Hom i (a'  b')} {x : X ʻ a} {y : Y ʻ b}
     {fgh : Hom i (a  b)} (p : fgh  (f ⊗₁ g)  h)
     day fgh x y  day h (X .F₁ f x) (Y .F₁ g y)
  day-glue {i} {a} {b} {a'} {b'} {f} {g} {h} {x} {y} {fgh} p =
    day fgh x y                   ≡⟨ day-ap p refl refl 
    day ((f ⊗₁ g)  h) x y        ≡⟨ ap {B = λ _  Day₀ _} lift (coend-glue (f , g) (h , x , y)) 
    day h (X .F₁ f x) (Y .F₁ g y) 

Finally, we will use the formalism of cowedges to define functions out of Essentially, this says that we can define a function whenever we can define in a way compatible with the relation above.

  factor :  {i} (W : Cowedge (Day-diagram i))  Day₀ i   W .nadir 
  factor W (lift x) = Day.factor _ W x

As an example of constructing a map using cowedges, we can construct the restriction given Pointwise, this sends to It’s a straightforward-but-annoying calculation to show that this extends to the quotient.

  Day-cowedge :  {x} {y}  Hom y x  Cowedge (Day-diagram x)
  Day-cowedge {y = y} h .nadir = el! (Day₀ y)
  Day-cowedge h .ψ (a , b) (f , x , y) = day (f  h) x y
  Day-cowedge h .extranatural {a , b} {a' , b'} (f , g) = funext λ where
    (i , x , y)  day-glue (pullr refl)

  _⊗ᴰ_ :  PSh  C 
  _⊗ᴰ_ .F₀ c = el! (Day₀ c)
  _⊗ᴰ_ .F₁ {x} {y} h v = factor (Day-cowedge h) v
  _⊗ᴰ_ .F-id    = ext λ h x y  day-apₘ (idr h)
  _⊗ᴰ_ .F-∘ f g = ext λ h x y  day-apₘ (assoc h g f)
Together with some quick functoriality proofs, we have shown above that the Day convolution is a presheaf. If we have natural transformations and then we can extend these to a so that we actually have a functor This is but another annoying calculation.
Day-bifunctor-cowedge
  :  {X Y X' Y' :  PSh  C } {i}
   X => X'
   Y => Y'
   Cowedge (Day-diagram X Y i)
Day-bifunctor-cowedge {X} {Y} {X'} {Y'} {i} F G = go where
  module D = Day X' Y'
  go : Cowedge (Day-diagram X Y i)
  go .nadir           = el! (D.Day₀ i)
  go .ψ c (h , x , y) = D.day h (F .η _ x) (G .η _ y)
  go .extranatural (f , g) = ext λ h x y 
    D.day ((f ⊗₁ g)  h) (F .η _ x) (G .η _ y)          ≡⟨ day-glue refl 
    D.day h (X' .F₁ f (F .η _ x)) (Y' .F₁ g (G .η _ y)) ≡˘⟨ day-ap refl (F .is-natural _ _ _ ·ₚ _) (G .is-natural _ _ _ ·ₚ _) ≡˘
    D.day h (F .η _ (X .F₁ f x)) (G .η _ (Y .F₁ g y))   

Day-map :  {X X' Y Y'} (F : X => X') (G : Y => Y')  X ⊗ᴰ Y => X' ⊗ᴰ Y'
Day-map F G .η i = Day-rec (Day-bifunctor-cowedge F G)
Day-map F G .is-natural x y f = ext λ _ _ _  refl

module _ where
  open Make-bifunctor
  Day-bifunctor : Bifunctor (PSh  C) (PSh  C) (PSh  C)
  Day-bifunctor = make-bifunctor λ where
    .F₀ X Y  X ⊗ᴰ Y
    .lmap f  Day-map f idnt
    .rmap f  Day-map idnt f
    .lmap-id  ext λ _ _ _ _  refl
    .rmap-id  ext λ _ _ _ _  refl
    .lmap-∘ f g  ext λ _ _ _ _  refl
    .rmap-∘ f g  ext λ _ _ _ _  refl
    .lrmap  f g  ext λ _ _ _ _  refl

The monoidal structure🔗

The rest of this module is devoted to showing that the Day convolution is actually a monoidal structure: that is, we have unitors and an associator, which satisfy the triangle and pentagon identities. We will give an overview of the constructor of the right unitor, It’s a representative example of the nasty calculations to come.

Fixing a presheaf and coordinate we want to show that

is isomorphic to Were we not working in a proof assistant, we could do this by coend calculus: it’s an instance of the Yoneda lemma. However, it will be much easier in the long run to bang out an explicit isomorphism. At the level of points, we are given and We must produce an element of The composite

acts on to give us precisely the element we want. In the other direction, we can send to We can then perform the extremely annoying calculations to show that (a) this map extends to the coend, (b) the resulting map is a natural transformation, and (c) the inverse construction we sketched is actually an inverse.

module _ (X :  PSh  C ) where
  idr-to-cowedge :  x  Cowedge (Day-diagram X (よ₀ C Unit) x)
  idr-to-cowedge i .nadir = X · i
  idr-to-cowedge i .ψ (a , b) (h , x , y) = X .F₁ (ρ← _  (_  y)  h) x
  idr-to-cowedge i .extranatural {a , b} {a' , b'} (f , g) = ext λ h x y  sym $
    let
      it =
        f  ρ← a  (a  y  g)  h           ≡⟨ extendl (sym (ρ←nat _)) 
        ρ← a'  (f  Unit)  (a  y  g)  h ≡⟨ extend-inner (▶.shufflel (-⊗-.lrmap _ _)) 
        ρ← a'  (a'  y)  (f ⊗₁ g)  h      
    in Fr.collapse X it ·ₚ x

  Day-idr : X ⊗ᴰ よ₀ C Unit ≅ⁿ X
  Day-idr = to-natural-iso mk-idr where
    mk-idr : make-natural-iso (X ⊗ᴰ よ₀ C Unit) X
    mk-idr .eta x   = Day-rec (idr-to-cowedge x)
    mk-idr .inv x a = day (ρ→ _) a id
    mk-idr .eta∘inv x = ext λ a 
      Fr.elim X (ap (ρ← x ∘_) (▶.eliml refl)  unitor-r .Isoⁿ.invr ηₚ _) ·ₚ _
    mk-idr .inv∘eta i = ext λ h x y 
      day (ρ→ i) (X .F₁ (ρ← _  (_  y)  h) x) id        ≡⟨ day-ap refl refl (introl refl) 
      day (ρ→ i) (X .F₁ (ρ← _  (_  y)  h) x) (id  id) ≡⟨ day-swap (ap₂ _∘_ (▶.elimr refl) refl  sym (ρ→nat _)  cancell ρ≅.invl  ap (_∘ h) (◀.introl refl)) 
      day h (X .F₁ id x) (id  y)                         ≡⟨ day-ap refl (X .F-id ·ₚ x) (idl y) 
      day h x y                                           
    mk-idr .natural x y f = ext λ h x y 
      X .F₁ f (X .F₁ (ρ← _  (_  y)  h) x) ≡⟨ sym (X .F-∘ _ _) ·ₚ _ 
      X .F₁ ((ρ← _  (_  y)  h)  f) x     ≡⟨ ap₂ (X .F₁) (pullr (pullr refl)) refl 
      X .F₁ (ρ← _  (_  y)  h  f) x       

This completes the construction of the right unitor. It also completes the commentary on this module: the construction of the left unitor, is analogous: just flip everything. The construction of the associator must be done in steps. However, at the level of points, these are all trivial operations, and the vast majority of this module is dedicated to (extra)naturality conditions and proofs of isomorphy.

We leave the rest of the construction in this <details> block.
module _ (Y :  PSh  C ) where
  idl-to-cowedge :  x  Cowedge (Day-diagram (よ₀ C Unit) Y x)
  idl-to-cowedge i .nadir = Y · i
  idl-to-cowedge i .ψ (a , b) (h , x , y) = Y .F₁ (λ← _  (x  _)  h) y
  idl-to-cowedge i .extranatural {a , b} {a' , b'} (f , g) = ext λ h x y  sym $
    Fr.collapse Y
      (extendl (sym (λ←nat _))  ap (λ← b' ∘_)
        (  cdr (◀.pushl refl)
        ∙∙ extendl (-⊗-.rlmap _ _)
        ∙∙ cdr (pulll (-⊗-.rlmap _ _))))
      ·ₚ _

  Day-idl : よ₀ C Unit ⊗ᴰ Y ≅ⁿ Y
  Day-idl = to-natural-iso mk-idl where
    mk-idl : make-natural-iso (よ₀ C Unit ⊗ᴰ Y) Y
    mk-idl .eta x = Day-rec (idl-to-cowedge x)
    mk-idl .inv x a = day (λ→ _) id a
    mk-idl .eta∘inv x = ext λ a  Fr.elim Y (ap (λ← x ∘_) (◀.eliml refl)  λ≅.invr) ·ₚ _
    mk-idl .inv∘eta i = ext λ h x y 
      day (λ→ i) id (Y .F₁ (λ← _  (x  _)  h) y)        ≡⟨ day-ap refl (introl refl) refl 
      day (λ→ i) (id  id) (Y .F₁ (λ← _  (x  _)  h) y) ≡⟨ day-swap (car (◀.eliml refl)  sym (λ→nat _)  cancell λ≅.invl  car (▶.intror refl)) 
      day h (id  x) (Y .F₁ id y)                         ≡⟨ day-ap refl (idl x) (Y .F-id ·ₚ y)  
      day h x y                                           
    mk-idl .natural = λ x y f  ext λ h x y 
      Y .F₁ f (Y .F₁ (λ← _  (x  _)  h) y) ≡˘⟨ Y .F-∘ _ _ ·ₚ _ ≡˘
      Y .F₁ ((λ← _  (x  _)  h)  f) y     ≡⟨ ap₂ (Y .F₁) (pullr (pullr refl)) refl 
      Y .F₁ (λ← _  (x  _)  h  f) y       

module _ (X Y Z :  PSh  C ) where
  assoc-to₀ :  i {a b} (h : Hom i (a  b)) (z : Z ʻ b)  Cowedge (Day-diagram X Y a)
  assoc-to₀ i h z .nadir = el! (Day₀ X (Y ⊗ᴰ Z) i)
  assoc-to₀ i h z .ψ (a' , b') (h' , x , y) = day (α→ _  (h'  _)  h) x (day id y z)
  assoc-to₀ i h z .extranatural (f , g) = ext λ h' x y 
    let
      p =
        α→ _  ((f ⊗₁ g)  h'  _)  h                   ≡⟨ refl⟩∘⟨ ◀.pushl (pullr refl) 
        α→ _  ((f  _)  _)  ((_  g)  h'  _)  h    ≡⟨ extendl (◀-assoc.from .is-natural _ _ _) 
        (f  _)  α→ _  ((_  g)  h'  _)  h          ≡⟨ extend-inner (◀.popl (◀-▶-comm.to .is-natural _ _ _)) 
        (f  _)  ((_  (g  _))  α→ _)  (h'  _)  h  ≡⟨ refl⟩∘⟨ pullr (pulll refl) 
        (f  _)  (_  (g  _))  (α→ _  (h'  _))  h  
    in
      day (α→ _  ((f ⊗₁ g)  h'  _)  h) x (day id y z)                  ≡⟨ day-glueₗ p  
      day ((_  (g  _))  (α→ _  (h'  _))  h) (X .F₁ f x) (day id y z) ≡⟨ day-glueᵣ refl 
      day ((α→ _  (h'  _))  h) (X .F₁ f x) (day (id  (g  _)) y z)     ≡⟨ day-ap (pullr refl) refl (day-glueₗ id-comm-sym) 
      day (α→ _  (h'  _)  h) (X .F₁ f x) (day id (Y .F₁ g y) z)         

  assoc-to-cowedge :  i  Cowedge (Day-diagram (X ⊗ᴰ Y) Z i)
  assoc-to-cowedge i .nadir = el! (Day₀ X (Y ⊗ᴰ Z) i)
  assoc-to-cowedge i .ψ (a , b) (h , x , y) = Day-rec (assoc-to₀ i h y) x
  assoc-to-cowedge i .extranatural (f , g) = ext λ h h' x y z 
    let
      p =
        (_  (_  g))  α→ _  (h'  f  _)  h       ≡⟨ extendl (sym (▶-assoc.to .is-natural _ _ _)) 
        α→ _  (_  g)  (h'  f  _)  h             ≡⟨ refl⟩∘⟨ extendl (-⊗-.rlmap _ _)  ◀.pushl refl 
        α→ _  (h'  _)  (f  _)  (_  g)  h       ≡⟨ refl⟩∘⟨ refl⟩∘⟨ pulll refl 
        α→ _  (h'  _)  ((f  _)  (_  g))  h     
    in
      day (α→ _  (h'  _)  (f ⊗₁ g)  h) x (day id y z)      ≡⟨ day-glueᵣ (sym p) 
      day (α→ _  (h'  f  _)  h) x (day (id  (_  g)) y z) ≡⟨ day-ap refl refl (day-glueᵣ id-comm-sym) 
      day (α→ _  (h'  f  _)  h) x (day id y (Z .F₁ g z))   

  assoc-from₀ :  i {a b} (h : Hom i (a  b)) (x : X ʻ a)  Cowedge (Day-diagram Y Z b)
  assoc-from₀ i h x .nadir = el! (Day₀ (X ⊗ᴰ Y) Z i)
  assoc-from₀ i h x .ψ (a' , b') (h' , y , z) = day (α← _  (_  h')  h) (day id x y) z
  assoc-from₀ i h x .extranatural (f , g) = ext λ h' y z 
    day (α← _  (_  (f ⊗₁ g)  h')  h) (day id x y) z                         ≡⟨ day-apₘ (pulll (ap₂ _∘_ refl (▶.expand (ap₂ _∘_ refl refl)  ap₂ _∘_ (-⊗-.rmap-◆ _) refl)  extendl (α←nat _ _ _))) 
    day ((((id ⊗₁ f) ⊗₁ g)  α← _  (_  h'))  h) (day id x y) z               ≡⟨ day-glue (pullr refl) 
    day ((α← _  (_  h'))  h) (day (id  (id  _)  (_  f)) x y) (Z .F₁ g z) ≡⟨ day-ap (pullr refl) (day-glueᵣ (cancell (◀.elimr refl)  intror refl)) refl 
    day (α← _  (_  h')  h) (day id x (Y .F₁ f y)) (Z .F₁ g z)                

  assoc-from-cowedge :  i  Cowedge (Day-diagram X (Y ⊗ᴰ Z) i)
  assoc-from-cowedge i .nadir = el! (Day₀ (X ⊗ᴰ Y) Z i)
  assoc-from-cowedge i .ψ (a , b) (h , x , y) = Day-rec (assoc-from₀ i h x) y
  assoc-from-cowedge i .extranatural (f , g) = ext λ h x h' y z 
    let
      p =
        α← _  (_  h')  ((f  _)  (_  g))  h     ≡⟨ refl ⟩∘⟨ pulll (pulll (-⊗-.rlmap _ _)  ▶.pullr refl) 
        α← _  ((f  _)  (_  h'  g))  h           ≡⟨ pulll (extendl (◀-assoc.to .is-natural _ _ _)) 
        (((f  _)  _)  α← _  (_  h'  g))  h     ≡⟨ pullr (pullr refl) 
        ((f  _)  _)  α← _  (_  h'  g)  h       
    in
      day (α← _  (_  h')  (f ⊗₁ g)  h) (day id x y) z      ≡⟨ day-glueₗ p 
      day (α← _  (_  h'  g)  h) (day (id  (f  _)) x y) z ≡⟨ day-ap refl (day-glueₗ id-comm-sym) refl 
      day (α← _  (_  h'  g)  h) (day id (X .F₁ f x) y) z   

  Day-assoc : (X ⊗ᴰ Y) ⊗ᴰ Z ≅ⁿ X ⊗ᴰ (Y ⊗ᴰ Z)
  Day-assoc = to-natural-iso mk-assoc where
    mk-assoc : make-natural-iso ((X ⊗ᴰ Y) ⊗ᴰ Z) (X ⊗ᴰ (Y ⊗ᴰ Z))
    mk-assoc .eta x = Day-rec (assoc-to-cowedge x)
    mk-assoc .inv x = Day-rec (assoc-from-cowedge x)
    mk-assoc .eta∘inv x = ext λ h x h' y z 
      day (α→ _  (id  _)  α← _  (_  h')  h) x (day id y z) ≡⟨ day-apₘ (pulll (◀.elimr refl)  cancell α≅.invl) 
      day ((_  h')  h) x (day id y z)                          ≡⟨ day-glueᵣ refl 
      day h x (day (id  h') y z)                                ≡⟨ day-ap refl refl (day-apₘ (idl h')) 
      day h x (day h' y z)                                       
    mk-assoc .inv∘eta x = ext λ h h' x y z 
      day (α← _  (_  id)  α→ _  (h'  _)  h) (day id x y) z ≡⟨ day-apₘ (pulll3 (ap₂ _∘_ refl (▶.eliml refl)  α≅.invr)  eliml refl) 
      day ((h'  _)  h) (day id x y) z                          ≡⟨ day-glueₗ refl 
      day h  day (id  h') x y  z                              ≡⟨ day-ap refl (day-apₘ (idl h')) refl 
      day h (day h' x y) z                                       
    mk-assoc .natural x y f = ext λ h h' x y z 
      day ((α→ _  (h'  _)  h)  f) x (day id y z) ≡⟨ day-ap (pullr (pullr refl)) refl refl 
      day (α→ _  (h'  _)  h  f) x (day id y z)   

private module M = Monoidal-category

abstract
  day-triangle :  {A B :  PSh  C }  Day-map (Day-idr A .Isoⁿ.to) idnt ∘nt Day-assoc A (よ₀ C Unit) B .Isoⁿ.from  Day-map idnt (Day-idl B .Isoⁿ.to)
  day-triangle {A} {B} = ext λ i h x h' y z 
    let
      p =
        (ρ← _  (_  y)  id  _)  α← _  (_  h')  h     ≡⟨ extendl (◀.popr (car (ap ◀.₁ (elimr refl))  sym (◀-▶-comm.from .is-natural _ _ _))  refl) 
        (ρ← _  _)  (α← _  (_  (y  _)))  (_  h')  h  ≡⟨ extendl (pulll triangle) 
        (_  λ← _)  (_  (y  _))  (_  h')  h           ≡⟨ ▶.pulll3 refl 
        (_  λ← _  (y  _)  h')  h                       
    in
      day (α← _  (_  h')  h) (A .F₁ (ρ← _  (_  y)  id) x) z ≡⟨ sym (day-glueₗ (sym p)) 
      day ((_  λ← _  (y  _)  h')  h) x z                     ≡⟨ day-glueᵣ refl 
      day h x (B .F₁ (λ← _  (y  _)  h') z)                     

  day-pentagon
    :  {A B C D :  PSh  C }
     Day-map (Day-assoc A B C .Isoⁿ.from) idnt
      ∘nt Day-assoc A (B ⊗ᴰ C) D .Isoⁿ.from
      ∘nt Day-map idnt (Day-assoc B C D .Isoⁿ.from)
     Day-assoc (A ⊗ᴰ B) C D .Isoⁿ.from
      ∘nt Day-assoc A B (C ⊗ᴰ D) .Isoⁿ.from
  day-pentagon {D = D} = ext λ i h a h' b h'' c d 
    let
      it =
        ((α← _  _)  α← _  (_  α← _  (_  h'')  h')  h)   ≡⟨ pulll3 (cdr (▶.pushr refl)  extendl pentagon) 
        (α← _  α← _  (_  (_  h'')  h'))  h                ≡⟨ extendr (car (▶.popl (▶-assoc.from .is-natural _ _ _))) 
        (α← _  ((_  h'')  α← _)  (_  h'))  h              ≡⟨ pullr (pullr3 refl) 
        (α← _  (_  h'')  α← _  (_  h')  h)                
    in
      day (α← _  (_  α← _  (_  h'')  h')  h) (day (α← _  (_  id)  id) (day id a b) c) d
        ≡⟨ day-ap refl (day-apₘ (elimr (▶.eliml refl)  introl refl)) refl 
      day (α← _  (_  α← _  (_  h'')  h')  h) (day (id  α← _) (day id a b) c) d
        ≡⟨ sym (day-glueₗ refl) 
      day ((α← _  _)  α← _  (_  α← _  (_  h'')  h')  h) (day id (day id a b) c) d
        ≡⟨ day-apₘ it 
      day (α← _  (_  h'')  α← _  (_  h')  h) (day id (day id a b) c) d
        

A bit of data shuffling assembles this into a proper instance of Monoidal-category.

Day-monoidal : Monoidal-category (PSh  C)
Day-monoidal .M.-⊗-      = Day-bifunctor
Day-monoidal .M.Unit     = よ₀ C Unit
Day-monoidal .M.unitor-l = to-natural-iso mk-λ where
  mk-λ : make-natural-iso _ _
  mk-λ .eta x = Day-idl x .Isoⁿ.from
  mk-λ .inv x = Day-idl x .Isoⁿ.to
  mk-λ .eta∘inv x = Day-idl x .Isoⁿ.invr
  mk-λ .inv∘eta x = Day-idl x .Isoⁿ.invl
  mk-λ .natural x y f = ext λ _ _  refl
Day-monoidal .M.unitor-r = to-natural-iso mk-ρ where
  mk-ρ : make-natural-iso _ _
  mk-ρ .eta x = Day-idr x .Isoⁿ.from
  mk-ρ .inv x = Day-idr x .Isoⁿ.to
  mk-ρ .eta∘inv x = Day-idr x .Isoⁿ.invr
  mk-ρ .inv∘eta x = Day-idr x .Isoⁿ.invl
  mk-ρ .natural x y f = ext λ _ _  refl
Day-monoidal .M.associator = to-natural-iso mk-α where
  mk-α : make-natural-iso _ _
  mk-α .eta (x , y , z) = Day-assoc x y z .Isoⁿ.to
  mk-α .inv (x , y , z) = Day-assoc x y z .Isoⁿ.from
  mk-α .eta∘inv (x , y , z) = Day-assoc x y z .Isoⁿ.invl
  mk-α .inv∘eta (x , y , z) = Day-assoc x y z .Isoⁿ.invr
  mk-α .natural x y f = ext λ _ _ _ _ _ _  refl
Day-monoidal .M.triangle {A} {B} = day-triangle
Day-monoidal .M.pentagon {A} {B} {C} {D} = day-pentagon

With a bit of extra effort, we can calculate that the Yoneda embedding becomes a lax monoidal functor into the Day convolution monoidal structure on

よ-lax : Lax-monoidal-functor-on cmon Day-monoidal ( C)
よ-lax .ε = idnt
よ-lax .F-mult =
  let
    f-mult-cowedge :  X Y {i}  Cowedge (Day-diagram (よ₀ C X) (よ₀ C Y) i)
    f-mult-cowedge X Y {i} = record where
      nadir = el! (Hom i (X  Y))
      ψ c (f , g , h) = (g ⊗₁ h)  f
      extranatural (f , g) = ext λ h i j  pulll (sym -⊗-.◆-∘)
  in make-binatural λ where
    .η c d .η   x  Day.factor _ _ (f-mult-cowedge _ _)
    .η c d .is-natural x y f  ext λ f g h  pulll refl
    .is-natural-◀ f d  ext λ i f g h  pushl (◀.pushl refl)
    .is-natural-▶ c f  ext λ i f g h  pushl (▶.pushr refl  pushl (-⊗-.lrmap _ _))
よ-lax .F-α→ = ext λ i f g h j k 
  α→ _  (((h ⊗₁ j)  g) ⊗₁ k)  f            ≡⟨ cdr (pushl (◀.pushl refl  cdr (-⊗-.lrmap _ _)  pulll refl)) 
  α→ _  ((h ⊗₁ j) ⊗₁ k)  (g  _)  f        ≡⟨ extendl (associator.to .is-natural _ _ _) 
  (h ⊗₁  (j ⊗₁ k) )  α→ _  (g  _)  f    ≡⟨ ap! (intror refl) 
  (h ⊗₁ ((j ⊗₁ k)  id))  α→ _  (g  _)  f 
よ-lax .F-λ← = ext λ i f g h 
  λ← _  (g ⊗₁ h)  f      ≡⟨ extendl (cdr (-⊗-.lrmap _ _)  extendl (unitor-l.from .is-natural _ _ _))  
  h  (λ← _  (g  _))  f ≡⟨ cdr (pullr refl) 
  h  λ← _  (g  _)  f   
よ-lax .F-ρ← = ext λ i f g h 
  ρ← _  (g ⊗₁ h)  f      ≡⟨ extendl (extendl (unitor-r.from .is-natural _ _ _)) 
  g  (ρ← _  (_  h))  f ≡⟨ cdr (pullr refl) 
  g  ρ← _  (_  h)  f   

That the components of this structure are invertible follows from another short calculation.

よ-monoidal : Monoidal-functor-on cmon Day-monoidal ( C)
よ-monoidal .lax = よ-lax
よ-monoidal .ε-inv = Cat.id-invertible (PSh  C)
よ-monoidal .F-mult-inv = invertible→invertibleⁿ _ λ x 
  invertible→invertibleⁿ _ λ y  invertible→invertibleⁿ _ λ z 
    Cat.make-invertible (Sets )
       f  day f id id)
      (ext λ x  ⊗.eliml refl)
      (ext λ f g h  day-glue refl  day-ap refl (idl _) (idl _))

  1. This is actually a slight under-approximation of strong monoidal functors: the unit must also be preserved, of course, and the preservation isomorphisms need to be compatible with the structural morphisms — the unitors and associator.↩︎