leanprover-community/mathlib4

Make `scripts/add_deprecations.sh` support additivised declarations

Open

#38,550 opened on Apr 26, 2026

View on GitHub
 (3 comments) (1 reaction) (0 assignees)Lean (1,381 forks)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (3,405 stars)
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