Introduce SMulWithZero
#
In analogy with the usual monoid action on a Type M
, we introduce an action of a
MonoidWithZero
on a Type with 0
.
In particular, for Types R
and M
, both containing 0
, we define SMulWithZero 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 MonoidWithZero
, we introduce the typeclass
MulActionWithZero 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
MonoidWithZero
, acting as zero; - associativity of the monoid.
We also add an instance
:
- any
MonoidWithZero
has aMulActionWithZero R R
acting on itself.
Main declarations #
smulMonoidWithZeroHom
: Scalar multiplication bundled as a morphism of monoids with zero.
- smul : R → M → M
Scalar multiplication by the scalar
0
is0
.
SMulWithZero
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
.
Instances
Equations
- MulZeroClass.toSMulWithZero R = SMulWithZero.mk (_ : ∀ (a : R), 0 * a = 0)
Like MulZeroClass.toSMulWithZero
, but multiplies on the right.
Equations
- MulZeroClass.toOppositeSMulWithZero R = SMulWithZero.mk (_ : ∀ (a : R), a * 0 = 0)
Pullback a SMulWithZero
structure along an injective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- Function.Injective.smulWithZero f hf smul = SMulWithZero.mk (_ : ∀ (a : M'), 0 • a = 0)
Instances For
Pushforward a SMulWithZero
structure along a surjective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- Function.Surjective.smulWithZero f hf smul = SMulWithZero.mk (_ : ∀ (m : M'), 0 • m = 0)
Instances For
Compose a SMulWithZero
with a ZeroHom
, with action f r' • m
Equations
- SMulWithZero.compHom M f = SMulWithZero.mk (_ : ∀ (m : M), ↑f 0 • m = 0)
Instances For
Equations
- AddMonoid.natSMulWithZero = SMulWithZero.mk (_ : ∀ (a : M), 0 • a = 0)
Equations
- AddGroup.intSMulWithZero = SMulWithZero.mk (_ : ∀ (a : M), 0 • a = 0)
- smul : R → M → M
Scalar multiplication by any element send
0
to0
.Scalar multiplication by the scalar
0
is0
.
An action of a monoid with zero R
on a Type M
, also with 0
, extends MulAction
and
is compatible with 0
(both in R
and in M
), with 1 ∈ R
, and with associativity of
multiplication on the monoid M
.
Instances
Equations
- MulActionWithZero.toSMulWithZero R M = SMulWithZero.mk (_ : ∀ (m : M), 0 • m = 0)
See also Semiring.toModule
Equations
- MonoidWithZero.toMulActionWithZero R = let src := MulZeroClass.toSMulWithZero R; let src_1 := Monoid.toMulAction R; MulActionWithZero.mk (_ : ∀ (a : R), a • 0 = 0) (_ : ∀ (m : R), 0 • m = 0)
Like MonoidWithZero.toMulActionWithZero
, but multiplies on the right. See also
Semiring.toOppositeModule
Equations
- One or more equations did not get rendered due to their size.
Pullback a MulActionWithZero
structure along an injective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pushforward a MulActionWithZero
structure along a surjective zero-preserving homomorphism.
See note [reducible non-instances].
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compose a MulActionWithZero
with a MonoidWithZeroHom
, with action f r' • m
Equations
- MulActionWithZero.compHom M f = let src := SMulWithZero.compHom M ↑f; MulActionWithZero.mk (_ : ∀ (a : R'), a • 0 = 0) (_ : ∀ (m : M), 0 • m = 0)
Instances For
Scalar multiplication as a monoid homomorphism with zero.
Equations
- One or more equations did not get rendered due to their size.