IMO-Steps / imo_proofs /imo_1968_p5_1.lean
roozbeh-yz's picture
Upload 42 files
1c3ffd8 verified
import Mathlib
set_option linter.unusedVariables.analyzeTactics true
open Real
theorem imo_1968_p5_1
(a : ℝ)
(f : ℝ β†’ ℝ)
(hβ‚€ : 0 < a)
(h₁ : βˆ€ x, f (x + a) = 1 / 2 + Real.sqrt (f x - (f x)^2))
(hβ‚‚ : βˆ€ x, 1 / 2 ≀ f x ∧ f x ≀ 1) :
βˆƒ b > 0, βˆ€ x, f (x + b) = f x := by
use (2 * a)
constructor
. refine mul_pos (by norm_num) hβ‚€
. intro x
have h₃: f (x + a) = 1 / 2 + Real.sqrt (f x - (f x)^2) := by
exact h₁ x
have hβ‚„: f (x + 2 * a) = 1 / 2 + Real.sqrt (f (x + a) - (f (x + a)^2)) := by
rw [two_mul, ← add_assoc]
exact h₁ (x + a)
have hβ‚…: f (x + a) - (f (x + a) ^ 2) = (f x - 1 / 2) ^ 2 := by
have h₅₁: 0 ≀ f x - (f x)^2 := by
refine sub_nonneg_of_le ?_
rw [pow_two]
nth_rw 3 [← mul_one (f x)]
refine (mul_le_mul_left ?_).mpr ?_
. linarith [hβ‚‚ x]
. exact (hβ‚‚ x).2
rw [h₃, add_sq, sub_sq, sq_sqrt h₅₁]
ring_nf
rw [hβ‚…, sqrt_sq ?_] at hβ‚„
. linarith
. have h₆: 1 / 2 ≀ f x := by
exact (hβ‚‚ x).1
linarith [h₆]