Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 321d159

Browse files
committed
feat(algebra/order/monoid): generalize, convert to to_additive and iff of lt_or_lt_of_mul_lt_mul (#13192)
I converted a lemma showing `m + n < a + b → m < a ∨ n < b` to the `to_additive` version of a lemma showing `m * n < a * b → m < a ∨ n < b`. I also added a lemma showing `m * n < a * b ↔ m < a ∨ n < b` and its `to_additive` version.
1 parent 506ad31 commit 321d159

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/algebra/order/monoid.lean

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,26 @@ variable [covariant_class α α (*) (≤)]
837837
lemma max_mul_mul_left (a b c : α) : max (a * b) (a * c) = a * max b c :=
838838
(monotone_id.const_mul' a).map_max.symm
839839

840+
@[to_additive]
841+
lemma lt_or_lt_of_mul_lt_mul [covariant_class α α (function.swap (*)) (≤)]
842+
{a b m n : α} (h : m * n < a * b) :
843+
m < a ∨ n < b :=
844+
by { contrapose! h, exact mul_le_mul' h.1 h.2 }
845+
846+
@[to_additive]
847+
lemma mul_lt_mul_iff_of_le_of_le
848+
[covariant_class α α (function.swap (*)) (<)]
849+
[covariant_class α α (*) (<)]
850+
[covariant_class α α (function.swap (*)) (≤)]
851+
{a b c d : α} (ac : a ≤ c) (bd : b ≤ d) :
852+
a * b < c * d ↔ (a < c) ∨ (b < d) :=
853+
begin
854+
refine ⟨lt_or_lt_of_mul_lt_mul, λ h, _⟩,
855+
cases h with ha hb,
856+
{ exact mul_lt_mul_of_lt_of_le ha bd },
857+
{ exact mul_lt_mul_of_le_of_lt ac hb }
858+
end
859+
840860
end left
841861

842862
section right
@@ -974,9 +994,6 @@ end order_dual
974994
section linear_ordered_cancel_add_comm_monoid
975995
variables [linear_ordered_cancel_add_comm_monoid α]
976996

977-
lemma lt_or_lt_of_add_lt_add {a b m n : α} (h : m + n < a + b) : m < a ∨ n < b :=
978-
by { contrapose! h, exact add_le_add h.1 h.2 }
979-
980997
end linear_ordered_cancel_add_comm_monoid
981998

982999
section ordered_cancel_add_comm_monoid

0 commit comments

Comments
 (0)