Skip to content

Commit

Permalink
Move dagger for daggerunctors to a where clause
Browse files Browse the repository at this point in the history
  • Loading branch information
Taneb committed May 29, 2024
1 parent 23306c7 commit 9988022
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/Categories/Category/Dagger/Construction/DaggerFunctors.agda
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ DaggerFunctors : (C : DaggerCategory o ℓ e) (D : DaggerCategory o′ ℓ′ e
DaggerFunctors C D = record
{ C = cat.DaggerFunctors C D
; hasDagger = record
{ _† = λ {F} {G} α
let
module F = DaggerFunctor F
module G = DaggerFunctor G
module α = NaturalTransformation α
-- We avoid using ntHelper here to preserve α's distinct commute and
-- sym-commute in case they have been defined explicitly.
in record
{ _† = λ {F} {G} α dagger F G α
; †-identity = †-identity
; †-homomorphism = †-homomorphism
; †-resp-≈ = λ α≈β †-resp-≈ α≈β
; †-involutive = λ α †-involutive (NaturalTransformation.η α _)
}
}
where
open DaggerCategory C using () renaming (_† to _‡)
open DaggerCategory D hiding (C)
open HomReasoning

dagger : (F G : DaggerFunctor C D)
NaturalTransformation (DaggerFunctor.functor F) (DaggerFunctor.functor G)
NaturalTransformation (DaggerFunctor.functor G) (DaggerFunctor.functor F)
dagger F G α = record
{ η = λ X α.η X †
; commute = λ {X Y} f begin
α.η Y † ∘ G.₁ f ≈˘⟨ †-involutive _ ⟩
Expand All @@ -51,13 +59,7 @@ DaggerFunctors C D = record
(α.η Y † ∘ G.₁ f) † † ≈⟨ †-involutive _ ⟩
α.η Y † ∘ G.₁ f ∎
}
; †-identity = †-identity
; †-homomorphism = †-homomorphism
; †-resp-≈ = λ α≈β †-resp-≈ α≈β
; †-involutive = λ α †-involutive (NaturalTransformation.η α _)
}
}
where
open DaggerCategory C using () renaming (_† to _‡)
open DaggerCategory D hiding (C)
open HomReasoning
where
module F = DaggerFunctor F
module G = DaggerFunctor G
module α = NaturalTransformation α

0 comments on commit 9988022

Please sign in to comment.