Skip to content

Commit fc39d3b

Browse files
committed
feat(Algebra/Category): ConcreteCategory instance for Semigrp (#21368)
Very straightforward, essentially copypasting the design of `MonCat` back onto `MagmaCat` and `Semigrp`. We can probably do without this amount of `dsimp` lemmas, they should all be pretty easy to prove from generic `ConcreteCategory` results, but it doesn't hurt to have them in any case.
1 parent 7bb9660 commit fc39d3b

File tree

3 files changed

+322
-104
lines changed

3 files changed

+322
-104
lines changed

Mathlib/Algebra/Category/MonCat/Adjunctions.lean

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,23 @@ namespace MonCat
3232
@[to_additive (attr := simps) "The functor of adjoining a neutral element `zero` to a semigroup"]
3333
def adjoinOne : Semigrp.{u} ⥤ MonCat.{u} where
3434
obj S := MonCat.of (WithOne S)
35-
map f := ofHom (WithOne.map f)
35+
map f := ofHom (WithOne.map f.hom)
3636
map_id _ := MonCat.hom_ext WithOne.map_id
3737
map_comp _ _ := MonCat.hom_ext (WithOne.map_comp _ _)
3838

3939
@[to_additive]
4040
instance hasForgetToSemigroup : HasForget₂ MonCat Semigrp where
4141
forget₂ :=
4242
{ obj := fun M => Semigrp.of M
43-
map f := f.hom.toMulHom }
43+
map f := Semigrp.ofHom f.hom.toMulHom }
4444

4545
/-- The `adjoinOne`-forgetful adjunction from `Semigrp` to `MonCat`. -/
4646
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigrp` to `AddMonCat`"]
4747
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} Semigrp.{u} :=
4848
Adjunction.mkOfHomEquiv
49-
{ homEquiv := fun _ _ => ConcreteCategory.homEquiv.trans WithOne.lift.symm
49+
{ homEquiv X Y :=
50+
ConcreteCategory.homEquiv.trans (WithOne.lift.symm.trans
51+
(ConcreteCategory.homEquiv (X := X) (Y := (forget₂ _ _).obj Y)).symm)
5052
homEquiv_naturality_left_symm := by
5153
intros
5254
ext ⟨_|_⟩ <;> simp <;> rfl }

0 commit comments

Comments
 (0)