|
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) |
|
|