Skip to content

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

Open
yuanyi-350 wants to merge 1 commit intoleanprover-community:masterfrom
yuanyi-350:A_1
Open

refactor(Analysis): golf Mathlib/Analysis/Normed/Operator/Mul#38272
yuanyi-350 wants to merge 1 commit 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

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

No declarations were harmed in the making of this PR! 🐙

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.

You can run this locally as

./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 on lines +161 to +162
def ring_lmap_equiv_selfₗ : (𝕜 →L[𝕜] E) ≃ₗ[𝕜] E :=
(ContinuousLinearMap.toSpanSingletonLE 𝕜 𝕜 E).symm
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since this is just .symm toSpanSingletonLE, we should probably deprecate it? toSpanSingletonLE has a better name anyway.


/-- If `M` is a normed space over `𝕜`, then the space of maps `𝕜 →L[𝕜] M` is linearly isometrically
equivalent to `M`. -/
def ring_lmap_equiv_self : (𝕜 →L[𝕜] E) ≃ₗᵢ[𝕜] E where
Copy link
Copy Markdown
Collaborator

@themathqueen themathqueen Apr 20, 2026

Choose a reason for hiding this comment

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

And this should arguably be called toSpanSingletonLIE or toSpanSingletonₗᵢ and flipped (i.e., E ≃ₗᵢ[𝕜] ..)? I'm not sure about the name.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. 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.

2 participants