Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b78e2e2
Given two monads construct the 1-category of bimodules between them
tillrampe May 30, 2025
aba333e
Delete unnecessary comment
tillrampe May 30, 2025
e52aa32
Merge branch 'bimodule' into cat-of-bimods
tillrampe Jul 3, 2025
99dc736
Open Bimodulehomomorphism as its definition has been moved to a new file
tillrampe Jul 3, 2025
1a211fb
Specify open commands by using commands
tillrampe Jul 3, 2025
3eede4b
Eta reduce the definition of hom sets
tillrampe Jul 3, 2025
26e78a2
Move the two monads that serve as parameters into the module signature
tillrampe Jul 3, 2025
ab136f3
Make monads an explicit parameter
tillrampe Jul 3, 2025
8b05760
Import Bimodulehomomorphism as it has moved to a different file
tillrampe Jul 3, 2025
4862f00
No lossy unification needed
tillrampe Jul 4, 2025
ba4c6c6
Specify open commands by using commands to avoid name clashes
tillrampe Jul 4, 2025
04e3ecb
Use named implicit application when opening the module and skip level…
tillrampe Jul 4, 2025
4762e52
Give a clearer name to lemmata
tillrampe Jul 4, 2025
294f18d
Move definitions of the fileds of the record type to the where clause
tillrampe Jul 4, 2025
7adb41d
Call the lemmata by their new names
tillrampe Jul 4, 2025
d0579d2
Don't open multiple instances of the module Monad resp. Bimodule as i…
tillrampe Jul 4, 2025
52e1af4
Add a comment explaining why we cannot delta reduce the definition of…
tillrampe Jul 7, 2025
ce521e5
Add a comment explaining why we cannot delta reduce the definition of…
tillrampe Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/Categories/Category/Construction/Bimodules.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{-# OPTIONS --without-K --safe #-}

open import Categories.Bicategory
open import Categories.Bicategory.Monad using (Monad)

module Categories.Category.Construction.Bimodules {o ℓ e t} {𝒞 : Bicategory o ℓ e t} (M₁ M₂ : Monad 𝒞) where

open import Level
open import Categories.Category
open import Categories.Bicategory.Monad.Bimodule using (Bimodule)
open import Categories.Bicategory.Monad.Bimodule.Homomorphism using (Bimodulehomomorphism; id-bimodule-hom; bimodule-hom-∘)
import Categories.Bicategory.Extras as Bicat
open Bicat 𝒞

Bimodules : Category (o ⊔ ℓ ⊔ e) (ℓ ⊔ e) e
Bimodules = record
{ Obj = Bimodule M₁ M₂
; _⇒_ = Bimodulehomomorphism
; _≈_ = λ h₁ h₂ → α h₁ ≈ α h₂
; id = id-bimodule-hom
; _∘_ = bimodule-hom-∘
; assoc = assoc₂
; sym-assoc = sym-assoc₂
; identityˡ = identity₂ˡ
; identityʳ = identity₂ʳ
; identity² = identity₂²
; equiv = record
{ refl = hom.Equiv.refl
; sym = hom.Equiv.sym
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it can be eta-reduced to hom.Equiv but in fact it cannot. The issue is that how.Equiv is a proof that hom._≈_ is an equivalence, but we need a proof that λ h₁ h₂ → α h₁ ≈ α h₂ is an equivalence.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A one liner comment (like "must be delta expanded to typecheck as at different types") would be good.

; trans = hom.Equiv.trans
}
; ∘-resp-≈ = hom.∘-resp-≈
}
where
open Bimodulehomomorphism using (α)
74 changes: 74 additions & 0 deletions src/Categories/Category/Construction/Bimodules/Properties.agda
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main purpose of this file is to show that a bimodule homomorphism is invertible if its underlying 2-cell is invertible. As this requires considering two different categories plus the ambient bicategory, there is a big potential for overloaded variable names. I'm employing using commands to avoid overloads, but don't rename. If you see a better way to strike a balance between being clear and being concise please let me know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to use named private modules, with the same name as the (bi)category of interest, to give the reader more 'local context' to help resolve which (bi)category is being talked about.

I tend to them use non-subscripted names when I do that, as that makes things harder to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer mixfix notation for _≅_ and _⇒_, and that is not possible unless you open the modules.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C.⇒ works just fine infix BTW.

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{-# OPTIONS --without-K --safe #-}


open import Categories.Bicategory
open import Categories.Bicategory.Monad

module Categories.Category.Construction.Bimodules.Properties
{o ℓ e t} {𝒞 : Bicategory o ℓ e t} {M₁ M₂ : Monad 𝒞} where

open import Agda.Primitive

import Categories.Category.Construction.Bimodules
open import Categories.Category

Bimodules : Category (o ⊔ ℓ ⊔ e) (ℓ ⊔ e) e
Bimodules = Categories.Category.Construction.Bimodules.Bimodules M₁ M₂

private
module Cat {o₁ ℓ₁ e₁} {C : Categories.Category.Category o₁ ℓ₁ e₁} where
open Categories.Category.Category C using (Obj; _⇒_) public
open import Categories.Morphism C using (IsIso; _≅_) public
open import Categories.Morphism.Reasoning.Iso C using (conjugate-from) public

open Cat


import Categories.Bicategory.Extras as Bicat
open Bicat 𝒞 using (hom; _⇒₂_; _≈_; _∘ᵥ_; _◁_; _▷_; _◁ᵢ_; _▷ᵢ_)

open import Categories.Bicategory.Monad.Bimodule {𝒞 = 𝒞}
open import Categories.Bicategory.Monad.Bimodule.Homomorphism {𝒞 = 𝒞}

module Bimodulehom-isIso {B₁ B₂ : Obj {C = Bimodules}} (f : _⇒_ {C = Bimodules} B₁ B₂) where
open Monad using (C; T)
open Bimodule using (F; actionˡ; actionʳ)
open Bimodulehomomorphism f using (α; linearˡ; linearʳ)

αisIso⇒fisIso : IsIso {C = hom (C M₁) (C M₂)} α → IsIso {C = Bimodules} f
αisIso⇒fisIso αisIso = record
{ inv = record
{ α = α⁻¹
; linearˡ = linearˡ⁻¹
; linearʳ = linearʳ⁻¹
}
; iso = record
{ isoˡ = IsIso.isoˡ αisIso
; isoʳ = IsIso.isoʳ αisIso
}
}
where
open hom.HomReasoning

α⁻¹ : F B₂ ⇒₂ F B₁
α⁻¹ = IsIso.inv αisIso

αIso : F B₁ ≅ F B₂
αIso = record
{ from = α
; to = α⁻¹
; iso = IsIso.iso αisIso
}

linearˡ⁻¹ : actionˡ B₁ ∘ᵥ α⁻¹ ◁ T M₁ ≈ α⁻¹ ∘ᵥ actionˡ B₂
linearˡ⁻¹ = ⟺ (conjugate-from (αIso ◁ᵢ T M₁) αIso linearˡ)

linearʳ⁻¹ : actionʳ B₁ ∘ᵥ T M₂ ▷ α⁻¹ ≈ α⁻¹ ∘ᵥ actionʳ B₂
linearʳ⁻¹ = ⟺ (conjugate-from (T M₂ ▷ᵢ αIso) αIso linearʳ)

αisIso⇒Iso : IsIso {C = hom (C M₁) (C M₂)} α → B₁ ≅ B₂
αisIso⇒Iso αisIso = record
{ from = f
; to = IsIso.inv (αisIso⇒fisIso αisIso)
; iso = IsIso.iso (αisIso⇒fisIso αisIso)
}
Loading