Skip to content

Commit ff2098d

Browse files
committed
chore: flip Algebra-on.ν-mult
This makes it more consistent with ν-unit.
1 parent 7bd66d6 commit ff2098d

File tree

12 files changed

+35
-35
lines changed

12 files changed

+35
-35
lines changed

src/Algebra/Group/Cat/Monadic.lagda.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,24 @@ is indeed a group structure, which is an incredibly boring calculation.
9292
assoc : ∀ x y z → mult x (mult y z) ≡ mult (mult x y) z
9393
assoc x y z = sym $
9494
ν (inc (ν (inc x ◆ inc y)) ◆ inc z) ≡⟨ (λ i → ν (inc (ν (inc x ◆ inc y)) ◆ inc (ν-unit (~ i) z))) ⟩
95-
ν (inc (ν (inc x ◆ inc y)) ◆ inc (ν (inc z))) ≡⟨ happly ν-mult (inc _ ◆ inc _) ⟩
95+
ν (inc (ν (inc x ◆ inc y)) ◆ inc (ν (inc z))) ≡˘⟨ happly ν-mult (inc _ ◆ inc _) ⟩
9696
ν (T.mult.η G (inc (inc x ◆ inc y) ◆ inc (inc z))) ≡˘⟨ ap ν (f-assoc _ _ _) ⟩
97-
ν (T.mult.η G (inc (inc x) ◆ inc (inc y ◆ inc z))) ≡˘⟨ happly ν-mult (inc _ ◆ inc _) ⟩
97+
ν (T.mult.η G (inc (inc x) ◆ inc (inc y ◆ inc z))) ≡⟨ happly ν-mult (inc _ ◆ inc _) ⟩
9898
ν (inc (ν (inc x)) ◆ inc (ν (inc y ◆ inc z))) ≡⟨ (λ i → ν (inc (ν-unit i x) ◆ inc (ν (inc y ◆ inc z)))) ⟩
9999
ν (inc x ◆ inc (ν (inc y ◆ inc z))) ∎
100100
101101
invl : ∀ x → mult (ν (inv (inc x))) x ≡ ν nil
102102
invl x =
103103
ν (inc (ν (inv (inc x))) ◆ inc x) ≡⟨ (λ i → ν (inc (ν (inv (inc x))) ◆ inc (ν-unit (~ i) x))) ⟩
104-
ν (inc (ν (inv (inc x))) ◆ inc (ν (inc x))) ≡⟨ happly ν-mult (inc _ ◆ inc _) ⟩
104+
ν (inc (ν (inv (inc x))) ◆ inc (ν (inc x))) ≡˘⟨ happly ν-mult (inc _ ◆ inc _) ⟩
105105
ν (T.mult.η G (inc (inv (inc x)) ◆ inc (inc x))) ≡⟨ ap ν (f-invl _) ⟩
106106
ν (T.mult.η G (inc nil)) ≡⟨⟩
107107
ν nil ∎
108108
109109
idl' : ∀ x → mult (ν nil) x ≡ x
110110
idl' x =
111111
ν (inc (ν nil) ◆ inc x) ≡⟨ (λ i → ν (inc (ν nil) ◆ inc (ν-unit (~ i) x))) ⟩
112-
ν (inc (ν nil) ◆ inc (ν (inc x))) ≡⟨ happly ν-mult (inc _ ◆ inc _) ⟩
112+
ν (inc (ν nil) ◆ inc (ν (inc x))) ≡˘⟨ happly ν-mult (inc _ ◆ inc _) ⟩
113113
ν (T.mult.η G (nil ◆ inc (inc x))) ≡⟨ ap ν (f-idl _) ⟩
114114
ν (inc x) ≡⟨ happly ν-unit x ⟩
115115
x ∎
@@ -174,14 +174,14 @@ but the other direction is by induction on "words".
174174
module G = Group-on grp
175175
176176
alg-gh : is-group-hom (Free-Group ⌞ x ⌟ .snd) grp (x .snd .ν)
177-
alg-gh .is-group-hom.pres-⋆ x y = sym (happly (alg .ν-mult) (inc _ ◆ inc _))
177+
alg-gh .is-group-hom.pres-⋆ x y = happly (alg .ν-mult) (inc _ ◆ inc _)
178178
179179
go : rec .fst ≡ x .snd .ν
180180
go = funext $ Free-elim-prop _ (λ _ → hlevel 1)
181181
(λ x → sym (happly (alg .ν-unit) x))
182182
(λ x p y q → rec .snd .is-group-hom.pres-⋆ x y
183183
∙∙ ap₂ G._⋆_ p q
184-
∙∙ happly (alg .ν-mult) (inc _ ◆ inc _))
184+
∙∙ sym (happly (alg .ν-mult) (inc _ ◆ inc _)))
185185
(λ x p → is-group-hom.pres-inv (rec .snd) {x = x}
186186
∙∙ ap G.inverse p
187187
∙∙ sym (is-group-hom.pres-inv alg-gh {x = x}))

src/Algebra/Monoid/Category.lagda.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,19 @@ these data assembles into a monoid:
295295
{ has-is-magma = record { has-is-set = A .is-tr }
296296
; associative = λ {x} {y} {z} →
297297
alg .ν (⌜ x ⌝ ∷ alg .ν (y ∷ z ∷ []) ∷ []) ≡˘⟨ ap¡ (happly (alg .ν-unit) x) ⟩
298-
alg .ν (alg .ν (x ∷ []) ∷ alg .ν (y ∷ z ∷ []) ∷ []) ≡⟨ happly (alg .ν-mult) _ ⟩
299-
alg .ν (x ∷ y ∷ z ∷ []) ≡˘⟨ happly (alg .ν-mult) _ ⟩
298+
alg .ν (alg .ν (x ∷ []) ∷ alg .ν (y ∷ z ∷ []) ∷ []) ≡˘⟨ happly (alg .ν-mult) _ ⟩
299+
alg .ν (x ∷ y ∷ z ∷ []) ≡⟨ happly (alg .ν-mult) _ ⟩
300300
alg .ν (alg .ν (x ∷ y ∷ []) ∷ ⌜ alg .ν (z ∷ []) ⌝ ∷ []) ≡⟨ ap! (happly (alg .ν-unit) z) ⟩
301301
alg .ν (alg .ν (x ∷ y ∷ []) ∷ z ∷ []) ∎
302302
}
303303
has-is-m .idl {x} =
304304
alg .ν (alg .ν [] ∷ ⌜ x ⌝ ∷ []) ≡˘⟨ ap¡ (happly (alg .ν-unit) x) ⟩
305-
alg .ν (alg .ν [] ∷ alg .ν (x ∷ []) ∷ []) ≡⟨ happly (alg .ν-mult) _ ⟩
305+
alg .ν (alg .ν [] ∷ alg .ν (x ∷ []) ∷ []) ≡˘⟨ happly (alg .ν-mult) _ ⟩
306306
alg .ν (x ∷ []) ≡⟨ happly (alg .ν-unit) x ⟩
307307
x ∎
308308
has-is-m .idr {x} =
309309
alg .ν (⌜ x ⌝ ∷ alg .ν [] ∷ []) ≡˘⟨ ap¡ (happly (alg .ν-unit) x) ⟩
310-
alg .ν (alg .ν (x ∷ []) ∷ alg .ν [] ∷ []) ≡⟨ happly (alg .ν-mult) _ ⟩
310+
alg .ν (alg .ν (x ∷ []) ∷ alg .ν [] ∷ []) ≡˘⟨ happly (alg .ν-mult) _ ⟩
311311
alg .ν (x ∷ []) ≡⟨ happly (alg .ν-unit) x ⟩
312312
x ∎
313313
```
@@ -321,7 +321,7 @@ can show by induction on the list:
321321
recover [] = refl
322322
recover (x ∷ xs) =
323323
alg .ν (x ∷ fold _ xs ∷ []) ≡⟨ ap₂ (λ e f → alg .ν (e ∷ f ∷ [])) (sym (happly (alg .ν-unit) x)) (recover xs) ⟩
324-
alg .ν (alg .ν (x ∷ []) ∷ alg .ν xs ∷ []) ≡⟨ happly (alg .ν-mult) _ ⟩
324+
alg .ν (alg .ν (x ∷ []) ∷ alg .ν xs ∷ []) ≡˘⟨ happly (alg .ν-mult) _ ⟩
325325
alg .ν (x ∷ xs ++ []) ≡⟨ ap (alg .ν) (++-idr _) ⟩
326326
alg .ν (x ∷ xs) ∎
327327
```

src/Cat/Diagram/Monad.lagda.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ doesn't matter whether you first join then evaluate, or evaluate twice.
107107

108108
```agda
109109
ν-unit : ν C.∘ η ob ≡ C.id
110-
ν-mult : ν C.∘ M₁ ν ≡ ν C.∘ μ ob
110+
ν-mult : ν C.∘ μ ob ≡ ν C.∘ M₁ ν
111111
```
112112

113113
<!--
@@ -341,7 +341,7 @@ become those of the $M$-action.
341341
Free-EM : Functor C (Eilenberg-Moore M)
342342
Free-EM .F₀ A .fst = M₀ A
343343
Free-EM .F₀ A .snd .ν = μ A
344-
Free-EM .F₀ A .snd .ν-mult = μ-assoc
344+
Free-EM .F₀ A .snd .ν-mult = sym μ-assoc
345345
Free-EM .F₀ A .snd .ν-unit = μ-unitl
346346
```
347347

@@ -384,7 +384,7 @@ $\cC^M$.
384384
Free-EM⊣Forget-EM .unit =
385385
NT M.η M.unit.is-natural
386386
Free-EM⊣Forget-EM .counit =
387-
NT (λ x → ∫hom (x .snd .ν) (sym (x .snd .ν-mult)))
387+
NT (λ x → ∫hom (x .snd .ν) (x .snd .ν-mult))
388388
(λ x y f → ext (sym (f .snd)))
389389
Free-EM⊣Forget-EM .zig = ext μ-unitr
390390
Free-EM⊣Forget-EM .zag {x} = x .snd .ν-unit
@@ -457,7 +457,7 @@ Eilenberg-Moore category can be restricted to the Kleisli category.
457457
Free-Kleisli⊣Forget-Kleisli ._⊣_.unit ._=>_.η = η
458458
Free-Kleisli⊣Forget-Kleisli ._⊣_.unit .is-natural = unit.is-natural
459459
Free-Kleisli⊣Forget-Kleisli ._⊣_.counit ._=>_.η ((X , α) , free) =
460-
∫hom (α .ν) (sym (α .ν-mult))
460+
∫hom (α .ν) (α .ν-mult)
461461
Free-Kleisli⊣Forget-Kleisli ._⊣_.counit .is-natural _ _ f =
462462
ext (sym (f .snd))
463463
Free-Kleisli⊣Forget-Kleisli ._⊣_.zig = ext μ-unitr

src/Cat/Diagram/Monad/Action.lagda.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ module _
8989
c .fst alg → λ where
9090
.α → !constⁿ (alg .ν)
9191
.α-unit → ext λ _ → alg .ν-unit
92-
.α-mult → ext λ _ → sym (alg .ν-mult)
92+
.α-mult → ext λ _ → alg .ν-mult
9393
c .snd → is-iso→is-equiv λ where
9494
.is-iso.from act → λ where
9595
.ν → act .α .η tt
9696
.ν-unit → act .α-unit ηₚ tt
97-
.ν-mult → sym (act .α-mult ηₚ tt)
97+
.ν-mult → act .α-mult ηₚ tt
9898
.is-iso.rinv act → ext λ _ → refl
9999
.is-iso.linv alg → ext refl
100100
```
@@ -124,7 +124,7 @@ module _ {o ℓ} {C : Precategory o ℓ} {M : Functor C C} (Mᵐ : Monad-on M) w
124124
Forget-EM-action .α .η (_ , alg) = alg .ν
125125
Forget-EM-action .α .is-natural _ _ f = sym (f .snd)
126126
Forget-EM-action .α-unit = ext λ (_ , alg) → alg .ν-unit
127-
Forget-EM-action .α-mult = ext λ (_ , alg) → sym (alg .ν-mult)
127+
Forget-EM-action .α-mult = ext λ (_ , alg) → alg .ν-mult
128128
```
129129

130130
And, second, that this left $M$-action is universal in the sense that
@@ -144,7 +144,7 @@ functors $\cB \to \cC$.
144144
EM-universal {A = A} act .F₀ b .fst = A .F₀ b
145145
EM-universal {A = A} act .F₀ b .snd .ν = act .α .η b
146146
EM-universal {A = A} act .F₀ b .snd .ν-unit = act .α-unit ηₚ b
147-
EM-universal {A = A} act .F₀ b .snd .ν-mult = sym (act .α-mult ηₚ b)
147+
EM-universal {A = A} act .F₀ b .snd .ν-mult = act .α-mult ηₚ b
148148
EM-universal {A = A} act .F₁ f .fst = A .F₁ f
149149
EM-universal {A = A} act .F₁ f .snd = sym (act .α .is-natural _ _ f)
150150
EM-universal {A = A} act .F-id = ext (A .F-id)
@@ -156,7 +156,7 @@ functors $\cB \to \cC$.
156156
EM→Action A^M .α .η b = A^M .F₀ b .snd .ν
157157
EM→Action A^M .α .is-natural _ _ f = sym (A^M .F₁ f .snd)
158158
EM→Action A^M .α-unit = ext λ b → A^M .F₀ b .snd .ν-unit
159-
EM→Action A^M .α-mult = ext λ b → sym (A^M .F₀ b .snd .ν-mult)
159+
EM→Action A^M .α-mult = ext λ b → A^M .F₀ b .snd .ν-mult
160160
```
161161

162162
Note that the universal action itself is induced by the identity

src/Cat/Diagram/Monad/Extension.lagda.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ that we shall omit.
323323
(α.ν ∘ M₁ f) ∘ bind g ≡⟨ pullr (bind-naturall _ _) ⟩
324324
α.ν ∘ bind ⌜ M₁ f ∘ g ⌝ ≡⟨ ap! (insertl (bind-unit-∘ id)) ⟩
325325
α.ν ∘ bind (join ∘ unit ∘ M₁ f ∘ g) ≡⟨ pushr (sym (bind-∘ _ _)) ⟩
326-
(α.ν ∘ join) ∘ bind (unit ∘ M₁ f ∘ g) ≡⟨ pushl (sym $ α.ν-mult)
326+
(α.ν ∘ join) ∘ bind (unit ∘ M₁ f ∘ g) ≡⟨ pushl α.ν-mult ⟩
327327
α.ν ∘ M₁ α.ν ∘ bind (unit ∘ M₁ f ∘ g) ≡⟨ ap (α.ν ∘_) (bind-naturall _ _) ⟩
328328
α.ν ∘ bind ⌜ M₁ α.ν ∘ unit ∘ M₁ f ∘ g ⌝ ≡⟨ ap! (centralizel (sym $ unit-natural _)) ⟩
329329
α.ν ∘ bind (unit ∘ (α.ν ∘ M₁ f) ∘ g) ∎
@@ -350,10 +350,10 @@ The proofs of the monad algebra laws are mercifully short.
350350
```agda
351351
alg .ν-unit = α.ν-unit id
352352
alg .ν-mult =
353-
α.ν id ∘ M₁ (α.ν id) ≡⟨ α.ν-natural _ _
354-
α.ν (id ∘ α.ν id) ⟨ ap α.ν (idl _) ⟩
355-
α.ν (α.ν id) ≡˘⟨ α.ν-join id
356-
α.ν id ∘ join
353+
α.ν id ∘ join ≡⟨ α.ν-join id
354+
α.ν (α.ν id) ≡˘⟨ ap α.ν (idl _) ⟩
355+
α.ν (id ∘ α.ν id) ≡˘⟨ α.ν-natural _ _
356+
α.ν id ∘ M₁ (α.ν id)
357357
```
358358
359359
As expected, these two functions constitute an equivalence between monad

src/Cat/Functor/Adjoint/Monadic.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Comparison-EM .F₀ x = R.₀ x , alg where
7575
alg : Algebra-on R∘L (R.₀ x)
7676
alg .Algebra-on.ν = R.₁ (adj.counit.ε _)
7777
alg .Algebra-on.ν-unit = adj.zag
78-
alg .Algebra-on.ν-mult = R.weave (adj.counit.is-natural _ _ _)
78+
alg .Algebra-on.ν-mult = R.weave (sym $ adj.counit.is-natural _ _ _)
7979
```
8080

8181
<details>

src/Cat/Functor/Adjoint/Reflective.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ is.
194194
comp-seso (ob , alg) = F.₀ ob , isom where
195195
Fo→o : Algebra-hom (R∘L adj) (Comp.₀ (F.₀ ob)) (ob , alg)
196196
Fo→o .fst = alg .ν
197-
Fo→o .snd = sym (alg .ν-mult)
197+
Fo→o .snd = alg .ν-mult
198198
199199
o→Fo : Algebra-hom (R∘L adj) (ob , alg) (Comp.₀ (F.₀ ob))
200200
o→Fo .fst = unit.η _

src/Cat/Functor/Algebra.lagda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ the algebraically free monad via extension along $\mathrm{fold}$.
458458
lift-alg {a = a} α .ν = fold α
459459
lift-alg {a = a} α .ν-unit = zag
460460
lift-alg {a = a} α .ν-mult =
461-
ap fst $ counit.is-natural (Free.₀ a) (a , α) (counit.ε (a , α))
461+
ap fst $ sym $ counit.is-natural (Free.₀ a) (a , α) (counit.ε (a , α))
462462
```
463463

464464
Likewise, we can extract an $F$-algebra out of a monad algebra by
@@ -500,7 +500,7 @@ clear, but proving it involves quite a bit of algebra.
500500
alg* {a = a} α .snd =
501501
α .ν ∘ roll a ≡⟨ intror (F.annihilate zag) ⟩
502502
(α .ν ∘ roll a) ∘ (F.₁ (mult a) ∘ F.₁ (unit.η _)) ≡⟨ pull-inner (sym $ fold-roll (roll a)) ⟩
503-
α .ν ∘ (mult a ∘ roll (F* a)) ∘ F.₁ (unit.η _) ≡⟨ dispersel (sym $ α .ν-mult) ⟩
503+
α .ν ∘ (mult a ∘ roll (F* a)) ∘ F.₁ (unit.η _) ≡⟨ dispersel (α .ν-mult) ⟩
504504
α .ν ∘ Free.₁ (α .ν) .fst ∘ roll (F* a) ∘ F.₁ (unit.η _) ≡⟨ extend-inner (map*-roll (α .ν)) ⟩
505505
α .ν ∘ roll a ∘ F.₁ (map* (α .ν)) ∘ F.₁ (unit.η _) ≡⟨ centralizer (F.weave (sym (unit.is-natural _ _ _))) ⟩
506506
α .ν ∘ (roll a ∘ F.₁ (unit.η _)) ∘ F.₁ (α .ν) ≡⟨ assoc _ _ _ ⟩

src/Cat/Functor/Monadic/Beck.lagda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ proof, and any adjunction presenting $T$ will do.
141141
open is-coequaliser
142142
algebra-is-coequaliser
143143
: is-coequaliser C^T {A = TTA} {B = TA} {E = Aalg}
144-
mult fold (∫hom A.ν (sym A.ν-mult))
144+
mult fold (∫hom A.ν A.ν-mult)
145145
algebra-is-coequaliser .coequal = ext $
146-
A.ν C.∘ T.mult .η _ ≡˘⟨ A.ν-mult ⟩
146+
A.ν C.∘ T.mult .η _ ≡⟨ A.ν-mult ⟩
147147
A.ν C.∘ T.M₁ A.ν ∎
148148
```
149149

src/Cat/Functor/Monadic/Crude.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ we're seeking.
183183
η⁻¹η : adj.unit.η _ .fst C.∘ η⁻¹ ≡ C.id
184184
ηη⁻¹ : η⁻¹ C.∘ adj.unit.η _ .fst ≡ C.id
185185
186-
η⁻¹ = preserved .universal {e' = o .snd .ν} (o .snd .ν-mult)
186+
η⁻¹ = preserved .universal {e' = o .snd .ν} (sym (o .snd .ν-mult))
187187
188188
η⁻¹η = is-coequaliser.unique₂ preserved
189189
{e' = U.₁ (has-coeq o .coeq)}

src/Cat/Instances/Algebras/Kan.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ property and some tedious computations.
130130
eq = ext λ j →
131131
eps .η j C.∘ Ext-action .α .η (p.₀ j) C.∘ M.M₁ (Ext-action .α .η (p.₀ j)) ≡⟨ C.extendl (σ-comm ηₚ j) ⟩
132132
G.₀ j .snd .ν C.∘ M.M₁ (eps .η j) C.∘ M.M₁ (Ext-action .α .η (p.₀ j)) ≡⟨ C.refl⟩∘⟨ MR.weave (σ-comm ηₚ j) ⟩
133-
G.₀ j .snd .ν C.∘ M.M₁ (G.₀ j .snd .ν) C.∘ M.M₁ (M.M₁ (eps .η j)) ≡⟨ C.extendl (G.₀ j .snd .ν-mult) ⟩
133+
G.₀ j .snd .ν C.∘ M.M₁ (G.₀ j .snd .ν) C.∘ M.M₁ (M.M₁ (eps .η j)) ≡˘⟨ C.extendl (G.₀ j .snd .ν-mult) ⟩
134134
G.₀ j .snd .ν C.∘ M.μ (G.₀ j .fst) C.∘ M.M₁ (M.M₁ (eps .η j)) ≡⟨ C.refl⟩∘⟨ M.mult .is-natural _ _ _ ⟩
135135
G.₀ j .snd .ν C.∘ M.M₁ (eps .η j) C.∘ M.μ (Ext.₀ (p.₀ j)) ≡˘⟨ C.extendl (σ-comm ηₚ j) ⟩
136136
eps .η j C.∘ Ext-action .α .η (p.₀ j) C.∘ M.μ (Ext.₀ (p.₀ j)) ∎

src/Cat/Instances/Algebras/Limits.lagda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ more complicated.
202202
apex-algebra .ν-mult = lim-over.unique₂ _
203203
(λ f → C.pulll $ C.pulll (F.₁ f .snd)
204204
∙ C.pullr (sym (M.M-∘ _ _) ∙ ap M.M₁ (lim-over.commutes f)))
205+
(λ j → C.pulll (lim-over.factors _ _))
205206
(λ j → C.pulll (lim-over.factors _ _)
206207
∙∙ C.pullr (sym (M.M-∘ _ _) ∙ ap M.M₁ (lim-over.factors _ _) ∙ M.M-∘ _ _)
207-
∙∙ C.extendl (FAlg.ν-mult j)
208+
∙∙ C.extendl (sym (FAlg.ν-mult j))
208209
∙∙ ap (FAlg.ν j C.∘_) (M.mult.is-natural _ _ _)
209210
∙∙ C.assoc _ _ _)
210-
(λ j → C.pulll (lim-over.factors _ _))
211211
```
212212
213213
</details>

0 commit comments

Comments
 (0)