leanprover-community / leanprover-community/mathlib4
Make `scripts/add_deprecations.sh` support additivised declarations
Open
Nobody has claimed this yet.
enhancement
good first issue
- Dominant language
- Lean
- Stars
- 4.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, changing
@[to_additive]
lemma foo_mul ...
to
@[to_additive]
lemma bar_mul ...
then running scripts/add_deprecations.sh creates
@[to_additive]
lemma bar_mul ...
@[deprecated ...] alias foo_mul := bar_mul
It should instead create
@[to_additive]
lemma bar_mul ...
@[deprecated ...] alias foo_mul := bar_mul
@[deprecated ...] alias foo_add := bar_add
Note that
@[to_additive (attr := deprecated ...)] alias foo_mul := bar_mul
doesn't work because deprecated loses track of what the deprecated declaration is an alias of (see #19424).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scripts/add_deprecations.sh and trace how it handles a renamed declaration marked with @[to_additive]. Run the script using the foo_mul/bar_mul example from the issue; done means it emits deprecated aliases for both foo_mul := bar_mul and foo_add := bar_add, without relying on the unsupported attr form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100