Download tasks/real-analysis/real-analysis-continuity-d2-e0004/solution/Solution.lean from RenaissanceLabsEU/math: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/real-analysis/real-analysis-continuity-d2-e0004/solution/Solution.lean
- Command line
-
hf download hf://datasets/RenaissanceLabsEU/math/tasks/real-analysis/real-analysis-continuity-d2-e0004/solution/Solution.lean
-
curl -L -o Solution.lean https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/real-analysis/real-analysis-continuity-d2-e0004/solution/Solution.lean
1.17 kB
| import Mathlib | |
| /-- Epsilon-delta continuity of a quadratic function at a point. -/ | |
| theorem continuous_at : | |
| ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (-4 : ℝ)| < δ → |((1 : ℝ) * x ^ 2 + (5 : ℝ)) - ((1 : ℝ) * (-4 : ℝ) ^ 2 + (5 : ℝ))| < ε := by | |
| intro ε hε | |
| refine ⟨min 1 (ε / (9 : ℝ)), lt_min one_pos (by positivity), fun x hx => ?_⟩ | |
| have h1 : |x - (-4 : ℝ)| < 1 := lt_of_lt_of_le hx (min_le_left _ _) | |
| have h2 : |x - (-4 : ℝ)| < ε / (9 : ℝ) := lt_of_lt_of_le hx (min_le_right _ _) | |
| have h3 : |x + (-4 : ℝ)| < 2 * (4 : ℝ) + 1 := by | |
| rw [abs_lt] at h1 ⊢ | |
| constructor <;> norm_num <;> linarith [h1.1, h1.2] | |
| have e : ((1 : ℝ) * x ^ 2 + (5 : ℝ)) - ((1 : ℝ) * (-4 : ℝ) ^ 2 + (5 : ℝ)) = (1 : ℝ) * ((x - (-4 : ℝ)) * (x + (-4 : ℝ))) := by ring | |
| rw [e, abs_mul, abs_mul, show |(1 : ℝ)| = (1 : ℝ) by norm_num] | |
| have h4 : |x - (-4 : ℝ)| * (9 : ℝ) < ε := by rwa [lt_div_iff₀ (by norm_num)] at h2 | |
| have h5 := mul_le_mul_of_nonneg_left h3.le (mul_nonneg (by norm_num : (0 : ℝ) ≤ (1 : ℝ)) (abs_nonneg (x - (-4 : ℝ)))) | |
| nlinarith [abs_nonneg (x - (-4 : ℝ)), abs_nonneg (x + (-4 : ℝ))] | |