Skip to content

feat(CategoryTheory/Monoidal): MulAction induced by a ModObj#38336

Open
chrisflav wants to merge 10 commits intoleanprover-community:masterfrom
chrisflav:mulactionobj
Open

feat(CategoryTheory/Monoidal): MulAction induced by a ModObj#38336
chrisflav wants to merge 10 commits intoleanprover-community:masterfrom
chrisflav:mulactionobj

Conversation

@chrisflav
Copy link
Copy Markdown
Member

@chrisflav chrisflav commented Apr 21, 2026

We define the MulAction on hom types induced by a monoid object M action on X in a cartesian monoidal category.


Given that Mathlib.CategoryTheory.Monoidal.Cartesian.Mod, I think the import increase is fine.

Open in Gitpod

@chrisflav chrisflav added the t-category-theory Category theory label Apr 21, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

PR summary ea11ccc0c5

Import changes exceeding 2%

% File
+8.45% Mathlib.CategoryTheory.Monoidal.Cartesian.Mod

Import changes for modified files

Dependency changes

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.

Comment thread Mathlib/CategoryTheory/Monoidal/Cartesian/MulAction.lean Outdated
Comment on lines +30 to +52
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will update this PR along these lines.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have now updated this PR (hopefully) following your suggestions.

@robin-carlier robin-carlier added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 21, 2026
@chrisflav chrisflav added the WIP Work in progress label Apr 21, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels Apr 21, 2026
@mathlib-dependent-issues
Copy link
Copy Markdown

This PR/issue depends on:

@mathlib-merge-conflicts
Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 6, 2026
@chrisflav chrisflav added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed WIP Work in progress awaiting-author A reviewer has asked the author a question or requested changes. labels May 6, 2026
@github-actions github-actions Bot added large-import Automatically added label for PRs with a significant increase in transitive imports and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels May 6, 2026
@chrisflav chrisflav changed the title feat(CategoryTheory/Monoidal): actions by monoid objects feat(CategoryTheory/Monoidal): MulAction induced by a ModObj May 6, 2026
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label May 6, 2026
Comment on lines +69 to +70
set_option linter.existingAttributeWarning false in
attribute [to_additive existing] ModObj.one_smul_assoc ModObj.mul_smul_assoc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_assoc

achieves what you want to do without the warning, I think

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I don't understand why the previous line doesn't do the same thing as these two lines

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Mathlib/CategoryTheory/Monoidal/Cartesian/Mod.lean Outdated
@dagurtomas dagurtomas added the awaiting-author A reviewer has asked the author a question or requested changes. label May 7, 2026
Co-authored-by: Dagur Asgeirsson <dagurtomas@gmail.com>
@chrisflav chrisflav removed the awaiting-author A reviewer has asked the author a question or requested changes. label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-import Automatically added label for PRs with a significant increase in transitive imports t-category-theory Category theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants