Skip to content

[Merged by Bors] - feat(Algebra/Order): LinearEquiv version of toLex/ofLex#27711

Closed
wwylele wants to merge 13 commits intoleanprover-community:masterfrom
wwylele:wwylele-hahn-lex
Closed

[Merged by Bors] - feat(Algebra/Order): LinearEquiv version of toLex/ofLex#27711
wwylele wants to merge 13 commits intoleanprover-community:masterfrom
wwylele:wwylele-hahn-lex

Conversation

@wwylele
Copy link
Copy Markdown
Collaborator

@wwylele wwylele commented Jul 31, 2025


Open in Gitpod

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

github-actions bot commented Jul 31, 2025

PR summary cdda99e28c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Algebra.Order.GroupWithZero.Lex 1
Mathlib.Algebra.Order.Group.Equiv (new file) 181
Mathlib.Algebra.Order.Module.Equiv (new file) 509

Declarations diff

+ coe_ofLexLinearEquiv
+ coe_ofLexMulEquiv
+ coe_toLexLinearEquiv
+ ofLexLinearEquiv
+ ofLexMulEquiv
+ symm_ofLexLinearEquiv
+ symm_ofLexMulEquiv
+ symm_toLexLinearEquiv
+ symm_toLexMulEquiv
+ toEquiv_ofLexMulEquiv
+ toLexLinearEquiv
- coe_symm_toLexMulEquiv
- toEquiv_symm_toLexMulEquiv

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

@wwylele wwylele force-pushed the wwylele-hahn-lex branch from fd6e0f0 to 2c98ade Compare July 31, 2025 02:19
@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Jul 31, 2025
@wwylele wwylele force-pushed the wwylele-hahn-lex branch 3 times, most recently from 5d0c49b to 29b924b Compare July 31, 2025 02:56
@github-actions github-actions bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Jul 31, 2025
@wwylele wwylele force-pushed the wwylele-hahn-lex branch from 29b924b to 494d834 Compare July 31, 2025 02:59
@pechersky
Copy link
Copy Markdown
Contributor

I think the existing lemmas about coercion from MulEquiv to Equiv should also be moved to the new file.

@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Jul 31, 2025

I moved toEquiv_toLexMulEquiv and toEquiv_symm_toLexMulEquiv mostly as-is, though I don't quite understand their purpose. They seems to be just repeat of coe_toLexMulEquiv and coe_symm_toLexMulEquiv with an additional intermediate coe...

@pechersky
Copy link
Copy Markdown
Contributor

Specifically for the lemmas that coerce to Equiv, you shouldn't have the outer coercion lemma. Because if you do, that statement becomes about coercions to functions.

@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Jul 31, 2025

Oh yeah that's also what confused me, because the original code had . I'll remove it

@pechersky
Copy link
Copy Markdown
Contributor

Yeah the original code, written by me, was wrong!

variable (α : Type*)

/-- `toLex` as a `MulEquiv`. -/
@[to_additive "`toLex` as a `AddEquiv`."]
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.

Suggested change
@[to_additive "`toLex` as a `AddEquiv`."]
@[to_additive (attr := simps toEquiv) "`toLex` as a `AddEquiv`."]

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.

This produces toLexMulEquiv_toEquiv, which is basically renaming toEquiv_toLexMulEquiv. (toEquiv_toLexMulEquiv was introduced in #22420). This is where I don't know what our naming convention is and I found both examples in the library. toEquiv can be seen as a function application so the function name should appear first; but there are also example where a dot member is written the other way.

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.

For things which ""are clearly projections"", the name tends to come last. At any rate, simps producing that name is good authority to follow

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.

Got it. I have applied the change and removed toEquiv_toLexMulEquiv

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.

Welp, the simp normal form checker rejected this

-- Mathlib.Algebra.Order.Group.Equiv
Error: /home/lean/actions-runner/_work/mathlib4/mathlib4/pr-branch/Mathlib/Algebra/Order/Group/Equiv.lean:16:24: error: toLexMulEquiv_toEquiv Left-hand side simplifies from
  (toLexMulEquiv α).toEquiv
to
  ↑(toLexMulEquiv α)
using
  dsimp only [*, @MulEquiv.toEquiv_eq_coe]
Try to change the left-hand side to the simplified term!

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.

Ugh, I'm so sorry my suggestion depends on #21031

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 6, 2025
@wwylele wwylele removed the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 6, 2025
This reverts commit aef0962.
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 7, 2025
@wwylele wwylele removed the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 7, 2025
@YaelDillies YaelDillies changed the title feat(Algebra/Order): Add Add/Mul/Linear equiv versions of toLex/ofLex feat(Algebra/Order): LinearEquiv version of toLex/ofLex Aug 8, 2025
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

github-actions bot commented Aug 8, 2025

🚀 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 8, 2025
@bryangingechen
Copy link
Copy Markdown
Contributor

Thanks!
bors r+

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Aug 9, 2025
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 9, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Algebra/Order): LinearEquiv version of toLex/ofLex [Merged by Bors] - feat(Algebra/Order): LinearEquiv version of toLex/ofLex Aug 9, 2025
@mathlib-bors mathlib-bors bot closed this Aug 9, 2025
thorimur pushed a commit to thorimur/mathlib4 that referenced this pull request Aug 11, 2025
Paul-Lez pushed a commit to Paul-Lez/mathlib4 that referenced this pull request Aug 23, 2025
@wwylele wwylele deleted the wwylele-hahn-lex branch September 2, 2025 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants