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

Commit b97b08b

Browse files
committed
fix(*): remove usages of ge/gt (#3808)
These were not caught by the old `ge_or_gt` linter, but they will be caught by the new (upcoming) `ge_or_gt` linter. The `nolint` flags are not yet removed, this will happen in a later PR. Renamings: ``` char_is_prime_of_ge_two -> char_is_prime_of_two_le dist_eq_sub_of_ge -> dist_eq_sub_of_le_right gt_of_mul_lt_mul_neg_right -> lt_of_mul_lt_mul_neg_right ```
1 parent 36ced83 commit b97b08b

File tree

21 files changed

+91
-91
lines changed

21 files changed

+91
-91
lines changed

scripts/nolints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ apply_nolint tactic.interactive.solve_mvar doc_blame
17911791
apply_nolint tactic.interactive.unify_with_instance doc_blame
17921792

17931793
-- tactic/monotonicity/lemmas.lean
1794-
apply_nolint gt_of_mul_lt_mul_neg_right ge_or_gt
1794+
apply_nolint lt_of_mul_lt_mul_neg_right ge_or_gt
17951795

17961796
-- tactic/norm_num.lean
17971797
apply_nolint norm_num.derive doc_blame
@@ -2110,4 +2110,4 @@ apply_nolint uniform_space.completion.map₂ doc_blame
21102110

21112111
-- topology/uniform_space/uniform_embedding.lean
21122112
apply_nolint uniform_embedding doc_blame
2113-
apply_nolint uniform_inducing doc_blame
2113+
apply_nolint uniform_inducing doc_blame

src/algebra/char_p.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ assume hp : p = 1,
214214
have ( 1 : α) = 0, by simpa using (cast_eq_zero_iff α p 1).mpr (hp ▸ dvd_refl p),
215215
absurd this one_ne_zero
216216

217-
theorem char_is_prime_of_ge_two (p : ℕ) [hc : char_p α p] (hp : p ≥ 2) : nat.prime p :=
217+
theorem char_is_prime_of_two_le (p : ℕ) [hc : char_p α p] (hp : 2 ≤ p) : nat.prime p :=
218218
suffices ∀d ∣ p, d = 1 ∨ d = p, from ⟨hp, this⟩,
219219
assume (d : ℕ) (hdvd : ∃ e, p = d * e),
220220
let ⟨e, hmul⟩ := hdvd in
@@ -236,7 +236,7 @@ theorem char_is_prime_or_zero (p : ℕ) [hc : char_p α p] : nat.prime p ∨ p =
236236
match p, hc with
237237
| 0, _ := or.inr rfl
238238
| 1, hc := absurd (eq.refl (1 : ℕ)) (@char_ne_one α _ (1 : ℕ) hc)
239-
| (m+2), hc := or.inl (@char_is_prime_of_ge_two α _ (m+2) hc (nat.le_add_left 2 m))
239+
| (m+2), hc := or.inl (@char_is_prime_of_two_le α _ (m+2) hc (nat.le_add_left 2 m))
240240
end
241241

242242
lemma char_is_prime_of_pos (p : ℕ) [h : fact (0 < p)] [char_p α p] : fact p.prime :=

src/algebra/order_functions.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,17 @@ calc abs a
181181
≤ b : by { apply abs_le_of_le_of_neg_le; assumption }
182182
... ≤ abs b : le_abs_self _
183183

184-
lemma min_le_add_of_nonneg_right {a b : α} (hb : b ≥ 0) : min a b ≤ a + b :=
184+
lemma min_le_add_of_nonneg_right {a b : α} (hb : 0 ≤ b) : min a b ≤ a + b :=
185185
calc
186186
min a b ≤ a : by apply min_le_left
187187
... ≤ a + b : le_add_of_nonneg_right hb
188188

189-
lemma min_le_add_of_nonneg_left {a b : α} (ha : a ≥ 0) : min a b ≤ a + b :=
189+
lemma min_le_add_of_nonneg_left {a b : α} (ha : 0 ≤ a) : min a b ≤ a + b :=
190190
calc
191191
min a b ≤ b : by apply min_le_right
192192
... ≤ a + b : le_add_of_nonneg_left ha
193193

194-
lemma max_le_add_of_nonneg {a b : α} (ha : a ≥ 0) (hb : b ≥ 0) : max a b ≤ a + b :=
194+
lemma max_le_add_of_nonneg {a b : α} (ha : 0 ≤ a) (hb : 0 ≤ b) : max a b ≤ a + b :=
195195
max_le_iff.2 (by split; simpa)
196196

197197
lemma max_zero_sub_eq_self (a : α) : max a 0 - max (-a) 0 = a :=

src/data/nat/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ theorem le_mul_self : Π (n : ℕ), n ≤ n * n
113113
| 0 := le_refl _
114114
| (n+1) := let t := mul_le_mul_left (n+1) (succ_pos n) in by simp at t; exact t
115115

116-
theorem eq_of_mul_eq_mul_right {n m k : ℕ} (Hm : m > 0) (H : n * m = k * m) : n = k :=
116+
theorem eq_of_mul_eq_mul_right {n m k : ℕ} (Hm : 0 < m) (H : n * m = k * m) : n = k :=
117117
by rw [mul_comm n m, mul_comm k m] at H; exact eq_of_mul_eq_mul_left Hm H
118118

119119
theorem one_add (n : ℕ) : 1 + n = succ n := by simp [add_comm]

src/data/nat/dist.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ begin rw [h, dist_self] end
3535
theorem dist_eq_sub_of_le {n m : ℕ} (h : n ≤ m) : dist n m = m - n :=
3636
begin rw [dist.def, sub_eq_zero_of_le h, zero_add] end
3737

38-
theorem dist_eq_sub_of_ge {n m : ℕ} (h : n ≥ m) : dist n m = n - m :=
38+
theorem dist_eq_sub_of_le_right {n m : ℕ} (h : m ≤ n) : dist n m = n - m :=
3939
begin rw [dist_comm], apply dist_eq_sub_of_le h end
4040

4141
theorem dist_zero_right (n : ℕ) : dist n 0 = n :=
42-
eq.trans (dist_eq_sub_of_ge (zero_le n)) (nat.sub_zero n)
42+
eq.trans (dist_eq_sub_of_le_right (zero_le n)) (nat.sub_zero n)
4343

4444
theorem dist_zero_left (n : ℕ) : dist 0 n = n :=
4545
eq.trans (dist_eq_sub_of_le (zero_le n)) (nat.sub_zero n)
@@ -87,7 +87,7 @@ or.elim (lt_or_ge i j)
8787
(assume : i < j,
8888
by rw [max_eq_right_of_lt this, min_eq_left_of_lt this, dist_eq_sub_of_lt this])
8989
(assume : i ≥ j,
90-
by rw [max_eq_left this , min_eq_right this, dist_eq_sub_of_ge this])
90+
by rw [max_eq_left this , min_eq_right this, dist_eq_sub_of_le_right this])
9191
-/
9292

9393
theorem dist_succ_succ {i j : nat} : dist (succ i) (succ j) = dist i j :=
@@ -99,6 +99,6 @@ assume hne, nat.lt_by_cases
9999
begin rw [dist_eq_sub_of_le (le_of_lt this)], apply nat.sub_pos_of_lt this end)
100100
(assume : i = j, by contradiction)
101101
(assume : i > j,
102-
begin rw [dist_eq_sub_of_ge (le_of_lt this)], apply nat.sub_pos_of_lt this end)
102+
begin rw [dist_eq_sub_of_le_right (le_of_lt this)], apply nat.sub_pos_of_lt this end)
103103

104104
end nat

src/data/num/lemmas.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ theorem cmp_swap (m) : ∀n, (cmp m n).swap = cmp n m :=
9797
by induction m with m IH m IH; intro n;
9898
cases n with n n; try {unfold cmp}; try {refl}; rw ←IH; cases cmp m n; refl
9999

100-
theorem cmp_to_nat : ∀ (m n), (ordering.cases_on (cmp m n) ((m:ℕ) < n) (m = n) ((m:ℕ) > n) : Prop)
100+
theorem cmp_to_nat : ∀ (m n), (ordering.cases_on (cmp m n) ((m:ℕ) < n) (m = n) ((n:ℕ) < m) : Prop)
101101
| 1 1 := rfl
102102
| (bit0 a) 1 := let h : (1:ℕ) ≤ a := to_nat_pos a in add_le_add h h
103103
| (bit1 a) 1 := nat.succ_lt_succ $ to_nat_pos $ bit0 a
@@ -227,7 +227,7 @@ theorem mul_to_nat : ∀ m n, ((m * n : num) : ℕ) = m * n
227227
| (pos p) 0 := rfl
228228
| (pos p) (pos q) := pos_num.mul_to_nat _ _
229229

230-
theorem cmp_to_nat : ∀ (m n), (ordering.cases_on (cmp m n) ((m:ℕ) < n) (m = n) ((m:ℕ) > n) : Prop)
230+
theorem cmp_to_nat : ∀ (m n), (ordering.cases_on (cmp m n) ((m:ℕ) < n) (m = n) ((n:ℕ) < m) : Prop)
231231
| 0 0 := rfl
232232
| 0 (pos b) := to_nat_pos _
233233
| (pos a) 0 := to_nat_pos _
@@ -517,7 +517,7 @@ end num
517517
namespace pos_num
518518
open num
519519

520-
theorem pred_to_nat {n : pos_num} (h : n > 1) : (pred n : ℕ) = nat.pred n :=
520+
theorem pred_to_nat {n : pos_num} (h : 1 < n) : (pred n : ℕ) = nat.pred n :=
521521
begin
522522
unfold pred,
523523
have := pred'_to_nat n,
@@ -950,7 +950,7 @@ of_int_cast n
950950
| (n : ℕ) := to_int_inj.1 $ by simp [znum.of_int']
951951
| -[1+ n] := to_int_inj.1 $ by simp [znum.of_int']
952952

953-
theorem cmp_to_int : ∀ (m n), (ordering.cases_on (cmp m n) ((m:ℤ) < n) (m = n) ((m:ℤ) > n) : Prop)
953+
theorem cmp_to_int : ∀ (m n), (ordering.cases_on (cmp m n) ((m:ℤ) < n) (m = n) ((n:ℤ) < m) : Prop)
954954
| 0 0 := rfl
955955
| (pos a) (pos b) := begin
956956
have := pos_num.cmp_to_nat a b; revert this; dsimp [cmp];

src/data/padics/padic_numbers.lean

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def stationary_point {f : padic_seq p} (hf : ¬ f ≈ 0) : ℕ :=
9595
classical.some $ stationary hf
9696

9797
lemma stationary_point_spec {f : padic_seq p} (hf : ¬ f ≈ 0) :
98-
∀ {m n}, m ≥ stationary_point hf → n ≥ stationary_point hf →
98+
∀ {m n}, stationary_point hf ≤ m → stationary_point hf ≤ n
9999
padic_norm p (f n) = padic_norm p (f m) :=
100100
classical.some_spec $ stationary hf
101101

@@ -147,7 +147,7 @@ lemma not_lim_zero_const_of_nonzero {q : ℚ} (hq : q ≠ 0) : ¬ lim_zero (cons
147147
lemma not_equiv_zero_const_of_nonzero {q : ℚ} (hq : q ≠ 0) : ¬ (const (padic_norm p) q) ≈ 0 :=
148148
λ h : lim_zero (const (padic_norm p) q - 0), not_lim_zero_const_of_nonzero hq $ by simpa using h
149149

150-
lemma norm_nonneg (f : padic_seq p) : f.norm0 :=
150+
lemma norm_nonneg (f : padic_seq p) : 0f.norm :=
151151
if hf : f ≈ 0 then by simp [hf, norm]
152152
else by simp [norm, hf, padic_norm.nonneg]
153153

@@ -265,22 +265,22 @@ by simp [h1, norm, hp.one_lt]
265265

266266
private lemma norm_eq_of_equiv_aux {f g : padic_seq p} (hf : ¬ f ≈ 0) (hg : ¬ g ≈ 0) (hfg : f ≈ g)
267267
(h : padic_norm p (f (stationary_point hf)) ≠ padic_norm p (g (stationary_point hg)))
268-
(hgt : padic_norm p (f (stationary_point hf)) > padic_norm p (g (stationary_point hg))) :
268+
(hlt : padic_norm p (g (stationary_point hg)) < padic_norm p (f (stationary_point hf))) :
269269
false :=
270270
begin
271-
have hpn : padic_norm p (f (stationary_point hf)) - padic_norm p (g (stationary_point hg)) > 0,
272-
from sub_pos_of_lt hgt,
271+
have hpn : 0 < padic_norm p (f (stationary_point hf)) - padic_norm p (g (stationary_point hg)),
272+
from sub_pos_of_lt hlt,
273273
cases hfg _ hpn with N hN,
274274
let i := max N (max (stationary_point hf) (stationary_point hg)),
275-
have hi : i ≥ N, from le_max_left _ _,
275+
have hi : N ≤ i, from le_max_left _ _,
276276
have hN' := hN _ hi,
277-
padic_index_simp [N, hf, hg] at hN' h hgt,
277+
padic_index_simp [N, hf, hg] at hN' h hlt,
278278
have hpne : padic_norm p (f i) ≠ padic_norm p (-(g i)),
279279
by rwa [ ←padic_norm.neg p (g i)] at h,
280280
let hpnem := add_eq_max_of_ne p hpne,
281281
have hpeq : padic_norm p ((f - g) i) = max (padic_norm p (f i)) (padic_norm p (g i)),
282282
{ rwa padic_norm.neg at hpnem },
283-
rw [hpeq, max_eq_left_of_lt hgt] at hN',
283+
rw [hpeq, max_eq_left_of_lt hlt] at hN',
284284
have : padic_norm p (f i) < padic_norm p (f i),
285285
{ apply lt_of_lt_of_le hN', apply sub_le_self, apply padic_norm.nonneg },
286286
exact lt_irrefl _ this
@@ -290,13 +290,13 @@ private lemma norm_eq_of_equiv {f g : padic_seq p} (hf : ¬ f ≈ 0) (hg : ¬ g
290290
padic_norm p (f (stationary_point hf)) = padic_norm p (g (stationary_point hg)) :=
291291
begin
292292
by_contradiction h,
293-
cases (decidable.em (padic_norm p (f (stationary_point hf)) >
294-
padic_norm p (g (stationary_point hg))))
295-
with hgt hngt,
296-
{ exact norm_eq_of_equiv_aux hf hg hfg h hgt },
293+
cases (decidable.em (padic_norm p (g (stationary_point hg)) <
294+
padic_norm p (f (stationary_point hf))))
295+
with hlt hnlt,
296+
{ exact norm_eq_of_equiv_aux hf hg hfg h hlt },
297297
{ apply norm_eq_of_equiv_aux hg hf (setoid.symm hfg) (ne.symm h),
298298
apply lt_of_le_of_ne,
299-
apply le_of_not_gt hngt,
299+
apply le_of_not_gt hnlt,
300300
apply h }
301301
end
302302

@@ -501,28 +501,28 @@ section embedding
501501
open padic_seq
502502
variables {p : ℕ} [fact p.prime]
503503

504-
lemma defn (f : padic_seq p) {ε : ℚ} (hε : ε > 0) : ∃ N, ∀ i ≥ N, padic_norm_e (⟦f⟧ - f i) < ε :=
504+
lemma defn (f : padic_seq p) {ε : ℚ} (hε : 0 < ε) : ∃ N, ∀ i ≥ N, padic_norm_e (⟦f⟧ - f i) < ε :=
505505
begin
506506
simp only [padic.cast_eq_of_rat],
507507
change ∃ N, ∀ i ≥ N, (f - const _ (f i)).norm < ε,
508508
by_contradiction h,
509509
cases cauchy₂ f hε with N hN,
510-
have : ∀ N, ∃ i ≥ N, (f - const _ (f i)).norm ≥ ε,
510+
have : ∀ N, ∃ i ≥ N, ε ≤ (f - const _ (f i)).norm,
511511
by simpa [not_forall] using h,
512512
rcases this N with ⟨i, hi, hge⟩,
513513
have hne : ¬ (f - const (padic_norm p) (f i)) ≈ 0,
514514
{ intro h, unfold padic_seq.norm at hge; split_ifs at hge, exact not_lt_of_ge hge hε },
515515
unfold padic_seq.norm at hge; split_ifs at hge,
516516
apply not_le_of_gt _ hge,
517-
cases decidable.em ((stationary_point hne) ≥ N) with hgen hngen,
517+
cases decidable.em (N ≤ stationary_point hne) with hgen hngen,
518518
{ apply hN; assumption },
519519
{ have := stationary_point_spec hne (le_refl _) (le_of_not_le hngen),
520520
rw ←this,
521521
apply hN,
522522
apply le_refl, assumption }
523523
end
524524

525-
protected lemma nonneg (q : ℚ_[p]) : padic_norm_e q ≥ 0 :=
525+
protected lemma nonneg (q : ℚ_[p]) : 0 ≤ padic_norm_e q :=
526526
quotient.induction_on q $ norm_nonneg
527527

528528
lemma zero_def : (0 : ℚ_[p]) = ⟦0⟧ := rfl
@@ -595,7 +595,7 @@ namespace padic
595595
section complete
596596
open padic_seq padic
597597

598-
theorem rat_dense' {p : ℕ} [fact p.prime] (q : ℚ_[p]) {ε : ℚ} (hε : ε > 0) :
598+
theorem rat_dense' {p : ℕ} [fact p.prime] (q : ℚ_[p]) {ε : ℚ} (hε : 0 < ε) :
599599
∃ r : ℚ, padic_norm_e (q - r) < ε :=
600600
quotient.induction_on q $ λ q',
601601
have ∃ N, ∀ m n ≥ N, padic_norm p (q' m - q' n) < ε, from cauchy₂ _ hε,
@@ -609,7 +609,7 @@ quotient.induction_on q $ λ q',
609609
{ simp only [padic_seq.norm, dif_neg hne'],
610610
change padic_norm p (q' _ - q' _) < ε,
611611
have := stationary_point_spec hne',
612-
cases decidable.em (N ≥ stationary_point hne') with hle hle,
612+
cases decidable.em (stationary_point hne' ≤ N) with hle hle,
613613
{ have := eq.symm (this (le_refl _) hle),
614614
simp at this, simpa [this] },
615615
{ apply hN,
@@ -619,7 +619,7 @@ quotient.induction_on q $ λ q',
619619
variables {p : ℕ} [fact p.prime] (f : cau_seq _ (@padic_norm_e p _))
620620
open classical
621621

622-
private lemma div_nat_pos (n : ℕ) : (1 / ((n + 1): ℚ)) > 0 :=
622+
private lemma div_nat_pos (n : ℕ) : 0 < (1 / ((n + 1): ℚ)) :=
623623
div_pos zero_lt_one (by exact_mod_cast succ_pos _)
624624

625625
def lim_seq : ℕ → ℚ := λ n, classical.some (rat_dense' (f n) (div_nat_pos n))
@@ -638,7 +638,7 @@ end
638638

639639
lemma exi_rat_seq_conv_cauchy : is_cau_seq (padic_norm p) (lim_seq f) :=
640640
assume ε hε,
641-
have3 : ε / 3 > 0, from div_pos hε (by norm_num),
641+
have3 : 0 < ε / 3, from div_pos hε (by norm_num),
642642
let ⟨N, hN⟩ := exi_rat_seq_conv f hε3,
643643
⟨N2, hN2⟩ := f.cauchy₂ hε3 in
644644
begin
@@ -677,8 +677,8 @@ private def lim : ℚ_[p] := ⟦lim' f⟧
677677
theorem complete' : ∃ q : ℚ_[p], ∀ ε > 0, ∃ N, ∀ i ≥ N, padic_norm_e (q - f i) < ε :=
678678
⟨ lim f,
679679
λ ε hε,
680-
let ⟨N, hN⟩ := exi_rat_seq_conv f (show ε / 2 > 0, from div_pos hε (by norm_num)),
681-
⟨N2, hN2⟩ := padic_norm_e.defn (lim' f) (show ε / 2 > 0, from div_pos hε (by norm_num)) in
680+
let ⟨N, hN⟩ := exi_rat_seq_conv f (show 0 < ε / 2, from div_pos hε (by norm_num)),
681+
⟨N2, hN2⟩ := padic_norm_e.defn (lim' f) (show 0 < ε / 2, from div_pos hε (by norm_num)) in
682682
begin
683683
existsi max N N2,
684684
intros i hi,
@@ -730,7 +730,7 @@ instance : is_absolute_value (λ a : ℚ_[p], ∥a∥) :=
730730
abv_add := norm_add_le,
731731
abv_mul := by simp [has_norm.norm, padic_norm_e.mul'] }
732732

733-
theorem rat_dense {p : ℕ} {hp : fact p.prime} (q : ℚ_[p]) {ε : ℝ} (hε : ε > 0) :
733+
theorem rat_dense {p : ℕ} {hp : fact p.prime} (q : ℚ_[p]) {ε : ℝ} (hε : 0 < ε) :
734734
∃ r : ℚ, ∥q - r∥ < ε :=
735735
let ⟨ε', hε'l, hε'r⟩ := exists_rat_btwn hε,
736736
⟨r, hr⟩ := rat_dense' q (by simpa using hε'l) in
@@ -858,7 +858,7 @@ begin
858858
exact_mod_cast hN i hi
859859
end
860860

861-
lemma padic_norm_e_lim_le {f : cau_seq ℚ_[p] norm} {a : ℝ} (ha : a > 0)
861+
lemma padic_norm_e_lim_le {f : cau_seq ℚ_[p] norm} {a : ℝ} (ha : 0 < a)
862862
(hf : ∀ i, ∥f i∥ ≤ a) : ∥f.lim∥ ≤ a :=
863863
let ⟨N, hN⟩ := setoid.symm (cau_seq.equiv_lim f) _ ha in
864864
calc ∥f.lim∥ = ∥f.lim - f N + f N∥ : by simp

src/data/polynomial/degree/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ lemma degree_eq_iff_nat_degree_eq {p : polynomial R} {n : ℕ} (hp : p ≠ 0) :
7676
p.degree = n ↔ p.nat_degree = n :=
7777
by rw [degree_eq_nat_degree hp, with_bot.coe_eq_coe]
7878

79-
lemma degree_eq_iff_nat_degree_eq_of_pos {p : polynomial R} {n : ℕ} (hn : n > 0) :
79+
lemma degree_eq_iff_nat_degree_eq_of_pos {p : polynomial R} {n : ℕ} (hn : 0 < n) :
8080
p.degree = n ↔ p.nat_degree = n :=
8181
begin
8282
split,

src/data/real/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ noncomputable instance decidable_lt (a b : ℝ) : decidable (a < b) := by apply_
153153
noncomputable instance decidable_le (a b : ℝ) : decidable (a ≤ b) := by apply_instance
154154
noncomputable instance decidable_eq (a b : ℝ) : decidable (a = b) := by apply_instance
155155

156-
lemma le_of_forall_epsilon_le {a b : real} (h : ∀ε, ε > 0 → a ≤ b + ε) : a ≤ b :=
156+
lemma le_of_forall_epsilon_le {a b : real} (h : ∀ε, 0 < ε → a ≤ b + ε) : a ≤ b :=
157157
le_of_forall_le_of_dense $ assume x hxb,
158158
calc a ≤ b + (x - b) : h (x-b) $ sub_pos.2 hxb
159159
... = x : by rw [add_comm]; simp

src/data/real/cau_seq.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ variables {α : Type*} [discrete_linear_ordered_field α]
169169
{β : Type*} [ring β] {abv : β → α} [is_absolute_value abv] {f : ℕ → β}
170170

171171
@[nolint ge_or_gt] -- see Note [nolint_ge]
172-
theorem cauchy₂ (hf : is_cau_seq abv f) {ε : α} (ε0 : ε > 0) :
172+
theorem cauchy₂ (hf : is_cau_seq abv f) {ε : α} (ε0 : 0 < ε) :
173173
∃ i, ∀ j k ≥ i, abv (f j - f k) < ε :=
174174
begin
175175
refine (hf _ (half_pos ε0)).imp (λ i hi j k ij ik, _),
@@ -179,7 +179,7 @@ begin
179179
end
180180

181181
@[nolint ge_or_gt] -- see Note [nolint_ge]
182-
theorem cauchy₃ (hf : is_cau_seq abv f) {ε : α} (ε0 : ε > 0) :
182+
theorem cauchy₃ (hf : is_cau_seq abv f) {ε : α} (ε0 : 0 < ε) :
183183
∃ i, ∀ j ≥ i, ∀ k ≥ j, abv (f k - f j) < ε :=
184184
let ⟨i, H⟩ := hf.cauchy₂ ε0 in ⟨i, λ j ij k jk, H _ _ (le_trans ij jk) ij⟩
185185

@@ -209,7 +209,7 @@ theorem is_cau (f : cau_seq β abv) : is_cau_seq abv f := f.2
209209

210210
@[nolint ge_or_gt] -- see Note [nolint_ge]
211211
theorem cauchy (f : cau_seq β abv) :
212-
∀ {ε}, ε > 0 → ∃ i, ∀ j ≥ i, abv (f j - f i) < ε := f.2
212+
∀ {ε}, 0 < ε → ∃ i, ∀ j ≥ i, abv (f j - f i) < ε := f.2
213213

214214
/-- Given a Cauchy sequence `f`, create a Cauchy sequence from a sequence `g` with
215215
the same values as `f`. -/
@@ -219,11 +219,11 @@ def of_eq (f : cau_seq β abv) (g : ℕ → β) (e : ∀ i, f i = g i) : cau_seq
219219
variable [is_absolute_value abv]
220220

221221
@[nolint ge_or_gt] -- see Note [nolint_ge]
222-
theorem cauchy₂ (f : cau_seq β abv) {ε} : ε > 0
222+
theorem cauchy₂ (f : cau_seq β abv) {ε} : 0 < ε
223223
∃ i, ∀ j k ≥ i, abv (f j - f k) < ε := f.2.cauchy₂
224224

225225
@[nolint ge_or_gt] -- see Note [nolint_ge]
226-
theorem cauchy₃ (f : cau_seq β abv) {ε} : ε > 0
226+
theorem cauchy₃ (f : cau_seq β abv) {ε} : 0 < ε
227227
∃ i, ∀ j ≥ i, ∀ k ≥ j, abv (f k - f j) < ε := f.2.cauchy₃
228228

229229
theorem bounded (f : cau_seq β abv) : ∃ r, ∀ i, abv (f i) < r :=
@@ -424,7 +424,7 @@ have hg' : ¬ lim_zero g, by simpa using (show ¬ lim_zero (g - 0), from hg),
424424
begin
425425
rcases abv_pos_of_not_lim_zero hf' with ⟨a1, ha1, N1, hN1⟩,
426426
rcases abv_pos_of_not_lim_zero hg' with ⟨a2, ha2, N2, hN2⟩,
427-
have : a1 * a2 > 0, from mul_pos ha1 ha2,
427+
have : 0 < a1 * a2, from mul_pos ha1 ha2,
428428
cases hlz _ this with N hN,
429429
let i := max N (max N1 N2),
430430
have hN' := hN i (le_max_left _ _),
@@ -456,12 +456,12 @@ variables {β : Type*} [integral_domain β] (abv : β → α) [is_absolute_value
456456

457457
lemma one_not_equiv_zero : ¬ (const abv 1) ≈ (const abv 0) :=
458458
assume h,
459-
have ∀ ε > 0, ∃ i, ∀ k, k ≥ i → abv (1 - 0) < ε, from h,
459+
have ∀ ε > 0, ∃ i, ∀ k, i ≤ k → abv (1 - 0) < ε, from h,
460460
have h1 : abv 10, from le_of_not_gt $
461-
assume h2 : abv 1 > 0,
461+
assume h2 : 0 < abv 1,
462462
exists.elim (this _ h2) $ λ i hi,
463463
lt_irrefl (abv 1) $ by simpa using hi _ (le_refl _),
464-
have h2 : abv 10, from is_absolute_value.abv_nonneg _ _,
464+
have h2 : 0 ≤ abv 1, from is_absolute_value.abv_nonneg _ _,
465465
have abv 1 = 0, from le_antisymm h1 h2,
466466
have (1 : β) = 0, from (is_absolute_value.abv_eq_zero abv).1 this,
467467
absurd this one_ne_zero

0 commit comments

Comments
 (0)