Files
colloquium-lean/ColloquiumLean/ContinuousSquareSolution.lean
Stefan Kebekus ea169e4c3e
Some checks failed
Lean Action CI / build (push) Has been cancelled
Initial checkout
2025-09-15 14:41:27 +02:00

40 lines
986 B
Lean4
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Library Import: Basic facts about real numbers and the root function
import Mathlib.Data.Real.Sqrt
open Real
-- In the following, x and y are real numbers
variable {x : } {y : }
-- Definition: Function (f : ) is continuous at (x₀ : )
def continuous (f : ) (x₀ : ) :=
ε > 0, δ > 0, x, |x - x₀| < δ |f x - f x₀| < ε
-- Definition: The square function
def squareFct : := fun x x ^ 2
-- Reminder: Three facts from the library that we will use.
example : 0 < x 0 < x := sqrt_pos.2
example : x ^ 2 < y (-y < x) (x < y) := sq_lt
example : |x| < y -y < x x < y := abs_lt
-- Theorem: The square function is continuous at x₀ = 0
theorem ContinuousAt_sq :
continuous squareFct 0 := by
unfold continuous
intro ε
use ε
constructor
· apply sqrt_pos.2
exact
· intro x hx
simp_all [squareFct]
apply sq_lt.2
exact abs_lt.1 hx