mathlib4 icon indicating copy to clipboard operation
mathlib4 copied to clipboard

fix: restrict abv positivity extension to variable functions

Open fpvandoorn opened this issue 1 month ago • 3 comments

  • Restrict the evalAbv positivity extension to only apply to variable functions. Note: this extension is called on all applications, and uses type-class inference to see whether it applies
  • Fix a bug in evalAbs, which would return .none, even when it could return .nonneg.
  • Originally hoped that this would improve performance, but that does not seem to be the case.

Open in Gitpod

fpvandoorn avatar Dec 12 '25 13:12 fpvandoorn

PR summary e11cecf457

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

github-actions[bot] avatar Dec 12 '25 13:12 github-actions[bot]

!bench

fpvandoorn avatar Dec 12 '25 16:12 fpvandoorn

Benchmark results for e90beccdbac9614420d87c305cd945030ff34c32 against e11cecf457b7114a4d013dfb872273c41da6ee2d are in! @fpvandoorn

No significant changes detected.

leanprover-radar avatar Dec 12 '25 16:12 leanprover-radar

It's not possible for f to be a bvar. Note that whnf will panic if it sees a bvar as the head expression.

JovanGerb avatar Dec 20 '25 09:12 JovanGerb

Do we also want it to work for a family of functions? I.e. if f.getAppFn.isFVar?

Otherwise, looks good to me.

JovanGerb avatar Dec 20 '25 20:12 JovanGerb