|
| 1 | +{-# OPTIONS --without-K --safe #-} |
| 2 | + |
| 3 | +-- Monoidal natural transformations between lax and strong braided |
| 4 | +-- monoidal functors. |
| 5 | +-- |
| 6 | +-- NOTE. Braided monoidal natural transformations are really just |
| 7 | +-- monoidal natural transformations that happen to go between braided |
| 8 | +-- monoidal functors. No additional conditions are necessary. |
| 9 | +-- Nevertheless, the definitions in this module are useful when one is |
| 10 | +-- working in a braided monoidal setting. They also help Agda's type |
| 11 | +-- checker by bundling the (braided monoidal) categories and functors |
| 12 | +-- involved. |
| 13 | +-- |
| 14 | +-- See |
| 15 | +-- * John Baez, Some definitions everyone should know, |
| 16 | +-- https://math.ucr.edu/home/baez/qg-fall2004/definitions.pdf |
| 17 | +-- * https://ncatlab.org/nlab/show/monoidal+natural+transformation |
| 18 | + |
| 19 | +module Categories.NaturalTransformation.Monoidal.Braided where |
| 20 | + |
| 21 | +open import Level |
| 22 | + |
| 23 | +open import Categories.Category.Monoidal using (BraidedMonoidalCategory) |
| 24 | +import Categories.Functor.Monoidal.Braided as BMF |
| 25 | +open import Categories.Functor.Monoidal.Properties using () |
| 26 | + renaming (∘-BraidedMonoidal to _∘Fˡ_; ∘-StrongBraidedMonoidal to _∘Fˢ_) |
| 27 | +open import Categories.NaturalTransformation as NT using (NaturalTransformation) |
| 28 | +import Categories.NaturalTransformation.Monoidal as MNT |
| 29 | + |
| 30 | +module Lax where |
| 31 | + open BMF.Lax using (BraidedMonoidalFunctor) |
| 32 | + open MNT.Lax using (IsMonoidalNaturalTransformation) |
| 33 | + open BraidedMonoidalFunctor using () renaming (F to UF; monoidalFunctor to MF) |
| 34 | + |
| 35 | + module _ {o ℓ e o′ ℓ′ e′} |
| 36 | + {C : BraidedMonoidalCategory o ℓ e} |
| 37 | + {D : BraidedMonoidalCategory o′ ℓ′ e′} where |
| 38 | + |
| 39 | + -- Monoidal natural transformations between braided monoidal functors. |
| 40 | + |
| 41 | + record BraidedMonoidalNaturalTransformation |
| 42 | + (F G : BraidedMonoidalFunctor C D) : Set (o ⊔ ℓ ⊔ ℓ′ ⊔ e′) where |
| 43 | + |
| 44 | + field |
| 45 | + U : NaturalTransformation (UF F) (UF G) |
| 46 | + isMonoidal : IsMonoidalNaturalTransformation (MF F) (MF G) U |
| 47 | + |
| 48 | + open NaturalTransformation U public |
| 49 | + open IsMonoidalNaturalTransformation isMonoidal public |
| 50 | + |
| 51 | + -- To shorten some definitions |
| 52 | + |
| 53 | + private |
| 54 | + _⇛_ = BraidedMonoidalNaturalTransformation |
| 55 | + module U = MNT.Lax |
| 56 | + |
| 57 | + module _ {o ℓ e o′ ℓ′ e′} |
| 58 | + {C : BraidedMonoidalCategory o ℓ e} |
| 59 | + {D : BraidedMonoidalCategory o′ ℓ′ e′} where |
| 60 | + |
| 61 | + -- Conversions |
| 62 | + |
| 63 | + ⌊_⌋ : {F G : BraidedMonoidalFunctor C D} → |
| 64 | + F ⇛ G → U.MonoidalNaturalTransformation (MF F) (MF G) |
| 65 | + ⌊ α ⌋ = record { U = U ; isMonoidal = isMonoidal } |
| 66 | + where open BraidedMonoidalNaturalTransformation α |
| 67 | + |
| 68 | + ⌈_⌉ : {F G : BraidedMonoidalFunctor C D} → |
| 69 | + U.MonoidalNaturalTransformation (MF F) (MF G) → F ⇛ G |
| 70 | + ⌈ α ⌉ = record { U = U ; isMonoidal = isMonoidal } |
| 71 | + where open U.MonoidalNaturalTransformation α |
| 72 | + |
| 73 | + -- Identity and compositions |
| 74 | + |
| 75 | + infixr 9 _∘ᵥ_ |
| 76 | + |
| 77 | + id : {F : BraidedMonoidalFunctor C D} → F ⇛ F |
| 78 | + id = ⌈ U.id ⌉ |
| 79 | + |
| 80 | + _∘ᵥ_ : {F G H : BraidedMonoidalFunctor C D} → G ⇛ H → F ⇛ G → F ⇛ H |
| 81 | + α ∘ᵥ β = ⌈ ⌊ α ⌋ U.∘ᵥ ⌊ β ⌋ ⌉ |
| 82 | + |
| 83 | + module _ {o ℓ e o′ ℓ′ e′ o″ ℓ″ e″} |
| 84 | + {C : BraidedMonoidalCategory o ℓ e} |
| 85 | + {D : BraidedMonoidalCategory o′ ℓ′ e′} |
| 86 | + {E : BraidedMonoidalCategory o″ ℓ″ e″} where |
| 87 | + |
| 88 | + infixr 9 _∘ₕ_ _∘ˡ_ _∘ʳ_ |
| 89 | + |
| 90 | + _∘ₕ_ : {F G : BraidedMonoidalFunctor C D} |
| 91 | + {H I : BraidedMonoidalFunctor D E} → |
| 92 | + H ⇛ I → F ⇛ G → (H ∘Fˡ F) ⇛ (I ∘Fˡ G) |
| 93 | + α ∘ₕ β = ⌈ ⌊ α ⌋ U.∘ₕ ⌊ β ⌋ ⌉ |
| 94 | + |
| 95 | + _∘ˡ_ : {F G : BraidedMonoidalFunctor C D} |
| 96 | + (H : BraidedMonoidalFunctor D E) → F ⇛ G → (H ∘Fˡ F) ⇛ (H ∘Fˡ G) |
| 97 | + H ∘ˡ α = id {F = H} ∘ₕ α |
| 98 | + |
| 99 | + _∘ʳ_ : {G H : BraidedMonoidalFunctor D E} → |
| 100 | + G ⇛ H → (F : BraidedMonoidalFunctor C D) → (G ∘Fˡ F) ⇛ (H ∘Fˡ F) |
| 101 | + α ∘ʳ F = α ∘ₕ id {F = F} |
| 102 | + |
| 103 | +module Strong where |
| 104 | + open BMF.Strong using (BraidedMonoidalFunctor) |
| 105 | + open MNT.Strong using (IsMonoidalNaturalTransformation) |
| 106 | + open BraidedMonoidalFunctor using () renaming |
| 107 | + ( F to UF |
| 108 | + ; monoidalFunctor to MF |
| 109 | + ; laxBraidedMonoidalFunctor to laxBMF |
| 110 | + ) |
| 111 | + |
| 112 | + module _ {o ℓ e o′ ℓ′ e′} |
| 113 | + {C : BraidedMonoidalCategory o ℓ e} |
| 114 | + {D : BraidedMonoidalCategory o′ ℓ′ e′} where |
| 115 | + |
| 116 | + -- Monoidal natural transformations between braided strong |
| 117 | + -- monoidal functors. |
| 118 | + |
| 119 | + record BraidedMonoidalNaturalTransformation |
| 120 | + (F G : BraidedMonoidalFunctor C D) : Set (o ⊔ ℓ ⊔ ℓ′ ⊔ e′) where |
| 121 | + |
| 122 | + field |
| 123 | + U : NaturalTransformation (UF F) (UF G) |
| 124 | + isMonoidal : IsMonoidalNaturalTransformation (MF F) (MF G) U |
| 125 | + |
| 126 | + laxBNT : Lax.BraidedMonoidalNaturalTransformation (laxBMF F) (laxBMF G) |
| 127 | + laxBNT = record { U = U ; isMonoidal = isMonoidal } |
| 128 | + open Lax.BraidedMonoidalNaturalTransformation laxBNT public |
| 129 | + hiding (U; isMonoidal) |
| 130 | + |
| 131 | + -- To shorten some definitions |
| 132 | + |
| 133 | + private |
| 134 | + _⇛_ = BraidedMonoidalNaturalTransformation |
| 135 | + module U = MNT.Strong |
| 136 | + |
| 137 | + module _ {o ℓ e o′ ℓ′ e′} |
| 138 | + {C : BraidedMonoidalCategory o ℓ e} |
| 139 | + {D : BraidedMonoidalCategory o′ ℓ′ e′} where |
| 140 | + |
| 141 | + -- Conversions |
| 142 | + |
| 143 | + ⌊_⌋ : {F G : BraidedMonoidalFunctor C D} → |
| 144 | + F ⇛ G → U.MonoidalNaturalTransformation (MF F) (MF G) |
| 145 | + ⌊ α ⌋ = record { U = U ; isMonoidal = isMonoidal } |
| 146 | + where open BraidedMonoidalNaturalTransformation α |
| 147 | + |
| 148 | + ⌈_⌉ : {F G : BraidedMonoidalFunctor C D} → |
| 149 | + U.MonoidalNaturalTransformation (MF F) (MF G) → F ⇛ G |
| 150 | + ⌈ α ⌉ = record { U = U ; isMonoidal = isMonoidal } |
| 151 | + where open U.MonoidalNaturalTransformation α |
| 152 | + |
| 153 | + -- Identity and compositions |
| 154 | + |
| 155 | + infixr 9 _∘ᵥ_ |
| 156 | + |
| 157 | + id : {F : BraidedMonoidalFunctor C D} → F ⇛ F |
| 158 | + id = ⌈ U.id ⌉ |
| 159 | + |
| 160 | + _∘ᵥ_ : {F G H : BraidedMonoidalFunctor C D} → G ⇛ H → F ⇛ G → F ⇛ H |
| 161 | + α ∘ᵥ β = ⌈ ⌊ α ⌋ U.∘ᵥ ⌊ β ⌋ ⌉ |
| 162 | + |
| 163 | + module _ {o ℓ e o′ ℓ′ e′ o″ ℓ″ e″} |
| 164 | + {C : BraidedMonoidalCategory o ℓ e} |
| 165 | + {D : BraidedMonoidalCategory o′ ℓ′ e′} |
| 166 | + {E : BraidedMonoidalCategory o″ ℓ″ e″} where |
| 167 | + |
| 168 | + infixr 9 _∘ₕ_ _∘ˡ_ _∘ʳ_ |
| 169 | + |
| 170 | + _∘ₕ_ : {F G : BraidedMonoidalFunctor C D} |
| 171 | + {H I : BraidedMonoidalFunctor D E} → |
| 172 | + H ⇛ I → F ⇛ G → (H ∘Fˢ F) ⇛ (I ∘Fˢ G) |
| 173 | + -- NOTE: this definition is clearly equivalent to |
| 174 | + -- |
| 175 | + -- α ∘ₕ β = ⌈ ⌊ α ⌋ U.∘ₕ ⌊ β ⌋ ⌉ |
| 176 | + -- |
| 177 | + -- but the latter takes an unreasonably long time to typecheck, |
| 178 | + -- while the unfolded version typechecks almost immediately. |
| 179 | + α ∘ₕ β = record |
| 180 | + { U = C.U |
| 181 | + ; isMonoidal = record |
| 182 | + { ε-compat = C.ε-compat |
| 183 | + ; ⊗-homo-compat = C.⊗-homo-compat |
| 184 | + } |
| 185 | + } |
| 186 | + where module C = U.MonoidalNaturalTransformation (⌊ α ⌋ U.∘ₕ ⌊ β ⌋) |
| 187 | + |
| 188 | + _∘ˡ_ : {F G : BraidedMonoidalFunctor C D} |
| 189 | + (H : BraidedMonoidalFunctor D E) → F ⇛ G → (H ∘Fˢ F) ⇛ (H ∘Fˢ G) |
| 190 | + H ∘ˡ α = id {F = H} ∘ₕ α |
| 191 | + |
| 192 | + _∘ʳ_ : {G H : BraidedMonoidalFunctor D E} → |
| 193 | + G ⇛ H → (F : BraidedMonoidalFunctor C D) → (G ∘Fˢ F) ⇛ (H ∘Fˢ F) |
| 194 | + α ∘ʳ F = α ∘ₕ id {F = F} |
0 commit comments