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_class
ishas_smul
+a • 0 = 0
distrib_smul
issmul_zero_class
+a • (x + y) = a • x + a • y
. The motivation for these classes is to instantiateqsmul
onsplitting_field
: in general scalar multiplication with rational numbers is not adistrib_mul_action
but it is adistrib_smul
, anddistrib_smul
is sufficient to lift an action to thesplitting_field
. I set up bothdistrib_mul_action
andsmul_with_zero
to 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
(withsmul
coming fromdistrib_mul_action
) and gettinga • 0 = 0
(withsmul
coming 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 anexample
test case to ensure everything stays OK.