Skip to content

Commit 73694cf

Browse files
committed
feat: clean up Mul -> FaithfulSMul instance structure (#34789)
Given `MulOneClass A`, the induced smultiplications `SMul A A` and `SMul (MulOpposite A) A` are faithful. As a result, the same holds when given `RightCancelMonoid A`, `LeftCancelMonoid A` or `RightCancelMonoidWithZero A`. the instances representing the latter three facts are removed due to their redundancy. (Also for the `to_additive` versions when applicable.) Secondly, given `Mul A`, and given `IsRightCancelMul A` or `IsLeftCancelMul A`, we find that `SMul A A` or `SMul (MulOpposite A) A` is faithful, respectively. The instances representing these facts are added. Co-authored-by: Edward van de Meent <edwardvdmeent@gmail.com>
1 parent a97056e commit 73694cf

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

Mathlib/Algebra/Group/Action/Faithful.lean

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,46 @@ export FaithfulVAdd (eq_of_vadd_eq_vadd)
5555
lemma smul_left_injective' [SMul M α] [FaithfulSMul M α] : Injective ((· • ·) : M → α → α) :=
5656
fun _ _ h ↦ FaithfulSMul.eq_of_smul_eq_smul (congr_fun h)
5757

58+
/-- `instSMulOfMul` is faithful when there is a (right) identity. -/
59+
@[to_additive /-- `instVAddOfAdd` is faithful when there is a (right) identity. -/]
60+
instance (R : Type*) [MulOneClass R] : FaithfulSMul R R where
61+
eq_of_smul_eq_smul {r₁ r₂} h := by simpa using h 1
62+
63+
/-- `Mul.toSMulMulOpposite` is faithful when there is a (left) identity. -/
64+
@[to_additive /-- `Add.toVAddAddOpposite` is faithful when there is a (left) identity. -/]
65+
instance (R : Type*) [MulOneClass R] : FaithfulSMul Rᵐᵒᵖ R where
66+
eq_of_smul_eq_smul {r₁ r₂} h := by simpa using h 1
67+
68+
/-- `instSMulOfMul` is faithful when multiplication is right cancellative. -/
69+
@[to_additive /-- `instVAddOfAdd` is faithful when addition is right cancellative. -/]
70+
instance (R : Type*) [Mul R] [IsRightCancelMul R] : FaithfulSMul R R where
71+
eq_of_smul_eq_smul {r₁ r₂} h := by simpa using h r₁
72+
73+
/-- `Mul.toSMulMulOpposite` is faithful when multiplication is left cancellative -/
74+
@[to_additive /-- `Add.toVAddAddOpposite` is faithful when addition is left cancellative -/]
75+
instance (R : Type*) [Mul R] [IsLeftCancelMul R] : FaithfulSMul Rᵐᵒᵖ R where
76+
eq_of_smul_eq_smul {r₁ r₂} h := by simpa using h r₁.unop
77+
5878
/-- `Monoid.toMulAction` is faithful on cancellative monoids. -/
59-
@[to_additive /-- `AddMonoid.toAddAction` is faithful on additive cancellative monoids. -/]
60-
instance RightCancelMonoid.faithfulSMul [RightCancelMonoid α] : FaithfulSMul α α :=
61-
fun h ↦ mul_right_cancel (h 1)⟩
79+
@[to_additive (attr :=
80+
deprecated "subsumed by `instFaithfulSMul` or `instFaithfulSMulOfIsRightCancelMul`"
81+
(since := "2026-02-03"))
82+
/-- `AddMonoid.toAddAction` is faithful on additive cancellative monoids. -/]
83+
lemma RightCancelMonoid.faithfulSMul [RightCancelMonoid α] : FaithfulSMul α α :=
84+
inferInstance
6285

6386
/-- `Monoid.toOppositeMulAction` is faithful on cancellative monoids. -/
64-
@[to_additive /-- `AddMonoid.toOppositeAddAction` is faithful on additive cancellative monoids. -/]
65-
instance LeftCancelMonoid.to_faithfulSMul_mulOpposite [LeftCancelMonoid α] : FaithfulSMul αᵐᵒᵖ α :=
66-
fun h ↦ MulOpposite.unop_injective <| mul_left_cancel (h 1)⟩
87+
@[to_additive (attr :=
88+
deprecated "subsumed by `instFaithfulSMulMulOpposite` or \
89+
`instFaithfulSMulMulOppositeOfIsLeftCancelMul`"
90+
(since := "2026-02-03"))
91+
/-- `AddMonoid.toOppositeAddAction` is faithful on additive cancellative monoids. -/]
92+
lemma LeftCancelMonoid.to_faithfulSMul_mulOpposite [LeftCancelMonoid α] : FaithfulSMul αᵐᵒᵖ α :=
93+
inferInstance
6794

6895
@[deprecated (since := "2025-09-15")]
6996
alias LefttCancelMonoid.to_faithfulSMul_mulOpposite := LeftCancelMonoid.to_faithfulSMul_mulOpposite
7097

71-
instance (R : Type*) [MulOneClass R] : FaithfulSMul R R := ⟨fun {r₁ r₂} h ↦ by simpa using h 1
7298

7399
@[to_additive]
74100
lemma faithfulSMul_iff_injective_smul_one (R A : Type*)

Mathlib/Algebra/GroupWithZero/Action/Faithful.lean

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ module
77

88
public import Mathlib.Algebra.Group.Action.Faithful
99
public import Mathlib.Algebra.GroupWithZero.NeZero
10+
public import Mathlib.Tactic.Linter.DeprecatedModule
1011

1112
/-!
1213
# Faithful actions involving groups with zero
1314
-/
15+
deprecated_module (since := "2026-02-03")
1416

1517
@[expose] public section
1618

@@ -21,9 +23,6 @@ open Function
2123
variable {α : Type*}
2224

2325
/-- `Monoid.toMulAction` is faithful on nontrivial cancellative monoids with zero. -/
24-
instance IsRightCancelMulZero.faithfulSMul [MonoidWithZero α] [IsRightCancelMulZero α] :
25-
FaithfulSMul α α where
26-
eq_of_smul_eq_smul h := by
27-
cases subsingleton_or_nontrivial α
28-
· exact Subsingleton.elim ..
29-
· exact mul_left_injective₀ one_ne_zero (h 1)
26+
@[nolint unusedArguments, deprecated "subsumed by `instFaithfulSMul`" (since := "2026-02-03")]
27+
lemma IsRightCancelMulZero.faithfulSMul [MonoidWithZero α] [IsRightCancelMulZero α] :
28+
FaithfulSMul α α := inferInstance

0 commit comments

Comments
 (0)