Zulip Chat Archive
Stream: Is there code for X?
Topic: SMulCommClass of CommMonoid
Andrew Yang (Jun 19 2024 at 20:16):
Do we not have this?
import Mathlib.Algebra.Group.Action.Defs
instance {R M : Type*} [CommMonoid M] [SMul R M] [IsScalarTower R M M] : SMulCommClass R M M where
smul_comm r s x := by
rw [← one_smul M (s • x), ← smul_assoc, smul_comm, smul_assoc, one_smul]
Kevin Buzzard (Jun 19 2024 at 23:16):
simp only [smul_eq_mul, mul_comm s, smul_mul_assoc]
avoids the 1
. The s
stops it looping :-)
Junyan Xu (Jun 20 2024 at 02:49):
apply?
and rw?
helped me find
import Mathlib.Algebra.Group.Action.Defs
instance {R M : Type*} [CommMonoid M] [SMul R M] [IsScalarTower R M M] :
SMulCommClass R M M :=
.of_mul_smul_one fun r m ↦ by rw [mul_comm, smul_one_mul]
Last updated: May 02 2025 at 03:31 UTC