Introduce smul_with_zero
#
In analogy with the usual monoid action on a Type M
, we introduce an action of a
monoid_with_zero
on a Type with 0
.
In particular, for Types R
and M
, both containing 0
, we define smul_with_zero R M
to
be the typeclass where the products r • 0
and 0 • m
vanish for all r : R
and all m : M
.
Moreover, in the case in which R
is a monoid_with_zero
, we introduce the typeclass
mul_action_with_zero R M
, mimicking group actions and having an absorbing 0
in R
.
Thus, the action is required to be compatible with
- the unit of the monoid, acting as the identity;
- the zero of the monoid_with_zero, acting as zero;
- associativity of the monoid.
We also add an instance
:
- any
monoid_with_zero
has amul_action_with_zero R R
acting on itself.
- to_has_scalar : has_scalar R M
- smul_zero : ∀ (r : R), r • 0 = 0
- zero_smul : ∀ (m : M), 0 • m = 0
smul_with_zero
is a class consisting of a Type R
with 0 ∈ R
and a scalar multiplication
of R
on a Type M
with 0
, such that the equality r • m = 0
holds if at least one among r
or m
equals 0
.
Equations
- mul_zero_class.to_smul_with_zero R = {to_has_scalar := {smul := has_mul.mul (mul_zero_class.to_has_mul R)}, smul_zero := _, zero_smul := _}
Like mul_zero_class.to_smul_with_zero
, but multiplies on the right.
Equations
- mul_zero_class.to_opposite_smul_with_zero R = {to_has_scalar := {smul := has_scalar.smul (has_mul.to_has_opposite_scalar R)}, smul_zero := _, zero_smul := _}
Equations
- add_monoid.to_smul_with_zero M = {to_has_scalar := add_monoid.has_scalar_nat _inst_1, smul_zero := _, zero_smul := _}
Note that this lemma has different typeclass assumptions to smul_zero
.
Pullback a smul_with_zero
structure along an injective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- function.injective.smul_with_zero f hf smul = {to_has_scalar := {smul := has_scalar.smul _inst_6}, smul_zero := _, zero_smul := _}
Pushforward a smul_with_zero
structure along a surjective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- function.surjective.smul_with_zero f hf smul = {to_has_scalar := {smul := has_scalar.smul _inst_6}, smul_zero := _, zero_smul := _}
Compose a smul_with_zero
with a zero_hom
, with action f r' • m
Equations
- smul_with_zero.comp_hom M f = {to_has_scalar := {smul := has_scalar.smul ∘ ⇑f}, smul_zero := _, zero_smul := _}
- to_mul_action : mul_action R M
- smul_zero : ∀ (r : R), r • 0 = 0
- zero_smul : ∀ (m : M), 0 • m = 0
An action of a monoid with zero R
on a Type M
, also with 0
, extends mul_action
and
is compatible with 0
(both in R
and in M
), with 1 ∈ R
, and with associativity of
multiplication on the monoid M
.
Equations
See also semiring.to_module
Equations
- monoid_with_zero.to_mul_action_with_zero R = {to_mul_action := {to_has_scalar := smul_with_zero.to_has_scalar (mul_zero_class.to_smul_with_zero R), one_smul := _, mul_smul := _}, smul_zero := _, zero_smul := _}
Like monoid_with_zero.to_mul_action_with_zero
, but multiplies on the right. See also
semiring.to_opposite_module
Equations
- monoid_with_zero.to_opposite_mul_action_with_zero R = {to_mul_action := {to_has_scalar := smul_with_zero.to_has_scalar (mul_zero_class.to_opposite_smul_with_zero R), one_smul := _, mul_smul := _}, smul_zero := _, zero_smul := _}
Pullback a mul_action_with_zero
structure along an injective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- function.injective.mul_action_with_zero f hf smul = {to_mul_action := {to_has_scalar := mul_action.to_has_scalar (function.injective.mul_action ⇑f hf smul), one_smul := _, mul_smul := _}, smul_zero := _, zero_smul := _}
Pushforward a mul_action_with_zero
structure along a surjective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- function.surjective.mul_action_with_zero f hf smul = {to_mul_action := {to_has_scalar := mul_action.to_has_scalar (function.surjective.mul_action ⇑f hf smul), one_smul := _, mul_smul := _}, smul_zero := _, zero_smul := _}
Compose a mul_action_with_zero
with a monoid_with_zero_hom
, with action f r' • m
Equations
- mul_action_with_zero.comp_hom M f = {to_mul_action := {to_has_scalar := {smul := has_scalar.smul ∘ ⇑f}, one_smul := _, mul_smul := _}, smul_zero := _, zero_smul := _}