feat(CategoryTheory/Monoidal): MulAction induced by a ModObj#38336
feat(CategoryTheory/Monoidal): MulAction induced by a ModObj#38336chrisflav wants to merge 10 commits intoleanprover-community:masterfrom
MulAction induced by a ModObj#38336Conversation
PR summary ea11ccc0c5Import changes exceeding 2%
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.CategoryTheory.Monoidal.Cartesian.Mod | 663 | 719 | +56 (+8.45%) |
Import changes for all files
| Files | Import difference |
|---|---|
Mathlib.CategoryTheory.Monoidal.Cartesian.Mod_ Mathlib.CategoryTheory.Monoidal.Cartesian.Mod |
56 |
Declarations diff
+ IsModHom.map_smul
+ IsModHom.mulActionHom
+ ModObj.comp_smul
+ instance (Y : C) : SMul (Y ⟶ M) (Y ⟶ X)
+ isIso_leftSMul_iff
+ leftSMul
+ leftSMul_fst
+ leftSMul_snd
+ liftEquiv
+ lift_leftSMul
+ lift_leftSMul_eq_lift_iff
+ mulAction
+ mul_smul_self
+ mul_smul_self_flip
+ ofIso
+ one_smul_self
You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.
No changes to strong technical debt.
No changes to weak technical debt.
| variable {C : Type*} [Category* C] [CartesianMonoidalCategory C] | ||
|
|
||
| /-- An additive action of an additive monoid object `M` on an object `X` | ||
| in a cartesian monoidal category. -/ | ||
| @[ext] | ||
| class AddActionObj (M : C) [AddMonObj M] (X : C) where | ||
| /-- The additive action morphism. -/ | ||
| vadd : M ⊗ X ⟶ X | ||
| /-- Acting by the zero element is the identity. -/ | ||
| zero_vadd (M X) : ζ ▷ X ≫ vadd = (λ_ X).hom := by cat_disch | ||
| /-- The action is compatible with addition. -/ | ||
| add_vadd (M X) : (σ ▷ X) ≫ vadd = (α_ _ _ _).hom ≫ (M ◁ vadd) ≫ vadd := by cat_disch | ||
|
|
||
| /-- A multiplicative action of a monoid object `M` on an object `X` | ||
| in a cartesian monoidal category. -/ | ||
| @[to_additive (attr := ext)] | ||
| class MulActionObj (M : C) [MonObj M] (X : C) where | ||
| /-- The scalar multiplication morphism. -/ | ||
| smul : M ⊗ X ⟶ X | ||
| /-- Acting by the unit element is the identity. -/ | ||
| one_smul (M X) : η ▷ X ≫ smul = (λ_ X).hom := by cat_disch | ||
| /-- The action is compatible with multiplication. -/ | ||
| mul_smul (M X) : (μ ▷ X) ≫ smul = (α_ _ _ _).hom ≫ (M ◁ smul) ≫ smul := by cat_disch |
There was a problem hiding this comment.
We already have something more general in Mathlib/CategoryTheory/Monoidal/Mod_.lean: this definition seems to be an instance of the notion of ModObj, which is the more general case where C is just monoidal (not necessarily cartesian monoidal) and acts on the left on a different category D. I think the results here that specializes to a cartesian monoidal category acting on itself should use ModObj instead. We might need a an additivization of them though.
There was a problem hiding this comment.
Oh, thanks! (This is very clearly not an area of mathlib I am familiar with).
As far as I can tell, the only thing from this PR that is not yet in mathlib is the bit about the induced MulAction on Hom types. Is this correct? Is it in the correct generality (after replacing everything with ModObj)?
There was a problem hiding this comment.
Well we still need to to_additivize the module objects AddModObj and the IsMod_Hom (this name should be changed...).
I can see a few things here that we don’t have: I don’t think we have transport of structure along isomorphisms for ModObj (this is true in the generality of ModObj for sure). Also a slight difference I can see is that for ModObj the regular action of M on itself is not a global instance (I can’t exactly remember if there is a reason for this...)
The SMul on hom-types "as is" requires a cartesian monoidal category acting on itself I would say: you want to use lift in the definition, and having both Y ⟶ M Y ⟶ X well-defined requires everything to be in the same category (but maybe I’m missing some general setup... I’ll think about it, but I think for now it’s probably safe to go with this and to avoid attempting too much generalization of this part.)
There was a problem hiding this comment.
Thanks, I will update this PR along these lines.
There was a problem hiding this comment.
I have now updated this PR (hopefully) following your suggestions.
|
This PR/issue depends on:
|
|
This pull request has conflicts, please merge |
MulAction induced by a ModObj
| set_option linter.existingAttributeWarning false in | ||
| attribute [to_additive existing] ModObj.one_smul_assoc ModObj.mul_smul_assoc |
There was a problem hiding this comment.
Changing this and line 67 to
attribute [to_additive existing (attr := simp, reassoc)] ModObj.mul_smul ModObj.one_smul
attribute [to_additive existing (attr := simp)] ModObj.one_smul_assoc ModObj.mul_smul_assocachieves what you want to do without the warning, I think
There was a problem hiding this comment.
But I don't understand why the previous line doesn't do the same thing as these two lines
There was a problem hiding this comment.
This is fixed in #38994 (see also #38336 (comment), where I asked Jovan a similar question). With that fix, these two lines can just be removed again and line 67 can stay as is.
I think it is slightly nicer to have the set_option version as is for now as a reminder that it should be cleaned up when #38994 lands, but if you prefer your version in the meantime I am happy to change it.
Co-authored-by: Dagur Asgeirsson <dagurtomas@gmail.com>
We define the
MulActionon hom types induced by a monoid objectMaction onXin a cartesian monoidal category.Mod_toMod#38342Given that
Mathlib.CategoryTheory.Monoidal.Cartesian.Mod, I think the import increase is fine.