Skip to content

refactor(Analysis): golf Mathlib/Analysis/Convex/Between#38436

Open
yuanyi-350 wants to merge 2 commits intoleanprover-community:masterfrom
yuanyi-350:A_7
Open

refactor(Analysis): golf Mathlib/Analysis/Convex/Between#38436
yuanyi-350 wants to merge 2 commits intoleanprover-community:masterfrom
yuanyi-350:A_7

Conversation

@yuanyi-350
Copy link
Copy Markdown
Collaborator

  • rewrites Wbtw.sameRay_vsub via sameRay_of_mem_segment
  • rewrites Wbtw.collinear via collinear_insert_of_mem_affineSpan_pair
  • simplifies wbtw_iff_sameRay_vsub to a simp proof using segment lemmas

Extracted from #37968

Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

PR summary 1c558eb49a

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.

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 24, 2026
@yuanyi-350 yuanyi-350 added codex OpenAI Codex wrote (parts of) this PR. LLM-generated PRs with substantial input from LLMs - review accordingly labels Apr 24, 2026
@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

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

Results (seconds):

  • Wbtw.sameRay_vsub: 0.549536 -> 0.061617 (-88.79%)
  • Wbtw.collinear: 0.121434 -> 0.020693 (-82.96%)
  • wbtw_iff_sameRay_vsub: 0.643571 -> 0.021504 (-96.66%)

Overall:

  • All measured changed declarations are faster after this refactor.

exact ⟨t, rfl⟩
· refine ⟨1, ?_⟩
simp
simpa [Set.insert_comm] using collinear_insert_of_mem_affineSpan_pair h.mem_affineSpan
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do you need insert_comm here?

@grunweg grunweg added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 24, 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