Skip to content

Commit aa0b441

Browse files
committed
style(Archive): avoid using > or ≥ (#35346)
Prefer to use < or ≤ instead. For consistently with mathlib style; extracted from #12933.
1 parent 325d475 commit aa0b441

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

Archive/Imo/Imo1960Q1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ theorem searchUpTo_step {c n} (H : SearchUpTo c n) {c' n'} (ec : c + 1 = c') (en
7171
obtain ⟨h₁, ⟨m, rfl⟩, h₂⟩ := id p
7272
by_cases h : 11 * m < c * 11; · exact H _ h p
7373
obtain rfl : m = c := by lia
74-
rw [Nat.mul_div_cancel_left _ (by simp : 11 > 0), mul_comm] at h₂
74+
rw [Nat.mul_div_cancel_left _ (by decide), mul_comm] at h₂
7575
refine (H' h₂).imp ?_ ?_ <;> · rintro rfl; norm_num
7676

7777
theorem searchUpTo_end {c} (H : SearchUpTo c 1001) {n : ℕ} (ppn : ProblemPredicate n) :

Archive/Imo/Imo1988Q6.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,16 @@ theorem imo1988_q6 {a b : ℕ} (h : a * b + 1 ∣ a ^ 2 + b ^ 2) :
226226
· -- Show the descent step.
227227
intro x y hx x_lt_y _ _ z h_root _ hV₀
228228
constructor
229-
· have hpos : z * z + x * x > 0 := by
229+
· have hpos : 0 < z * z + x * x := by
230230
apply add_pos_of_nonneg_of_pos
231231
· apply mul_self_nonneg
232232
· apply mul_pos <;> exact mod_cast hx
233233
have hzx : z * z + x * x = (z * x + 1) * k := by
234234
rw [← sub_eq_zero, ← h_root]
235235
ring
236236
rw [hzx] at hpos
237-
replace hpos : z * x + 1 > 0 := pos_of_mul_pos_left hpos (Int.natCast_nonneg k)
238-
replace hpos : z * x0 := Int.le_of_lt_add_one hpos
237+
replace hpos : 0 < z * x + 1 := pos_of_mul_pos_left hpos (Int.natCast_nonneg k)
238+
replace hpos : 0z * x := Int.le_of_lt_add_one hpos
239239
apply nonneg_of_mul_nonneg_left hpos (mod_cast hx)
240240
· contrapose! hV₀ with x_lt_z
241241
apply ne_of_gt

Archive/Imo/Imo2005Q3.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ and then making use of `xyz ≥ 1` to show `(x^5-x^2)/(x^3*(x^2+y^2+z^2)) ≥ (x
2424

2525
namespace Imo2005Q3
2626

27-
theorem key_insight (x y z : ℝ) (hx : x > 0) (hy : y > 0) (hz : z > 0) (h : x * y * z ≥ 1) :
27+
theorem key_insight (x y z : ℝ) (hx : 0 < x) (hy : 0 < y) (hz : 0 < z) (h : x * y * z ≥ 1) :
2828
(x ^ 5 - x ^ 2) / (x ^ 5 + y ^ 2 + z ^ 2) ≥ (x ^ 2 - y * z) / (x ^ 2 + y ^ 2 + z ^ 2) := by
2929
have key :
3030
(x ^ 5 - x ^ 2) / (x ^ 5 + y ^ 2 + z ^ 2) -
@@ -44,7 +44,7 @@ end Imo2005Q3
4444

4545
open Imo2005Q3
4646

47-
theorem imo2005_q3 (x y z : ℝ) (hx : x > 0) (hy : y > 0) (hz : z > 0) (h : x * y * z ≥ 1) :
47+
theorem imo2005_q3 (x y z : ℝ) (hx : 0 < x) (hy : 0 < y) (hz : 0 < z) (h : x * y * z ≥ 1) :
4848
(x ^ 5 - x ^ 2) / (x ^ 5 + y ^ 2 + z ^ 2) + (y ^ 5 - y ^ 2) / (y ^ 5 + z ^ 2 + x ^ 2) +
4949
(z ^ 5 - z ^ 2) / (z ^ 5 + x ^ 2 + y ^ 2) ≥
5050
0 := by

Archive/Imo/Imo2008Q2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ theorem imo2008_q2b : Set.Infinite rationalSolutions := by
6767
simp only [Set.mem_setOf_eq] at hs_in_W ⊢
6868
rcases hs_in_W with ⟨x, y, z, h₁, t, ht_gt_zero, hx_t, hy_t, hz_t⟩
6969
use x, y, z
70-
have key_gt_zero : t ^ 2 + t + 1 > 0 := by linarith [pow_pos ht_gt_zero 2, ht_gt_zero]
70+
have key_gt_zero : 0 < t ^ 2 + t + 1 := by linarith [pow_pos ht_gt_zero 2, ht_gt_zero]
7171
have h₂ : x ≠ 1 := by rw [hx_t]; simp [field]; linarith [key_gt_zero]
7272
have h₃ : y ≠ 1 := by rw [hy_t]; simp [field]; linarith [key_gt_zero]
7373
have h₄ : z ≠ 1 := by rw [hz_t]; linarith [key_gt_zero]

Archive/Imo/Imo2008Q3.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ theorem p_lemma (p : ℕ) (hpp : Nat.Prime p) (hp_mod_4_eq_1 : p ≡ 1 [MOD 4])
4545
simp only [m, Int.cast_pow, Int.cast_add, Int.cast_one, ZMod.coe_valMinAbs]
4646
rw [pow_two, ← hy]; exact neg_add_cancel 1
4747
have hnat₂ : n ≤ p / 2 := ZMod.natAbs_valMinAbs_le y
48-
have hnat₃ : p ≥ 2 * n := by lia
48+
have hnat₃ : 2 * n ≤ p := by lia
4949
set k : ℕ := p - 2 * n with hnat₄
5050
have hnat₅ : p ∣ k ^ 2 + 4 := by
5151
obtain ⟨x, hx⟩ := hnat₁
@@ -55,11 +55,11 @@ theorem p_lemma (p : ℕ) (hpp : Nat.Prime p) (hp_mod_4_eq_1 : p ≡ 1 [MOD 4])
5555
have hcast₂ : (n : ℤ) ^ 2 + 1 = p * x := by assumption_mod_cast
5656
linear_combination ((k : ℤ) + p - 2 * n) * hcast₁ + 4 * hcast₂
5757
assumption_mod_cast
58-
have hnat₆ : k ^ 2 + 4 ≥ p := Nat.le_of_dvd (k ^ 2 + 3).succ_pos hnat₅
58+
have hnat₆ : p ≤ k ^ 2 + 4 := Nat.le_of_dvd (k ^ 2 + 3).succ_pos hnat₅
5959
have hreal₁ : (k : ℝ) = p - 2 * n := by assumption_mod_cast
60-
have hreal₂ : (p : ℝ) > 20 := by assumption_mod_cast
61-
have hreal₃ : (k : ℝ) ^ 2 + 4 ≥ p := by assumption_mod_cast
62-
have hreal₅ : (k : ℝ) > 4 := by
60+
have hreal₂ : 20 < (p : ℝ) := by assumption_mod_cast
61+
have hreal₃ : p ≤ (k : ℝ) ^ 2 + 4 := by assumption_mod_cast
62+
have hreal₅ : 4 < (k : ℝ) := by
6363
refine lt_of_pow_lt_pow_left₀ 2 k.cast_nonneg ?_
6464
linarith only [hreal₂, hreal₃]
6565
have hreal₆ : (k : ℝ) > sqrt (2 * n) := by

Archive/Imo/Imo2008Q4.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ end Imo2008Q4
3434
open Imo2008Q4
3535

3636
set_option linter.flexible false in
37-
theorem imo2008_q4 (f : ℝ → ℝ) (H₁ : ∀ x > 0, f x > 0) :
37+
theorem imo2008_q4 (f : ℝ → ℝ) (H₁ : ∀ x > 0, 0 < f x) :
3838
(∀ w x y z : ℝ, 0 < w → 0 < x → 0 < y → 0 < z → w * x = y * z →
3939
(f w ^ 2 + f x ^ 2) / (f (y ^ 2) + f (z ^ 2)) = (w ^ 2 + x ^ 2) / (y ^ 2 + z ^ 2)) ↔
4040
(∀ x > 0, f x = x) ∨ ∀ x > 0, f x = 1 / x := by
@@ -64,10 +64,10 @@ theorem imo2008_q4 (f : ℝ → ℝ) (H₁ : ∀ x > 0, f x > 0) :
6464
-- f(a) ≠ 1/a, f(a) = a
6565
obtain hfb₂ := Or.resolve_left (h₃ b hb) hfb₁
6666
-- f(b) ≠ b, f(b) = 1/b
67-
have hab : a * b > 0 := mul_pos ha hb
68-
have habss : a * b = sqrt (a * b) * sqrt (a * b) := (mul_self_sqrt (le_of_lt hab)).symm
67+
have hab : 0 < a * b := by positivity
68+
have habss : a * b = sqrt (a * b) * sqrt (a * b) := (mul_self_sqrt hab.le).symm
6969
specialize H₂ a b (sqrt (a * b)) (sqrt (a * b)) ha hb (sqrt_pos.mpr hab) (sqrt_pos.mpr hab) habss
70-
rw [sq_sqrt (le_of_lt hab), ← two_mul (f (a * b)), ← two_mul (a * b)] at H₂
70+
rw [sq_sqrt hab.le, ← two_mul (f (a * b)), ← two_mul (a * b)] at H₂
7171
rw [hfa₂, hfb₂] at H₂
7272
have h2ab_ne_0 : 2 * (a * b) ≠ 0 := by positivity
7373
specialize h₃ (a * b) hab

Archive/Imo/Imo2019Q4.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ theorem upper_bound {k n : ℕ} (hk : k > 0)
8080
end Imo2019Q4
8181

8282
set_option linter.flexible false in
83-
theorem imo2019_q4 {k n : ℕ} (hk : k > 0) (hn : n > 0) :
83+
theorem imo2019_q4 {k n : ℕ} (hk : 0 < k) (hn : 0 < n) :
8484
(k ! : ℤ) = ∏ i ∈ range n, ((2 : ℤ) ^ n - (2 : ℤ) ^ i) ↔ (k, n) = (1, 1) ∨ (k, n) = (3, 2) := by
8585
-- The implication `←` holds.
8686
constructor

Archive/Wiedijk100Theorems/AreaOfACircle.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ theorem area_disc : volume (disc r) = NNReal.pi * r ^ 2 := by
105105
((hasDerivAt_const x (r : ℝ)⁻¹).mul (hasDerivAt_id' x)))).add
106106
((hasDerivAt_id' x).mul ((((hasDerivAt_id' x).fun_pow 2).const_sub ((r : ℝ) ^ 2)).sqrt _))
107107
using 1
108-
· have h₁ : (r : ℝ) ^ 2 - x ^ 2 > 0 := sub_pos_of_lt (sq_lt_sq' hx1 hx2)
108+
· have h₁ : 0 < (r : ℝ) ^ 2 - x ^ 2 := sub_pos_of_lt (sq_lt_sq' hx1 hx2)
109109
have h : sqrt ((r : ℝ) ^ 2 - x ^ 2) ^ 3 =
110110
((r : ℝ) ^ 2 - x ^ 2) * sqrt ((r : ℝ) ^ 2 - x ^ 2) := by
111111
rw [pow_three, ← mul_assoc, mul_self_sqrt (by positivity)]

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ theorem ballot_problem' :
321321
(countedSequence_finite p (q + 1)) (countedSequence_nonempty _ _)
322322
haveI := isProbabilityMeasure_uniformOn
323323
(countedSequence_finite (p + 1) q) (countedSequence_nonempty _ _)
324-
have h₃ : p + 1 + (q + 1) > 0 := Nat.add_pos_left (Nat.succ_pos _) _
324+
have h₃ : 0 < p + 1 + (q + 1) := Nat.add_pos_left (Nat.succ_pos _) _
325325
rw [← uniformOn_add_compl_eq {l : List ℤ | l.headI = 1} _ (countedSequence_finite _ _),
326326
first_vote_pos _ _ h₃, first_vote_neg _ _ h₃, ballot_pos, ballot_neg _ _ qp]
327327
rw [ENNReal.toReal_add, ENNReal.toReal_mul, ENNReal.toReal_mul, ← Nat.cast_add,

0 commit comments

Comments
 (0)