leanprover-community / leanprover-community/mathlib4
`to_additive` feature requests / issues
Open
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
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 #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 #19297 - [probably wontfix]:
to_additivedoes not supportmatch ... with. Zulip, also filed as #1428 - noncomputable definitions in a noncomputable sections won't be translated properly unless you explicitly specify
noncomputable(this is https://github.com/leanprover/lean4/pull/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 - #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 https://github.com/leanprover/lean4/pull/5853 -- fixed in #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
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 by choosing one unchecked to_additive item and reading its linked Zulip discussion or referenced issue, such as #1428. Define completion for that single request before changing anything; this umbrella issue is addressed only when the selected behavior is implemented and its stated limitation is resolved.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100