import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Tactic namespace Inekoalaty /-- Core inequality used in the game analysis: if `a,b ≥ 0` and `a^2+b^2=2` then `a+b ≥ √2`. -/ lemma add_ge_sqrt_two_of_sq_add_sq_eq_two {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (h : a^2 + b^2 = 2) : Real.sqrt 2 ≤ a + b := by have hab : 0 ≤ a + b := add_nonneg ha hb have habmul : 0 ≤ a * b := mul_nonneg ha hb have h_expand : (a + b)^2 = 2 + 2 * (a * b) := by calc (a + b)^2 = a^2 + b^2 + 2 * (a * b) := by ring _ = 2 + 2 * (a * b) := by simpa [h] have hsq : (2 : ℝ) ≤ (a + b)^2 := by have : (2 : ℝ) ≤ 2 + 2 * (a * b) := by linarith simpa [h_expand] using this -- `sqrt x ≤ y ↔ 0 ≤ y ∧ x ≤ y^2`. exact (Real.sqrt_le_iff).2 ⟨hab, by simpa using hsq⟩ /-- Archimedean lemma used to choose a sufficiently large stage in the game. -/ lemma exists_nat_mul_sqrt2_gt_linear (lam : ℝ) (hlam : lam < Real.sqrt 2 / 2) : ∃ k : ℕ, (k : ℝ) * Real.sqrt 2 > lam * (2 * (k : ℝ) + 1) := by sorry end Inekoalaty