Skip to content

Commit a4cbabc

Browse files
committed
chore(Algebra/Order/Monoid/Unbundled/Basic): replace mul_left_cancel'' with an IsLeftCancelMul instance (#36629)
1 parent 735f4ae commit a4cbabc

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,22 @@ section PartialOrder
276276
variable [PartialOrder α]
277277

278278
@[to_additive]
279-
theorem mul_left_cancel'' [MulLeftReflectLE α] {a b c : α} (h : a * b = a * c) :
280-
b = c :=
281-
(le_of_mul_le_mul_left' h.le).antisymm (le_of_mul_le_mul_left' h.ge)
279+
instance [MulLeftReflectLE α] : IsLeftCancelMul α where
280+
mul_left_cancel _ _ _ h := (le_of_mul_le_mul_left' h.le).antisymm (le_of_mul_le_mul_left' h.ge)
281+
282+
@[deprecated (since := "2026-03-14")]
283+
alias add_left_cancel'' := add_left_cancel
284+
@[to_additive existing, deprecated (since := "2026-03-14")]
285+
alias mul_left_cancel'' := mul_left_cancel
282286

283287
@[to_additive]
284-
theorem mul_right_cancel'' [MulRightReflectLE α] {a b c : α}
285-
(h : a * b = c * b) :
286-
a = c :=
287-
(le_of_mul_le_mul_right' h.le).antisymm (le_of_mul_le_mul_right' h.ge)
288+
instance [MulRightReflectLE α] : IsRightCancelMul α where
289+
mul_right_cancel _ _ _ h := (le_of_mul_le_mul_right' h.le).antisymm (le_of_mul_le_mul_right' h.ge)
290+
291+
@[deprecated (since := "2026-03-14")]
292+
alias add_right_cancel'' := add_right_cancel
293+
@[to_additive existing, deprecated (since := "2026-03-14")]
294+
alias mul_right_cancel'' := mul_right_cancel
288295

289296
@[to_additive] lemma mul_le_mul_iff_of_ge [MulLeftStrictMono α]
290297
[MulRightStrictMono α] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
@@ -1115,9 +1122,7 @@ to the appropriate covariant class. -/
11151122
@[to_additive (attr := implicit_reducible)
11161123
/-- An additive semigroup with a partial order and satisfying `AddLeftCancelSemigroup`
11171124
(i.e. `c + a < c + b → a < b`) is a `AddLeftCancelSemigroup`. -/]
1118-
def Contravariant.toLeftCancelSemigroup [MulLeftReflectLE α] :
1119-
LeftCancelSemigroup α :=
1120-
{ ‹Semigroup α› with mul_left_cancel := fun _ _ _ => mul_left_cancel'' }
1125+
def Contravariant.toLeftCancelSemigroup [MulLeftReflectLE α] : LeftCancelSemigroup α where
11211126

11221127
/- This is not instance, since we want to have an instance from `RightCancelSemigroup`s
11231128
to the appropriate covariant class. -/
@@ -1126,9 +1131,7 @@ to the appropriate covariant class. -/
11261131
@[to_additive (attr := implicit_reducible)
11271132
/-- An additive semigroup with a partial order and satisfying `AddRightCancelSemigroup`
11281133
(`a + c < b + c → a < b`) is a `AddRightCancelSemigroup`. -/]
1129-
def Contravariant.toRightCancelSemigroup [MulRightReflectLE α] :
1130-
RightCancelSemigroup α :=
1131-
{ ‹Semigroup α› with mul_right_cancel := fun _ _ _ => mul_right_cancel'' }
1134+
def Contravariant.toRightCancelSemigroup [MulRightReflectLE α] : RightCancelSemigroup α where
11321135

11331136
end PartialOrder
11341137

0 commit comments

Comments
 (0)