Skip to content

[Merged by Bors] - chore: split WithLp.equiv into a new pair WithLp.toLp/WithLp.ofLp#26459

Closed
eric-wieser wants to merge 33 commits intomasterfrom
eric-wieser/with-lp-refactor
Closed

[Merged by Bors] - chore: split WithLp.equiv into a new pair WithLp.toLp/WithLp.ofLp#26459
eric-wieser wants to merge 33 commits intomasterfrom
eric-wieser/with-lp-refactor

Conversation

@eric-wieser
Copy link
Copy Markdown
Member

@eric-wieser eric-wieser commented Jun 27, 2025

(WithLp.equiv p _).symm v is very inconvenient as a normal form when working with WithLp.

This introduces WithLp.toLp p v as the simp-normal spelling of this operation, and v'.ofLp as the simp-normal spelling of WithLp.equiv p _ v'. It then deprecates almost all the lemmas about WithLp.equiv, as these are no longer stated in simp-normal form.

The motivation for making toLp and ofLp as plain functions, as opposed to Equivs, is to permit them to be later adapted into a constructor and projection of a one-field structure. Almost nothing in mathlib needs them to be equivs anyway.

Zulip thread: #mathlib4 > defeq abuse in `WithLp` @ 💬

Co-authored-by: Yael Dillies yael.dillies@gmail.com
Co-authored-by: Paul Lezeau paul.lezeau@gmail.com


Open in Gitpod

Alternative to #24261, which makes toLp and ofLp plain functions, and does not touch any of the existing equivs beside making them not simp-normal.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 27, 2025

PR summary 508c1928c2

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ EuclideanSpace.inner_toLp_toLp
+ EuclideanSpace.ofLp_single
+ EuclideanSpace.toLp_single
+ PiLp.volume_preserving_ofLp
+ PiLp.volume_preserving_toLp
+ antilipschitzWith_ofLp
+ continuous_ofLp
+ continuous_toLp
+ dist_toLp_fst
+ dist_toLp_single_same
+ dist_toLp_snd
+ edist_toLp_fst
+ edist_toLp_single_same
+ edist_toLp_snd
+ hasFDerivAt_ofLp
+ hasFDerivAt_toLp
+ hasStrictFDerivAt_ofLp
+ hasStrictFDerivAt_toLp
+ isometry_ofLp_infty
+ lipschitzWith_ofLp
+ measurable_ofLp
+ measurable_toLp
+ nndist_toLp_fst
+ nndist_toLp_single_same
+ nndist_toLp_snd
+ nnnorm_ofLp
+ nnnorm_toLp
+ nnnorm_toLp_const
+ nnnorm_toLp_const'
+ nnnorm_toLp_inl
+ nnnorm_toLp_inr
+ nnnorm_toLp_one
+ nnnorm_toLp_single
+ norm_ofLp
+ norm_ofLp_crossProduct
+ norm_toLp
+ norm_toLp_const
+ norm_toLp_const'
+ norm_toLp_equivTuple
+ norm_toLp_fst
+ norm_toLp_one
+ norm_toLp_single
+ norm_toLp_snd
+ norm_toLp_symm_crossProduct
+ ofLp
+ ofLp_add
+ ofLp_apply
+ ofLp_eq_zero
+ ofLp_fst
+ ofLp_neg
+ ofLp_smul
+ ofLp_snd
+ ofLp_sub
+ ofLp_surjective
+ ofLp_toEuclideanCLM
+ ofLp_toEuclideanLin_apply
+ ofLp_toLp
+ ofLp_zero
+ piLp_ofLp_toEuclideanLin
+ prod_antilipschitzWith_ofLp
+ prod_continuous_ofLp
+ prod_continuous_toLp
+ prod_isometry_ofLp_infty
+ prod_lipschitzWith_ofLp
+ prod_nnnorm_ofLp
+ prod_nnnorm_toLp
+ prod_norm_ofLp
+ prod_norm_toLp
+ prod_uniformContinuous_ofLp
+ prod_uniformContinuous_toLp
+ toEuclideanCLM_toLp
+ toEuclideanLin_apply_piLp_toLp
+ toEuclideanLin_toLp
+ toLp
+ toLp_add
+ toLp_eq_zero
+ toLp_fst
+ toLp_neg
+ toLp_ofLp
+ toLp_smul
+ toLp_snd
+ toLp_sub
+ toLp_surjective
+ toLp_zero
+ uniformContinuous_ofLp
+ uniformContinuous_toLp
- antilipschitzWith_equiv_aux
- aux_cobounded_eq
- aux_uniformity_eq
- lipschitzWith_equiv_aux
- prod_antilipschitzWith_equiv_aux
- prod_aux_cobounded_eq
- prod_aux_uniformity_eq
- prod_lipschitzWith_equiv_aux
-++ toLp_apply

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

@eric-wieser eric-wieser requested a review from YaelDillies June 27, 2025 01:37
@eric-wieser eric-wieser added the t-analysis Analysis (normed *, calculus) label Jun 27, 2025
@eric-wieser eric-wieser marked this pull request as ready for review June 27, 2025 12:09
@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 28, 2025
Copy link
Copy Markdown
Member

@EtienneC30 EtienneC30 left a comment

Choose a reason for hiding this comment

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

Thanks!

@EtienneC30 EtienneC30 added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 28, 2025
@eric-wieser eric-wieser added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Jun 28, 2025
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 28, 2025
@EtienneC30
Copy link
Copy Markdown
Member

Thanks! For me it's good to go.
maintainer merge

@github-actions
Copy link
Copy Markdown

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

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jun 28, 2025
@b-mehta
Copy link
Copy Markdown
Contributor

b-mehta commented Jun 28, 2025

Thanks!

bors merge

@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 Jun 28, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jun 28, 2025
…p` (#26459)

`(WithLp.equiv p _).symm v` is very inconvenient as a normal form when working with `WithLp`.

This introduces `WithLp.toLp p v` as the simp-normal spelling of this operation, and `v'.ofLp` as the simp-normal spelling of `WithLp.equiv p _ v'`. It then deprecates almost all the lemmas about `WithLp.equiv`, as these are no longer stated in simp-normal form.

The motivation for making `toLp` and `ofLp` as plain functions, as opposed to `Equiv`s, is to permit them to be later adapted into a constructor and projection of a one-field structure. Almost nothing in mathlib needs them to be equivs anyway.

Zulip thread: [#mathlib4 > defeq abuse in &#96;WithLp&#96; @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/defeq.20abuse.20in.20.60WithLp.60/near/516241777)

Co-authored-by: Yael Dillies <yael.dillies@gmail.com>
Co-authored-by: Paul Lezeau <paul.lezeau@gmail.com>



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jun 28, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: split WithLp.equiv into a new pair WithLp.toLp/WithLp.ofLp [Merged by Bors] - chore: split WithLp.equiv into a new pair WithLp.toLp/WithLp.ofLp Jun 28, 2025
@mathlib-bors mathlib-bors bot closed this Jun 28, 2025
@mathlib-bors mathlib-bors bot deleted the eric-wieser/with-lp-refactor branch June 28, 2025 22:43
eric-wieser added a commit that referenced this pull request Jun 28, 2025
eric-wieser added a commit that referenced this pull request Jun 28, 2025
joelriou pushed a commit to joelriou/mathlib4 that referenced this pull request Jul 7, 2025
…p` (leanprover-community#26459)

`(WithLp.equiv p _).symm v` is very inconvenient as a normal form when working with `WithLp`.

This introduces `WithLp.toLp p v` as the simp-normal spelling of this operation, and `v'.ofLp` as the simp-normal spelling of `WithLp.equiv p _ v'`. It then deprecates almost all the lemmas about `WithLp.equiv`, as these are no longer stated in simp-normal form.

The motivation for making `toLp` and `ofLp` as plain functions, as opposed to `Equiv`s, is to permit them to be later adapted into a constructor and projection of a one-field structure. Almost nothing in mathlib needs them to be equivs anyway.

Zulip thread: [#mathlib4 > defeq abuse in &leanprover-community#96;WithLp&leanprover-community#96; @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/defeq.20abuse.20in.20.60WithLp.60/near/516241777)

Co-authored-by: Yael Dillies <yael.dillies@gmail.com>
Co-authored-by: Paul Lezeau <paul.lezeau@gmail.com>



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
callesonne pushed a commit to callesonne/mathlib4 that referenced this pull request Jul 24, 2025
…p` (leanprover-community#26459)

`(WithLp.equiv p _).symm v` is very inconvenient as a normal form when working with `WithLp`.

This introduces `WithLp.toLp p v` as the simp-normal spelling of this operation, and `v'.ofLp` as the simp-normal spelling of `WithLp.equiv p _ v'`. It then deprecates almost all the lemmas about `WithLp.equiv`, as these are no longer stated in simp-normal form.

The motivation for making `toLp` and `ofLp` as plain functions, as opposed to `Equiv`s, is to permit them to be later adapted into a constructor and projection of a one-field structure. Almost nothing in mathlib needs them to be equivs anyway.

Zulip thread: [#mathlib4 > defeq abuse in &leanprover-community#96;WithLp&leanprover-community#96; @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/defeq.20abuse.20in.20.60WithLp.60/near/516241777)

Co-authored-by: Yael Dillies <yael.dillies@gmail.com>
Co-authored-by: Paul Lezeau <paul.lezeau@gmail.com>



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
hrmacbeth pushed a commit to szqzs/mathlib4 that referenced this pull request Jul 28, 2025
…p` (leanprover-community#26459)

`(WithLp.equiv p _).symm v` is very inconvenient as a normal form when working with `WithLp`.

This introduces `WithLp.toLp p v` as the simp-normal spelling of this operation, and `v'.ofLp` as the simp-normal spelling of `WithLp.equiv p _ v'`. It then deprecates almost all the lemmas about `WithLp.equiv`, as these are no longer stated in simp-normal form.

The motivation for making `toLp` and `ofLp` as plain functions, as opposed to `Equiv`s, is to permit them to be later adapted into a constructor and projection of a one-field structure. Almost nothing in mathlib needs them to be equivs anyway.

Zulip thread: [#mathlib4 > defeq abuse in &leanprover-community#96;WithLp&leanprover-community#96; @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/defeq.20abuse.20in.20.60WithLp.60/near/516241777)

Co-authored-by: Yael Dillies <yael.dillies@gmail.com>
Co-authored-by: Paul Lezeau <paul.lezeau@gmail.com>



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
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-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants