Skip to content

refactor(NumberTheory): golf Mathlib/NumberTheory/PellMatiyasevic#38494

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

refactor(NumberTheory): golf Mathlib/NumberTheory/PellMatiyasevic#38494
yuanyi-350 wants to merge 2 commits intoleanprover-community:masterfrom
yuanyi-350:N_10

Conversation

@yuanyi-350
Copy link
Copy Markdown
Collaborator

  • simplifies pellZd_succ_succ in Mathlib/NumberTheory/PellMatiyasevic by replacing a hand-written intermediate equality with a direct ext/simp/ring_nf proof

Extracted from #38144

Open in Gitpod

@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 25, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 25, 2026

PR summary 9268b22206

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.


Decrease in tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type
6205 -1 backward.isDefEq.respectTransparency

Current commit 1c154ec9da
Reference commit 9268b22206

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-number-theory Number theory (also use t-algebra or t-analysis to specialize) label Apr 25, 2026
@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

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

Results (seconds):

  • Pell.pellZd_succ_succ: 0.592 -> 0.433 (-26.9%)

Overall:

  • Pell.pellZd_succ_succ is faster after replacing the hand-written intermediate equality with a direct ext/simp/ring_nf proof.

@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

!bench

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented Apr 25, 2026

Benchmark results for 83d958a against 9268b22 are in. No significant results found. @yuanyi-350

  • 🟥 build//instructions: +3.6G (+0.00%)

Small changes (1✅, 1🟥)

  • 🟥 build/module/Mathlib.MeasureTheory.MeasurableSpace.Card//instructions: +432.9M (+3.60%)
  • build/module/Mathlib.Tactic.SimpRw//instructions: -547.6M (-12.11%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex OpenAI Codex wrote (parts of) this PR. LLM-generated PRs with substantial input from LLMs - review accordingly t-number-theory Number theory (also use t-algebra or t-analysis to specialize)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants