Zulip Chat Archive
Stream: Is there code for X?
Topic: Scalar multiplication on the right
Anne Baanen (Jul 12 2022 at 13:00):
We have docs#linear_map.lsmul. Isn't there a right multiplication version that doesn't need commutativity? It's not hard to show:
def linear_map.rsmul (R : Type*) {M : Type*} [semiring R] [add_comm_monoid M] [module R M] (y : M) : R →ₗ[R] M :=
{ to_fun := λ r, r • y,
map_add' := λ r s, add_smul r s y,
map_smul' := λ r s, smul_assoc r s y }
Yury G. Kudryashov (Jul 12 2022 at 13:03):
We have docs#linear_map.smul_right
Anne Baanen (Jul 12 2022 at 13:04):
That (linear_map.id.smul_right y
) works, thanks!
Yury G. Kudryashov (Jul 12 2022 at 13:05):
Probably, we should have a name for this specific linear map.
Yury G. Kudryashov (Jul 12 2022 at 13:06):
It is used, e.g., in the definition of src#has_deriv_at_filter
Eric Wieser (Jul 12 2022 at 13:15):
docs#linear_map.to_span_singleton is that map
Anne Baanen (Jul 12 2022 at 13:22):
That's an unhelpful name...
Eric Wieser (Jul 12 2022 at 13:28):
Definitely
Eric Wieser (Jul 12 2022 at 13:28):
I also feel like smul_right
ought to be defined in terms of it, not vice versa
Last updated: Dec 20 2023 at 11:08 UTC