Skip to content

[Merged by Bors] - chore: use the positivity [h, h'] syntax when useful#30654

Closed
grunweg wants to merge 1 commit intoleanprover-community:masterfrom
grunweg:golf-positivity-have
Closed

[Merged by Bors] - chore: use the positivity [h, h'] syntax when useful#30654
grunweg wants to merge 1 commit intoleanprover-community:masterfrom
grunweg:golf-positivity-have

Conversation

@grunweg
Copy link
Copy Markdown
Contributor

@grunweg grunweg commented Oct 18, 2025

Since #30388, have := foo; positivity can be shortened to positivity [foo].
Make use of that when sensible.

I searched for all occurrences of have :.*\n\s*positi (using VS Code, i.e. using rg internally) and inspected them manually. In a few cases, keeping the have separate seemed more readable to me.


Open in Gitpod

@grunweg grunweg added awaiting-bench This PR needs to be benchmarked before merging bench-after-CI labels Oct 18, 2025
@grunweg grunweg requested a review from fpvandoorn October 18, 2025 17:12
@github-actions
Copy link
Copy Markdown

PR summary 94c059e90a

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

@ghost
Copy link
Copy Markdown

ghost commented Oct 18, 2025

!bench

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 562c75f.
There were no significant changes against commit 94c059e.

@github-actions
Copy link
Copy Markdown

File Instructions %
build -2.523⬝10⁹ (+0.00%)
CI run Lakeprof report

@grunweg grunweg removed the awaiting-bench This PR needs to be benchmarked before merging label Oct 18, 2025
@j-loreaux
Copy link
Copy Markdown
Contributor

Yes, please! And thank you!

Can you please add a short blurb in the PR description saying how you found these occurrences? Was it just grep? It would be nice if we had a systematic way to find all of them, as I think there are surely more than this.

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 18, 2025

✌️ grunweg can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Oct 18, 2025
@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Oct 18, 2025

Yes, I grepped (added that to the PR description) --- and just realised why I only found so few hits. Thanks for the inspiration, follow-up incoming :-)

@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Oct 18, 2025

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Oct 18, 2025
mathlib-bors bot pushed a commit that referenced this pull request Oct 18, 2025
Since #30388, `have := foo; positivity` can be shortened to `positivity [foo]`.
Make use of that when sensible.

I searched for all occurrences of `have :.*\n\s*positi` (using VS Code, i.e. using `rg` internally) and inspected them manually. In a few cases, keeping the `have` separate seemed more readable to me.
@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Oct 18, 2025

Update: searching for have .*\n\s*positi yields one more actionable location (and 14 others). Am I overlooking something, or are there indeed only this few places?

@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Oct 18, 2025

Filed the follow-up as #30656.

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 18, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: use the positivity [h, h'] syntax when useful [Merged by Bors] - chore: use the positivity [h, h'] syntax when useful Oct 18, 2025
@mathlib-bors mathlib-bors bot closed this Oct 18, 2025
@grunweg grunweg deleted the golf-positivity-have branch October 18, 2025 21:17
mathlib-bors bot pushed a commit that referenced this pull request Oct 18, 2025
Jlh18 pushed a commit to Jlh18/mathlib4 that referenced this pull request Oct 24, 2025
…mmunity#30654)

Since leanprover-community#30388, `have := foo; positivity` can be shortened to `positivity [foo]`.
Make use of that when sensible.

I searched for all occurrences of `have :.*\n\s*positi` (using VS Code, i.e. using `rg` internally) and inspected them manually. In a few cases, keeping the `have` separate seemed more readable to me.
Jlh18 pushed a commit to Jlh18/mathlib4 that referenced this pull request Oct 24, 2025
BeibeiX0 pushed a commit to BeibeiX0/mathlib4 that referenced this pull request Nov 7, 2025
…mmunity#30654)

Since leanprover-community#30388, `have := foo; positivity` can be shortened to `positivity [foo]`.
Make use of that when sensible.

I searched for all occurrences of `have :.*\n\s*positi` (using VS Code, i.e. using `rg` internally) and inspected them manually. In a few cases, keeping the `have` separate seemed more readable to me.
BeibeiX0 pushed a commit to BeibeiX0/mathlib4 that referenced this pull request Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). 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