Rational Endpoint Intervals - Transcendental Functions #
This file provides noncomputable interval bounds for transcendental functions using floor/ceiling to obtain rational endpoints.
Main definitions #
ofRealEndpoints- Create rational interval from real bounds using floor/ceilexpInterval- Interval bound for exponentiallogInterval- Interval bound for logarithm (positive intervals)atanhIntervalComputed- Interval bound for atanh (intervals in (-1, 1))sqrtInterval- Interval bound for square root
Main theorems #
mem_expInterval- FTIA for expmem_logInterval- FTIA for logmem_atanhIntervalComputed- FTIA for atanhmem_sqrtInterval- FTIA for sqrt
Design notes #
All definitions in this file are noncomputable as they use Real.exp, Real.log,
etc. For computable versions, see IntervalRat.Taylor.
Rational enclosure of real intervals #
Coarse rational enclosure of a real interval using floor/ceil. Given a real interval [lo, hi], returns a rational interval [⌊lo⌋, ⌈hi⌉] that is guaranteed to contain all points in the original interval.
Equations
Instances For
Exponential interval #
Interval bound for exp on rational intervals. Since exp is strictly increasing, exp([a,b]) ⊆ [⌊exp(a)⌋, ⌈exp(b)⌉]. This uses Real.exp and floor/ceil to get rational bounds.
Equations
- I.expInterval = LeanCert.Core.IntervalRat.ofRealEndpoints (Real.exp ↑I.lo) (Real.exp ↑I.hi) ⋯
Instances For
FTIA for exp: if x ∈ I, then exp(x) ∈ expInterval(I)
Positive interval check #
Decidable isPositive
Equations
- I.instDecidableIsPositive = inferInstanceAs (Decidable (0 < I.lo))
Logarithm interval (for positive intervals) #
Interval bound for log on positive rational intervals. Since log is strictly increasing on (0, ∞), log([a,b]) ⊆ [⌊log(a)⌋, ⌈log(b)⌉] for a > 0. This uses Real.log and floor/ceil to get rational bounds.
Equations
Instances For
FTIA for log: if x ∈ I with lo > 0, then log(x) ∈ logInterval(I)
Atanh interval (for intervals in (-1, 1)) #
Convert to standard interval
Instances For
Membership in the underlying interval
Interval bound for atanh on intervals strictly inside (-1, 1). Since atanh is strictly increasing on (-1, 1), atanh([a,b]) ⊆ [⌊atanh(a)⌋, ⌈atanh(b)⌉].
Equations
Instances For
FTIA for atanh: if x ∈ I and I ⊂ (-1, 1), then atanh(x) ∈ atanhIntervalComputed(I)
Square Root Interval #
Integer square root (floor of sqrt).
Satisfies: (intSqrtNat n)^2 ≤ n < (intSqrtNat n + 1)^2
Equations
Instances For
Rational lower bound for sqrt. For q ≥ 0 with q = num/den, we compute floor(sqrt(num * den)) / den. This gives: sqrtRatLower q ≤ sqrt(q).
The idea: sqrt(num/den) = sqrt(num*den)/den when properly scaled.
Equations
Instances For
Rational upper bound for sqrt. For q ≥ 0, we compute ceil(sqrt(num * den)) / den. This gives: sqrt(q) ≤ sqrtRatUpper q.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rational lower bound for sqrt with high precision. For q ≥ 0, we scale by 4^k, compute integer sqrt, and scale back by 2^k. This gives: sqrtRatLowerPrec q ≤ sqrt(q) with precision ~2^(-k).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rational upper bound for sqrt with high precision. For q ≥ 0, we scale by 4^k, compute ceil of integer sqrt, and scale back by 2^k. This gives: sqrt(q) ≤ sqrtRatUpperPrec q with precision ~2^(-k).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Soundness of sqrtRatLower: sqrtRatLower q ≤ Real.sqrt q for q ≥ 0
Soundness of sqrtRatUpper: Real.sqrt q ≤ sqrtRatUpper q for q ≥ 0
Square root interval with conservative bounds. For a non-negative interval [lo, hi], sqrt is monotone so: sqrt([lo, hi]) ⊆ [0, max(hi, 1)]
The lower bound is 0 (always sound for sqrt). The upper bound uses max(hi, 1) which satisfies sqrt(x) ≤ max(x, 1) for x ≥ 0.
Instances For
Improved square root interval with tight lower bounds. For a non-negative interval [lo, hi] with lo ≥ 0:
- Lower bound: sqrtRatLower(lo)
- Upper bound: sqrtRatUpper(hi)
For intervals crossing zero, we use 0 as lower bound.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Soundness of sqrtRatLowerPrec: sqrtRatLowerPrec q k ≤ Real.sqrt q for q ≥ 0
Soundness of sqrtRatUpperPrec: Real.sqrt q ≤ sqrtRatUpperPrec q k for q ≥ 0
High-precision square root interval. For a non-negative interval [lo, hi] with lo ≥ 0:
- Lower bound: sqrtRatLowerPrec(lo)
- Upper bound: sqrtRatUpperPrec(hi)
Uses scaling to achieve ~6 decimal digits of precision.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Membership theorem for sqrtIntervalTightPrec
Soundness of sqrt interval: if x ∈ I and x ≥ 0, then sqrt(x) ∈ sqrtInterval I
General soundness of sqrt interval: works for any x ∈ I (including negative). When x < 0, Real.sqrt x = 0, which is always in [0, max(hi, 1)].
Soundness of tight sqrt interval: if x ∈ I and x ≥ 0, then sqrt(x) ∈ sqrtIntervalTight I
General soundness of tight sqrt interval: works for any x ∈ I (including negative). When x < 0, Real.sqrt x = 0, which is always in the result interval.