x feat(Algebra): generalize ModuleCat to Semiring#30636
x feat(Algebra): generalize ModuleCat to Semiring#30636alreadydone wants to merge 1 commit intoleanprover-community:masterfrom
Conversation
PR summary 6b1d0f08cbImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
| /-- the underlying type of an object in `ModuleCat R` -/ | ||
| carrier : Type v | ||
| [isAddCommGroup : AddCommGroup carrier] | ||
| [isAddCommMonoid : AddCommMonoid carrier] |
There was a problem hiding this comment.
In case R is a ring, this does not change the category of modules up to an equivalence, but if M : ModuleCat R and m : M, we would no longer be able to write an equality such as m - m = 0. This seems to be an excessively radical change to me. Here, we may relax the Ring assumption as Semiring, but if would want modules over semirings without neg, I think you need to define a separate category.
There was a problem hiding this comment.
I added the instance (M : ModuleCat R) : AddCommGroup M := Module.addCommMonoidToAddCommGroup R below so m - m = 0 still works, but this causes defeq issues which can be hard to fix. I think @plp127 would be interested to see the fallout since he suggested this approach in #28826 (comment). For a while I thought this might result in less code change than #30624, but apparently not. I now have a better approach in #30638 so I'm closing this.
... so that ModuleCat only contains the AddCommMonoid data, not AddCommGroup. Consequently, the forgetful functor to AddCommGrpCat creates the
negandzsmulfields of AddCommGroup that may not agree with a preexisting instance.