Skip to content

Conversation

@euprunin
Copy link
Collaborator

@euprunin euprunin commented Jan 5, 2026


The goal of this golfing PR is to decrease the number of times lemmas are called explicitly (replacing calls to lemmas with calls to tactics). Any decrease in compilation time is a welcome side effect, although it is not a primary objective.

Trace profiling results (shown if ≥10 ms before or after):

  • LinearIsometry.extend_apply: 159 ms before, 109 ms after 🎉
  • Submodule.finrank_add_inf_finrank_orthogonal: 219 ms before, 193 ms after 🎉
  • maximal_orthonormal_iff_basis_of_finiteDimensional: 100 ms before, 58 ms after 🎉
  • Field.primitive_element_iff_algHom_eq_of_eval: 508 ms before, 460 ms after 🎉
  • Field.finSepDegree_eq: 118 ms before, 89 ms after 🎉
  • IntermediateField.adjoin_eq_adjoin_pow_expChar_pow_of_isSeparable: 638 ms before, 611 ms after 🎉
  • IntermediateField.adjoin_simple_eq_adjoin_pow_expChar_pow_of_isSeparable': 57 ms before, <10 ms after 🎉
  • LinearIndependent.map_pow_expChar_pow_of_isSeparable: 314 ms before, 268 ms after 🎉
  • IntermediateField.rank_bot_mul_relrank: 775 ms before, 686 ms after 🎉
  • EuclideanGeometry.exists_circumradius_eq_of_cospherical: 63 ms before, 41 ms after 🎉
  • EuclideanGeometry.exists_circumcenter_eq_of_cospherical: 63 ms before, 41 ms after 🎉
  • EuclideanGeometry.exists_circumsphere_eq_of_cospherical: 64 ms before, 43 ms after 🎉
  • Submodule.natAbs_det_equiv: 653 ms before, 587 ms after 🎉
  • Matrix.rank_le_card_width: 65 ms before, 16 ms after 🎉
  • Matrix.rank_le_card_height: 80 ms before, 12 ms after 🎉
  • LinearMap.BilinForm.exists_orthogonal_basis: 606 ms before, 581 ms after 🎉
  • RingOfIntegers.isUnit_norm: 654 ms before, 584 ms after 🎉

This golfing PR is batched under the following guidelines:

  • Up to ~5 changed files per PR
  • Up to ~25 changed declarations per PR
  • Up to ~100 changed lines per PR

Open in Gitpod

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

PR summary 959c85291a

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

@euprunin
Copy link
Collaborator Author

euprunin commented Jan 5, 2026

!bench

@leanprover-radar
Copy link

leanprover-radar commented Jan 5, 2026

Benchmark results for 018af2c against 959c852 are in! @euprunin

Small changes (3✅, 3🟥)
  • build/module/Mathlib.Algebra.Order.Hom.TypeTags//instructions: -220.7M (-2.3%)
  • 🟥 build/module/Mathlib.Lean.Name//instructions: +232.7M (+7.0%)
  • build/module/Mathlib.Tactic.Coe//instructions: -384.4M (-9.8%)
  • 🟥 build/module/Mathlib.Tactic.Recover//instructions: +390.1M (+8.7%)
  • build/module/Mathlib.Topology.MetricSpace.Ultra.TotallySeparated//instructions: -395.4M (-6.2%)
  • 🟥 build/module/Mathlib.Util.AtLocation//instructions: +130.1M (+3.1%)

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Jan 6, 2026
mathlib-bors bot pushed a commit that referenced this pull request Jan 6, 2026
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 6, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: golf proofs [Merged by Bors] - chore: golf proofs Jan 6, 2026
@mathlib-bors mathlib-bors bot closed this Jan 6, 2026
@adomani adomani mentioned this pull request Jan 16, 2026
goliath-klein pushed a commit to PrParadoxy/mathlib4 that referenced this pull request Jan 24, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants