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_classishas_smul+a • 0 = 0distrib_smulissmul_zero_class+a • (x + y) = a • x + a • y. The motivation for these classes is to instantiateqsmulonsplitting_field: in general scalar multiplication with rational numbers is not adistrib_mul_actionbut it is adistrib_smul, anddistrib_smulis sufficient to lift an action to thesplitting_field. I set up bothdistrib_mul_actionandsmul_with_zeroto be subclasses of the above classes, and unifysmul_zero(depending ondistrib_mul_action) andsmul_zero'(depending onsmul_with_zero) into one lemma. There are a few places where I need to help the elaborator because e.g. it's expectingunits.mk0 a ha • 0 = 0(withsmulcoming fromdistrib_mul_action) and gettinga • 0 = 0(withsmulcoming fromsmul_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 anexampletest case to ensure everything stays OK.