Open fpvandoorn opened 1 year ago
to_additive
does not seem to support the auxiliary lemmas generated by norm_cast
: See #8916
Can you please minimize the example?
Is this minimal enough?
import Mathlib.Data.Finset.Pointwise
open scoped Pointwise
@[to_additive]
lemma mul_foo {α : Type*} [DecidableEq α] [Mul α] (s t : Finset α) :
(↑(s * t) : Set α) = ↑s * ↑t := by norm_cast
/-
application type mismatch
Mathlib.Data.Finset.Pointwise._auxLemma.9
argument has type
Add α
but function has type
∀ [inst : Mul α] (s t : Finset α), ↑s * ↑t = ↑(s * t)
-/
Yes, thanks! This was actually already a todo in the code. I will see if I can find a more systematic way to additivize new declarations generated attributes.
norm_cast
handling is fixed in #14628
This is a single issue for new features or feature requests for
to_additive
, that I'll try to keep up-to-date. Feel free to comment with other suggestionsto_additive
connections in #1056to_additive?
, showing the type of the generated declaration (and not the body for lemmas)Pow.mk
toSMul.mk
(requires re-ordering the function arguments in a particular argument)to_additive (attr := scoped simp)
can scope the additive version in the wrong namespace (Zulip).norm_cast
(and other attributes).to_additive
doesn't translate operations. Zulip 1 2to_additive
does not supportmatch ... with
. Zulipnoncomputable
(this is https://github.com/leanprover/lean4/pull/2610)congr
can generate complicated terms involvingEq.rec
thatto_additive
has a hard time to additivize. E.g.MeasureTheory.Measure.haar.prehaar_sup_eq
to_additive
doesn't work well withprivate
: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60.40.5Bto_additive.5D.60.20bug.3Fto_additive
doesn't copy the docstring ofalias
: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/to_additive.20and.20deprecated.20alias