Skip to content

chore(Analysis): golf Order, Asymptotic, and Between#38041

Closed
yuanyi-350 wants to merge 4 commits intoleanprover-community:masterfrom
yuanyi-350:golf_52
Closed

chore(Analysis): golf Order, Asymptotic, and Between#38041
yuanyi-350 wants to merge 4 commits intoleanprover-community:masterfrom
yuanyi-350:golf_52

Conversation

@yuanyi-350
Copy link
Copy Markdown
Collaborator

This PR extracts from #37968 the changes to the following files:

  • Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean
  • Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean
  • Mathlib/Analysis/Convex/Between.lean

This is intended to split those refactors into a standalone PR.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

PR summary c27c098f0d

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 14, 2026
@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

I ran a profiler comparison for the changed declarations in this PR, using [Elab.definition.value] on the actual merge-base c290b55c6e (before) and the PR head ab0cb64496 (after).

Results (seconds):

  • CStarAlgebra.isUnit_of_le: 0.553297 -> 0.207085 (-62.6%)
  • CStarAlgebra.norm_le_norm_of_nonneg_of_le: 5.278791 -> 3.585134 (-32.1%)
  • Function.locallyFinsuppWithin.one_isLittleO_logCounting_single: 0.218979 -> 0.028834 (-86.8%)
  • ValueDistribution.logCounting_isBigO_one_iff_analyticOnNhd: 0.441337 -> 0.050721 (-88.5%)
  • Wbtw.sameRay_vsub: 0.519748 -> 0.068429 (-86.8%)
  • Wbtw.collinear: 0.092810 -> 0.023367 (-74.8%)
  • wbtw_iff_sameRay_vsub: 0.634995 -> 0.035643 (-94.4%)

Overall:

  • All seven modified declarations got faster in this run.
  • The largest speedups were in wbtw_iff_sameRay_vsub, ValueDistribution.logCounting_isBigO_one_iff_analyticOnNhd, Wbtw.sameRay_vsub, and Function.locallyFinsuppWithin.one_isLittleO_logCounting_single.
  • No regression showed up.

Caveat:

  • This was a single-run trace.profiler comparison on the declaration bodies only, using [Elab.definition.value], so absolute times may vary slightly across runs.

@yuanyi-350 yuanyi-350 requested a review from grunweg April 14, 2026 14:39
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Apr 19, 2026

For reference, let me cross-link the comments here and here. (Can you update the PR description accordingly? Thanks!)

@yuanyi-350 yuanyi-350 closed this Apr 20, 2026
@yuanyi-350 yuanyi-350 deleted the golf_52 branch April 20, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants