Intervals with Real Endpoints #
This file defines IntervalReal, an interval type with real (ℝ) endpoints.
Unlike IntervalRat (which has rational endpoints and is suitable for computation),
IntervalReal allows us to represent intervals involving transcendental values
like [1, Real.exp 1] or [Real.log 2, π].
Main definitions #
IntervalReal- Intervals with real endpointsexpInterval- Interval bound for explogInterval- Interval bound for log (on positive intervals)
Main theorems #
mem_expInterval- FTIA for exp: if x ∈ I, then exp(x) ∈ expInterval(I)
Design notes #
This type complements IntervalRat for proving facts about transcendental functions.
While IntervalRat is used for numerical computation (since rationals are computable),
IntervalReal is used for correctness proofs involving exp, log, etc.
Typical workflow:
- Use
IntervalRatfor actual interval arithmetic computations - Convert to
IntervalRealwhen proving facts about transcendental functions - Use mathlib's analysis lemmas directly on real intervals
The set of reals contained in this interval
Instances For
Membership in an interval
Create an interval from a single real
Equations
- LeanCert.Core.IntervalReal.singleton r = { lo := r, hi := r, le := ⋯ }
Instances For
Convert from IntervalRat to IntervalReal
Instances For
Interval addition #
Add two intervals
Instances For
FTIA for addition
Interval negation #
Negate an interval
Instances For
FTIA for negation
Interval multiplication #
Multiply two intervals
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exponential interval #
Interval bound for exp. Since exp is strictly increasing, exp([a,b]) = [exp(a), exp(b)].
Instances For
FTIA for exp: if x ∈ [a,b], then exp(x) ∈ [exp(a), exp(b)]. This is FULLY PROVED - no sorry, no axioms.
Logarithm interval (for positive intervals) #
Interval bound for log on positive intervals. Since log is strictly increasing on (0, ∞), log([a,b]) = [log(a), log(b)] for a > 0.
Equations
Instances For
FTIA for log: if x ∈ [a,b] with a > 0, then log(x) ∈ [log(a), log(b)]. This is FULLY PROVED - no sorry, no axioms.
Trigonometric intervals (global bounds) #
Interval bound for sin. Since |sin x| ≤ 1 for all x, we use [-1, 1].
Equations
- _I.sinInterval = { lo := -1, hi := 1, le := LeanCert.Core.IntervalReal.sinInterval._proof_1 }
Instances For
FTIA for sin
Interval bound for cos. Since |cos x| ≤ 1 for all x, we use [-1, 1].
Equations
- _I.cosInterval = { lo := -1, hi := 1, le := LeanCert.Core.IntervalReal.sinInterval._proof_1 }
Instances For
FTIA for cos
Interval bound for atan. Since arctan x ∈ (-π/2, π/2) ⊂ [-2, 2] for all x.
Equations
- _I.atanInterval = { lo := -2, hi := 2, le := LeanCert.Core.IntervalReal.atanInterval._proof_2 }
Instances For
FTIA for atan
|arsinh x| ≤ |x| for all x. This follows from MVT and |arsinh'| ≤ 1.
FTIA for arsinh
Hyperbolic function intervals #
Interval bound for sinh. Since sinh is strictly monotonic increasing, sinh([a,b]) = [sinh(a), sinh(b)].
Instances For
FTIA for sinh: if x ∈ [a,b], then sinh(x) ∈ [sinh(a), sinh(b)]. This is FULLY PROVED - no sorry, no axioms.
Interval bound for cosh. cosh is convex with minimum at 0:
- If interval is all non-negative: cosh is increasing
- If interval is all non-positive: cosh is decreasing
- If interval contains 0: minimum is cosh(0) = 1, max is at endpoints
Equations
- One or more equations did not get rendered due to their size.
Instances For
FTIA for cosh: if x ∈ [a,b], then cosh(x) ∈ coshInterval([a,b]). This is FULLY PROVED - no sorry, no axioms.
Square root interval #
Interval bound for sqrt. For any interval I, sqrt(x) ∈ [0, max(hi, 1)] for x ∈ I. This is always sound because:
- sqrt(x) ≥ 0 for all x (Mathlib convention: sqrt(negative) = 0)
- sqrt(x) ≤ max(x, 1) for x ≥ 0, so sqrt(x) ≤ max(hi, 1)
Instances For
FTIA for sqrt: if x ∈ I, then sqrt(x) ∈ sqrtInterval(I). Works for all x including negative (where sqrt returns 0 by Mathlib convention).