Skip to content

[Merged by Bors] - chore: miscellaneous linter whitespace fixes#30663

Closed
grunweg wants to merge 1 commit intoleanprover-community:masterfrom
grunweg:whitespace1019
Closed

[Merged by Bors] - chore: miscellaneous linter whitespace fixes#30663
grunweg wants to merge 1 commit intoleanprover-community:masterfrom
grunweg:whitespace1019

Conversation

@grunweg
Copy link
Contributor

@grunweg grunweg commented Oct 18, 2025

Extracted from #30658. Found by adomani's extension of the commandStart linter to proof bodies.


Open in Gitpod

@github-actions
Copy link

PR summary 3af1c0aa0e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+-+- coe_mk

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

@grunweg
Copy link
Contributor Author

grunweg commented Oct 18, 2025

@YaelDillies @Ruben-VandeVelde Would one of you like to review this one?

Copy link
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Easy!

maintainer merge

Comment on lines 30 to 31
∀ (n i : ℕ), i < n → (iterate f a n)[i]? = f^[i] a
| n + 1, 0 , _ => by simp
| n + 1, 0, _ => by simp
| n + 1, i + 1, h => by simp [getElem?_iterate f (f a) n i (by simpa using h)]
Copy link
Member

Choose a reason for hiding this comment

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

This one is more subtle I think, there was clear intent to align the =>. I think it's okay to change it, but IMO this should be allowed by whatever tooling we use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with the intent. I'm sceptical about manual alignment, though - as this often becomes stale.
In this case, the proofs are also similar, but not too parallel, so this wasn't worth it to me.

I'm not sure how easy or difficult manual alignment is to detect. Manually disabling the linter seems like a good enough band-aid for now.


theorem formPerm_apply_lt_getElem (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
formPerm xs xs[n] = xs[n+1] := by
formPerm xs xs[n] = xs[n + 1] := by
Copy link
Member

Choose a reason for hiding this comment

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

These ones are also debatable IMO. I like a bit of flexibility in sticking together things n+1 in a complicated expression. But I won't fight for it.

Copy link
Contributor Author

@grunweg grunweg Oct 19, 2025

Choose a reason for hiding this comment

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

I understand this, abstractly! I think, however, that doing so consistently in a library like mathlib is very hard to impossible, and would much rather have a consistent and enforceable rule. (It's not trivial to make the commandStart linter allow this. Maybe the autoformatter will, but we won't know that for a while.)

Copy link
Member

@ADedecker ADedecker left a comment

Choose a reason for hiding this comment

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

Thanks! You can ignore my comments, they are just things I wanted to nuance.

bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 19, 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 19, 2025
@grunweg
Copy link
Contributor Author

grunweg commented Oct 19, 2025

Thanks for the careful review. I agree both places you flagged could be discussed carefully in the abstract. In this case, I think both changes are fine, so let me go ahead with the one that's easier to automate (namely, making the linter happy).
bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Oct 19, 2025
mathlib-bors bot pushed a commit that referenced this pull request Oct 19, 2025
Extracted from #30658. Found by `adomani`'s extension of the commandStart linter to proof bodies.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 19, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: miscellaneous linter whitespace fixes [Merged by Bors] - chore: miscellaneous linter whitespace fixes Oct 19, 2025
@mathlib-bors mathlib-bors bot closed this Oct 19, 2025
Jlh18 pushed a commit to Jlh18/mathlib4 that referenced this pull request Oct 24, 2025
)

Extracted from leanprover-community#30658. Found by `adomani`'s extension of the commandStart linter to proof bodies.
BeibeiX0 pushed a commit to BeibeiX0/mathlib4 that referenced this pull request Nov 7, 2025
)

Extracted from leanprover-community#30658. Found by `adomani`'s extension of the commandStart linter to proof bodies.
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.

3 participants