IMO-Steps / Lemmas /imo_1960_p2_lemmas.lean
roozbeh-yz's picture
Upload 42 files
1c3ffd8 verified
import Mathlib
set_option linter.unusedVariables.analyzeTactics true
open Real
theorem imo_1960_p2_1
(x : ℝ)
(hβ‚€ : 0 ≀ 1 + 2 * x)
-- (h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
-- (hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9)
(h₃ : 7 * x ≀ -(7/4)) :
x ^ 3 + x ^ 2 * (2 / 5) ≀ (15/400) ∧ x / 16 + 3 / 160 ≀ (5/100) * x ^ 2 := by
have hβ‚„: -(1/2) ≀ x := by linarith
have hβ‚…: x ≀ -(1/4) := by linarith
have h₆: x ^ 2 ≀ (-(1 / 2)) ^ 2 := by
refine sq_le_sq.mpr ?_
norm_num
have h₆₁: x < 0 := by linarith
rw [abs_of_neg h₆₁]
rw [abs_of_pos (by norm_num)]
exact neg_le.mp hβ‚„
have h₇: (-(1 / 4)) ^ 2 ≀ x ^ 2 := by
refine sq_le_sq.mpr ?_
have h₆₁: x < 0 := by linarith
rw [abs_of_neg h₆₁]
rw [abs_of_neg (by norm_num)]
norm_num
exact le_neg_of_le_neg hβ‚…
norm_num at h₆ h₇
constructor
. have hβ‚ˆ: x + (4/10) ≀ (15/100) := by linarith
have h₉: (x + (4/10)) * x ^ 2 ≀ (15/100) * (1 / 4) := by
refine mul_le_mul hβ‚ˆ h₆ ?_ ?_
. exact sq_nonneg x
. norm_num
linarith
. linarith
theorem imo_1960_p2_2
(x : ℝ)
-- (hβ‚€ : 0 ≀ 1 + 2 * x)
(h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
(hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9) :
4 * x ^ 2 < (2 * x + 9) * (1 - √(1 + 2 * x)) ^ 2 := by
refine' (div_lt_iffβ‚€ ?_).mp hβ‚‚
refine Ne.lt_of_le (id (Ne.symm h₁)) ?_
exact sq_nonneg (1 - sqrt (1 + 2 * x))
theorem imo_1960_p2_3
(x : ℝ)
(hβ‚€ : 0 ≀ 1 + 2 * x) :
-- (h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
-- (hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9) :
(1 - sqrt (1 + 2 * x)) ^ 2 = (2 + 2 * x) - 2 * sqrt (1 + 2 * x) := by
ring_nf
ring_nf at hβ‚€
rw [Real.sq_sqrt hβ‚€]
ring_nf
theorem imo_1960_p2_4
(x : ℝ)
(hβ‚€ : 0 ≀ 1 + 2 * x)
-- (h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
-- (hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9)
(h₃: 4 * x ^ 2 < (2 * x + 9) * (1 - sqrt (1 + 2 * x) ) ^ 2)
(hβ‚„: (1 - sqrt (1 + 2 * x)) ^ 2 = (2 + 2 * x) - 2 * sqrt (1 + 2 * x)) :
(2 * x + 9) ^ 2 * (sqrt (1 + 2 * x)) ^ 2 < (11 * x + 9) ^ 2 := by
rw [← mul_pow]
refine' pow_lt_pow_leftβ‚€ ?_ ?_ (by norm_num)
. rw [hβ‚„] at h₃
linarith
. refine' mul_nonneg ?_ ?_
. linarith
. exact sqrt_nonneg (1 + 2 * x)
theorem imo_1960_p2_5
(x : ℝ)
(hβ‚€ : 0 ≀ 1 + 2 * x)
-- (h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
-- (hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9)
(h₃: (2 * x + 9) ^ 2 * (sqrt (1 + 2 * x)) ^ 2 < (11 * x + 9) ^ 2) :
8 * x^3 < 45 * x^2 := by
rw [Real.sq_sqrt hβ‚€] at h₃
ring_nf at h₃
linarith
theorem imo_1960_p2_6
(x : ℝ)
-- (hβ‚€ : 0 ≀ 1 + 2 * x)
-- (h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
-- (hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9)
(h₃: x^3 * 8 < x^2 * 45) :
x < 45/8 := by
have h₇₁: 0 ≀ x^2 := by exact sq_nonneg x
refine (lt_div_iffβ‚€ (by norm_num)).mpr ?_
refine' lt_of_mul_lt_mul_right ?_ h₇₁
ring_nf
exact h₃
theorem imo_1960_p2_7
(x : ℝ)
(hβ‚€ : 0 ≀ 1 + 2 * x)
(h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
(hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9) :
0 < x ^ 2 ∨ x ^ 2 = 0 := by
have hβ‚„: 0 ≀ x ^ 2 := by
exact sq_nonneg x
exact LE.le.gt_or_eq hβ‚„
theorem imo_1960_p2_8
(x : ℝ)
-- (hβ‚€ : 0 ≀ 1 + 2 * x)
-- (h₁ : (1 - Real.sqrt (1 + 2 * x))^2 β‰  0)
-- (hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9)
(h₃: 4 * x ^ 2 < (2 * x + 9) * (1 - sqrt (1 + 2 * x) ) ^ 2)
(hβ‚„: (1 - sqrt (1 + 2 * x)) ^ 2 = (2 + 2 * x) - 2 * sqrt (1 + 2 * x)) :
(2 * x + 9) * √(1 + 2 * x) < 11 * x + 9 := by
rw [hβ‚„] at h₃
linarith
theorem imo_1960_p2_9
(x : ℝ)
(hβ‚€ : 0 ≀ 1 + 2 * x) :
-- (h₁ : (1 - Real.sqrt (1 + 2 * x)) ^ 2 β‰  0)
-- (hβ‚‚ : (4 * x^2) / (1 - Real.sqrt (1 + 2*x))^2 < 2*x + 9) :
0 ≀ (2 * x + 9) * √(1 + 2 * x) := by
refine' mul_nonneg ?_ ?_
. linarith
. exact sqrt_nonneg (1 + 2 * x)