Skip to content

feat(RingTheory/MvPowerSeries): introduce rename#33188

Open
BryceT233 wants to merge 145 commits intoleanprover-community:masterfrom
BryceT233:master
Open

feat(RingTheory/MvPowerSeries): introduce rename#33188
BryceT233 wants to merge 145 commits intoleanprover-community:masterfrom
BryceT233:master

Conversation

@BryceT233
Copy link
Contributor

@BryceT233 BryceT233 commented Dec 22, 2025

This file establishes the rename operation on multivariate power series under a map with finite fibers,
which modifies the set of variables.

This file is patterned after 'Mathlib/Algebra/MvPolynomial/Rename.lean`


Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Dec 22, 2025
@github-actions
Copy link

github-actions bot commented Dec 22, 2025

PR summary c287e212ea

Import changes exceeding 2%

% File
+4.58% Mathlib.Data.Finsupp.Antidiagonal

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Data.Finsupp.Antidiagonal 699 731 +32 (+4.58%)
Import changes for all files
Files Import difference
Mathlib.Data.Finsupp.Antidiagonal 32
Mathlib.Order.Filter.TendstoCofinite (new file) 910
Mathlib.RingTheory.MvPowerSeries.Rename (new file) 1124

Declarations diff

+ Finsupp.mapDomain_tendstoCofinite
+ TendstoCofinite
+ TendstoCofinite.finite_preimage
+ TendstoCofinite.finite_preimage_singleton
+ coeff_embDomain_rename
+ coeff_killCompl
+ coeff_killComplFun
+ coeff_rename
+ coeff_renameFun
+ coeff_rename_eq_zero
+ comp
+ constantCoeff_rename
+ degree_comapDomain_le_of_canonicallyOrderedAdd
+ degree_mapDomain_eq_of_subsingletonAddUnits
+ embDomain_refl
+ embDomain_trans_apply
+ embedding
+ equiv
+ id
+ image_prodMap_embDomain_antidiagonal
+ isLowerSet_range_embDomain
+ killCompl
+ killComplFun
+ killComplFun_monomial_embDomain
+ killComplFun_monomial_eq_zero
+ killComplFun_mul
+ killCompl_C
+ killCompl_X
+ killCompl_X_eq_zero
+ killCompl_comp_rename
+ killCompl_map
+ killCompl_monomial_embDomain
+ killCompl_monomial_eq_zero
+ killCompl_rename_app
+ mapDomain
+ mapDomain_add
+ mapDomain_apply_eq_sum
+ mapDomain_apply_eq_zero_iff_of_subsingletonAddUnits
+ mapDomain_eq_zero
+ mapDomain_smul
+ mapDomain_support_of_subsingletonAddUnits
+ mem_range_embDomain_iff
+ rename
+ renameEquiv
+ renameEquiv_refl
+ renameEquiv_symm
+ renameEquiv_trans
+ renameFun
+ renameFunAux
+ renameFunAux'
+ renameFunAuxImage
+ renameFun_monomial
+ renameFun_mul
+ rename_C
+ rename_X
+ rename_coe
+ rename_comp_rename
+ rename_id
+ rename_id_apply
+ rename_injective
+ rename_map
+ rename_monomial
+ rename_rename
+ tendstoCofinite_iff_finite_preimage_singleton
+ tendstoCofinite_of_finite
+ tendstoCofinite_of_injective

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-ring-theory Ring theory label Dec 22, 2025
@erdOne erdOne added the awaiting-author A reviewer has asked the author a question or requested changes. label Dec 27, 2025
@BryceT233 BryceT233 requested a review from erdOne December 29, 2025 01:55
@BryceT233 BryceT233 changed the title feat(RingTheory/MvPowerSeries): introduce rename feat(RingTheory/MvPowerSeries): introduce rename Mar 8, 2026
(x : α →₀ M) {a : α} : (x.mapDomain f) (f a) = ∑ i ∈ x.support with f i = f a, x i := by
simp [mapDomain, sum, single_apply, Finset.sum_ite]

theorem mapDomain_apply_eq_zero_iff [AddCommMonoid M] (f : α → β) [Subsingleton (AddUnits M)]
Copy link
Member

Choose a reason for hiding this comment

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

I think consistency is a good think, so let's add it to mapDomain_apply_eq_zero_iff.

@BryceT233
Copy link
Contributor Author

BryceT233 commented Mar 10, 2026

I've updated the files as suggested. Also, since this PR generalizes your previous work and ideas, I thought it was only appropriate to add your name to the authors list for the files.

Copy link
Member

@riccardobrasca riccardobrasca left a comment

Choose a reason for hiding this comment

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

Sorry for the very long time I took to make this review and thanks a lot! A couple of cosmetic comments and then it is ready to go.

bors d+


section CommSemiring

variable [CommSemiring R] [CommSemiring S]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
variable [CommSemiring R] [CommSemiring S]
variable [Semiring R] [Semiring S]

The very beginning works in this generality, why not (you may need to create a new section to avoid reintroducing R and S.)

Copy link
Contributor Author

@BryceT233 BryceT233 Mar 10, 2026

Choose a reason for hiding this comment

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

I tested relaxing R and S to Semiring, and actually most of the file compiles fine if I only define rename as a RingHom. However, this will creates a discrepancy with the current definition of MvPolynomial.rename, which is defined as an AlgHom (requiring CommSemiring). I know there are ongoing works to relax the CommSemiring assumption in MvPolynomial as well. Given this context,should I:

  1. Keep it as CommSemiring and AlgHom for now to maintain API symmetry with current MvPolynomial?
  2. Go ahead with Semiring and RingHom for the general parts, and assume CommSemiring when defining AlgHom versions? (e. g. MvPowerSeries.renameₐ)

I prefer option 2, but what to you think?

Copy link
Member

Choose a reason for hiding this comment

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

Mmm, unless you have very good reasons I would say 1: people will almost use it in the CommSemiring case and it's nice to have the map as a bundled hom.


theorem rename_injective (e : σ ↪ τ) : Function.Injective (rename (R := R) e) := by
intro _ _ h; ext x
simpa using MvPowerSeries.ext_iff.mp h (embDomain e x)
Copy link
Member

Choose a reason for hiding this comment

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

embDomain_injective e⟩)))]

/-- Given an embedding `e : σ ↪ τ`, `MvPowerSeries.killComplFun e` is the function from
`R[[τ]]` to `R[[σ]]` that is left inverse to `rename e.injective.fiberFinite : R[[σ]] → R[[τ]]`
Copy link
Member

Choose a reason for hiding this comment

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

Can you use R⟦τ⟧ in this docstring?

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Mar 10, 2026

✌️ BryceT233 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mathlib-triage mathlib-triage bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Mar 10, 2026
Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). large-import Automatically added label for PRs with a significant increase in transitive imports new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants