Skip to content

refactor(Analysis): golf Mathlib/Analysis/Normed/Operator/Mul#38272

Open
yuanyi-350 wants to merge 6 commits intoleanprover-community:masterfrom
yuanyi-350:A_1
Open

refactor(Analysis): golf Mathlib/Analysis/Normed/Operator/Mul#38272
yuanyi-350 wants to merge 6 commits intoleanprover-community:masterfrom
yuanyi-350:A_1

Conversation

@yuanyi-350
Copy link
Copy Markdown
Collaborator

  • refactors Normed/Operator/Mul by defining ring_lmap_equiv_selfₗ as the symmetry of ContinuousLinearMap.toSpanSingletonLE
  • shortens the norm proof for ring_lmap_equiv_self to ContinuousLinearMap.norm_toSpanSingleton

Extracted from #37968

Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

PR summary c3e588b468

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ toContinuousLinearEquiv_toSpanSingletonₗᵢ
+ toLinearEquiv_toSpanSingletonₗᵢ
+ toSpanSingletonₗᵢ
+ toSpanSingletonₗᵢ_apply
+ toSpanSingletonₗᵢ_symm_apply

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

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

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


No changes to technical debt.

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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).

@github-actions github-actions Bot added the t-analysis Analysis (normed *, calculus) label Apr 20, 2026
@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

yuanyi-350 commented Apr 20, 2026

I ran a profiler comparison for the changed declarations in this PR.

Results (seconds):

  • ContinuousLinearMap.ring_lmap_equiv_selfₗ: 0.210 -> 0.089 (-57.9%)
  • ContinuousLinearMap.ring_lmap_equiv_self: 0.254 -> 0.155 (-39.0%)

Overall:

  • Both changed declarations elaborated faster.

@yuanyi-350 yuanyi-350 added LLM-generated PRs with substantial input from LLMs - review accordingly codex OpenAI Codex wrote (parts of) this PR. labels Apr 20, 2026
@yuanyi-350 yuanyi-350 requested a review from grunweg April 20, 2026 06:42
@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

@grunweg , I think the current PR now meets your guidelines.

Comment thread Mathlib/Analysis/Normed/Operator/Mul.lean Outdated
Comment thread Mathlib/Analysis/Normed/Operator/Mul.lean Outdated
@themathqueen
Copy link
Copy Markdown
Collaborator

themathqueen commented Apr 20, 2026

There's also 0 api for these two definitions. I know this wasn't the initial plan for this PR, but can you add some basic supporting lemmas for the second one please (like _apply, _symm_apply, toLinearEquiv_, etc)?

@themathqueen themathqueen added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 20, 2026
@yuanyi-350 yuanyi-350 removed the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 23, 2026
@yuanyi-350 yuanyi-350 requested a review from themathqueen April 23, 2026 00:49
Copy link
Copy Markdown
Collaborator

@themathqueen themathqueen left a comment

Choose a reason for hiding this comment

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

I know I suggested the name, but it currently doesn't indicate that it's an equivalence, so that needs to probably change, I don't know to what 🤔

Comment thread Mathlib/Analysis/Normed/Operator/Mul.lean Outdated
Comment thread Mathlib/Analysis/Normed/Operator/Mul.lean Outdated
Comment thread Mathlib/Analysis/Normed/Operator/Mul.lean Outdated
Comment thread Mathlib/Analysis/Normed/Operator/Mul.lean Outdated
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
Comment thread Mathlib/Analysis/Normed/Operator/Mul.lean
@themathqueen
Copy link
Copy Markdown
Collaborator

Can you ask on Zulip what a good name for the linear isometric version would be?

I think toSpanSingletonLIE might be okay-ish? We have toSpanSingletonLE and toSpanSingletonCLE, so it makes sense in that way.

@j-loreaux j-loreaux added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 24, 2026
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
@yuanyi-350 yuanyi-350 removed the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 24, 2026
@themathqueen
Copy link
Copy Markdown
Collaborator

@yuanyi-350, can you please tag me in the Zulip post? Or post the link here? (I can't find it)

@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

@themathqueen themathqueen added the awaiting-zulip There is a Zulip discussion; the author should await and report/implement the decision reached there label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-zulip There is a Zulip discussion; the author should await and report/implement the decision reached there codex OpenAI Codex wrote (parts of) this PR. LLM-generated PRs with substantial input from LLMs - review accordingly t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants