Skip to content

[Merged by Bors] - feat(Tactic): linarith and rify for NNReal #35155

Closed
DavidLedvinka wants to merge 50 commits intoleanprover-community:masterfrom
DavidLedvinka:linarith_for_nnreal
Closed

[Merged by Bors] - feat(Tactic): linarith and rify for NNReal #35155
DavidLedvinka wants to merge 50 commits intoleanprover-community:masterfrom
DavidLedvinka:linarith_for_nnreal

Conversation

@DavidLedvinka
Copy link
Copy Markdown
Collaborator

@DavidLedvinka DavidLedvinka commented Feb 11, 2026

No description provided.

@DavidLedvinka DavidLedvinka added the WIP Work in progress label Feb 11, 2026
@github-actions github-actions bot added large-import Automatically added label for PRs with a significant increase in transitive imports t-meta Tactics, attributes or user commands labels Feb 11, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 11, 2026

PR summary cde919c85c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Tactic.Rify Mathlib.Tactic 1
Mathlib.Tactic.Linarith.NNRealPreprocessor (new file) 910

Declarations diff

+ coe_sub_of_lt
+ isNNRealtoReal
+ mkRifyContext
+ mk_toReal_nonneg_prf
+ nnrealToReal
+ rifyProof
+ toReal_eq
+ toReal_le
+ toReal_lt
+ toReal_ne

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

note: file MathlibTest/linarith.lean` was renamed to `MathlibTest/Linarith/Basic.lean without a module deprecation
Please create a follow-up pull request adding one. Thanks!

David Ledvinka added 2 commits February 12, 2026 16:52
@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 19, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 19, 2026
@mathlib-merge-conflicts
Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 19, 2026
DavidLedvinka and others added 5 commits February 21, 2026 14:25
Co-authored-by: Jovan Gerbscheid <56355248+JovanGerb@users.noreply.github.com>
Co-authored-by: Jovan Gerbscheid <56355248+JovanGerb@users.noreply.github.com>
Co-authored-by: Jovan Gerbscheid <56355248+JovanGerb@users.noreply.github.com>
Co-authored-by: Jovan Gerbscheid <56355248+JovanGerb@users.noreply.github.com>
Co-authored-by: Jovan Gerbscheid <56355248+JovanGerb@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@JovanGerb JovanGerb left a comment

Choose a reason for hiding this comment

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

For the trick you to do add the preprocessor in a later file, wouldn't it be more natural to have

initialize defaultPreprocessors : IO.Ref (Array GlobalBranchingPreprocessor) ←
  IO.mkRef #[filterComparisons, removeNegations, natToInt, strengthenStrictInt,
    compWithZero, cancelDenoms]

And then in the later file, you can use initialize to push the NNReal preprocessor onto this array.
This way, the preprocessing can be extended in other ways in the future.

@DavidLedvinka
Copy link
Copy Markdown
Collaborator Author

For the trick you to do add the preprocessor in a later file, wouldn't it be more natural to have

initialize defaultPreprocessors : IO.Ref (Array GlobalBranchingPreprocessor) ←
  IO.mkRef #[filterComparisons, removeNegations, natToInt, strengthenStrictInt,
    compWithZero, cancelDenoms]

And then in the later file, you can use initialize to push the NNReal preprocessor onto this array. This way, the preprocessing can be extended in other ways in the future.

I thought about this but the reason I decided against it was:

a) I suspect there won't need to be that many uses of this trick
b) Order is important for preprocessors.

It seems more convenient to see the order of everything up front given any subset is being used rather than make sure we are threading a bunch of preprocessors in separate files correctly.

@JovanGerb
Copy link
Copy Markdown
Contributor

Aha, I didn't realize that their order was important. In that case I'm happy with the current implementation.

Thank you 🎉

maintainer merge

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by JovanGerb.

@mathlib-triage mathlib-triage bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Feb 21, 2026
@hrmacbeth
Copy link
Copy Markdown
Member

bors r+

@mathlib-triage mathlib-triage bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Feb 22, 2026
mathlib-bors bot pushed a commit that referenced this pull request Feb 22, 2026
Co-authored-by: David Ledvinka <dledvinka.ledvinka@mail.utoronto.ca>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 22, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Tactic): linarith and rify for NNReal [Merged by Bors] - feat(Tactic): linarith and rify for NNReal Feb 22, 2026
@mathlib-bors mathlib-bors bot closed this Feb 22, 2026
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
…35155)

Co-authored-by: David Ledvinka <dledvinka.ledvinka@mail.utoronto.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

file-removed A Lean module was (re)moved without a `deprecated_module` annotation ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants