|
| 1 | +{-# OPTIONS --without-K --safe --lossy-unification #-} |
| 2 | +-- lossy unification is required to complete type-checking |
| 3 | + |
| 4 | +open import Categories.Bicategory |
| 5 | +open import Categories.Bicategory.LocalCoequalizers |
| 6 | + |
| 7 | +module Categories.Bicategory.Construction.Bimodules {o ℓ e t} (𝒞 : Bicategory o ℓ e t) (localCoeq : LocalCoequalizers 𝒞) where |
| 8 | +open import Level using (_⊔_) |
| 9 | +open import Data.Product using (_,_) |
| 10 | + |
| 11 | +import Categories.Bicategory.Extras as Bicat |
| 12 | +open Bicat 𝒞 |
| 13 | + |
| 14 | +open import Categories.Bicategory.Monad using (Monad) |
| 15 | +open import Categories.Bicategory.Monad.Bimodule using (Bimodule; id-bimodule) |
| 16 | + |
| 17 | +open import Categories.Category.Construction.Bimodules {𝒞 = 𝒞} using ()renaming (Bimodules to 1-Bimodules) |
| 18 | +open import Categories.Category using (Category) |
| 19 | +private |
| 20 | + module 1-Bimodules M₁ M₂ = Category (1-Bimodules M₁ M₂) |
| 21 | + |
| 22 | +open import Categories.NaturalTransformation.NaturalIsomorphism using (niHelper) |
| 23 | +open import Categories.Morphism using (_≅_) |
| 24 | + |
| 25 | +open import Categories.Bicategory.Construction.Bimodules.TensorproductOfBimodules localCoeq using () renaming (Tensorproduct to infixr 30 _⊗₀_) |
| 26 | +open import Categories.Bicategory.Construction.Bimodules.TensorproductOfHomomorphisms localCoeq using () renaming (Tensorproduct to infixr 30 _⊗₁_) |
| 27 | +open import Categories.Bicategory.Construction.Bimodules.Tensorproduct.Functorial localCoeq |
| 28 | +open import Categories.Bicategory.Construction.Bimodules.Tensorproduct.Associator localCoeq using (associator-⊗) |
| 29 | +open import Categories.Bicategory.Construction.Bimodules.Tensorproduct.Associator.Naturality localCoeq using (α⇒-⊗-natural) |
| 30 | +open import Categories.Bicategory.Construction.Bimodules.Tensorproduct.Unitor localCoeq using (module Left-Unitor; module Right-Unitor) |
| 31 | +open Left-Unitor using (unitorˡ-⊗) |
| 32 | +open Right-Unitor using (unitorʳ-⊗) |
| 33 | +open import Categories.Bicategory.Construction.Bimodules.Tensorproduct.Unitor.Naturality localCoeq |
| 34 | + using (module Left-Unitor-natural; module Right-Unitor-natural) |
| 35 | +open Left-Unitor-natural using (λ⇒-⊗-natural) |
| 36 | +open Right-Unitor-natural using (ρ⇒-⊗-natural) |
| 37 | +open import Categories.Bicategory.Construction.Bimodules.Tensorproduct.Coherence.Pentagon localCoeq using (pentagon-⊗) |
| 38 | +open import Categories.Bicategory.Construction.Bimodules.Tensorproduct.Coherence.Triangle localCoeq using (triangle-⊗) |
| 39 | + |
| 40 | +Bimodules : Bicategory (o ⊔ ℓ ⊔ e) (ℓ ⊔ e) e (o ⊔ ℓ ⊔ e ⊔ t) |
| 41 | +Bimodules = record |
| 42 | + { enriched = record |
| 43 | + { Obj = Monad 𝒞 |
| 44 | + ; hom = 1-Bimodules |
| 45 | + ; id = λ {M} → record |
| 46 | + { F₀ = λ _ → id-bimodule M |
| 47 | + ; F₁ = λ _ → 1-Bimodules.id M M |
| 48 | + ; identity = hom.Equiv.refl |
| 49 | + ; homomorphism = hom.Equiv.sym (1-Bimodules.identity² M M) |
| 50 | + ; F-resp-≈ = λ _ → hom.Equiv.refl |
| 51 | + } |
| 52 | + ; ⊚ = record |
| 53 | + { F₀ = λ (B₂ , B₁) → B₂ ⊗₀ B₁ |
| 54 | + ; F₁ = λ (h₂ , h₁) → h₂ ⊗₁ h₁ |
| 55 | + ; identity = λ {(B₂ , B₁)} → Identity.⊗₁-resp-id₂ B₂ B₁ |
| 56 | + ; homomorphism = λ {_} {_} {_} {(g₂ , g₁)} {(h₂ , h₁)} → Composition.⊗₁-distr-∘ᵥ h₂ h₁ g₂ g₁ |
| 57 | + ; F-resp-≈ = λ {_} {_} {(h₂ , h₁)} {(h'₂ , h'₁)} (e₂ , e₁) → ≈Preservation.⊗₁-resp-≈ h₂ h'₂ h₁ h'₁ e₂ e₁ |
| 58 | + } |
| 59 | + ; ⊚-assoc = niHelper record |
| 60 | + { η = λ ((B₃ , B₂) , B₁) → _≅_.from (associator-⊗ {B₃ = B₃} {B₂} {B₁}) |
| 61 | + ; η⁻¹ = λ ((B₃ , B₂) , B₁) → _≅_.to (associator-⊗ {B₃ = B₃} {B₂} {B₁}) |
| 62 | + ; commute = λ ((f₃ , f₂) , f₁) → α⇒-⊗-natural f₃ f₂ f₁ |
| 63 | + ; iso = λ ((B₃ , B₂) , B₁) → _≅_.iso (associator-⊗ {B₃ = B₃} {B₂} {B₁}) |
| 64 | + } |
| 65 | + ; unitˡ = niHelper record |
| 66 | + { η = λ (_ , B) → _≅_.from (unitorˡ-⊗ {B = B}) |
| 67 | + ; η⁻¹ = λ (_ , B) → _≅_.to (unitorˡ-⊗ {B = B}) |
| 68 | + ; commute = λ (_ , f) → λ⇒-⊗-natural f |
| 69 | + ; iso = λ (_ , B) → _≅_.iso (unitorˡ-⊗ {B = B}) |
| 70 | + } |
| 71 | + ; unitʳ = niHelper record |
| 72 | + { η = λ (B , _) → _≅_.from (unitorʳ-⊗ {B = B}) |
| 73 | + ; η⁻¹ = λ (B , _) → _≅_.to (unitorʳ-⊗ {B = B}) |
| 74 | + ; commute = λ (f , _) → ρ⇒-⊗-natural f |
| 75 | + ; iso = λ (B , _) → _≅_.iso (unitorʳ-⊗ {B = B}) |
| 76 | + } |
| 77 | + } |
| 78 | + ; triangle = λ {_} {_} {_} {B₁} {B₂} → triangle-⊗ {B₂ = B₂} {B₁} |
| 79 | + ; pentagon = λ {_} {_} {_} {_} {_} {B₁} {B₂} {B₃} {B₄} → pentagon-⊗ {B₄ = B₄} {B₃} {B₂} {B₁} |
| 80 | + } |
0 commit comments