@@ -8,6 +8,7 @@ import Mathlib.Algebra.Order.Field.Defs
8
8
import Mathlib.Algebra.Order.Ring.Abs
9
9
import Mathlib.Order.Bounds.OrderIso
10
10
import Mathlib.Tactic.Positivity.Core
11
+ import Mathlib.Algebra.Order.Field.Unbundled.Basic
11
12
12
13
#align_import algebra.order.field.basic from "leanprover-community/mathlib" @"84771a9f5f0bd5e5d6218811556508ddf476dcbd"
13
14
@@ -49,7 +50,7 @@ theorem le_div_iff (hc : 0 < c) : a ≤ b / c ↔ a * c ≤ b :=
49
50
⟨fun h => div_mul_cancel₀ b (ne_of_lt hc).symm ▸ mul_le_mul_of_nonneg_right h hc.le, fun h =>
50
51
calc
51
52
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
53
54
_ = b / c := (div_eq_mul_one_div b c).symm
54
55
⟩
55
56
#align le_div_iff le_div_iff
@@ -66,7 +67,7 @@ theorem div_le_iff (hb : 0 < b) : a / b ≤ c ↔ a ≤ c * b :=
66
67
fun h =>
67
68
calc
68
69
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
70
71
_ = c * b / b := (div_eq_mul_one_div (c * b) b).symm
71
72
_ = c := by refine (div_eq_iff (ne_of_gt hb)).mpr rfl
72
73
⟩
@@ -188,15 +189,15 @@ theorem inv_le_inv (ha : 0 < a) (hb : 0 < b) : a⁻¹ ≤ b⁻¹ ↔ b ≤ a :=
188
189
/-- In a linear ordered field, for positive `a` and `b` we have `a⁻¹ ≤ b ↔ b⁻¹ ≤ a`.
189
190
See also `inv_le_of_inv_le` for a one-sided implication with one fewer assumption. -/
190
191
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]
192
193
#align inv_le inv_le
193
194
194
195
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
196
197
#align inv_le_of_inv_le inv_le_of_inv_le
197
198
198
199
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]
200
201
#align le_inv le_inv
201
202
202
203
/-- 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 :=
216
217
#align inv_lt inv_lt
217
218
218
219
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
220
221
#align inv_lt_of_inv_lt inv_lt_of_inv_lt
221
222
222
223
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
240
241
#align one_le_inv one_le_inv
241
242
242
243
theorem inv_lt_one_iff_of_pos (h₀ : 0 < a) : a⁻¹ < 1 ↔ 1 < 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⟩
244
245
#align inv_lt_one_iff_of_pos inv_lt_one_iff_of_pos
245
246
246
247
theorem inv_lt_one_iff : a⁻¹ < 1 ↔ a ≤ 0 ∨ 1 < a := by
247
248
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]
249
250
· simp only [ha.not_le, false_or_iff, inv_lt_one_iff_of_pos ha]
250
251
#align inv_lt_one_iff inv_lt_one_iff
251
252
252
253
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⟩
254
256
#align one_lt_inv_iff one_lt_inv_iff
255
257
256
258
theorem inv_le_one_iff : a⁻¹ ≤ 1 ↔ a ≤ 0 ∨ 1 ≤ a := by
@@ -260,7 +262,8 @@ theorem inv_le_one_iff : a⁻¹ ≤ 1 ↔ a ≤ 0 ∨ 1 ≤ a := by
260
262
#align inv_le_one_iff inv_le_one_iff
261
263
262
264
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⟩
264
267
#align one_le_inv_iff one_le_inv_iff
265
268
266
269
/-!
@@ -271,13 +274,13 @@ theorem one_le_inv_iff : 1 ≤ a⁻¹ ↔ 0 < a ∧ a ≤ 1 :=
271
274
@[mono, gcongr]
272
275
lemma div_le_div_of_nonneg_right (hab : a ≤ b) (hc : 0 ≤ c) : a / c ≤ b / c := by
273
276
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)
275
278
#align div_le_div_of_le_of_nonneg div_le_div_of_nonneg_right
276
279
277
280
@[gcongr]
278
281
lemma div_lt_div_of_pos_right (h : a < b) (hc : 0 < c) : a / c < b / c := by
279
282
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)
281
284
#align div_lt_div_of_lt div_lt_div_of_pos_right
282
285
283
286
-- 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
482
485
simp only [div_eq_mul_inv, mul_pos_iff_of_pos_left ha, inv_pos]
483
486
484
487
@[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)]
486
489
487
490
theorem mul_le_mul_of_mul_div_le (h : a * (b / c) ≤ d) (hc : 0 < c) : b * a ≤ d * c := by
488
491
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
492
495
theorem div_mul_le_div_mul_of_div_le_div (h : a / b ≤ c / d) (he : 0 ≤ e) :
493
496
a / (b * e) ≤ c / (d * e) := by
494
497
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)
496
499
#align div_mul_le_div_mul_of_div_le_div div_mul_le_div_mul_of_div_le_div
497
500
498
501
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 ∧
504
507
505
508
theorem exists_pos_lt_mul {a : α} (h : 0 < a) (b : α) : ∃ c : α, 0 < c ∧ b < c * a :=
506
509
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₀]⟩
508
511
#align exists_pos_lt_mul exists_pos_lt_mul
509
512
510
513
lemma monotone_div_right_of_nonneg (ha : 0 ≤ a) : Monotone (· / a) :=
@@ -519,7 +522,7 @@ theorem Monotone.div_const {β : Type*} [Preorder β] {f : β → α} (hf : Mono
519
522
520
523
theorem StrictMono.div_const {β : Type *} [Preorder β] {f : β → α} (hf : StrictMono f) {c : α}
521
524
(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)
523
526
#align strict_mono.div_const StrictMono.div_const
524
527
525
528
-- see Note [lower instance priority]
@@ -652,7 +655,7 @@ theorem div_le_iff_of_neg (hc : c < 0) : b / c ≤ a ↔ a * c ≤ b :=
652
655
⟨fun h => div_mul_cancel₀ b (ne_of_lt hc) ▸ mul_le_mul_of_nonpos_right h hc.le, fun h =>
653
656
calc
654
657
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
656
659
_ = b / c := (div_eq_mul_one_div b c).symm
657
660
⟩
658
661
#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
697
700
#align inv_le_inv_of_neg inv_le_inv_of_neg
698
701
699
702
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]
701
704
#align inv_le_of_neg inv_le_of_neg
702
705
703
706
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]
705
708
#align le_inv_of_neg le_inv_of_neg
706
709
707
710
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) :
768
771
769
772
theorem div_le_div_of_nonpos_of_le (hc : c ≤ 0 ) (h : b ≤ a) : a / c ≤ b / c := by
770
773
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)
772
775
#align div_le_div_of_nonpos_of_le div_le_div_of_nonpos_of_le
773
776
774
777
theorem div_lt_div_of_neg_of_lt (hc : c < 0 ) (h : b < a) : a / c < b / c := by
775
778
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)
777
780
#align div_lt_div_of_neg_of_lt div_lt_div_of_neg_of_lt
778
781
779
782
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
905
908
/-- An inequality involving `2`. -/
906
909
theorem sub_one_div_inv_le_two (a2 : 2 ≤ a) : (1 - 1 / a)⁻¹ ≤ 2 := by
907
910
-- 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 : α))
909
912
-- move `1 / a` to the left and `2⁻¹` to the right.
910
913
rw [le_sub_iff_add_le, add_comm, ← le_sub_iff_add_le]
911
914
-- take inverses on both sides and use the assumption `2 ≤ a`.
0 commit comments