Commit 2022-09-23 14:45 8f66240c
View on Github →feat(group_theory/group_action): define distrib_smul and smul_zero_class (#16123)
These are two new superclasses of distrib_mul_action that get rid of the mul_action part:
- smul_zero_classis- has_smul+- a • 0 = 0
- distrib_smulis- smul_zero_class+- a • (x + y) = a • x + a • y. The motivation for these classes is to instantiate- qsmulon- splitting_field: in general scalar multiplication with rational numbers is not a- distrib_mul_actionbut it is a- distrib_smul, and- distrib_smulis sufficient to lift an action to the- splitting_field. I set up both- distrib_mul_actionand- smul_with_zeroto be subclasses of the above classes, and unify- smul_zero(depending on- distrib_mul_action) and- smul_zero'(depending on- smul_with_zero) into one lemma. There are a few places where I need to help the elaborator because e.g. it's expecting- units.mk0 a ha • 0 = 0(with- smulcoming from- distrib_mul_action) and getting- a • 0 = 0(with- smulcoming from- smul_zero_class). Apparently having both the type and instance differ is too hard for the unifier. Because we don't have definitional eta for structures yet, setting up the inheritance is a bit more tricky than you might think; I added an- exampletest case to ensure everything stays OK.