Skip to content

perf(Tactic/Positivity): run extensions in reducible transparency - #43504

Open
JovanGerb wants to merge 7 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-positivity-reducible
Open

perf(Tactic/Positivity): run extensions in reducible transparency#43504
JovanGerb wants to merge 7 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-positivity-reducible

Conversation

@JovanGerb

@JovanGerb JovanGerb commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

This PR makes it so that positivity extensions are executed at reducible transparency, which should help with proof maintainability, and gives a slight speedup.

  • This does not affect the check of whether the goal is a positivity goal. So, 0 i < x is still considered a positivity goal, even though 0 i is not defeq to 0 at reducible transparency.
  • The positivity extension for subtraction is checking that it has the right instance using isDefEq, so this has to be done at the implicit transparency. Apparently, this change causes positivity to succeed somewhere where it did not before.

Open in Gitpod

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

PR summary 53072a60b9

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

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

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 53072a6).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit 53072a60b9
Reference commit 80cbd0498a

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

@JovanGerb JovanGerb added the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Sep 6, 2026
@JovanGerb

Copy link
Copy Markdown
Contributor Author

!radar

@leanprover-radar

leanprover-radar commented Sep 6, 2026

Copy link
Copy Markdown

Benchmark results for 53072a6 against 80cbd04 are in. There are significant results. @JovanGerb

  • build//instructions: -26.2G (-0.02%)

Large changes (1✅)

  • build/module/Mathlib.Analysis.Normed.Field.Dense//instructions: -8.1G (-45.10%)

Medium changes (2✅)

  • build/module/Mathlib.Combinatorics.SimpleGraph.Extremal.Zarankiewicz//instructions: -1.4G (-13.23%)
  • build/module/Mathlib.RingTheory.Polynomial.GaussNorm//instructions: -1.9G (-6.41%)

Small changes (5✅, 1🟥)

  • 🟥 build/module/Aesop.Builder.Basic//instructions: +26.7M (+1.48%)
  • build/module/Mathlib.Analysis.Calculus.ContDiff.Bounds//instructions: -719.7M (-1.10%)
  • build/module/Mathlib.Analysis.Convex.StoneSeparation//instructions: -424.2M (-4.10%)
  • build/module/Mathlib.Analysis.InnerProductSpace.Orientation//instructions: -374.5M (-1.58%)
  • build/module/Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne//instructions: -3.0G (-6.78%)
  • build/module/Mathlib.Topology.VectorBundle.Riemannian//instructions: -1.4G (-2.18%)

@grunweg grunweg added the t-meta Tactics, attributes or user commands label Sep 7, 2026
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants