Skip to content

Commit ba665e3

Browse files
committed
chore (Algebra.Order.Field.Defs): split off results about unbundled ordered algebra (#14451)
We should be able to use these results about unbundled ordered algebra without importing the heavy machinery of the bundled typeclasses.
1 parent 8d10ce3 commit ba665e3

File tree

12 files changed

+132
-99
lines changed

12 files changed

+132
-99
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ import Mathlib.Algebra.Order.Field.Pi
531531
import Mathlib.Algebra.Order.Field.Power
532532
import Mathlib.Algebra.Order.Field.Rat
533533
import Mathlib.Algebra.Order.Field.Subfield
534+
import Mathlib.Algebra.Order.Field.Unbundled.Basic
534535
import Mathlib.Algebra.Order.Floor
535536
import Mathlib.Algebra.Order.Floor.Div
536537
import Mathlib.Algebra.Order.Floor.Prime

Mathlib/Algebra/Order/Field/Basic.lean

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Mathlib.Algebra.Order.Field.Defs
88
import Mathlib.Algebra.Order.Ring.Abs
99
import Mathlib.Order.Bounds.OrderIso
1010
import Mathlib.Tactic.Positivity.Core
11+
import Mathlib.Algebra.Order.Field.Unbundled.Basic
1112

1213
#align_import algebra.order.field.basic from "leanprover-community/mathlib"@"84771a9f5f0bd5e5d6218811556508ddf476dcbd"
1314

@@ -49,7 +50,7 @@ theorem le_div_iff (hc : 0 < c) : a ≤ b / c ↔ a * c ≤ b :=
4950
fun h => div_mul_cancel₀ b (ne_of_lt hc).symm ▸ mul_le_mul_of_nonneg_right h hc.le, fun h =>
5051
calc
5152
a = a * c * (1 / c) := mul_mul_div a (ne_of_lt hc).symm
52-
_ ≤ b * (1 / c) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hc).le
53+
_ ≤ b * (1 / c) := mul_le_mul_of_nonneg_right h (one_div_pos (α := α) |>.2 hc).le
5354
_ = b / c := (div_eq_mul_one_div b c).symm
5455
5556
#align le_div_iff le_div_iff
@@ -66,7 +67,7 @@ theorem div_le_iff (hb : 0 < b) : a / b ≤ c ↔ a ≤ c * b :=
6667
fun h =>
6768
calc
6869
a / b = a * (1 / b) := div_eq_mul_one_div a b
69-
_ ≤ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hb).le
70+
_ ≤ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos (α := α) |>.2 hb).le
7071
_ = c * b / b := (div_eq_mul_one_div (c * b) b).symm
7172
_ = c := by refine (div_eq_iff (ne_of_gt hb)).mpr rfl
7273
@@ -188,15 +189,15 @@ theorem inv_le_inv (ha : 0 < a) (hb : 0 < b) : a⁻¹ ≤ b⁻¹ ↔ b ≤ a :=
188189
/-- In a linear ordered field, for positive `a` and `b` we have `a⁻¹ ≤ b ↔ b⁻¹ ≤ a`.
189190
See also `inv_le_of_inv_le` for a one-sided implication with one fewer assumption. -/
190191
theorem inv_le (ha : 0 < a) (hb : 0 < b) : a⁻¹ ≤ b ↔ b⁻¹ ≤ a := by
191-
rw [← inv_le_inv hb (inv_pos.2 ha), inv_inv]
192+
rw [← inv_le_inv hb (inv_pos (α := α) |>.2 ha), inv_inv]
192193
#align inv_le inv_le
193194

194195
theorem inv_le_of_inv_le (ha : 0 < a) (h : a⁻¹ ≤ b) : b⁻¹ ≤ a :=
195-
(inv_le ha ((inv_pos.2 ha).trans_le h)).1 h
196+
(inv_le ha ((inv_pos (α := α) |>.2 ha).trans_le h)).1 h
196197
#align inv_le_of_inv_le inv_le_of_inv_le
197198

198199
theorem le_inv (ha : 0 < a) (hb : 0 < b) : a ≤ b⁻¹ ↔ b ≤ a⁻¹ := by
199-
rw [← inv_le_inv (inv_pos.2 hb) ha, inv_inv]
200+
rw [← inv_le_inv (inv_pos (α := α) |>.2 hb) ha, inv_inv]
200201
#align le_inv le_inv
201202

202203
/-- See `inv_lt_inv_of_lt` for the implication from right-to-left with one fewer assumption. -/
@@ -216,7 +217,7 @@ theorem inv_lt (ha : 0 < a) (hb : 0 < b) : a⁻¹ < b ↔ b⁻¹ < a :=
216217
#align inv_lt inv_lt
217218

218219
theorem inv_lt_of_inv_lt (ha : 0 < a) (h : a⁻¹ < b) : b⁻¹ < a :=
219-
(inv_lt ha ((inv_pos.2 ha).trans h)).1 h
220+
(inv_lt ha ((inv_pos (α := α) |>.2 ha).trans h)).1 h
220221
#align inv_lt_of_inv_lt inv_lt_of_inv_lt
221222

222223
theorem lt_inv (ha : 0 < a) (hb : 0 < b) : a < b⁻¹ ↔ b < a⁻¹ :=
@@ -240,17 +241,18 @@ theorem one_le_inv (h₁ : 0 < a) (h₂ : a ≤ 1) : 1 ≤ a⁻¹ := by
240241
#align one_le_inv one_le_inv
241242

242243
theorem inv_lt_one_iff_of_pos (h₀ : 0 < a) : a⁻¹ < 11 < a :=
243-
fun h₁ => inv_inv a ▸ one_lt_inv (inv_pos.2 h₀) h₁, inv_lt_one⟩
244+
fun h₁ => inv_inv a ▸ one_lt_inv (inv_pos (α := α) |>.2 h₀) h₁, inv_lt_one⟩
244245
#align inv_lt_one_iff_of_pos inv_lt_one_iff_of_pos
245246

246247
theorem inv_lt_one_iff : a⁻¹ < 1 ↔ a ≤ 01 < a := by
247248
rcases le_or_lt a 0 with ha | ha
248-
· simp [ha, (inv_nonpos.2 ha).trans_lt zero_lt_one]
249+
· simp [ha, (inv_nonpos (α := α) |>.2 ha).trans_lt zero_lt_one]
249250
· simp only [ha.not_le, false_or_iff, inv_lt_one_iff_of_pos ha]
250251
#align inv_lt_one_iff inv_lt_one_iff
251252

252253
theorem one_lt_inv_iff : 1 < a⁻¹ ↔ 0 < a ∧ a < 1 :=
253-
fun h => ⟨inv_pos.1 (zero_lt_one.trans h), inv_inv a ▸ inv_lt_one h⟩, and_imp.2 one_lt_inv⟩
254+
fun h => ⟨inv_pos (α := α) |>.1 (zero_lt_one.trans h),
255+
inv_inv a ▸ inv_lt_one h⟩, and_imp.2 one_lt_inv⟩
254256
#align one_lt_inv_iff one_lt_inv_iff
255257

256258
theorem inv_le_one_iff : a⁻¹ ≤ 1 ↔ a ≤ 01 ≤ a := by
@@ -260,7 +262,8 @@ theorem inv_le_one_iff : a⁻¹ ≤ 1 ↔ a ≤ 0 ∨ 1 ≤ a := by
260262
#align inv_le_one_iff inv_le_one_iff
261263

262264
theorem one_le_inv_iff : 1 ≤ a⁻¹ ↔ 0 < a ∧ a ≤ 1 :=
263-
fun h => ⟨inv_pos.1 (zero_lt_one.trans_le h), inv_inv a ▸ inv_le_one h⟩, and_imp.2 one_le_inv⟩
265+
fun h => ⟨inv_pos (α := α) |>.1 (zero_lt_one.trans_le h),
266+
inv_inv a ▸ inv_le_one h⟩, and_imp.2 one_le_inv⟩
264267
#align one_le_inv_iff one_le_inv_iff
265268

266269
/-!
@@ -271,13 +274,13 @@ theorem one_le_inv_iff : 1 ≤ a⁻¹ ↔ 0 < a ∧ a ≤ 1 :=
271274
@[mono, gcongr]
272275
lemma div_le_div_of_nonneg_right (hab : a ≤ b) (hc : 0 ≤ c) : a / c ≤ b / c := by
273276
rw [div_eq_mul_one_div a c, div_eq_mul_one_div b c]
274-
exact mul_le_mul_of_nonneg_right hab (one_div_nonneg.2 hc)
277+
exact mul_le_mul_of_nonneg_right hab (one_div_nonneg (α := α) |>.2 hc)
275278
#align div_le_div_of_le_of_nonneg div_le_div_of_nonneg_right
276279

277280
@[gcongr]
278281
lemma div_lt_div_of_pos_right (h : a < b) (hc : 0 < c) : a / c < b / c := by
279282
rw [div_eq_mul_one_div a c, div_eq_mul_one_div b c]
280-
exact mul_lt_mul_of_pos_right h (one_div_pos.2 hc)
283+
exact mul_lt_mul_of_pos_right h (one_div_pos (α := α) |>.2 hc)
281284
#align div_lt_div_of_lt div_lt_div_of_pos_right
282285

283286
-- Not a `mono` lemma b/c `div_le_div` is strictly more general
@@ -482,7 +485,7 @@ theorem add_thirds (a : α) : a / 3 + a / 3 + a / 3 = a := by
482485
simp only [div_eq_mul_inv, mul_pos_iff_of_pos_left ha, inv_pos]
483486

484487
@[simp] lemma div_pos_iff_of_pos_right (hb : 0 < b) : 0 < a / b ↔ 0 < a := by
485-
simp only [div_eq_mul_inv, mul_pos_iff_of_pos_right (inv_pos.2 hb)]
488+
simp only [div_eq_mul_inv, mul_pos_iff_of_pos_right (inv_pos (α := α) |>.2 hb)]
486489

487490
theorem mul_le_mul_of_mul_div_le (h : a * (b / c) ≤ d) (hc : 0 < c) : b * a ≤ d * c := by
488491
rw [← mul_div_assoc] at h
@@ -492,7 +495,7 @@ theorem mul_le_mul_of_mul_div_le (h : a * (b / c) ≤ d) (hc : 0 < c) : b * a
492495
theorem div_mul_le_div_mul_of_div_le_div (h : a / b ≤ c / d) (he : 0 ≤ e) :
493496
a / (b * e) ≤ c / (d * e) := by
494497
rw [div_mul_eq_div_mul_one_div, div_mul_eq_div_mul_one_div]
495-
exact mul_le_mul_of_nonneg_right h (one_div_nonneg.2 he)
498+
exact mul_le_mul_of_nonneg_right h (one_div_nonneg (α := α) |>.2 he)
496499
#align div_mul_le_div_mul_of_div_le_div div_mul_le_div_mul_of_div_le_div
497500

498501
theorem exists_pos_mul_lt {a : α} (h : 0 < a) (b : α) : ∃ c : α, 0 < c ∧ b * c < a := by
@@ -504,7 +507,7 @@ theorem exists_pos_mul_lt {a : α} (h : 0 < a) (b : α) : ∃ c : α, 0 < c ∧
504507

505508
theorem exists_pos_lt_mul {a : α} (h : 0 < a) (b : α) : ∃ c : α, 0 < c ∧ b < c * a :=
506509
let ⟨c, hc₀, hc⟩ := exists_pos_mul_lt h b;
507-
⟨c⁻¹, inv_pos.2 hc₀, by rwa [← div_eq_inv_mul, lt_div_iff hc₀]⟩
510+
⟨c⁻¹, inv_pos (α := α) |>.2 hc₀, by rwa [← div_eq_inv_mul, lt_div_iff hc₀]⟩
508511
#align exists_pos_lt_mul exists_pos_lt_mul
509512

510513
lemma monotone_div_right_of_nonneg (ha : 0 ≤ a) : Monotone (· / a) :=
@@ -519,7 +522,7 @@ theorem Monotone.div_const {β : Type*} [Preorder β] {f : β → α} (hf : Mono
519522

520523
theorem StrictMono.div_const {β : Type*} [Preorder β] {f : β → α} (hf : StrictMono f) {c : α}
521524
(hc : 0 < c) : StrictMono fun x => f x / c := by
522-
simpa only [div_eq_mul_inv] using hf.mul_const (inv_pos.2 hc)
525+
simpa only [div_eq_mul_inv] using hf.mul_const (inv_pos (α := α) |>.2 hc)
523526
#align strict_mono.div_const StrictMono.div_const
524527

525528
-- see Note [lower instance priority]
@@ -652,7 +655,7 @@ theorem div_le_iff_of_neg (hc : c < 0) : b / c ≤ a ↔ a * c ≤ b :=
652655
fun h => div_mul_cancel₀ b (ne_of_lt hc) ▸ mul_le_mul_of_nonpos_right h hc.le, fun h =>
653656
calc
654657
a = a * c * (1 / c) := mul_mul_div a (ne_of_lt hc)
655-
_ ≥ b * (1 / c) := mul_le_mul_of_nonpos_right h (one_div_neg.2 hc).le
658+
_ ≥ b * (1 / c) := mul_le_mul_of_nonpos_right h (one_div_neg (α := α) |>.2 hc).le
656659
_ = b / c := (div_eq_mul_one_div b c).symm
657660
658661
#align div_le_iff_of_neg div_le_iff_of_neg
@@ -697,11 +700,11 @@ theorem inv_le_inv_of_neg (ha : a < 0) (hb : b < 0) : a⁻¹ ≤ b⁻¹ ↔ b
697700
#align inv_le_inv_of_neg inv_le_inv_of_neg
698701

699702
theorem inv_le_of_neg (ha : a < 0) (hb : b < 0) : a⁻¹ ≤ b ↔ b⁻¹ ≤ a := by
700-
rw [← inv_le_inv_of_neg hb (inv_lt_zero.2 ha), inv_inv]
703+
rw [← inv_le_inv_of_neg hb (inv_lt_zero (α := α) |>.2 ha), inv_inv]
701704
#align inv_le_of_neg inv_le_of_neg
702705

703706
theorem le_inv_of_neg (ha : a < 0) (hb : b < 0) : a ≤ b⁻¹ ↔ b ≤ a⁻¹ := by
704-
rw [← inv_le_inv_of_neg (inv_lt_zero.2 hb) ha, inv_inv]
707+
rw [← inv_le_inv_of_neg (inv_lt_zero (α := α) |>.2 hb) ha, inv_inv]
705708
#align le_inv_of_neg le_inv_of_neg
706709

707710
theorem inv_lt_inv_of_neg (ha : a < 0) (hb : b < 0) : a⁻¹ < b⁻¹ ↔ b < a :=
@@ -768,12 +771,12 @@ theorem inv_antitoneOn_Icc_left (hb : b < 0) :
768771

769772
theorem div_le_div_of_nonpos_of_le (hc : c ≤ 0) (h : b ≤ a) : a / c ≤ b / c := by
770773
rw [div_eq_mul_one_div a c, div_eq_mul_one_div b c]
771-
exact mul_le_mul_of_nonpos_right h (one_div_nonpos.2 hc)
774+
exact mul_le_mul_of_nonpos_right h (one_div_nonpos (α := α) |>.2 hc)
772775
#align div_le_div_of_nonpos_of_le div_le_div_of_nonpos_of_le
773776

774777
theorem div_lt_div_of_neg_of_lt (hc : c < 0) (h : b < a) : a / c < b / c := by
775778
rw [div_eq_mul_one_div a c, div_eq_mul_one_div b c]
776-
exact mul_lt_mul_of_neg_right h (one_div_neg.2 hc)
779+
exact mul_lt_mul_of_neg_right h (one_div_neg (α := α) |>.2 hc)
777780
#align div_lt_div_of_neg_of_lt div_lt_div_of_neg_of_lt
778781

779782
theorem div_le_div_right_of_neg (hc : c < 0) : a / c ≤ b / c ↔ b ≤ a :=
@@ -905,7 +908,7 @@ theorem add_sub_div_two_lt (h : a < b) : a + (b - a) / 2 < b := by
905908
/-- An inequality involving `2`. -/
906909
theorem sub_one_div_inv_le_two (a2 : 2 ≤ a) : (1 - 1 / a)⁻¹ ≤ 2 := by
907910
-- Take inverses on both sides to obtain `2⁻¹ ≤ 1 - 1 / a`
908-
refine (inv_le_inv_of_le (inv_pos.2 <| zero_lt_two' α) ?_).trans_eq (inv_inv (2 : α))
911+
refine (inv_le_inv_of_le (inv_pos (α := α) |>.2 <| zero_lt_two' α) ?_).trans_eq (inv_inv (2 : α))
909912
-- move `1 / a` to the left and `2⁻¹` to the right.
910913
rw [le_sub_iff_add_le, add_comm, ← le_sub_iff_add_le]
911914
-- take inverses on both sides and use the assumption `2 ≤ a`.

Mathlib/Algebra/Order/Field/Defs.lean

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ Copyright (c) 2014 Robert Lewis. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Robert Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn
55
-/
6-
import Mathlib.Algebra.Field.Defs
7-
import Mathlib.Algebra.GroupWithZero.Basic
86
import Mathlib.Algebra.Order.Ring.Defs
7+
import Mathlib.Algebra.Field.Defs
98

109
#align_import algebra.order.field.defs from "leanprover-community/mathlib"@"655994e298904d7e5bbd1e18c95defd7b543eb94"
1110

@@ -42,62 +41,3 @@ instance (priority := 100) LinearOrderedField.toLinearOrderedSemifield [LinearOr
4241
{ LinearOrderedRing.toLinearOrderedSemiring, ‹LinearOrderedField α› with }
4342
#align linear_ordered_field.to_linear_ordered_semifield LinearOrderedField.toLinearOrderedSemifield
4443

45-
variable [LinearOrderedSemifield α] {a b : α}
46-
47-
@[simp] lemma inv_pos : 0 < a⁻¹ ↔ 0 < a :=
48-
suffices ∀ a : α, 0 < a → 0 < a⁻¹ fromfun h ↦ inv_inv a ▸ this _ h, this a⟩
49-
fun a ha ↦ flip lt_of_mul_lt_mul_left ha.le <| by simp [ne_of_gt ha, zero_lt_one]
50-
#align inv_pos inv_pos
51-
52-
alias ⟨_, inv_pos_of_pos⟩ := inv_pos
53-
#align inv_pos_of_pos inv_pos_of_pos
54-
55-
@[simp] lemma inv_nonneg : 0 ≤ a⁻¹ ↔ 0 ≤ a := by simp only [le_iff_eq_or_lt, inv_pos, zero_eq_inv]
56-
#align inv_nonneg inv_nonneg
57-
58-
alias ⟨_, inv_nonneg_of_nonneg⟩ := inv_nonneg
59-
#align inv_nonneg_of_nonneg inv_nonneg_of_nonneg
60-
61-
@[simp] lemma inv_lt_zero : a⁻¹ < 0 ↔ a < 0 := by simp only [← not_le, inv_nonneg]
62-
#align inv_lt_zero inv_lt_zero
63-
64-
@[simp] lemma inv_nonpos : a⁻¹ ≤ 0 ↔ a ≤ 0 := by simp only [← not_lt, inv_pos]
65-
#align inv_nonpos inv_nonpos
66-
67-
lemma one_div_pos : 0 < 1 / a ↔ 0 < a := inv_eq_one_div a ▸ inv_pos
68-
#align one_div_pos one_div_pos
69-
70-
lemma one_div_neg : 1 / a < 0 ↔ a < 0 := inv_eq_one_div a ▸ inv_lt_zero
71-
#align one_div_neg one_div_neg
72-
73-
lemma one_div_nonneg : 01 / a ↔ 0 ≤ a := inv_eq_one_div a ▸ inv_nonneg
74-
#align one_div_nonneg one_div_nonneg
75-
76-
lemma one_div_nonpos : 1 / a ≤ 0 ↔ a ≤ 0 := inv_eq_one_div a ▸ inv_nonpos
77-
#align one_div_nonpos one_div_nonpos
78-
79-
lemma div_pos (ha : 0 < a) (hb : 0 < b) : 0 < a / b := by
80-
rw [div_eq_mul_inv]; exact mul_pos ha (inv_pos.2 hb)
81-
#align div_pos div_pos
82-
83-
lemma div_nonneg (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a / b := by
84-
rw [div_eq_mul_inv]; exact mul_nonneg ha (inv_nonneg.2 hb)
85-
#align div_nonneg div_nonneg
86-
87-
lemma div_nonpos_of_nonpos_of_nonneg (ha : a ≤ 0) (hb : 0 ≤ b) : a / b ≤ 0 := by
88-
rw [div_eq_mul_inv]; exact mul_nonpos_of_nonpos_of_nonneg ha (inv_nonneg.2 hb)
89-
#align div_nonpos_of_nonpos_of_nonneg div_nonpos_of_nonpos_of_nonneg
90-
91-
lemma div_nonpos_of_nonneg_of_nonpos (ha : 0 ≤ a) (hb : b ≤ 0) : a / b ≤ 0 := by
92-
rw [div_eq_mul_inv]; exact mul_nonpos_of_nonneg_of_nonpos ha (inv_nonpos.2 hb)
93-
#align div_nonpos_of_nonneg_of_nonpos div_nonpos_of_nonneg_of_nonpos
94-
95-
lemma zpow_nonneg (ha : 0 ≤ a) : ∀ n : ℤ, 0 ≤ a ^ n
96-
| (n : ℕ) => by rw [zpow_natCast]; exact pow_nonneg ha _
97-
| -(n + 1 : ℕ) => by rw [zpow_neg, inv_nonneg, zpow_natCast]; exact pow_nonneg ha _
98-
#align zpow_nonneg zpow_nonneg
99-
100-
lemma zpow_pos_of_pos (ha : 0 < a) : ∀ n : ℤ, 0 < a ^ n
101-
| (n : ℕ) => by rw [zpow_natCast]; exact pow_pos ha _
102-
| -(n + 1 : ℕ) => by rw [zpow_neg, inv_pos, zpow_natCast]; exact pow_pos ha _
103-
#align zpow_pos_of_pos zpow_pos_of_pos
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/-
2+
Copyright (c) 2014 Robert Lewis. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Robert Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn
5+
-/
6+
import Mathlib.Algebra.Field.Defs
7+
import Mathlib.Algebra.GroupWithZero.Basic
8+
import Mathlib.Algebra.Order.Ring.Unbundled.Basic
9+
10+
#align_import algebra.order.field.defs from "leanprover-community/mathlib"@"655994e298904d7e5bbd1e18c95defd7b543eb94"
11+
12+
/-!
13+
# Basic facts for unbundled linear ordered (semi)fields
14+
15+
-/
16+
17+
-- Guard against import creep.
18+
assert_not_exists OrderedCommMonoid
19+
assert_not_exists MonoidHom
20+
21+
variable {α : Type*}
22+
23+
variable [Semifield α] [LinearOrder α] [PosMulReflectLT α] [ZeroLEOneClass α] {a b : α}
24+
25+
@[simp] lemma inv_pos : 0 < a⁻¹ ↔ 0 < a :=
26+
suffices ∀ a : α, 0 < a → 0 < a⁻¹ fromfun h ↦ inv_inv a ▸ this _ h, this a⟩
27+
fun a ha ↦ flip lt_of_mul_lt_mul_left ha.le <| by simp [ne_of_gt ha, zero_lt_one]
28+
#align inv_pos inv_pos
29+
30+
alias ⟨_, inv_pos_of_pos⟩ := inv_pos
31+
#align inv_pos_of_pos inv_pos_of_pos
32+
33+
@[simp] lemma inv_nonneg : 0 ≤ a⁻¹ ↔ 0 ≤ a := by simp only [le_iff_eq_or_lt, inv_pos, zero_eq_inv]
34+
#align inv_nonneg inv_nonneg
35+
36+
alias ⟨_, inv_nonneg_of_nonneg⟩ := inv_nonneg
37+
#align inv_nonneg_of_nonneg inv_nonneg_of_nonneg
38+
39+
@[simp] lemma inv_lt_zero : a⁻¹ < 0 ↔ a < 0 := by simp only [← not_le, inv_nonneg]
40+
#align inv_lt_zero inv_lt_zero
41+
42+
@[simp] lemma inv_nonpos : a⁻¹ ≤ 0 ↔ a ≤ 0 := by simp only [← not_lt, inv_pos]
43+
#align inv_nonpos inv_nonpos
44+
45+
lemma one_div_pos : 0 < 1 / a ↔ 0 < a := inv_eq_one_div a ▸ inv_pos
46+
#align one_div_pos one_div_pos
47+
48+
lemma one_div_neg : 1 / a < 0 ↔ a < 0 := inv_eq_one_div a ▸ inv_lt_zero
49+
#align one_div_neg one_div_neg
50+
51+
lemma one_div_nonneg : 01 / a ↔ 0 ≤ a := inv_eq_one_div a ▸ inv_nonneg
52+
#align one_div_nonneg one_div_nonneg
53+
54+
lemma one_div_nonpos : 1 / a ≤ 0 ↔ a ≤ 0 := inv_eq_one_div a ▸ inv_nonpos
55+
#align one_div_nonpos one_div_nonpos
56+
57+
lemma div_pos [PosMulStrictMono α] (ha : 0 < a) (hb : 0 < b) : 0 < a / b := by
58+
rw [div_eq_mul_inv]; exact mul_pos ha (inv_pos.2 hb)
59+
#align div_pos div_pos
60+
61+
lemma div_nonneg [PosMulMono α] (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a / b := by
62+
rw [div_eq_mul_inv]; exact mul_nonneg ha (inv_nonneg.2 hb)
63+
#align div_nonneg div_nonneg
64+
65+
lemma div_nonpos_of_nonpos_of_nonneg [MulPosMono α] (ha : a ≤ 0) (hb : 0 ≤ b) : a / b ≤ 0 := by
66+
rw [div_eq_mul_inv]; exact mul_nonpos_of_nonpos_of_nonneg ha (inv_nonneg.2 hb)
67+
#align div_nonpos_of_nonpos_of_nonneg div_nonpos_of_nonpos_of_nonneg
68+
69+
lemma div_nonpos_of_nonneg_of_nonpos [PosMulMono α] (ha : 0 ≤ a) (hb : b ≤ 0) : a / b ≤ 0 := by
70+
rw [div_eq_mul_inv]; exact mul_nonpos_of_nonneg_of_nonpos ha (inv_nonpos.2 hb)
71+
#align div_nonpos_of_nonneg_of_nonpos div_nonpos_of_nonneg_of_nonpos
72+
73+
lemma zpow_nonneg [PosMulMono α] (ha : 0 ≤ a) : ∀ n : ℤ, 0 ≤ a ^ n
74+
| (n : ℕ) => by rw [zpow_natCast]; exact pow_nonneg ha _
75+
| -(n + 1 : ℕ) => by rw [zpow_neg, inv_nonneg, zpow_natCast]; exact pow_nonneg ha _
76+
#align zpow_nonneg zpow_nonneg
77+
78+
lemma zpow_pos_of_pos [PosMulStrictMono α] (ha : 0 < a) : ∀ n : ℤ, 0 < a ^ n
79+
| (n : ℕ) => by rw [zpow_natCast]; exact pow_pos ha _
80+
| -(n + 1 : ℕ) => by rw [zpow_neg, inv_pos, zpow_natCast]; exact pow_pos ha _
81+
#align zpow_pos_of_pos zpow_pos_of_pos

Mathlib/Algebra/Order/Module/Defs.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Mathlib.Algebra.Order.GroupWithZero.Unbundled
88
import Mathlib.Algebra.Order.Module.Synonym
99
import Mathlib.GroupTheory.GroupAction.Group
1010
import Mathlib.Tactic.Positivity.Core
11+
import Mathlib.Algebra.Order.Field.Unbundled.Basic
1112

1213
/-!
1314
# Monotonicity of scalar multiplication by positive elements
@@ -995,13 +996,14 @@ variable [LinearOrderedSemifield α] [AddCommGroup β] [PartialOrder β]
995996
-- See note [lower instance priority]
996997
instance (priority := 100) PosSMulMono.toPosSMulReflectLE [MulAction α β] [PosSMulMono α β] :
997998
PosSMulReflectLE α β where
998-
elim _a ha b₁ b₂ h := by simpa [ha.ne'] using smul_le_smul_of_nonneg_left h <| inv_nonneg.2 ha.le
999+
elim _a ha b₁ b₂ h := by
1000+
simpa [ha.ne'] using smul_le_smul_of_nonneg_left h <| inv_nonneg (α := α) |>.2 ha.le
9991001

10001002
-- See note [lower instance priority]
10011003
instance (priority := 100) PosSMulStrictMono.toPosSMulReflectLT [MulActionWithZero α β]
10021004
[PosSMulStrictMono α β] : PosSMulReflectLT α β :=
10031005
PosSMulReflectLT.of_pos fun a ha b₁ b₂ h ↦ by
1004-
simpa [ha.ne'] using smul_lt_smul_of_pos_left h <| inv_pos.2 ha
1006+
simpa [ha.ne'] using smul_lt_smul_of_pos_left h <| inv_pos (α := α) |>.2 ha
10051007

10061008
end LinearOrderedSemifield
10071009

0 commit comments

Comments
 (0)