Skip to content

[Merged by Bors] - feat: improve toAdditive.guessName#715

Closed
fpvandoorn wants to merge 3 commits intomasterfrom
toAdditiveTranslate
Closed

[Merged by Bors] - feat: improve toAdditive.guessName#715
fpvandoorn wants to merge 3 commits intomasterfrom
toAdditiveTranslate

Conversation

@fpvandoorn
Copy link
Copy Markdown
Member

@fpvandoorn fpvandoorn commented Nov 24, 2022

  • The heuristic to split names did it wrong on a long sequence of capital letters. The new heuristic is to have a sequence of "white-listed" names that only consist of capital letters (currently ["LE", "LT", "WF"]). This new heuristic correctly splits ZeroLEHAdd and HSMul
  • translate [h]pow to [h]smul (see [Merged by Bors] - fix(Algebra/Group/Defs): make to_additive play nice with pow and smul #706). I believe Mathlib4 never used the previous automatic translation pow -> nsmul (I used regex @\[to_additive\]\n?.*(_p|P| p)ow to search). Since capitalization goes wrong in this case, add some cases in fixAbbreviation to fix it.
  • Fix all places where the capitalization Smul was used instead of SMul.

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Nov 25, 2022

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Nov 25, 2022
bors bot pushed a commit that referenced this pull request Nov 25, 2022
* The heuristic to split names did it wrong on a long sequence of capital letters. The new heuristic is to have a sequence of "white-listed" names that only consist of capital letters (currently `["LE", "LT", "WF"]`). This new heuristic correctly splits `ZeroLEHAdd` and `HSMul`
* translate `[h]pow` to `[h]smul` (see #706). I believe Mathlib4 never used the previous automatic translation `pow -> nsmul` (I used regex `@\[to_additive\]\n?.*(_p|P| p)ow` to search). Since capitalization goes wrong in this case, add some cases in `fixAbbreviation` to fix it.
* Fix all places where the capitalization `Smul` was used instead of `SMul`.
@bors
Copy link
Copy Markdown

bors bot commented Nov 25, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: improve toAdditive.guessName [Merged by Bors] - feat: improve toAdditive.guessName Nov 25, 2022
@bors bors bot closed this Nov 25, 2022
@bors bors bot deleted the toAdditiveTranslate branch November 25, 2022 16:37
bors bot pushed a commit that referenced this pull request Jan 24, 2023
* I tried translating it to `smul` in #715, but that was a bad decision
* It is possible that some lemmas that want to be called `smul` now use `nsmul`. This doesn't raise an error unless they are aligned or explicitly used elsewhere.
* Rename some lemmas from `smul` to `nsmul`.
* [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/to_additive.20translating.20pow.20to.20nsmul)



Co-authored-by: Reid Barton <rwbarton@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants