Commit 2025-01-30 07:11 132efc70

View on Github →

feat(Algebra/Category): concrete category refactor for Grp (#21192) This is a step towards a concrete category redesign, as outlined in this Zulip post: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign/near/493903980 This PR updates the concrete category definitions of Grp, AddGrp, CommGrp and AddCommGrp to match the standard set by AlgebraCat, ModuleCat and RingCat:

  • Package objects and homs into structures.
  • Replace HasForget with ConcreteCategory.
  • Set up a good @[simp] set.
  • Ensure constructors and projections are reducible. See MathlibTest/CategoryTheory/ConcreteCategory/Grp.lean for the specification of all the new functionality. In particular, we can drop coe_of from the @[simp] set, which means we can re-enable some @[simps] attributes downstream. (I did the ones I came across, but we'd need to go through the library more carefully to get them all.) Overall I think we get a good cleanup, even if there are a handful of places where we have to fight more against the HasForget/ConcreteCategory non-reducible defeq. Those should go away as HasForget is obsoleted further. I have not tried to look for code that can be cleaned up now, only at what broke. I want to get started on cleanup when the other concrete category instances are in.

Estimated changes

added structure AddCommGrp.Hom
deleted theorem AddCommGrp.asHom_apply
added structure AddCommGrp
added structure AddGrp.Hom
added structure AddGrp
added structure CommGrp.Hom
deleted theorem CommGrp.coe_comp'
deleted theorem CommGrp.coe_id'
modified theorem CommGrp.coe_of
added theorem CommGrp.comp_apply
modified theorem CommGrp.comp_def
added theorem CommGrp.hom_comp
added theorem CommGrp.hom_ext
added theorem CommGrp.hom_id
added theorem CommGrp.hom_inv_apply
added theorem CommGrp.hom_ofHom
added theorem CommGrp.id_apply
added theorem CommGrp.inv_hom_apply
deleted def CommGrp.of
deleted def CommGrp.ofHom
modified theorem CommGrp.ofHom_apply
added theorem CommGrp.ofHom_comp
added theorem CommGrp.ofHom_hom
added theorem CommGrp.ofHom_id
added structure CommGrp
deleted def CommGrp
added structure Grp.Hom
deleted theorem Grp.coe_comp'
deleted theorem Grp.coe_id'
added theorem Grp.comp_apply
modified theorem Grp.comp_def
added theorem Grp.hom_comp
added theorem Grp.hom_ext
added theorem Grp.hom_id
added theorem Grp.hom_inv_apply
added theorem Grp.hom_ofHom
added theorem Grp.id_apply
added theorem Grp.inv_hom_apply
deleted def Grp.of
deleted def Grp.ofHom
modified theorem Grp.ofHom_apply
added theorem Grp.ofHom_comp
added theorem Grp.ofHom_hom
added theorem Grp.ofHom_id
added structure Grp
deleted def Grp
modified theorem MonoidHom.comp_id_commGrp
modified theorem MonoidHom.comp_id_grp
modified theorem MonoidHom.id_commGrp_comp
modified theorem MonoidHom.id_grp_comp