-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Merged by Bors] - feat(Algebra/Order): LinearEquiv version of toLex/ofLex
#27711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
494d834
feat(Algebra/Order): Add Add/Mul/Linear equiv versions of toLex/ofLex
wwylele 92b50a0
move lemma
wwylele 3f414a0
move
wwylele 5a400ed
simplify
wwylele 3ef1834
to_additive
wwylele 4e50811
shake
wwylele e13603f
remove coerce
wwylele 3b3f5cb
address comments
wwylele aef0962
address comments
wwylele d529836
Revert "address comments"
wwylele 2116674
adjust symm simp
wwylele 7843b71
extract Mul to variable
wwylele 242bb00
remove extra space
wwylele File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /- | ||
| Copyright (c) 2025 Weiyi Wang. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Weiyi Wang | ||
| -/ | ||
| import Mathlib.Algebra.Group.Equiv.Defs | ||
| import Mathlib.Algebra.Order.Group.Synonym | ||
|
|
||
| /-! | ||
| # Add/Mul equivalence for order type synonyms | ||
| -/ | ||
|
|
||
| variable (α : Type*) [Mul α] | ||
|
|
||
| /-- `toLex` as a `MulEquiv`. -/ | ||
| @[to_additive "`toLex` as a `AddEquiv`."] | ||
| def toLexMulEquiv : α ≃* Lex α where | ||
| toEquiv := toLex | ||
| map_mul' _ _ := by simp | ||
|
|
||
| /-- `ofLex` as a `MulEquiv`. -/ | ||
| @[to_additive "`ofLex` as a `AddEquiv`."] | ||
| def ofLexMulEquiv : Lex α ≃* α where | ||
| toEquiv := ofLex | ||
| map_mul' _ _ := by simp | ||
|
|
||
| @[to_additive (attr := simp)] | ||
| theorem coe_toLexMulEquiv : ⇑(toLexMulEquiv α) = toLex := rfl | ||
|
|
||
| @[to_additive (attr := simp)] | ||
| theorem coe_ofLexMulEquiv : ⇑(ofLexMulEquiv α) = ofLex := rfl | ||
|
|
||
| @[to_additive (attr := simp)] | ||
| lemma symm_toLexMulEquiv : (toLexMulEquiv α).symm = ofLexMulEquiv α := rfl | ||
|
|
||
| @[to_additive (attr := simp)] | ||
| lemma symm_ofLexMulEquiv : (ofLexMulEquiv α).symm = toLexMulEquiv α := rfl | ||
|
|
||
| @[to_additive (attr := simp)] | ||
| lemma toEquiv_toLexMulEquiv : (toLexMulEquiv α : α ≃ Lex α) = toLex := rfl | ||
|
|
||
| @[to_additive (attr := simp)] | ||
| lemma toEquiv_ofLexMulEquiv : (ofLexMulEquiv α : Lex α ≃ α) = ofLex := rfl | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /- | ||
| Copyright (c) 2025 Weiyi Wang. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Weiyi Wang | ||
| -/ | ||
| import Mathlib.Algebra.Module.Equiv.Basic | ||
| import Mathlib.Algebra.Order.Group.Equiv | ||
| import Mathlib.Algebra.Order.Module.Synonym | ||
|
|
||
| /-! | ||
| # Linear equivalence for order type synonyms | ||
| -/ | ||
|
|
||
| variable (α β : Type*) | ||
| variable [Semiring α] [AddCommMonoid β] [Module α β] | ||
|
|
||
| /-- `toLex` as a linear equivalence -/ | ||
| def toLexLinearEquiv : β ≃ₗ[α] Lex β := (toLexAddEquiv β).toLinearEquiv toLex_smul | ||
|
|
||
| /-- `ofLex` as a linear equivalence -/ | ||
| def ofLexLinearEquiv : Lex β ≃ₗ[α] β := (ofLexAddEquiv β).toLinearEquiv ofLex_smul | ||
|
|
||
| @[simp] lemma coe_toLexLinearEquiv : ⇑(toLexLinearEquiv α β) = toLex := rfl | ||
| @[simp] lemma coe_ofLexLinearEquiv : ⇑(ofLexLinearEquiv α β) = ofLex := rfl | ||
|
|
||
| @[simp] lemma symm_toLexLinearEquiv : (toLexLinearEquiv α β).symm = ofLexLinearEquiv α β := rfl | ||
| @[simp] lemma symm_ofLexLinearEquiv : (ofLexLinearEquiv α β).symm = toLexLinearEquiv α β := rfl |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 renamingtoEquiv_toLexMulEquiv. (toEquiv_toLexMulEquivwas introduced in #22420). This is where I don't know what our naming convention is and I found both examples in the library.toEquivcan 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.There was a problem hiding this comment.
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,
simpsproducing that name is good authority to followThere was a problem hiding this comment.
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_toLexMulEquivThere was a problem hiding this comment.
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
There was a problem hiding this comment.
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