Skip to content

[Merged by Bors] - feat: make sure that the simp normal form of equiv-like classes pushes symm and trans to the right#25604

Closed
sgouezel wants to merge 23 commits intomasterfrom
SG_moveSymm
Closed

[Merged by Bors] - feat: make sure that the simp normal form of equiv-like classes pushes symm and trans to the right#25604
sgouezel wants to merge 23 commits intomasterfrom
SG_moveSymm

Conversation

@sgouezel
Copy link
Copy Markdown
Contributor

@sgouezel sgouezel commented Jun 8, 2025

This follows the usual convention for coercions. See discussion at #mathlib4 > simp normal form for symm and coercions @ 💬

For each equiv class, after the PR we should have lemmas like

@[simp]
lemma coe_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv = e := rfl

@[simp]
lemma coe_symm_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv.symm = e.symm := rfl

@[simp]
lemma toEquiv_symm (e : G ≃+c[a, b] H) : e.symm.toEquiv = e.toEquiv.symm := rfl

@[simp]
lemma toEquiv_trans (e₁ : G ≃+c[a, b] H) (e₂ : H ≃+c[b, c] K) :
    (e₁.trans e₂).toEquiv = e₁.toEquiv.trans e₂.toEquiv := rfl

The PR does not complete this task, because it would require killing the coercion from EquivLike classes to Equivs (which I am planning to do in a subsequent PR), but it is a significant first step in this direction.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 8, 2025

PR summary c34d6acfe2

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ _root_.IsometryEquiv.coe_symm_toDilationEquiv
+ _root_.IsometryEquiv.coe_toDilationEquiv
+ coe_mk
+ coe_symm_toContinuousLinearEquiv
+ coe_symm_toIntLinearEquiv
+ coe_symm_toMeasurableEquiv
+ coe_symm_toNatLinearEquiv
+ coe_symm_toRelIsoLT
+ coe_toLinearEquiv
+ coe_toRelIsoLT
+ linear_symm
+ toContinuousLinearEquiv_symm
+ toEquiv_trans
+ toHomeomorph_trans
+ toIsometryEquiv_trans
++ coe_symm_toAffineEquiv
++ coe_symm_toIsometryEquiv
+++ coe_symm_toLinearEquiv
+++ coe_toEquiv
++++ coe_symm_toHomeomorph
+++++++ coe_symm_toEquiv
++++-+++ toEquiv_symm
+++--- coe_toEquiv_symm
++- toAffineEquiv_symm
++-- toIsometryEquiv_symm
+-+++-- toHomeomorph_symm
+-++- toLinearEquiv_symm

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

@sgouezel sgouezel added the WIP Work in progress label Jun 8, 2025
@sgouezel sgouezel removed the WIP Work in progress label Jun 8, 2025
@j-loreaux
Copy link
Copy Markdown
Contributor

killing the coercion from EquivLike classes to Equivs

You're planning on killing it as a coercion, but keeping the constructor, right?

Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux left a comment

Choose a reason for hiding this comment

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

Thanks for making all these consistent!

@j-loreaux j-loreaux added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 11, 2025
@j-loreaux
Copy link
Copy Markdown
Contributor

@sgouezel I won't merge in case there was a reason you didn't take the awaiting-author tag off. But in case you're done:

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jun 11, 2025

✌️ sgouezel 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 awaiting-author A reviewer has asked the author a question or requested changes. labels Jun 11, 2025
@sgouezel
Copy link
Copy Markdown
Contributor Author

bors r+
Thanks a lot for the careful review!

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Jun 12, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jun 12, 2025
…s `symm` and `trans` to the right (#25604)

This follows the usual convention for coercions. See discussion at [#mathlib4 > simp normal form for symm and coercions @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/simp.20normal.20form.20for.20symm.20and.20coercions/near/522879475)

For each equiv class, after the PR we should have lemmas like
```lean
@[simp]
lemma coe_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv = e := rfl

@[simp]
lemma coe_symm_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv.symm = e.symm := rfl

@[simp]
lemma toEquiv_symm (e : G ≃+c[a, b] H) : e.symm.toEquiv = e.toEquiv.symm := rfl

@[simp]
lemma toEquiv_trans (e₁ : G ≃+c[a, b] H) (e₂ : H ≃+c[b, c] K) :
    (e₁.trans e₂).toEquiv = e₁.toEquiv.trans e₂.toEquiv := rfl
```

The PR does not complete this task, because it would require killing the coercion from EquivLike classes to Equivs (which I am planning to do in a subsequent PR), but it is a significant first step in this direction.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jun 12, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: make sure that the simp normal form of equiv-like classes pushes symm and trans to the right [Merged by Bors] - feat: make sure that the simp normal form of equiv-like classes pushes symm and trans to the right Jun 12, 2025
@mathlib-bors mathlib-bors bot closed this Jun 12, 2025
@mathlib-bors mathlib-bors bot deleted the SG_moveSymm branch June 12, 2025 08:56
vlad902 added a commit to vlad902/mathlib4 that referenced this pull request Jun 12, 2025
* master: (447 commits)
  chore(Data/Set): move very basic lemmas earlier (leanprover-community#25707)
  feat: preserve draft status when migrating PRs to fork (leanprover-community#25777)
  chore(Data/Set/Basic): deprecate lemmas that abuse the `Set α := α → Prop` defeq (leanprover-community#25669)
  refactor: redefine `ProperCone` as an `abbrev` for `ClosedSubmodule` (leanprover-community#25204)
  feat: interaction between ContinuousLinearMap.coprod and ContinuousLinearEquiv.prodComm (leanprover-community#25564)
  fix: outdated docstring (leanprover-community#25717)
  feat(MeasureTheory): convolution of measures with densities  (leanprover-community#25718)
  feat: make sure that the simp normal form of equiv-like classes pushes `symm` and `trans` to the right (leanprover-community#25604)
  feat(ModelTheory): Formula.iSup and iInf (leanprover-community#21948)
  feat(RingTheory/Polynomial/ContentIdeal): the content ideal of a polynomial. (leanprover-community#25333)
  fix: typo in labels_from_comment.yml (leanprover-community#25727)
  feat: is{Inducing,Embedding}_prodMkLeft (leanprover-community#25705)
  feat: check that the mathlib options exist (leanprover-community#25687)
  feat(Algebra/Group/Even): Add missing lemmas (leanprover-community#20818)
  refactor: make `Matrix.kroneckerTMulAlgEquiv` heterogeneous (leanprover-community#25693)
  feat: allow contributors to remove labels with comments (leanprover-community#25723)
  chore: disable build.yml and bors.yml on forks (leanprover-community#25722)
  feat: improvements to user_activity_report.py (leanprover-community#25721)
  chore: update the migration script to check for necessary permissions and prefer ssh if possible (leanprover-community#25701)
  chore: update the migration script to check for necessary permissions and prefer ssh if possible (leanprover-community#25701)
  ...
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Jun 15, 2025
…s `symm` and `trans` to the right (leanprover-community#25604)

This follows the usual convention for coercions. See discussion at [#mathlib4 > simp normal form for symm and coercions @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/simp.20normal.20form.20for.20symm.20and.20coercions/near/522879475)

For each equiv class, after the PR we should have lemmas like
```lean
@[simp]
lemma coe_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv = e := rfl

@[simp]
lemma coe_symm_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv.symm = e.symm := rfl

@[simp]
lemma toEquiv_symm (e : G ≃+c[a, b] H) : e.symm.toEquiv = e.toEquiv.symm := rfl

@[simp]
lemma toEquiv_trans (e₁ : G ≃+c[a, b] H) (e₂ : H ≃+c[b, c] K) :
    (e₁.trans e₂).toEquiv = e₁.toEquiv.trans e₂.toEquiv := rfl
```

The PR does not complete this task, because it would require killing the coercion from EquivLike classes to Equivs (which I am planning to do in a subsequent PR), but it is a significant first step in this direction.
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Jun 15, 2025
…s `symm` and `trans` to the right (leanprover-community#25604)

This follows the usual convention for coercions. See discussion at [#mathlib4 > simp normal form for symm and coercions @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/simp.20normal.20form.20for.20symm.20and.20coercions/near/522879475)

For each equiv class, after the PR we should have lemmas like
```lean
@[simp]
lemma coe_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv = e := rfl

@[simp]
lemma coe_symm_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv.symm = e.symm := rfl

@[simp]
lemma toEquiv_symm (e : G ≃+c[a, b] H) : e.symm.toEquiv = e.toEquiv.symm := rfl

@[simp]
lemma toEquiv_trans (e₁ : G ≃+c[a, b] H) (e₂ : H ≃+c[b, c] K) :
    (e₁.trans e₂).toEquiv = e₁.toEquiv.trans e₂.toEquiv := rfl
```

The PR does not complete this task, because it would require killing the coercion from EquivLike classes to Equivs (which I am planning to do in a subsequent PR), but it is a significant first step in this direction.
callesonne pushed a commit to callesonne/mathlib4 that referenced this pull request Jul 24, 2025
…s `symm` and `trans` to the right (leanprover-community#25604)

This follows the usual convention for coercions. See discussion at [#mathlib4 > simp normal form for symm and coercions @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/simp.20normal.20form.20for.20symm.20and.20coercions/near/522879475)

For each equiv class, after the PR we should have lemmas like
```lean
@[simp]
lemma coe_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv = e := rfl

@[simp]
lemma coe_symm_toEquiv (e : G ≃+c[a, b] H) : ⇑e.toEquiv.symm = e.symm := rfl

@[simp]
lemma toEquiv_symm (e : G ≃+c[a, b] H) : e.symm.toEquiv = e.toEquiv.symm := rfl

@[simp]
lemma toEquiv_trans (e₁ : G ≃+c[a, b] H) (e₂ : H ≃+c[b, c] K) :
    (e₁.trans e₂).toEquiv = e₁.toEquiv.trans e₂.toEquiv := rfl
```

The PR does not complete this task, because it would require killing the coercion from EquivLike classes to Equivs (which I am planning to do in a subsequent PR), but it is a significant first step in this direction.
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). ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants