Commit 2022-08-09 12:53 d812abd8
View on Github →refactor(algebra/periodic): weaken antiperiodic typeclass assumptions (#15941)
Many lemmas about antiperiodic have typeclass assumptions on the
codomain of the antiperiodic function that are stronger than
necessary, generally because the weaker typeclasses didn't exist when
most of the lemmas were added. Weaken those assumptions as follows:
add_grouptohas_involutive_neg(the most common change).add_grouptohas_neg(in a few places).add_grouptosubtraction_monoid(twice).ringtohas_mulwithhas_distrib_neg(once).division_ringtodivision_monoidwithhas_distrib_neg(once). There remain three cases where lemmas have typeclass assumptions requiring addition and subtraction operations on the codomain, despite those operations not otherwise being used in the lemma, because of the lack of more specific typeclasses appropriate to those lemmas. The two that I changed to usesubtraction_monoidactually only need theneg_zerolemma (along withhas_involutive_negin one case), but we don't have a typeclass for types that satisfyneg_zero(one example without addition and subtraction operations issign_type). Andantiperiodic.smulactually only needs a scalar action that satisfiessmul_neg, without needing addition or subtraction operations on the type on which the scalar action acts, but again we don't have such a typeclass (and I don't know if we have any such scalar actions in mathlib for which such a typeclass would actually enable this lemma to apply).