Open
Description
This is a single issue for issues or feature requests for to_additive, that I'll try to keep up-to-date. Feel free to comment with other suggestions
- Reorder arguments using an arbitrary permutation. This can be used to fix some
to_additiveconnections in [Merged by Bors] - feat: Port GroupTheory.GroupAction.Prod #1056 - Improve output of
to_additive?, showing the type of the generated declaration (and not the body for lemmas) - Even more reorder features, so that we can reorder
Pow.mktoSMul.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). - [bug] additivize lemmas generated by
norm_cast(and other attributes). - Allow specifying types where
to_additivedoesn't translate operations. Zulip 1 2 -- fixed by [Merged by Bors] - feat(to_additive): option to not translate operations on a type #19297 - [probably wontfix]:
to_additivedoes not supportmatch ... with. Zulip, also filed as to_additive doesn't support match #1428 - noncomputable definitions in a noncomputable sections won't be translated properly unless you explicitly specify
noncomputable(this is feat: mark predefinitions that failed to compile as noncomputable leanprover/lean4#2610) - The
congrcan generate complicated terms involvingEq.recthatto_additivehas a hard time to additivize. E.g.MeasureTheory.Measure.haar.prehaar_sup_eq - Apparently
to_additivedoesn't work well withprivate: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60.40.5Bto_additive.5D.60.20bug.3F -
to_additivedoesn't copy the docstring ofalias: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/to_additive.20and.20deprecated.20alias -
alias,deprecated, andto_additivedon't get along together #19424 -
to_additiveshould additivize structures (warning: requires syntax for adding docstrings to constructors) -
to_additiveshould additivize instances created by theextends-clause for structures (i.e. put these instances into the translation dictionary). This is possible since feat: record all structure parents inStructureInfoleanprover/lean4#5853 -- fixed in [Merged by Bors] - fix(to_additive): automatically translate all instances generated byextends#19302 - Improve the
to_additiveheuristic so that we can support lemmas that have both a variable ring-like type (that should not be additivized) and a variable monoid-like type (that should be). This would allow writing a multiplicative version of MeasureTheory.convolution whereGis multiplicative andto_additiveadditivizes it (without touching𝕜) (Zulip, and there are probably more).
Note: We now have the optiondont_translateto work around limitations of the heuristic. - (low priority) More robustly reorder universe variables
- Allow for a declaration to have multiple
to_additivetranslations, depending on the "relevant" arguments (the types where we additivize functions). We can already specify which ones to translate usingdont_translate, and this would require finding the right translation, and maybe automatically generating the names of the various additive versions. - (hard) somehow translate from
G →* Multiplicative HtoAdditive G →+ H -
to_dualandto_additiveinteraction, and potentially with a third translation attribute (orsimps) - Make
guessNamehashmaps into environment extesions
Reacted by Bolton Bailey, Jovan Gerbscheid, Violeta Hernández Palacios and Miyahara Kō
Metadata
Metadata
Assignees
Labels
No labels
Activity
perf: improve performance of `to_additive` (#3632)
perf: improve performance of `to_additive` (#3632)
perf: improve performance of `to_additive` (#3632)
perf: improve performance of `to_additive` (#3632)
Squashed commit of the following:
[-]`to_additive` feature requests[/-][+]`to_additive` feature requests / issues[/+]YaelDillies commentedon Dec 9, 2023
to_additivedoes not seem to support the auxiliary lemmas generated bynorm_cast: See #8916fpvandoorn commentedon Dec 11, 2023
Can you please minimize the example?
YaelDillies commentedon Dec 11, 2023
Is this minimal enough?
fpvandoorn commentedon Dec 11, 2023
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.
fpvandoorn commentedon Jul 10, 2024
norm_casthandling is fixed in #14628feat: toAdditive to transfer MatcherInfo data
feat: toAdditive to transfer MatcherInfo data (#16026)
feat: toAdditive to transfer MatcherInfo data (#16026)
feat: toAdditive to transfer MatcherInfo data (#16026)
feat: toAdditive to transfer MatcherInfo data (#16026)
YaelDillies commentedon Jul 11, 2025
This makes
to_additiveincompatible withnoncomputable section. This has come up in #26774.