Rational Endpoint Intervals - Core Definitions #
This file defines IntervalRat, a concrete interval type with rational endpoints
suitable for computation. We prove the Fundamental Theorem of Interval Arithmetic
(FTIA) for each operation.
Main definitions #
LeanCert.Core.IntervalRat- Intervals with rational endpointsLeanCert.Core.IntervalRat.toSet- Semantic interpretation as a subset of ℝ- Operations:
add,neg,sub,mul,inv,div
Main theorems #
mem_add- FTIA for additionmem_neg- FTIA for negationmem_sub- FTIA for subtractionmem_mul- FTIA for multiplication
Design notes #
All operations maintain the invariant lo ≤ hi. Domain restrictions for partial
operations (like inv) are encoded via separate types or explicit hypotheses.
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Default interval [0, 0] for unsupported expression branches
Equations
- LeanCert.Core.instInhabitedIntervalRat = { default := { lo := 0, hi := 0, le := LeanCert.Core.instInhabitedIntervalRat._proof_1 } }
The set of reals contained in this interval
Instances For
Membership in an interval
Membership in IntervalRat is the same as membership in Set.Icc
Universal quantifier over IntervalRat equals universal over Set.Icc
Existence in IntervalRat equals existence in Set.Icc
Create an interval from a single rational
Equations
- LeanCert.Core.IntervalRat.singleton q = { lo := q, hi := q, le := ⋯ }
Instances For
The width of an interval
Instances For
Midpoint of an interval
Instances For
The midpoint of an interval is contained in the interval
Interval addition #
Add two intervals
Instances For
FTIA for addition
Interval negation #
Negate an interval
Instances For
FTIA for negation
Interval subtraction #
Subtract two intervals
Instances For
FTIA for subtraction
Interval multiplication #
Multiply two intervals
Equations
- One or more equations did not get rendered due to their size.
Instances For
FTIA for multiplication
Interval containing zero check #
Check if an interval contains zero
Instances For
Decidable containsZero
Equations
- I.instDecidableContainsZero = inferInstanceAs (Decidable (I.lo ≤ 0 ∧ 0 ≤ I.hi))
Interval inversion (for nonzero intervals) #
Invert an interval that doesn't contain zero
Equations
Instances For
FTIA for inversion #
Scalar operations #
Scale an interval by a rational
Equations
Instances For
FTIA for scaling
Interval splitting #
Split an interval at its midpoint
Equations
Instances For
Midpoint is at least lo
Midpoint is at most hi
Midpoint is at least lo (real version)
Midpoint is at most hi (real version)
Left bisection is a subset of the original interval
Right bisection is a subset of the original interval
Any point in an interval is in one of its bisected halves
Interval intersection #
If intersection succeeds, the result contains any point in both intervals