Interval arithmetic #
Interval arithmetic computes with closed intervals [a, b] instead of real numbers. Every
operation returns an interval that contains the results of the operation on all points of its
arguments, so evaluating an expression in interval arithmetic on a box gives guaranteed bounds
for its range over the box (the fundamental theorem of interval arithmetic). This file develops
the theory of Moore and Neumaier, Chapters 1–2 for real intervals:
the interval operations, the natural interval extension of arithmetic expressions, its inclusion
isotonicity and linear convergence, the mean value form with its quadratic convergence, outward
rounding, and interval branch and bound (the Moore–Skelboe algorithm) as a corollary of
ConvexAnalysis.BranchAndBound.
Intervals are Mathlib's NonemptyInterval ℝ (X.fst ≤ X.snd, denoting Icc X.fst X.snd, ordered
by inclusion), whose +, - (negation and subtraction), pure and length are used as they are.
Main definitions #
ConvexAnalysis.IntervalArith.mul,ConvexAnalysis.IntervalArith.inv,ConvexAnalysis.IntervalArith.exp,ConvexAnalysis.IntervalArith.log,ConvexAnalysis.IntervalArith.sqrt,ConvexAnalysis.IntervalArith.pow: the product, the inverse of an interval not containing0, the exponential, the logarithm of a positive interval, the square root and natural powers of intervals.ConvexAnalysis.IntervalArith.magandConvexAnalysis.IntervalArith.migare the largest and the least absolute value of a point of an interval.ConvexAnalysis.IntervalArith.box X,ConvexAnalysis.IntervalArith.width X,ConvexAnalysis.IntervalArith.ofCorners a b: the box of an interval vectorX : ι → NonemptyInterval ℝ, its width (the largest length of a side), and the interval vector ofIcc a b.ConvexAnalysis.ArithExpr ι: arithmetic expressions in the variablesιwith constants,+,-,*,⁻¹,exp,log,√and natural powers;ConvexAnalysis.ArithExpr.evalis the real value,ConvexAnalysis.ArithExpr.IsDefinedAtthe domain condition, andConvexAnalysis.ArithExpr.intervalEvalthe natural interval extension, which is undefined (none) where a domain condition may fail.ConvexAnalysis.ArithExpr.IsRoundedEval X e G:Gis a result of evaluatingeonXin interval arithmetic with outward rounding.ConvexAnalysis.ArithExpr.IsSingleUse: every variable occurs at most once.ConvexAnalysis.ArithExpr.SqrtArgPos: every square root has an argument bounded away from0.ConvexAnalysis.IntervalArith.meanValueForm: the mean value formf(c) + ∑ i, G i · (X i - c i).ConvexAnalysis.BranchAndBound.intervalBound,ConvexAnalysis.BranchAndBound.intervalNode,ConvexAnalysis.BranchAndBound.intervalPoint: interval branch and bound on the bisection tree of a box, with the lower endpoints of the natural interval extension as bounds;ConvexAnalysis.BranchAndBound.meanValueBound,ConvexAnalysis.BranchAndBound.meanValueNode: the same with the mean value form.ConvexAnalysis.IntervalArith.ofInclusion f I: the real interval that an intervalIof Mathlib'sinclusiontactic with finite endpoints denotes underf(for the tactic,Dyadic.toReal).
Main statements #
ConvexAnalysis.IntervalArith.mul_mem_mul,ConvexAnalysis.IntervalArith.inv_mem_inv, …: the inclusion property of the operations;ConvexAnalysis.IntervalArith.coe_add,ConvexAnalysis.IntervalArith.coe_mul,ConvexAnalysis.IntervalArith.coe_inv,ConvexAnalysis.IntervalArith.coe_pow, …: they are exact, the interval result is the set of all results;ConvexAnalysis.IntervalArith.add_mono,ConvexAnalysis.IntervalArith.mul_mono, …: inclusion isotonicity;ConvexAnalysis.IntervalArith.mul_le_iff, …: the exact result is the least interval with the inclusion property.ConvexAnalysis.IntervalArith.length_mul_le,ConvexAnalysis.IntervalArith.length_inv_le, … bound the lengths.ConvexAnalysis.ArithExpr.eval_mem_of_intervalEval_eq_some,ConvexAnalysis.ArithExpr.image_eval_subset: the fundamental theorem of interval arithmetic (Neumaier, Theorem 1.4.1): the range ofeover the boxXlies in the natural interval extension, whenever it is defined; theneis defined on the box (ConvexAnalysis.ArithExpr.isDefinedAt_of_intervalEval_eq_some).ConvexAnalysis.ArithExpr.intervalEval_mono: inclusion isotonicity of the natural interval extension.ConvexAnalysis.ArithExpr.IsRoundedEval.eval_mem,ConvexAnalysis.ArithExpr.isRoundedEval_iff: the fundamental theorem holds with outward rounding: the rounded results are exactly the intervals that contain the natural interval extension.ConvexAnalysis.ArithExpr.intervalEval_sub_var_self: the dependency problem:x - xon[0, 1]gives[-1, 1].ConvexAnalysis.ArithExpr.coe_intervalEval_of_isSingleUse: Moore's single-use theorem: if every variable occurs at most once, the natural interval extension is the exact range.ConvexAnalysis.ArithExpr.exists_length_intervalEval_le_modulus: convergence of the natural interval extension: on the subboxesXof a boxX₀on which it is defined, its length is at mostω (width X)withω t → 0; henceeis uniformly continuous onX₀(ConvexAnalysis.ArithExpr.exists_abs_eval_sub_le,ConvexAnalysis.ArithExpr.continuousOn_eval).ConvexAnalysis.ArithExpr.exists_length_intervalEval_le: linear convergence: if every square root has an argument away from0, the length is at mostC · width X, andeis Lipschitz onX₀(ConvexAnalysis.ArithExpr.exists_lipschitzOnWith_eval). The condition cannot be dropped (ConvexAnalysis.ArithExpr.not_exists_length_intervalEval_sqrt_var_le:√xon[0, 1]).ConvexAnalysis.IntervalArith.mem_meanValueForm: the mean value form encloses the range;ConvexAnalysis.IntervalArith.exists_le_fst_meanValueForm_add_sum: its a posteriori overestimation bound∑ i, length (G i) · |X i - c i|;ConvexAnalysis.IntervalArith.exists_le_fst_meanValueForm,ConvexAnalysis.IntervalArith.exists_snd_meanValueForm_le: quadratic convergence of the mean value form: if the derivative enclosures have lengthO(width X), both endpoints are withinn L (width X)²of values offonX.ConvexAnalysis.BranchAndBound.isLowerBound_intervalBound,ConvexAnalysis.BranchAndBound.isConsistent_intervalBound,ConvexAnalysis.BranchAndBound.exists_isMinOn_and_tendsto_interval,ConvexAnalysis.BranchAndBound.exists_incumbent_sub_intervalBound_le: convergence of interval branch and bound for every expression whose natural interval extension is defined on the box: the bounds are consistent, and the bounds and the incumbent values converge to the minimum;ConvexAnalysis.BranchAndBound.isConsistent_meanValueBound,ConvexAnalysis.BranchAndBound.exists_isMinOn_and_tendsto_meanValueand their_of_length_leversions for bounded derivative enclosures: the same with the mean value form.ConvexAnalysis.IntervalArith.ofInclusion_add,ConvexAnalysis.IntervalArith.ofInclusion_neg,ConvexAnalysis.IntervalArith.ofInclusion_sub,ConvexAnalysis.IntervalArith.mul_le_of_ofInclusion: on finite intervals,+,-of Mathlib'sinclusiontactic are exact and its*contains the exact product, so its results are outward roundings in the sense ofConvexAnalysis.ArithExpr.IsRoundedEval.
Implementation notes #
- Intervals. Mathlib's
NonemptyInterval αhas the exact sum, negative and difference for ordered additive groups, theSetLikecoercion toIcc, and the inclusion order. Its*,⁻¹,/and^multiply endpoints and need monotone multiplication (MulLeftMono, ordered groups), so they do not apply toℝ: the product of intervals with signed endpoints needs the least and the largest of the four endpoint products. Mathlib PR #20636 (multiplication of intervals in rings) was closed unmerged. The real operations are therefore functions in the namespaceIntervalArith, not instances, so that a later Mathlib instance cannot clash. - Partial operations.
ConvexAnalysis.IntervalArith.invandConvexAnalysis.IntervalArith.logtake the domain condition (0 ∉ X,0 < X.fst) as an argument, andConvexAnalysis.ArithExpr.intervalEvalreturns anOption. The real valueConvexAnalysis.ArithExpr.evaluses Mathlib's total functions (0⁻¹ = 0); the fundamental theorem needs no domain hypothesis, since a defined natural interval extension excludes the junk values. The square root is defined in the natural interval extension for arguments with0 ≤ X.fst; it is not Lipschitz at0(the length ofConvexAnalysis.IntervalArith.sqrt [0, h]is√h), so linear convergence assumesConvexAnalysis.ArithExpr.SqrtArgPos, the analogue of Neumaier's condition thatfis Lipschitz atX₀. Convergence without a rate, and with it interval branch and bound, needs no such condition, since√b - √a ≤ √(b - a). - Exactness. Every operation is exact (the image of the box under the operation), by the
intermediate value theorem and connectedness. Inclusion isotonicity, the characterizations
ConvexAnalysis.IntervalArith.mul_le_iffand Moore's single-use theorem follow from exactness. - Outward rounding. An implementation with floating-point or dyadic endpoints returns, for each
operation, an interval that contains the exact interval result on its (rounded) arguments; by
ConvexAnalysis.IntervalArith.mul_le_iffand its analogues, this is the same as the inclusion property of the implemented operation.ConvexAnalysis.ArithExpr.IsRoundedEvaldescribes such evaluations inductively. - The
inclusiontactic of Mathlib (Mathlib/Tactic/Inclusion; PRs #42850, #45638 and #46487 merged, #45720 and #46628 open) is an engine that proves numerical bounds on closed real terms. Its classInclusion.ToSet Iα α(toSet : Iα → Set α) is how a computational interval type denotes sets; itsInclusion.Interval αhas endpoints inWithBot αandWithTop α, computes withα = Dyadicforℝ, and its correctness lemmas (Inclusion.Interval.mul_mem, …) are inclusion properties stated for any mapf : α → ℝof the endpoints.ConvexAnalysis.IntervalArith.ofInclusion fconverts its finite intervals toNonemptyInterval ℝ; the conversion of the tactic's sum, negative and difference is the exact interval result, and the conversion of its product containsConvexAnalysis.IntervalArith.mul. The other operations of the tactic (exp,log,√, powers) are bridged inConvexAnalysis.IntervalDyadic, which also builds a computable evaluator from them. NoInclusion.ToSetinstance is declared forNonemptyInterval ℝ: the tactic's genericMembershipinstance forToSettypes would duplicate theSetLikemembership. The tactic has no inclusion isotonicity, single-use theorem or convergence theory, which this file supplies for the exact operations. - Boxes are interval vectors
X : ι → NonemptyInterval ℝ, ordered coordinatewise by inclusion;ConvexAnalysis.IntervalArith.box Xis anIccinι → ℝ, and its width is its diameter in the sup norm (ConvexAnalysis.IntervalArith.diam_box), the convention ofConvexAnalysis.Box. - Mean value form. It is stated for any function
Gof boxes that encloses the partial derivativesf' x (Pi.single i 1);ConvexAnalysis.IntervalDerivativecomputes such aGfrom an expression by interval differentiation. A rounded value off cmay be used (ConvexAnalysis.IntervalArith.mem_add_sum_of_mem). - Branch and bound. The boxes are those of longest-edge bisection
(
ConvexAnalysis.Box.bisectionSet), and the points evaluated are their centers (ConvexAnalysis.BranchAndBound.bisectionCenter). The bounds of the natural interval extension do not decrease from a box to its halves, by inclusion isotonicity, so the lower bounds increase along the run; the mean value bounds need not. - Searches on 2026-11-30 (Mathlib
d747d52): Mathlib has no multiplication or inverse of real intervals, no natural interval extension, centered or mean value form, and no interval branch and bound; no pull request (any state) matches "interval extension", "centered form", "Moore interval" or "mean value form interval"; "interval arithmetic" finds theinclusiontactic PRs and #20636.
References #
- R. E. Moore, Interval Analysis, Prentice-Hall, 1966.
- R. E. Moore, R. B. Kearfott, M. J. Cloud, Introduction to Interval Analysis, SIAM, 2009.
- A. Neumaier, Interval Methods for Systems of Equations, Cambridge University Press, 1990, Sections 1.4, 2.1 and 2.3.
- R. Krawczyk, K. Nickel, Die zentrische Form in der Intervallarithmetik, ihre quadratische Konvergenz und ihre Inklusionsisotonie, Computing 28 (1982), 117–137.
- H. Ratschek, J. Rokne, Computer Methods for the Range of Functions, Ellis Horwood, 1984.
- H. Ratschek, J. Rokne, New Computer Methods for Global Optimization, Ellis Horwood, 1988.
- S. Skelboe, Computation of rational interval functions, BIT 14 (1974), 87–95.
Tags #
interval arithmetic, interval analysis, natural interval extension, inclusion function, inclusion isotonicity, dependency problem, single-use expression, mean value form, centered form, outward rounding, interval branch and bound, Moore–Skelboe algorithm
Operations on intervals #
The lower endpoint is a point of the interval.
The upper endpoint is a point of the interval.
A point of X is a point of every interval containing X.
X ≤ Y if every point of X is a point of Y.
A subinterval is not longer than the interval.
Addition is exact: the interval sum is the set of all sums.
The inclusion property of interval addition.
Inclusion isotonicity of interval addition.
The interval sum is the least interval with the inclusion property: an interval contains it
iff it contains all sums. Any interval operation with the inclusion property therefore returns an
outward rounding of the exact one (ArithExpr.IsRoundedEval).
Negation is exact.
Inclusion isotonicity of interval negation.
The interval negative is the least interval containing all negatives.
The product of two intervals: the least and the largest of the four products of the endpoints.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The inclusion property of interval multiplication.
Multiplication is exact: the interval product is the set of all products.
Inclusion isotonicity of interval multiplication.
The interval product is the least interval with the inclusion property.
The magnitude |X| = max |a| |b| of X = [a, b], the largest absolute value of a point
of X.
Instances For
The mignitude ⟨X⟩ of X = [a, b], the least absolute value of a point of X: a if
0 ≤ a, -b if b ≤ 0, and 0 if 0 ∈ X.
Instances For
The magnitude is nonnegative.
Every point of X has absolute value at most |X|.
The magnitude is monotone in the interval.
The mignitude is nonnegative.
Every point of X has absolute value at least ⟨X⟩.
The mignitude is antitone in the interval.
The mignitude is at most the magnitude.
0 ∉ [a, b] iff 0 < a or b < 0.
An interval not containing 0 has positive mignitude.
The absolute values of the points of X fill the interval [⟨X⟩, |X|].
The lower endpoint of a product is a product of points of the factors.
The upper endpoint of a product is a product of points of the factors.
The points of X - c are the numbers x - c with x ∈ X.
If 0 ∉ [a, b], then 1 / b ≤ 1 / a.
The inverse [1 / b, 1 / a] of an interval X = [a, b] with 0 ∉ X.
Equations
Instances For
The inverse is exact: for 0 ∉ X, X⁻¹ is the set of inverses of the points of X.
The inclusion property of the interval inverse.
Inclusion isotonicity of the interval inverse.
The interval inverse is the least interval containing all inverses.
The interval exponential is exact.
The inclusion property of the interval exponential.
Inclusion isotonicity of the interval exponential.
The interval exponential is the least interval containing all exponentials.
The logarithm [log a, log b] of X = [a, b] with 0 < a.
Equations
Instances For
The interval logarithm is exact.
The square root [√a, √b] of X = [a, b]. Mathlib's Real.sqrt is 0 on negative
numbers; the interval extension of expressions (ConvexAnalysis.ArithExpr.intervalEval) uses it
only for 0 ≤ a.
Equations
Instances For
The interval square root is exact.
The inclusion property of the interval square root.
Inclusion isotonicity of the interval square root.
The interval square root is the least interval containing all square roots.
√ is uniformly continuous with modulus √: the length of sqrt X is at most √(length X),
since √b - √a ≤ √(b - a). This holds for every interval, also for X = [0, h], where √ is not
Lipschitz.
The power X ^ k of an interval: [a ^ k, b ^ k] for odd k, and [⟨X⟩ ^ k, |X| ^ k]
for even k.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The interval power is exact.
The inclusion property of the interval power.
Inclusion isotonicity of the interval power.
The interval power is the least interval containing all powers.
Boxes #
The box of an interval vector X: the points x with x i ∈ X i for all i.
Equations
- ConvexAnalysis.IntervalArith.box X = Set.Icc (fun (i : ι) => (X i).toProd.1) fun (i : ι) => (X i).toProd.2
Instances For
Membership in a box is membership of every coordinate in its side.
The box is monotone in the interval vector.
Boxes are nonempty.
The interval vector of the box with corners a and b: its sides are the intervals
[min (a i) (b i), max (a i) (b i)].
Equations
Instances For
The width of an interval vector: the largest length of its sides, the sup norm of the vector of lengths.
Equations
- ConvexAnalysis.IntervalArith.width X = ‖fun (i : ι) => (X i).length‖
Instances For
The width is nonnegative.
Every side of a box is at most as long as its width.
The width is monotone.
The width of a box is its diameter in the sup norm of ι → ℝ.
Arithmetic expressions and their natural interval extension #
Arithmetic expressions in the variables ι: constants, variables, sums, negatives,
products, inverses, and the elementary functions exp, log, √ and natural powers.
- const {ι : Type u_1} (c : ℝ) : ArithExpr ι
A real constant.
- var {ι : Type u_1} (i : ι) : ArithExpr ι
The variable
x i. - add {ι : Type u_1} (e₁ e₂ : ArithExpr ι) : ArithExpr ι
The sum
e₁ + e₂. - neg {ι : Type u_1} (e : ArithExpr ι) : ArithExpr ι
The negative
-e. - mul {ι : Type u_1} (e₁ e₂ : ArithExpr ι) : ArithExpr ι
The product
e₁ * e₂. - inv {ι : Type u_1} (e : ArithExpr ι) : ArithExpr ι
The inverse
e⁻¹. - exp {ι : Type u_1} (e : ArithExpr ι) : ArithExpr ι
The exponential
exp e. - log {ι : Type u_1} (e : ArithExpr ι) : ArithExpr ι
The logarithm
log e. - sqrt {ι : Type u_1} (e : ArithExpr ι) : ArithExpr ι
The square root
√e. - pow {ι : Type u_1} (e : ArithExpr ι) (k : ℕ) : ArithExpr ι
The power
e ^ k.
Instances For
e₁ + e₂ is ArithExpr.add e₁ e₂.
-e is ArithExpr.neg e.
e₁ - e₂ is ArithExpr.sub e₁ e₂.
e₁ * e₂ is ArithExpr.mul e₁ e₂.
e⁻¹ is ArithExpr.inv e.
e₁ / e₂ is ArithExpr.div e₁ e₂.
e ^ k is ArithExpr.pow e k.
A numeral is a constant.
The real value of an expression at x : ι → ℝ. The operations are Mathlib's total
functions (0⁻¹ = 0, Real.log and Real.sqrt on all of ℝ); ArithExpr.IsDefinedAt is the
domain condition.
Equations
- ConvexAnalysis.ArithExpr.eval x (ConvexAnalysis.ArithExpr.const c) = c
- ConvexAnalysis.ArithExpr.eval x (ConvexAnalysis.ArithExpr.var i) = x i
- ConvexAnalysis.ArithExpr.eval x (e₁.add e₂) = ConvexAnalysis.ArithExpr.eval x e₁ + ConvexAnalysis.ArithExpr.eval x e₂
- ConvexAnalysis.ArithExpr.eval x e.neg = -ConvexAnalysis.ArithExpr.eval x e
- ConvexAnalysis.ArithExpr.eval x (e₁.mul e₂) = ConvexAnalysis.ArithExpr.eval x e₁ * ConvexAnalysis.ArithExpr.eval x e₂
- ConvexAnalysis.ArithExpr.eval x e.inv = (ConvexAnalysis.ArithExpr.eval x e)⁻¹
- ConvexAnalysis.ArithExpr.eval x e.exp = Real.exp (ConvexAnalysis.ArithExpr.eval x e)
- ConvexAnalysis.ArithExpr.eval x e.log = Real.log (ConvexAnalysis.ArithExpr.eval x e)
- ConvexAnalysis.ArithExpr.eval x e.sqrt = √(ConvexAnalysis.ArithExpr.eval x e)
- ConvexAnalysis.ArithExpr.eval x (e.pow k) = ConvexAnalysis.ArithExpr.eval x e ^ k
Instances For
The domain condition: every inverse is applied to a nonzero number, every logarithm to a positive one, and every square root to a nonnegative one.
Equations
- ConvexAnalysis.ArithExpr.IsDefinedAt x (ConvexAnalysis.ArithExpr.const c) = True
- ConvexAnalysis.ArithExpr.IsDefinedAt x (ConvexAnalysis.ArithExpr.var i) = True
- ConvexAnalysis.ArithExpr.IsDefinedAt x (e₁.add e₂) = (ConvexAnalysis.ArithExpr.IsDefinedAt x e₁ ∧ ConvexAnalysis.ArithExpr.IsDefinedAt x e₂)
- ConvexAnalysis.ArithExpr.IsDefinedAt x e.neg = ConvexAnalysis.ArithExpr.IsDefinedAt x e
- ConvexAnalysis.ArithExpr.IsDefinedAt x (e₁.mul e₂) = (ConvexAnalysis.ArithExpr.IsDefinedAt x e₁ ∧ ConvexAnalysis.ArithExpr.IsDefinedAt x e₂)
- ConvexAnalysis.ArithExpr.IsDefinedAt x e.inv = (ConvexAnalysis.ArithExpr.IsDefinedAt x e ∧ ConvexAnalysis.ArithExpr.eval x e ≠ 0)
- ConvexAnalysis.ArithExpr.IsDefinedAt x e.exp = ConvexAnalysis.ArithExpr.IsDefinedAt x e
- ConvexAnalysis.ArithExpr.IsDefinedAt x e.log = (ConvexAnalysis.ArithExpr.IsDefinedAt x e ∧ 0 < ConvexAnalysis.ArithExpr.eval x e)
- ConvexAnalysis.ArithExpr.IsDefinedAt x e.sqrt = (ConvexAnalysis.ArithExpr.IsDefinedAt x e ∧ 0 ≤ ConvexAnalysis.ArithExpr.eval x e)
- ConvexAnalysis.ArithExpr.IsDefinedAt x (e.pow k) = ConvexAnalysis.ArithExpr.IsDefinedAt x e
Instances For
The natural interval extension of an expression, evaluated on the interval vector X:
every operation is replaced by its interval version. It is undefined (none) if an inverse is
applied to an interval containing 0, a logarithm to an interval with a nonpositive point, or
a square root to an interval with a negative point.
Equations
- One or more equations did not get rendered due to their size.
- ConvexAnalysis.ArithExpr.intervalEval X (ConvexAnalysis.ArithExpr.const c) = some (NonemptyInterval.pure c)
- ConvexAnalysis.ArithExpr.intervalEval X (ConvexAnalysis.ArithExpr.var i) = some (X i)
- ConvexAnalysis.ArithExpr.intervalEval X e.neg = Option.map (fun (x : NonemptyInterval ℝ) => -x) (ConvexAnalysis.ArithExpr.intervalEval X e)
- ConvexAnalysis.ArithExpr.intervalEval X e.exp = Option.map ConvexAnalysis.IntervalArith.exp (ConvexAnalysis.ArithExpr.intervalEval X e)
- ConvexAnalysis.ArithExpr.intervalEval X (e.pow k) = Option.map (fun (x : NonemptyInterval ℝ) => ConvexAnalysis.IntervalArith.pow x k) (ConvexAnalysis.ArithExpr.intervalEval X e)
Instances For
The natural interval extension of a constant c is [c, c].
The natural interval extension of the variable x i is X i.
The natural interval extension of a sum is the sum of the extensions.
The natural interval extension of a negative is the negative of the extension.
The natural interval extension of a product is the product of the extensions.
The natural interval extension of an inverse is defined iff the extension of the argument is
defined and does not contain 0.
The natural interval extension of exp e.
The natural interval extension of a logarithm is defined iff the extension of the argument is defined and positive.
The natural interval extension of a square root is defined iff the extension of the argument is defined and nonnegative.
The natural interval extension of e ^ k.
The fundamental theorem of interval arithmetic (Neumaier, Theorem 1.4.1,
due to Moore; Moore–Kearfott–Cloud, Theorem 5.1): if the natural
interval extension of e is defined on X, then it contains the value of e at every point of
the box X.
The fundamental theorem of interval arithmetic, range form: the range of e over the
box X lies in the natural interval extension, whenever the latter is defined.
If the natural interval extension is defined on X, then e is defined at every point of
X: no inverse of 0, no logarithm of a nonpositive number and no square root of a negative
number occurs.
The dependency problem: the natural interval extension of x i - x i on X is
X i - X i, of twice the length of X i, although the expression is 0 everywhere. For
X i = [0, 1] it is [-1, 1]. Each occurrence of a variable is treated as an independent
variable.
Outward rounding #
IsRoundedEval X e G: G is a result of evaluating e on X in interval arithmetic with
outward rounding. Every operation may return any interval that contains the exact interval
result of the operation on the computed arguments, and inputs and constants may be enclosed in
larger intervals. This models interval arithmetic with floating-point or dyadic endpoints and
directed rounding abstractly.
- const {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {c : ℝ} {G : NonemptyInterval ℝ} : c ∈ G → IsRoundedEval X (ArithExpr.const c) G
A constant is enclosed in any interval containing it.
- var {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {i : ι} {G : NonemptyInterval ℝ} : X i ≤ G → IsRoundedEval X (ArithExpr.var i) G
A variable is enclosed in any interval containing its input interval.
- add {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e₁ e₂ : ArithExpr ι} {F₁ F₂ G : NonemptyInterval ℝ} : IsRoundedEval X e₁ F₁ → IsRoundedEval X e₂ F₂ → F₁ + F₂ ≤ G → IsRoundedEval X (e₁.add e₂) G
Rounded addition.
- neg {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e : ArithExpr ι} {F G : NonemptyInterval ℝ} : IsRoundedEval X e F → -F ≤ G → IsRoundedEval X e.neg G
Rounded negation.
- mul {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e₁ e₂ : ArithExpr ι} {F₁ F₂ G : NonemptyInterval ℝ} : IsRoundedEval X e₁ F₁ → IsRoundedEval X e₂ F₂ → IntervalArith.mul F₁ F₂ ≤ G → IsRoundedEval X (e₁.mul e₂) G
Rounded multiplication.
- inv {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e : ArithExpr ι} {F G : NonemptyInterval ℝ} (h : 0 ∉ F) : IsRoundedEval X e F → IntervalArith.inv F h ≤ G → IsRoundedEval X e.inv G
Rounded inverse, of an interval not containing
0. - exp {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e : ArithExpr ι} {F G : NonemptyInterval ℝ} : IsRoundedEval X e F → IntervalArith.exp F ≤ G → IsRoundedEval X e.exp G
Rounded exponential.
- log {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e : ArithExpr ι} {F G : NonemptyInterval ℝ} (h : 0 < F.toProd.1) : IsRoundedEval X e F → IntervalArith.log F h ≤ G → IsRoundedEval X e.log G
Rounded logarithm, of an interval of positive numbers.
- sqrt {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e : ArithExpr ι} {F G : NonemptyInterval ℝ} : 0 ≤ F.toProd.1 → IsRoundedEval X e F → IntervalArith.sqrt F ≤ G → IsRoundedEval X e.sqrt G
Rounded square root, of an interval of nonnegative numbers.
- pow {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e : ArithExpr ι} {F G : NonemptyInterval ℝ} {k : ℕ} : IsRoundedEval X e F → IntervalArith.pow F k ≤ G → IsRoundedEval X (e.pow k) G
Rounded power.
Instances For
The exact natural interval extension is a rounded evaluation (with no rounding).
Outward rounding is safe: every interval containing a rounded result is a rounded result.
A rounded evaluation contains the exact natural interval extension, which is therefore defined: the domain conditions checked on the rounded arguments hold for the exact ones.
The fundamental theorem of interval arithmetic with outward rounding: a rounded
evaluation of e on X contains the value of e at every point of the box X.
The rounded results of e on X are exactly the intervals that contain the natural
interval extension: G is a rounded result iff the natural extension is defined and ≤ G.
A rounded evaluation on a box X' is a rounded evaluation on every smaller box X ≤ X'.
Inclusion isotonicity of the natural interval extension
(Neumaier, Theorem 1.4.1, due to Moore): if it is defined on X' and X ≤ X'
(that is, X i ⊆ X' i for all i), then it is defined on X, with a smaller value.
Moore's single-use theorem #
The set of variables that occur in e.
Equations
Instances For
e is single use: every variable occurs at most once in e.
Equations
- (ConvexAnalysis.ArithExpr.const c).IsSingleUse = True
- (ConvexAnalysis.ArithExpr.var i).IsSingleUse = True
- (e₁.add e₂).IsSingleUse = (e₁.IsSingleUse ∧ e₂.IsSingleUse ∧ Disjoint e₁.vars e₂.vars)
- e.neg.IsSingleUse = e.IsSingleUse
- (e₁.mul e₂).IsSingleUse = (e₁.IsSingleUse ∧ e₂.IsSingleUse ∧ Disjoint e₁.vars e₂.vars)
- e.inv.IsSingleUse = e.IsSingleUse
- e.exp.IsSingleUse = e.IsSingleUse
- e.log.IsSingleUse = e.IsSingleUse
- e.sqrt.IsSingleUse = e.IsSingleUse
- (e.pow k).IsSingleUse = e.IsSingleUse
Instances For
For expressions without common variables, the pairs of values on a box are all pairs of values: a binary operation of their ranges is the range of the operation.
Moore's single-use theorem (Neumaier, Theorem 1.4.3 and
Neumaier, Corollary 1.4.4): if every variable occurs at most once in e, then the
natural interval extension of e on X (if defined) is exactly the range of e on the box X;
there is no overestimation.
Linear convergence of the natural interval extension #
e.SqrtArgPos X₀: every square root in e is applied to a subexpression whose natural
interval extension on X₀ has a positive lower endpoint. The square root is Lipschitz away from
0 only, and the natural extension of √x on [0, h] has length √h, not O(h)
(ArithExpr.not_exists_length_intervalEval_sqrt_var_le). This is the analogue for √ of
Neumaier's condition "f is Lipschitz at x°" Neumaier, Section 2.1; only the
linear rate needs it, convergence of the natural extension holds without it
(ArithExpr.exists_length_intervalEval_le_modulus).
Equations
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ (ConvexAnalysis.ArithExpr.const c) = True
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ (ConvexAnalysis.ArithExpr.var i) = True
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ (e₁.add e₂) = (ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e₁ ∧ ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e₂)
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e.neg = ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ (e₁.mul e₂) = (ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e₁ ∧ ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e₂)
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e.inv = ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e.exp = ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e.log = ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e.sqrt = (ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e ∧ ∀ (F : NonemptyInterval ℝ), ConvexAnalysis.ArithExpr.intervalEval X₀ e = some F → 0 < F.toProd.1)
- ConvexAnalysis.ArithExpr.SqrtArgPos X₀ (e.pow k) = ConvexAnalysis.ArithExpr.SqrtArgPos X₀ e
Instances For
If the natural interval extension is defined on X₀ and X ≤ X₀, then its value on X
lies in its value on X₀.
Linear convergence of the natural interval extension
(Neumaier, Theorem 2.1.1 and Neumaier, Corollary 2.1.2;
Moore–Kearfott–Cloud, Lemma 6.1 for rational expressions): if the
natural interval extension of e is defined on X₀ and every square root in e has an
argument bounded away from 0 on X₀, then it is Lipschitz in the width on the subboxes of
X₀: length (e(X)) ≤ C · width X for all X ≤ X₀. The overestimation of the range is
therefore O(width X). Neumaier states this for expressions "Lipschitz at X₀", the same
condition for the elementary functions here; the hypothesis on square roots cannot be dropped
(ArithExpr.not_exists_length_intervalEval_sqrt_var_le), but convergence without a rate holds
without it (ArithExpr.exists_length_intervalEval_le_modulus).
An expression whose natural interval extension is Lipschitz in the width on the subboxes of
X₀ (ArithExpr.exists_length_intervalEval_le) is Lipschitz on the box X₀, in the sup norm.
For x, y ∈ X₀, both values lie in the natural extension on the smallest box containing x and
y, whose width is ‖x - y‖.
Convergence of the natural interval extension, without a rate and without
ArithExpr.SqrtArgPos: if the natural interval extension of e is defined on X₀, its length on
the subboxes X of X₀ is at most ω (width X) for a function ω with ω t → 0 as t → 0.
Square roots contribute √(ω t) (IntervalArith.length_sqrt_le_sqrt_length); the other
operations are Lipschitz on the bounded range, and the arguments of inverses and logarithms stay
away from 0 by inclusion isotonicity.
A modulus of continuity of e on the box X₀ from its natural interval extension: if the
latter is defined on X₀, then |e x - e y| ≤ ω ‖x - y‖ on X₀ (sup norm) for a function ω
with ω t → 0 as t → 0, so e is uniformly continuous on X₀.
An expression whose natural interval extension is defined on the box X₀ is continuous on
X₀ (ArithExpr.exists_abs_eval_sub_le).
ArithExpr.SqrtArgPos cannot be dropped from linear convergence: for √x on
X₀ = [0, 1] there is no C with length (e(X)) ≤ C · width X for all X ≤ X₀, since the
natural extension on [0, h] is [0, √h]. Convergence without a rate still holds
(ArithExpr.exists_length_intervalEval_le_modulus).
The mean value form #
The inclusion property of interval sums over a finite set.
The lower endpoint of a sum of intervals is the sum of the lower endpoints.
The upper endpoint of a sum of intervals is the sum of the upper endpoints.
A linear functional on ι → ℝ is the sum of the coordinates weighted by its values on the
standard basis (the partial derivatives, for a derivative).
The mean value form f(c) + ∑ i, G i · (X i - c i) on the interval vector X with
center c, for the value fc = f c and intervals G i that enclose the partial derivatives of
f on X.
Equations
- ConvexAnalysis.IntervalArith.meanValueForm fc G X c = NonemptyInterval.pure fc + ∑ i : ι, ConvexAnalysis.IntervalArith.mul (G i) (X i - NonemptyInterval.pure (c i))
Instances For
The mean value theorem in interval form: the difference of two values of f on a box is
the sum of the coordinate differences weighted by partial derivatives at a point of the box.
The mean value form encloses the range (Neumaier, Theorem 2.3.3, with
s = G and z = c): if f is differentiable on the box X, the intervals G i enclose the
partial derivatives of f on X, and the center c lies in X, then
f x ∈ f(c) + ∑ i, G i · (X i - c i) for all x ∈ X.
The mean value form with an enclosure Fc of f c instead of the exact value, as computed
in rounded arithmetic: f x ∈ Fc + ∑ i, G i · (X i - c i) for all x ∈ X.
The a posteriori bound of the mean value form, lower endpoint
(Neumaier, Theorem 2.3.3, (7)): under the hypotheses of
IntervalArith.mem_meanValueForm, some value of f on X lies within
∑ i, length (G i) · |X i - c i| of the lower endpoint. With c the midpoint, this is
Neumaier's bound 2 rad(G) rad(X) of Neumaier, Corollary 2.3.4(i).
The a posteriori bound of the mean value form, upper endpoint
(Neumaier, Theorem 2.3.3): some value of f on X lies within
∑ i, length (G i) · |X i - c i| of the upper endpoint.
Quadratic approximation by the mean value form (Krawczyk–Nickel,
Neumaier, Corollary 2.3.4): if the intervals G i enclose the partial derivatives
of f on X and have length at most L · width X, then the lower endpoint of the mean value form
is within n L (width X)² of a value of f on X (and below all of them, by
IntervalArith.mem_meanValueForm), n the dimension.
Quadratic approximation by the mean value form, upper endpoint: under the hypotheses of
IntervalArith.exists_le_fst_meanValueForm, the upper endpoint is within n L (width X)² of a
value of f on X.
Bounded variation from a derivative enclosure: if the intervals G i enclose the
partial derivatives of f on X, then |f y - f x| ≤ (∑ i, |G i|) · width X on X.
Interval branch and bound #
The interval vector of the box at the node p of the bisection tree of Icc a b.
Equations
Instances For
The center of the box at the node p of the bisection tree of Icc a b, the point at which
interval branch and bound evaluates the objective.
Equations
- ConvexAnalysis.BranchAndBound.bisectionCenter a b p = midpoint ℝ (ConvexAnalysis.Box.bisectionTree a b p).1 (ConvexAnalysis.Box.bisectionTree a b p).2
Instances For
The box of intervalBox a b p is the box of the node p of the bisection tree.
The boxes of the bisection tree lie in the root box.
The box of a child lies in the box of its parent.
The width of the box of a node is its diameter.
The center of the box of a node is a feasible point of the node.
The interval lower bound of the node p for the expression e: the lower endpoint of the
natural interval extension of e on the box of p, or 0 if it is undefined there (which does
not happen if it is defined on the root box, by ArithExpr.intervalEval_mono).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The upper endpoint of the natural interval extension of e on the box of p, or 0.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If the natural interval extension of e is defined on the root box, then it is defined on the
box of every node, and the interval bounds are its endpoints.
The natural interval extension encloses the values of e on every box of the bisection
tree.
The interval bounds are lower bounds.
The interval bounds do not decrease from a node to its children, by inclusion isotonicity.
Consistency of the interval bounds: by the convergence of the natural interval extension
(ArithExpr.exists_length_intervalEval_le_modulus), the gap between e and the interval bound on
a box is at most ω d, d its diameter, with ω d → 0 as d → 0. No condition on square roots
is needed; with ArithExpr.SqrtArgPos the gap is O(d)
(ArithExpr.exists_length_intervalEval_le).
The node selected at step k of the interval branch and bound method (the
Moore–Skelboe algorithm) for e on Icc a b: best-first selection on the bisection tree with
the interval bounds BranchAndBound.intervalBound.
Equations
Instances For
The point at which the interval branch and bound method evaluates e at step k: the
center of the selected box.
Equations
Instances For
The interval branch and bound method is a branch and bound run.
The lower bounds of the interval branch and bound method increase.
Convergence of interval branch and bound (the Moore–Skelboe algorithm with bisection;
Ratschek–Rokne): if the natural interval extension of e is defined on
Icc a b, then e has a minimizer z on the box, and the interval lower bounds of the selected
boxes (which increase) and the incumbent values at the centers (which decrease) tend to e z.
Finite termination of interval branch and bound: for every ε > 0, the stopping test
incumbent - bound ≤ ε holds at some step k, and one of the centers evaluated up to step k is
ε-optimal.
The mean value lower bound of the node p: the lower endpoint of the mean value form of
f on the box of p, centered at its center, with the enclosure G X of the partial
derivatives on a box X.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The mean value bounds are lower bounds.
Consistency of the mean value bounds for bounded derivative enclosures: if G encloses
the partial derivatives of f on the subboxes X of Icc a b and length (G X i) ≤ K (for
example if G is inclusion isotone), then the gap between f and the mean value bound on a box
is at most (M + n K) d, d its diameter, by the a posteriori bound
IntervalArith.exists_le_fst_meanValueForm_add_sum. No rate length (G X i) = O(width X) is
needed.
Consistency of the mean value bounds: if G encloses the partial derivatives of f on
the subboxes X of Icc a b, with length (G X i) ≤ L · width X, then the mean value bounds are
consistent: the case K = |L| · width (Icc a b) of
ConvexAnalysis.BranchAndBound.isConsistent_meanValueBound_of_length_le. For such enclosures the
lower endpoint of the mean value form on a box of diameter d is within n L d² of a value of f
(ConvexAnalysis.IntervalArith.exists_le_fst_meanValueForm).
The node selected at step k of interval branch and bound with the mean value form.
Equations
Instances For
Convergence of interval branch and bound with the mean value form for bounded derivative
enclosures: for f differentiable on Icc a b and an enclosure G of its partial derivatives
on the subboxes whose length is at most K (for example an inclusion isotone G), f has a
minimizer z on the box, and the mean value lower bounds of the selected boxes and the incumbent
values at their centers tend to f z.
Convergence of interval branch and bound with the mean value form: for f
differentiable on Icc a b and an enclosure G of its partial derivatives on the subboxes whose
length is at most L times the width, f has a minimizer z on the box, and the mean value
lower bounds of the selected boxes and the incumbent values at their centers tend to f z. The
case K = |L| · width (Icc a b) of
ConvexAnalysis.BranchAndBound.exists_isMinOn_and_tendsto_meanValue_of_length_le.
Relation with Mathlib's inclusion tactic #
The interval X as an interval Inclusion.Interval ℝ of Mathlib's inclusion tactic, whose
endpoints may be infinite.
Instances For
An interval of the inclusion tactic with finite endpoints denotes the same set
(Inclusion.ToSet.toSet) as the corresponding NonemptyInterval ℝ.
The multiplication of the inclusion tactic (Inclusion.Interval.mul, which selects the
products of endpoints by the signs of the endpoints) contains the exact product
IntervalArith.mul: it has the inclusion property, and the exact product is the set of all
products (IntervalArith.mul_le_iff). See IntervalArith.mul_le_of_ofInclusion for intervals
with endpoints in any ordered type, such as the dyadic numbers of the tactic.
The real interval [f a, f b] that an interval I = [a, b] of the inclusion tactic with
finite endpoints in α denotes under f : α → ℝ (for the tactic on ℝ, α is Dyadic and f
the inclusion Dyadic.toReal); none if an endpoint is infinite or f b < f a.
Equations
Instances For
ofInclusion of an interval with finite endpoints.
ofInclusion f I is defined iff I has finite endpoints a, b with f a ≤ f b, and then
it is [f a, f b].
The interval ofInclusion f I has the points of I under f: the real numbers x with
x ∈ I.map f, the membership of the inclusion tactic.
A finite interval X of reals is the conversion of toInclusion X.
The conversion of an interval with finite endpoints that contains a point is defined.
Addition of the inclusion tactic is exact on finite intervals: for an additive f, the
conversion of I.add J is the interval sum of the conversions of I and J.
Negation of the inclusion tactic is exact on finite intervals.
Subtraction of the inclusion tactic is exact on finite intervals.
Multiplication of the inclusion tactic is an outward rounding of the exact product: for
an order embedding f : α ↪o ℝ that preserves 0 and products (as Dyadic.toReal), finite
intervals I, J have a finite product I.mul J, and its conversion contains
IntervalArith.mul of the conversions. So the tactic's results for +, - and * are rounded
evaluations in the sense of ConvexAnalysis.ArithExpr.IsRoundedEval.