Skip to content

[Merged by Bors] - feat(RingTheory): add HahnSeries.truncLT#27055

Closed
wwylele wants to merge 16 commits intoleanprover-community:masterfrom
wwylele:wwylele-hahn-truncate
Closed

[Merged by Bors] - feat(RingTheory): add HahnSeries.truncLT#27055
wwylele wants to merge 16 commits intoleanprover-community:masterfrom
wwylele:wwylele-hahn-truncate

Conversation

@wwylele
Copy link
Copy Markdown
Collaborator

@wwylele wwylele commented Jul 13, 2025


This is for the proof of Hahn embedding theorem #27043, but it feels niche to have it in HahnSeries file, so I am not sure... if this doesn't feel right, I could make them private to the proof.

Open in Gitpod

@github-actions github-actions bot added the t-algebra Algebra (groups, rings, fields, etc) label Jul 13, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 13, 2025

PR summary d51b0adb3d

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ coe_truncLTLinearMap
+ coeff_truncLT
+ coeff_truncLT_of_le
+ coeff_truncLT_of_lt
+ truncLT
+ truncLTLinearMap
+ truncLT_add
+ truncLT_smul

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

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

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


No changes to technical debt.

You can run this locally as

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

Copy link
Copy Markdown
Collaborator

@ScottCarnahan ScottCarnahan left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@wwylele wwylele requested a review from ScottCarnahan July 22, 2025 03:40
Copy link
Copy Markdown
Contributor

@Ruben-VandeVelde Ruben-VandeVelde left a comment

Choose a reason for hiding this comment

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

maintainer merge

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde.

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 26, 2025
@wwylele wwylele force-pushed the wwylele-hahn-truncate branch 2 times, most recently from 5a2d0c6 to 4bba53b Compare August 1, 2025 00:58
@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Aug 1, 2025

After comparing with existing code, I decided to make a few changes

  • rename to trunc (similar to PowerSeries.trunc)
  • upgrade the base trunc to a ZeroHom, similar to HahnSeries.single
  • also add the AddMonoidHom version
  • manual simp lemma to get the correct name (though this ended up creating ambiguity with PowerSeries.coeff_trunc in LaurentSeries.lean where both HahnSeries and PowerSeries are opened, so I marked the new one with protected

Sorry for making big change after review

@wwylele wwylele changed the title feat(RingTheory): add HahnSeries.truncate feat(RingTheory): add HahnSeries.trunc Aug 1, 2025
@wwylele wwylele requested a review from kbuzzard August 2, 2025 15:31
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Apologies, I don't actually know the proof of the Hahn embedding theorem. Would you mind explaining how truncation of Hahn series comes in? Naïvely, I would have expected truncation to be upwards, but instead it's downwards.

@YaelDillies YaelDillies added awaiting-author A reviewer has asked the author a question or requested changes. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Aug 3, 2025
@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Aug 3, 2025

@YaelDillies sure, let me see if I can explain this well...

The proof I am following is https://www.ams.org/journals/proc/1952-003-06/S0002-9939-1952-0052045-1/. (The proof shown there is for a special case where the ordered group is a real vector space. Generalization is explained here). The truncation operation is called "cut" on page 980.

The proof is a process of transfinite induction starting from a partial map and adding new elements to the domain (Theorem 3.2). Whenever a new element is added, one needs to assign appropriate output to that element and preserve desired properties (strict monotone & linear). This turns out pretty hard on its own (maybe impossible?), so one strengthen the induction hypothesis with an extra condition on the partial map $F$:

  • if $f \in Range(F)$, then $Trunc(f, \Gamma) \in Range (F)$ for all $\Gamma$

Because of linearity of $F$, this can be rephrased in terms of the upward truncation $Trunc'(f, \Gamma) = f - Trunc(f, \Gamma) \in Range (F) $. I doubt that it will make the proof simpler, though.

This condition means that all values of $F$ is a limit point of a sequence by progressively adding more terms. It goes hand-in-hand with how $F(x)$ for a new element $x$ is chosen: we progressively add terms to $F(x)$ equal to a neighbor $F(y)$ in a ball defined by Archimedean class. if there is no such neighbor $y$ with $F(y)$ defined, we stop adding more terms to $F(x)$ and leave the rest as zero. One can then show that $F(x)$ respects the order embedding: as $x$ slightly deviates from $y$, $F(x)$ does so from $F(y)$ in the same direction.

@wwylele wwylele removed the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 3, 2025
@wwylele wwylele requested a review from YaelDillies August 4, 2025 21:03
@grunweg grunweg added t-ring-theory Ring theory and removed t-algebra Algebra (groups, rings, fields, etc) labels Aug 5, 2025
wwylele and others added 6 commits August 11, 2025 11:58
Co-authored-by: Scott Carnahan <128885296+ScottCarnahan@users.noreply.github.com>
- rename to trunc (similar to PowerSeries.trunc)
- upgrade the base trunc to a ZeroHom, similar to HahnSeries.single
- also add the AddMonoidHom version
- manual simp lemma to get the correct name
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Comment on lines +562 to +564
@[simp]
theorem truncLinearMap_apply [DecidableLE Γ] (c : Γ) (x : HahnSeries Γ V) :
truncLinearMap R c x = trunc c x := rfl
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.

Can we also have coe_truncLinearMap?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added the coe version. I also removed truncLinearMap_apply as it becomes a redundant simp lemma

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 11, 2025
@wwylele wwylele changed the title feat(RingTheory): add HahnSeries.trunc feat(RingTheory): add HahnSeries.truncLT Aug 11, 2025
@wwylele wwylele requested a review from YaelDillies August 12, 2025 17:00
@YaelDillies
Copy link
Copy Markdown
Contributor

Don't forget to remove awaiting-author if you want me to look at a PR again!

@wwylele wwylele removed the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 12, 2025
@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Aug 12, 2025

@YaelDillies Thanks for the reminder. Could you take a look now?

Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks!

maintainer delegate

@github-actions
Copy link
Copy Markdown

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

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Aug 13, 2025
wwylele and others added 2 commits August 13, 2025 03:39
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Copy link
Copy Markdown
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.

Thanks!

bors d+

/-- `HahnSeries.truncLT` as a linear map. -/
def truncLTLinearMap [DecidableLT Γ] (c : Γ) : HahnSeries Γ V →ₗ[R] HahnSeries Γ V where
toFun := truncLT c
map_add' x y := by
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.

Can you prove these two results as separated lemmas (with minimal assumptions)? Thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added. As the code is not so trivial, I am going to leave it here for a day for further comments before I merge

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 13, 2025

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

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Aug 13, 2025
@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Aug 13, 2025

:/ another weird CI error. Going to merge from master

@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Aug 13, 2025

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Aug 13, 2025
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 13, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(RingTheory): add HahnSeries.truncLT [Merged by Bors] - feat(RingTheory): add HahnSeries.truncLT Aug 13, 2025
@mathlib-bors mathlib-bors bot closed this Aug 13, 2025
Paul-Lez pushed a commit to Paul-Lez/mathlib4 that referenced this pull request Aug 23, 2025
pechersky pushed a commit to pechersky/mathlib4 that referenced this pull request Aug 25, 2025
@wwylele wwylele deleted the wwylele-hahn-truncate branch September 2, 2025 01:33
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). t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants