module Cat.Monoidal.Instances.Factorisations.Left
{o ℓ} (C : Precategory o ℓ) where
private module Arr = Cat.Reasoning (Arr C)
open Cat.Reasoning C
open Ffm C
Monoidal structure on lwfs🔗
The monoidal category structure on functorial factorisations lifts to left weak factorisation structures.
The comultiplication on the tensor unit is trivial.
: Lwfs-on Ff-unit
Lwfs-on-unit .L-δ .η (X , Y , f) = Arr.id
Lwfs-on-unit .L-δ .is-natural x y f = ext (id-comm-sym ,ₚ id-comm-sym)
Lwfs-on-unit .L-comonad .δ-unitl = ext (idl id ,ₚ idl id)
Lwfs-on-unit .L-comonad .δ-unitr = ext (idl id ,ₚ idl id)
Lwfs-on-unit .L-comonad .δ-assoc = ext refl Lwfs-on-unit
The comultiplication on tensors is where most of the work goes.
module _ {F G : Factorisation C} (Fl : Lwfs-on F) (Gl : Lwfs-on G) where
private
module FG = Factorisation (F ⊗ᶠᶠ G)
module F = Lwfs Fl
module G = Lwfs Gl
open F renaming (ρ→ to ρᶠ ; λ→ to λᶠ) using ()
open G renaming (ρ→ to ρᵍ ; λ→ to λᵍ) using ()
: ∀ {x y} (f : Hom x y) → Hom x (G.Mid (ρᶠ f))
λλ = λᵍ (ρᶠ f) ∘ λᶠ f
λλ f
: ∀ {x y} (f : Hom x y) → Homᵃ C (λᶠ f) (λλ f)
λ→λλ .top = id
λ→λλ f .bot = λᵍ (ρᶠ f)
λ→λλ f .com = elimr refl λ→λλ f
: ∀ {x y} (f : Hom x y) → Homᵃ C (λᵍ (ρᶠ f)) (ρᶠ (λλ f))
δ-sq using (llift , α , β) ← F.lift-λρ (λ→λλ f) = record
δ-sq f { top = llift
; bot = id
; com = β ∙ introl refl
}
The component of the comultiplication at a map is given by the dashed arrow in the diagram below. The auxiliary arrow serves primarily to establish that everything necessary commutes. Note that the ellipse with faces and is only the identity on and this gives one of the counit laws for
: FG.L => (FG.L F∘ FG.L)
lδ .η (X , Y , f) = record where
lδ (l1 , α , _) = F.lift-λρ (λ→λλ f)
(bot , β , _) = G.lift-λρ (δ-sq f)
= id
top : (λᵍ (ρᶠ (λλ f)) ∘ λᶠ (λλ f)) ∘ id ≡ bot ∘ λᵍ (ρᶠ f) ∘ λᶠ f
com = sym (pulll β ∙∙ pullr α ∙∙ pulll refl) com
.is-natural x y f = ext $ id-comm-sym ,ₚ
lδ (sym (G.δ-nat _))
pullr (G.weave (ext
∙ extendl ( pullr (sym (F.δ-nat _))
(F.weave (ext (id-comm-sym ,ₚ G .S₁ _ .sq₀)))
∙ extendl ))) ,ₚ id-comm-sym
As indicated, we can obtain one of the counit laws by pondering the orb contained in the diagram, and the other counit law pops up by calculating until we can apply and unit laws in turn. The only lengthy calculation is associativity, but the idea is the same: calculate to expose opportunities to apply the associativity of both factors.
: Lwfs-on (F ⊗ᶠᶠ G)
Lwfs-on-tensor .L-δ = lδ
Lwfs-on-tensor .L-comonad .δ-assoc {x , y , f} = ext $ refl ,ₚ sym p1 where
Lwfs-on-tensor =
p0 .map (λ→λλ (λλ f)) ∘ F.δ (λλ f) ∘ F.map (λ→λλ f) ∘ F.δ f
F_∘_ refl (pulll (sym (F.δ-nat _)) ∙ pullr (sym F.δ-assoc)) ⟩
≡⟨ ap₂ .map (λ→λλ (λλ f)) ∘ F.map (F.L₁ (λ→λλ f)) ∘ F.map (F.δˢ f) ∘ F.δ f
F(F.collapse refl) ⟩
≡⟨ pulll .map (λ→λλ (λλ f) Arr.∘ F.L₁ (λ→λλ f)) ∘ F.map (F.δˢ f) ∘ F.δ f
F(F.weave (ext (elimr F.δ-top ,ₚ pullr refl ∙ sym (G.lift-λρ (δ-sq f) .snd .fst)))) ⟩
≡⟨ extendl .map (lδ .η (_ , _ , f)) ∘ F.map (λ→λλ f) ∘ F.δ f
F
∎
=
p1 (G.map (δ-sq (λλ f)) ∘ G.δ (ρᶠ (λλ f))) ∘ G.map (δ-sq f) ∘ G.δ (ρᶠ f)
(extendl (sym (G.δ-nat _))) ⟩
≡⟨ pullr .map (δ-sq (λλ f)) ∘ G.map (G.L₁ (δ-sq f)) ∘ G.δ (λᵍ (ρᶠ f)) ∘ G.δ (ρᶠ f)
G_∘_ refl (ap₂ _∘_ refl (sym G.δ-assoc)) ⟩
≡⟨ ap₂ .map (δ-sq (λλ f)) ∘ G.map (G.L₁ (δ-sq f)) ∘ G.map (G.δˢ (ρᶠ f)) ∘ G.δ (ρᶠ f)
G_∘_ refl (pulll (G.collapse refl)) ⟩
≡⟨ ap₂ .map (δ-sq (λλ f)) ∘ G.map (G.L₁ (δ-sq f) Arr.∘ G.δˢ (ρᶠ f)) ∘ G.δ (ρᶠ f)
G(G.weave (ext (pullr (ap₂ _∘_ refl (elimr G.δ-top)) ∙ p0 ,ₚ pulll (eliml refl) ∙ intror refl))) ⟩
≡⟨ extendl .map _ ∘ G.map (δ-sq f) ∘ G.δ (ρᶠ f)
G ∎
.L-comonad .δ-unitl {x , y , f} = ext $ idl id ,ₚ
Lwfs-on-tensor (G.collapse (ext (pulll (F.collapse
pulll (ext (idl id ,ₚ sym (G.factors (ρᶠ f))))) ∙ F.δ-unitl ,ₚ idr _)))
.δ-unitl
∙ G
.L-comonad .δ-unitr {x , y , f} = ext $ idl id ,ₚ
Lwfs-on-tensor .lift-λρ (δ-sq f) .snd .snd G