Skip to content

refactor: change definition of restricted power series to align with restricted multivariate power series#39583

Open
WilliamCoram wants to merge 6 commits into
leanprover-community:masterfrom
WilliamCoram:RestrictedPS
Open

refactor: change definition of restricted power series to align with restricted multivariate power series#39583
WilliamCoram wants to merge 6 commits into
leanprover-community:masterfrom
WilliamCoram:RestrictedPS

Conversation

@WilliamCoram

@WilliamCoram WilliamCoram commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Previously, restricted power series were defined in terms of a tendsto atTop this has been changed to be an abbrev of MvPowerSeries.IsRestricted with isRestricted_iff lemmas to convert to nicer usable definitions.


Open in Gitpod

@github-actions github-actions Bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) t-ring-theory Ring theory 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 19, 2026
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

PR summary e239c1e0ed

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.RingTheory.PowerSeries.Restricted 1695 1582 -113 (-6.67%)
Import changes for all files
Files Import difference
Mathlib.RingTheory.PowerSeries.Restricted -113

Declarations diff (regex)

+ addSubgroup
+ isRestricted.add
+ isRestricted.mul
+ isRestricted.neg
+ isRestricted_C
+ isRestricted_abs_iff
+ isRestricted_comp_uniqueEquiv
+ isRestricted_iff'
+ isRestricted_monomial
+ isRestricted_one
+ isRestricted_zero
+ subring
- C
- add
- convergenceSet
- convergenceSet_BddAbove
- isRestricted_iff_abs
- monomial
- mul
- neg
- one
- smul
- zero

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

  • +12 new declarations
  • −12 removed declarations
-PowerSeries.IsRestricted.C
-PowerSeries.IsRestricted.add
+PowerSeries.IsRestricted.addSubgroup
-PowerSeries.IsRestricted.convergenceSet
-PowerSeries.IsRestricted.convergenceSet_BddAbove
-PowerSeries.IsRestricted.isRestricted_iff
-PowerSeries.IsRestricted.isRestricted_iff_abs
-PowerSeries.IsRestricted.monomial
-PowerSeries.IsRestricted.mul
-PowerSeries.IsRestricted.neg
-PowerSeries.IsRestricted.one
-PowerSeries.IsRestricted.smul
+PowerSeries.IsRestricted.subring
-PowerSeries.IsRestricted.zero
+PowerSeries.isRestricted.add
+PowerSeries.isRestricted.mul
+PowerSeries.isRestricted.neg
+PowerSeries.isRestricted_C
+PowerSeries.isRestricted_abs_iff
+PowerSeries.isRestricted_iff
+PowerSeries.isRestricted_iff'
+PowerSeries.isRestricted_monomial
+PowerSeries.isRestricted_one
+PowerSeries.isRestricted_zero

Decrease in strong tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (strong)
391 -1 adaptation notes
No changes to weak technical debt.

Current commit e239c1e0ed
Reference commit 5f6fd26f8a

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

@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label May 19, 2026
@WilliamCoram
WilliamCoram marked this pull request as draft May 19, 2026 16:05
@mathlib-bors

mathlib-bors Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in draft mode. No active bors state needed cleanup.

While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like bors r+ or bors try.

@WilliamCoram
WilliamCoram marked this pull request as ready for review May 19, 2026 16:13
@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 Jun 26, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

@WilliamCoram WilliamCoram removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jun 29, 2026
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 29, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

This PR/issue depends on:

@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 Jul 18, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

@riccardobrasca riccardobrasca self-assigned this Jul 18, 2026
@github-actions github-actions Bot added tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Jul 18, 2026
lemma isRestricted_iff (c : ℝ) (f : PowerSeries R) :
IsRestricted c f ↔ Tendsto (fun (t : ℕ) ↦ ‖coeff t f‖ * c ^ t) cofinite (𝓝 0) := by
rw [IsRestricted, MvPowerSeries.IsRestricted, isRestricted_comp_uniqueEquiv]
exact ⟨fun H => (H.comp (Finsupp.uniqueEquiv ()).symm.injective.tendsto_cofinite).congr fun n =>

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.

Suggested change
exact ⟨fun H => (H.comp (Finsupp.uniqueEquiv ()).symm.injective.tendsto_cofinite).congr fun n =>
exact ⟨fun H (H.comp (Finsupp.uniqueEquiv ()).symm.injective.tendsto_cofinite).congr fun n

Can you check this everywhere?

open Filter
open scoped Topology Pointwise

variable {R : Type*} [NormedRing R]

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.

Suggested change
variable {R : Type*} [NormedRing R]
variable {R : Type*} [NormedRing R] (c : ℝ) (f : PowerSeries R)

Then you can remove it everywhere else.

calc _ ≤ ‖(coeff i) f‖ * |c ^ i| := by bound
_ ≤ 1 := by simpa using (hf i h).le
/-- Restricted power series as an additive subgroup of `PowerSeries R`. -/
def addSubgroup (c : ℝ) : AddSubgroup (PowerSeries R) where

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.

I am not 100% it works, but can you to use MvPowerSeries.IsRestricted.addSubgroup directly?

end IsRestricted
end PowerSeries
/-- Restricted power series as an subring of `PowerSeries R`. -/
def subring (c : ℝ) : Subring (PowerSeries R) where

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.

Same as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ring-theory Ring theory tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants