Skip to content

Commit aabe490

Browse files
Merge pull request #479 from tillrampe/cat-of-bimods
1-Category of Bimodules
2 parents e9f1d62 + ce521e5 commit aabe490

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{-# OPTIONS --without-K --safe #-}
2+
3+
open import Categories.Bicategory
4+
open import Categories.Bicategory.Monad using (Monad)
5+
6+
module Categories.Category.Construction.Bimodules {o ℓ e t} {𝒞 : Bicategory o ℓ e t} (M₁ M₂ : Monad 𝒞) where
7+
8+
open import Level
9+
open import Categories.Category
10+
open import Categories.Bicategory.Monad.Bimodule using (Bimodule)
11+
open import Categories.Bicategory.Monad.Bimodule.Homomorphism using (Bimodulehomomorphism; id-bimodule-hom; bimodule-hom-∘)
12+
import Categories.Bicategory.Extras as Bicat
13+
open Bicat 𝒞
14+
15+
Bimodules : Category (o ⊔ ℓ ⊔ e) (ℓ ⊔ e) e
16+
Bimodules = record
17+
{ Obj = Bimodule M₁ M₂
18+
; _⇒_ = Bimodulehomomorphism
19+
; _≈_ = λ h₁ h₂ α h₁ ≈ α h₂
20+
; id = id-bimodule-hom
21+
; _∘_ = bimodule-hom-∘
22+
; assoc = assoc₂
23+
; sym-assoc = sym-assoc₂
24+
; identityˡ = identity₂ˡ
25+
; identityʳ = identity₂ʳ
26+
; identity² = identity₂²
27+
; equiv = record
28+
-- must be delta expanded to type-check
29+
-- as functions are applied to different implicit parameters
30+
{ refl = hom.Equiv.refl
31+
; sym = hom.Equiv.sym
32+
; trans = hom.Equiv.trans
33+
}
34+
; ∘-resp-≈ = hom.∘-resp-≈
35+
}
36+
where
37+
open Bimodulehomomorphism using (α)
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{-# OPTIONS --without-K --safe #-}
2+
3+
4+
open import Categories.Bicategory
5+
open import Categories.Bicategory.Monad
6+
7+
module Categories.Category.Construction.Bimodules.Properties
8+
{o ℓ e t} {𝒞 : Bicategory o ℓ e t} {M₁ M₂ : Monad 𝒞} where
9+
10+
open import Agda.Primitive
11+
12+
import Categories.Category.Construction.Bimodules
13+
open import Categories.Category
14+
15+
Bimodules : Category (o ⊔ ℓ ⊔ e) (ℓ ⊔ e) e
16+
Bimodules = Categories.Category.Construction.Bimodules.Bimodules M₁ M₂
17+
18+
private
19+
module Cat {o₁ ℓ₁ e₁} {C : Categories.Category.Category o₁ ℓ₁ e₁} where
20+
open Categories.Category.Category C using (Obj; _⇒_) public
21+
open import Categories.Morphism C using (IsIso; _≅_) public
22+
open import Categories.Morphism.Reasoning.Iso C using (conjugate-from) public
23+
24+
open Cat
25+
26+
27+
import Categories.Bicategory.Extras as Bicat
28+
open Bicat 𝒞 using (hom; _⇒₂_; _≈_; _∘ᵥ_; _◁_; _▷_; _◁ᵢ_; _▷ᵢ_)
29+
30+
open import Categories.Bicategory.Monad.Bimodule {𝒞 = 𝒞}
31+
open import Categories.Bicategory.Monad.Bimodule.Homomorphism {𝒞 = 𝒞}
32+
33+
module Bimodulehom-isIso {B₁ B₂ : Obj {C = Bimodules}} (f : _⇒_ {C = Bimodules} B₁ B₂) where
34+
open Monad using (C; T)
35+
open Bimodule using (F; actionˡ; actionʳ)
36+
open Bimodulehomomorphism f using (α; linearˡ; linearʳ)
37+
38+
αisIso⇒fisIso : IsIso {C = hom (C M₁) (C M₂)} α IsIso {C = Bimodules} f
39+
αisIso⇒fisIso αisIso = record
40+
{ inv = record
41+
{ α = α⁻¹
42+
; linearˡ = linearˡ⁻¹
43+
; linearʳ = linearʳ⁻¹
44+
}
45+
; iso = record
46+
-- Cannot be delta reduced because of size issues
47+
{ isoˡ = IsIso.isoˡ αisIso
48+
; isoʳ = IsIso.isoʳ αisIso
49+
}
50+
}
51+
where
52+
open hom.HomReasoning
53+
54+
α⁻¹ : F B₂ ⇒₂ F B₁
55+
α⁻¹ = IsIso.inv αisIso
56+
57+
αIso : F B₁ ≅ F B₂
58+
αIso = record
59+
{ from = α
60+
; to = α⁻¹
61+
; iso = IsIso.iso αisIso
62+
}
63+
64+
linearˡ⁻¹ : actionˡ B₁ ∘ᵥ α⁻¹ ◁ T M₁ ≈ α⁻¹ ∘ᵥ actionˡ B₂
65+
linearˡ⁻¹ = ⟺ (conjugate-from (αIso ◁ᵢ T M₁) αIso linearˡ)
66+
67+
linearʳ⁻¹ : actionʳ B₁ ∘ᵥ T M₂ ▷ α⁻¹ ≈ α⁻¹ ∘ᵥ actionʳ B₂
68+
linearʳ⁻¹ = ⟺ (conjugate-from (T M₂ ▷ᵢ αIso) αIso linearʳ)
69+
70+
αisIso⇒Iso : IsIso {C = hom (C M₁) (C M₂)} α B₁ ≅ B₂
71+
αisIso⇒Iso αisIso = record
72+
{ from = f
73+
; to = IsIso.inv (αisIso⇒fisIso αisIso)
74+
; iso = IsIso.iso (αisIso⇒fisIso αisIso)
75+
}

0 commit comments

Comments
 (0)