Skip to content

[Merged by Bors] - feat(RingTheory/MvPowerSeries/Trunc): generalize truncation lemmas#39625

Closed
justus-springer wants to merge 6 commits into
leanprover-community:masterfrom
justus-springer:justus/MvPowerSeries_trunc_lemmas
Closed

[Merged by Bors] - feat(RingTheory/MvPowerSeries/Trunc): generalize truncation lemmas#39625
justus-springer wants to merge 6 commits into
leanprover-community:masterfrom
justus-springer:justus/MvPowerSeries_trunc_lemmas

Conversation

@justus-springer

@justus-springer justus-springer commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Generalize coeff_trunc_mul_trunc_eq_coeff_mul (and its analogs for truncFinset and trunc') to allow for different truncation levels for the two arguments. This matches the API for univariate power series, where we already have PowerSeries.coeff_mul_eq_coeff_trunc_mul_trunc₂.

This is useful for defining partial derivatives of multivariate power series, see PR #39626.


Open in Gitpod

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown

PR summary f084f1bbe9

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ coeff_trunc'_mul_trunc'_eq_coeff_mul₂
+ coeff_truncFinset_mul_truncFinset_eq_coeff_mul₂
+ coeff_trunc_mul_trunc_eq_coeff_mul
+ coeff_trunc_mul_trunc_eq_coeff_mul₂

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.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit f084f1b).

  • +4 new declarations
  • −0 removed declarations
+MvPowerSeries.coeff_trunc'_mul_trunc'_eq_coeff_mul₂
+MvPowerSeries.coeff_truncFinset_mul_truncFinset_eq_coeff_mul₂
+MvPowerSeries.coeff_trunc_mul_trunc_eq_coeff_mul
+MvPowerSeries.coeff_trunc_mul_trunc_eq_coeff_mul₂

No changes to strong technical debt.

No changes to weak technical debt.

Current commit f084f1bbe9
Reference commit 8f49886e72

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/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).

@faenuccio

Copy link
Copy Markdown
Contributor

@justus-springer Can you update master here as well? Thanks

@justus-springer justus-springer added the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 20, 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 Jun 20, 2026
Comment thread Mathlib/RingTheory/MvPowerSeries/Trunc.lean Outdated
Comment thread Mathlib/RingTheory/MvPowerSeries/Trunc.lean
Comment thread Mathlib/RingTheory/MvPowerSeries/Trunc.lean Outdated

@tb65536 tb65536 left a comment

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.

Very nice, thanks!

maintainer delegate

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by tb65536.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jun 26, 2026

@riccardobrasca riccardobrasca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

bors d+

@mathlib-bors mathlib-bors Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jun 26, 2026
@mathlib-bors

mathlib-bors Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

✌️ justus-springer can now approve this pull request until 2026-07-10 11:37 UTC (in 2 weeks). To approve and merge, reply with bors r+. More detailed instructions are available here.

⚠️ This delegation only covers changes within Archive/**, Counterexamples/**, docs/**, DownstreamTest/**, Mathlib/**, MathlibTest/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.lean; an author commit touching anything else will revoke it. Bors also revokes it if a later push changes too many files for it to check the full list — even if it stays within scope.

@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jun 26, 2026
@justus-springer justus-springer added the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 26, 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 Jun 26, 2026
@justus-springer

Copy link
Copy Markdown
Collaborator Author

bors r+

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Jun 26, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Jun 26, 2026
…39625)

Generalize `coeff_trunc_mul_trunc_eq_coeff_mul` (and its analogs for `truncFinset` and `trunc'`) to allow for different truncation levels for the two arguments. This matches the API for univariate power series, where we already have `PowerSeries.coeff_mul_eq_coeff_trunc_mul_trunc₂`.

This is useful for defining partial derivatives of multivariate power series, see PR #39626.

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Jun 26, 2026
@mathlib-bors

mathlib-bors Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(RingTheory/MvPowerSeries/Trunc): generalize truncation lemmas [Merged by Bors] - feat(RingTheory/MvPowerSeries/Trunc): generalize truncation lemmas Jun 26, 2026
@mathlib-bors mathlib-bors Bot closed this Jun 26, 2026
@mathlib-bors mathlib-bors Bot removed the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jun 26, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Jul 16, 2026
#39626)

Previously, we had formal derivatives for `PowerSeries` and `Polynomial` and formal partial derivatives for `MvPolynomial`, but no formal partial derivatives for `MvPowerSeries`. This PR adds them. Furthermore, `PowerSeries.derivative` is refactored to be defined in terms of `MvPowerSeries.pderiv`, which reduces code duplication (In particular, there is no need to define the bare function `PowerSeries.derivativeFun` anymore).

Most proofs are direct generalizations from the univariate case. I only had to add a few missing API lemmas, which I am PR'ing separately below:

- [x] depends on: #39623 
- [x] depends on: #39624 
- [x] depends on: #39625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors. t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants