Documentation

ConvexAnalysis.IntervalArithmetic

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 #

Main statements #

Implementation notes #

References #

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.

theorem ConvexAnalysis.IntervalArith.mem_of_le_of_mem {X Y : NonemptyInterval ℝ} {x : ℝ} (h : X ≤ Y) (hx : x ∈ X) :
x ∈ Y

A point of X is a point of every interval containing X.

theorem ConvexAnalysis.IntervalArith.le_of_forall_mem {X Y : NonemptyInterval ℝ} (h : ∀ x ∈ X, x ∈ Y) :
X ≤ Y

X ≤ Y if every point of X is a point of Y.

theorem ConvexAnalysis.IntervalArith.abs_sub_le_length {X : NonemptyInterval ℝ} {x y : ℝ} (hx : x ∈ X) (hy : y ∈ X) :
|x - y| ≤ X.length

Two points of an interval differ by at most its length.

A subinterval is not longer than the interval.

theorem ConvexAnalysis.IntervalArith.coe_add (X Y : NonemptyInterval ℝ) :
↑(X + Y) = ↑X + ↑Y

Addition is exact: the interval sum is the set of all sums.

theorem ConvexAnalysis.IntervalArith.add_mem_add {X Y : NonemptyInterval ℝ} {x y : ℝ} (hx : x ∈ X) (hy : y ∈ Y) :
x + y ∈ X + Y

The inclusion property of interval addition.

theorem ConvexAnalysis.IntervalArith.add_mono {X X' Y Y' : NonemptyInterval ℝ} (hX : X ≤ X') (hY : Y ≤ Y') :
X + Y ≤ X' + Y'

Inclusion isotonicity of interval addition.

theorem ConvexAnalysis.IntervalArith.add_le_iff {X Y G : NonemptyInterval ℝ} :
X + Y ≤ G ↔ ∀ x ∈ X, ∀ y ∈ Y, x + y ∈ G

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
    theorem ConvexAnalysis.IntervalArith.mul_mem_mul {X Y : NonemptyInterval ℝ} {x y : ℝ} (hx : x ∈ X) (hy : y ∈ Y) :
    x * y ∈ mul X Y

    The inclusion property of interval multiplication.

    theorem ConvexAnalysis.IntervalArith.coe_mul (X Y : NonemptyInterval ℝ) :
    ↑(mul X Y) = Set.image2 (fun (x1 x2 : ℝ) => x1 * x2) ↑X ↑Y

    Multiplication is exact: the interval product is the set of all products.

    theorem ConvexAnalysis.IntervalArith.mul_mono {X X' Y Y' : NonemptyInterval ℝ} (hX : X ≤ X') (hY : Y ≤ Y') :
    mul X Y ≤ mul X' Y'

    Inclusion isotonicity of interval multiplication.

    theorem ConvexAnalysis.IntervalArith.mul_le_iff {X Y G : NonemptyInterval ℝ} :
    mul X Y ≤ G ↔ ∀ x ∈ X, ∀ y ∈ Y, x * y ∈ G

    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.

    Equations
    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.

      Equations
      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 length of a product: length (X Y) ≤ |X| length Y + |Y| length X.

        theorem ConvexAnalysis.IntervalArith.exists_mul_eq_fst (X Y : NonemptyInterval ℝ) :
        ∃ x ∈ X, ∃ y ∈ Y, x * y = (mul X Y).toProd.1

        The lower endpoint of a product is a product of points of the factors.

        theorem ConvexAnalysis.IntervalArith.exists_mul_eq_snd (X Y : NonemptyInterval ℝ) :
        ∃ x ∈ X, ∃ y ∈ Y, x * y = (mul X Y).toProd.2

        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
          theorem ConvexAnalysis.IntervalArith.coe_inv (X : NonemptyInterval ℝ) (h : 0 ∉ X) :
          ↑(inv X h) = Inv.inv '' ↑X

          The inverse is exact: for 0 ∉ X, X⁻¹ is the set of inverses of the points of X.

          theorem ConvexAnalysis.IntervalArith.inv_mem_inv {X : NonemptyInterval ℝ} {x : ℝ} (h : 0 ∉ X) (hx : x ∈ X) :

          The inclusion property of the interval inverse.

          theorem ConvexAnalysis.IntervalArith.inv_mono {X X' : NonemptyInterval ℝ} (h : 0 ∉ X) (h' : 0 ∉ X') (hX : X ≤ X') :
          inv X h ≤ inv X' h'

          Inclusion isotonicity of the interval inverse.

          theorem ConvexAnalysis.IntervalArith.inv_le_iff {X G : NonemptyInterval ℝ} (h : 0 ∉ X) :
          inv X h ≤ G ↔ ∀ x ∈ X, x⁻¹ ∈ G

          The interval inverse is the least interval containing all inverses.

          The length of the inverse: length X⁻¹ ≤ length X / ⟨X⟩².

          The exponential [exp a, exp b] of X = [a, b].

          Equations
          Instances For

            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.

            exp is Lipschitz with constant exp b on X = [a, b].

            The logarithm [log a, log b] of X = [a, b] with 0 < a.

            Equations
            Instances For

              The interval logarithm is exact.

              theorem ConvexAnalysis.IntervalArith.log_mem_log {X : NonemptyInterval ℝ} {x : ℝ} (h : 0 < X.toProd.1) (hx : x ∈ X) :

              The inclusion property of the interval logarithm.

              theorem ConvexAnalysis.IntervalArith.log_mono {X X' : NonemptyInterval ℝ} (h : 0 < X.toProd.1) (h' : 0 < X'.toProd.1) (hX : X ≤ X') :
              log X h ≤ log X' h'

              Inclusion isotonicity of the interval logarithm.

              theorem ConvexAnalysis.IntervalArith.log_le_iff {X G : NonemptyInterval ℝ} (h : 0 < X.toProd.1) :
              log X h ≤ G ↔ ∀ x ∈ X, Real.log x ∈ G

              The interval logarithm is the least interval containing all logarithms.

              log is Lipschitz with constant 1 / a on X = [a, b], 0 < a.

              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 Lipschitz with constant 1 / √a on X = [a, b], 0 < a. It is not Lipschitz on [0, b]: the length of sqrt [0, h] is √h.

                √ 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
                  theorem ConvexAnalysis.IntervalArith.coe_pow (X : NonemptyInterval ℝ) (k : ℕ) :
                  ↑(pow X k) = (fun (x : ℝ) => x ^ k) '' ↑X

                  The interval power is exact.

                  theorem ConvexAnalysis.IntervalArith.pow_mem_pow {X : NonemptyInterval ℝ} {x : ℝ} (hx : x ∈ X) (k : ℕ) :
                  x ^ k ∈ pow X k

                  The inclusion property of the interval power.

                  theorem ConvexAnalysis.IntervalArith.pow_mono {X X' : NonemptyInterval ℝ} (hX : X ≤ X') (k : ℕ) :
                  pow X k ≤ pow X' k

                  Inclusion isotonicity of the interval power.

                  theorem ConvexAnalysis.IntervalArith.pow_le_iff {X G : NonemptyInterval ℝ} (k : ℕ) :
                  pow X k ≤ G ↔ ∀ x ∈ X, x ^ k ∈ G

                  The interval power is the least interval containing all powers.

                  x ↦ x ^ k is Lipschitz with constant k |X| ^ (k - 1) on X.

                  Boxes #

                  def ConvexAnalysis.IntervalArith.box {ι : Type u_1} (X : ι → NonemptyInterval ℝ) :
                  Set (ι → ℝ)

                  The box of an interval vector X: the points x with x i ∈ X i for all i.

                  Equations
                  Instances For
                    theorem ConvexAnalysis.IntervalArith.mem_box {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {x : ι → ℝ} :
                    x ∈ box X ↔ ∀ (i : ι), x i ∈ X i

                    Membership in a box is membership of every coordinate in its side.

                    theorem ConvexAnalysis.IntervalArith.box_mono {ι : Type u_1} {X Y : ι → NonemptyInterval ℝ} (h : X ≤ Y) :
                    box X ⊆ box Y

                    The box is monotone in the interval vector.

                    Boxes are nonempty.

                    noncomputable def ConvexAnalysis.IntervalArith.ofCorners {ι : Type u_1} (a b : ι → ℝ) :

                    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
                      theorem ConvexAnalysis.IntervalArith.box_ofCorners {ι : Type u_1} {a b : ι → ℝ} (hab : a ≤ b) :

                      For a ≤ b, the box of ofCorners a b is Icc a b.

                      theorem ConvexAnalysis.IntervalArith.ofCorners_le {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {x y : ι → ℝ} (hx : x ∈ box X) (hy : y ∈ box X) :

                      The smallest box containing two points of a box lies in that box.

                      A corner lies in the box it spans.

                      A corner lies in the box it spans.

                      theorem ConvexAnalysis.IntervalArith.ofCorners_mono {ι : Type u_1} {a b a' b' : ι → ℝ} (hab : a ≤ b) (h : Set.Icc a b ⊆ Set.Icc a' b') :

                      Inclusion of boxes Icc a b ⊆ Icc a' b' (with a ≤ b) is inclusion of the interval vectors.

                      noncomputable def ConvexAnalysis.IntervalArith.width {ι : Type u_1} [Fintype ι] (X : ι → NonemptyInterval ℝ) :

                      The width of an interval vector: the largest length of its sides, the sup norm of the vector of lengths.

                      Equations
                      Instances For

                        The width is nonnegative.

                        theorem ConvexAnalysis.IntervalArith.length_le_width {ι : Type u_1} [Fintype ι] (X : ι → NonemptyInterval ℝ) (i : ι) :
                        (X i).length ≤ width X

                        Every side of a box is at most as long as its width.

                        theorem ConvexAnalysis.IntervalArith.width_le {ι : Type u_1} {X : ι → NonemptyInterval ℝ} [Fintype ι] {c : ℝ} (hc : 0 ≤ c) (h : ∀ (i : ι), (X i).length ≤ c) :

                        A box whose sides have length at most c ≥ 0 has width at most c.

                        theorem ConvexAnalysis.IntervalArith.width_mono {ι : Type u_1} {X Y : ι → NonemptyInterval ℝ} [Fintype ι] (h : X ≤ Y) :

                        The width is monotone.

                        The width of a box is its diameter in the sup norm of ι → ℝ.

                        theorem ConvexAnalysis.IntervalArith.width_ofCorners {ι : Type u_1} [Fintype ι] (x y : ι → ℝ) :

                        The smallest box containing x and y has width ‖x - y‖ (sup norm).

                        Arithmetic expressions and their natural interval extension #

                        inductive ConvexAnalysis.ArithExpr (ι : Type u_1) :
                        Type u_1

                        Arithmetic expressions in the variables ι: constants, variables, sums, negatives, products, inverses, and the elementary functions exp, log, √ and natural powers.

                        Instances For
                          def ConvexAnalysis.ArithExpr.sub {ι : Type u_1} (e₁ e₂ : ArithExpr ι) :

                          The difference e₁ - e₂ = e₁ + (-e₂).

                          Equations
                          Instances For
                            def ConvexAnalysis.ArithExpr.div {ι : Type u_1} (e₁ e₂ : ArithExpr ι) :

                            The quotient e₁ / e₂ = e₁ * e₂⁻¹.

                            Equations
                            Instances For
                              @[instance_reducible]

                              The notation e₁ + e₂ for ArithExpr.add.

                              Equations
                              @[instance_reducible]

                              The notation -e for ArithExpr.neg.

                              Equations
                              @[instance_reducible]

                              The notation e₁ - e₂ for ArithExpr.sub.

                              Equations
                              @[instance_reducible]

                              The notation e₁ * e₂ for ArithExpr.mul.

                              Equations
                              @[instance_reducible]

                              The notation e⁻¹ for ArithExpr.inv.

                              Equations
                              @[instance_reducible]

                              The notation e₁ / e₂ for ArithExpr.div.

                              Equations
                              @[instance_reducible]

                              The notation e ^ k for ArithExpr.pow.

                              Equations
                              @[instance_reducible]
                              instance ConvexAnalysis.ArithExpr.instOfNat {ι : Type u_1} {n : ℕ} :

                              Numerals (n : ArithExpr ι) are constants.

                              Equations
                              @[simp]
                              theorem ConvexAnalysis.ArithExpr.add_eq {ι : Type u_1} (e₁ e₂ : ArithExpr ι) :
                              e₁ + e₂ = e₁.add e₂

                              e₁ + e₂ is ArithExpr.add e₁ e₂.

                              @[simp]
                              theorem ConvexAnalysis.ArithExpr.neg_eq {ι : Type u_1} (e : ArithExpr ι) :
                              -e = e.neg

                              -e is ArithExpr.neg e.

                              @[simp]
                              theorem ConvexAnalysis.ArithExpr.sub_eq {ι : Type u_1} (e₁ e₂ : ArithExpr ι) :
                              e₁ - e₂ = e₁.sub e₂

                              e₁ - e₂ is ArithExpr.sub e₁ e₂.

                              @[simp]
                              theorem ConvexAnalysis.ArithExpr.mul_eq {ι : Type u_1} (e₁ e₂ : ArithExpr ι) :
                              e₁ * e₂ = e₁.mul e₂

                              e₁ * e₂ is ArithExpr.mul e₁ e₂.

                              @[simp]
                              theorem ConvexAnalysis.ArithExpr.inv_eq {ι : Type u_1} (e : ArithExpr ι) :

                              e⁻¹ is ArithExpr.inv e.

                              @[simp]
                              theorem ConvexAnalysis.ArithExpr.div_eq {ι : Type u_1} (e₁ e₂ : ArithExpr ι) :
                              e₁ / e₂ = e₁.div e₂

                              e₁ / e₂ is ArithExpr.div e₁ e₂.

                              @[simp]
                              theorem ConvexAnalysis.ArithExpr.pow_eq {ι : Type u_1} (e : ArithExpr ι) (k : ℕ) :
                              e ^ k = e.pow k

                              e ^ k is ArithExpr.pow e k.

                              theorem ConvexAnalysis.ArithExpr.ofNat_eq {ι : Type u_1} (n : ℕ) :

                              A numeral is a constant.

                              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
                              Instances For
                                @[simp]

                                The natural interval extension of a constant c is [c, c].

                                @[simp]
                                theorem ConvexAnalysis.ArithExpr.intervalEval_var {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {i : ι} :
                                intervalEval X (var i) = some (X i)

                                The natural interval extension of the variable x i is X i.

                                theorem ConvexAnalysis.ArithExpr.intervalEval_add_eq_some {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {G : NonemptyInterval ℝ} {e₁ e₂ : ArithExpr ι} :
                                intervalEval X (e₁.add e₂) = some G ↔ ∃ (F₁ : NonemptyInterval ℝ) (F₂ : NonemptyInterval ℝ), intervalEval X e₁ = some F₁ ∧ intervalEval X e₂ = some F₂ ∧ F₁ + F₂ = G

                                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.

                                theorem ConvexAnalysis.ArithExpr.intervalEval_mul_eq_some {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {G : NonemptyInterval ℝ} {e₁ e₂ : ArithExpr ι} :
                                intervalEval X (e₁.mul e₂) = some G ↔ ∃ (F₁ : NonemptyInterval ℝ) (F₂ : NonemptyInterval ℝ), intervalEval X e₁ = some F₁ ∧ intervalEval X e₂ = some F₂ ∧ IntervalArith.mul F₁ F₂ = G

                                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.

                                theorem ConvexAnalysis.ArithExpr.eval_mem_of_intervalEval_eq_some {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {F : NonemptyInterval ℝ} {e : ArithExpr ι} {x : ι → ℝ} (h : intervalEval X e = some F) (hx : x ∈ IntervalArith.box X) :
                                eval x e ∈ F

                                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.

                                theorem ConvexAnalysis.ArithExpr.image_eval_subset {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {F : NonemptyInterval ℝ} {e : ArithExpr ι} (h : intervalEval X e = some F) :
                                (fun (x : ι → ℝ) => eval x e) '' IntervalArith.box X ⊆ ↑F

                                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.

                                theorem ConvexAnalysis.ArithExpr.intervalEval_sub_var_self {ι : Type u_1} (X : ι → NonemptyInterval ℝ) (i : ι) :
                                intervalEval X ((var i).sub (var i)) = some (X i - X i) ∧ (X i - X i).length = 2 * (X i).length ∧ ∀ (x : ι → ℝ), eval x ((var i).sub (var i)) = 0

                                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.

                                Instances For

                                  The exact natural interval extension is a rounded evaluation (with no rounding).

                                  theorem ConvexAnalysis.ArithExpr.IsRoundedEval.mono {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {G : NonemptyInterval ℝ} {e : ArithExpr ι} (h : IsRoundedEval X e G) {G' : NonemptyInterval ℝ} (hG : G ≤ G') :

                                  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.

                                  theorem ConvexAnalysis.ArithExpr.IsRoundedEval.eval_mem {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {G : NonemptyInterval ℝ} {e : ArithExpr ι} {x : ι → ℝ} (h : IsRoundedEval X e G) (hx : x ∈ IntervalArith.box X) :
                                  eval x e ∈ G

                                  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.

                                  theorem ConvexAnalysis.ArithExpr.IsRoundedEval.of_box_le {ι : Type u_1} {X X' : ι → NonemptyInterval ℝ} {G : NonemptyInterval ℝ} {e : ArithExpr ι} (hX : X ≤ X') (h : IsRoundedEval X' e G) :

                                  A rounded evaluation on a box X' is a rounded evaluation on every smaller box X ≤ X'.

                                  theorem ConvexAnalysis.ArithExpr.intervalEval_mono {ι : Type u_1} {X X' : ι → NonemptyInterval ℝ} {F' : NonemptyInterval ℝ} {e : ArithExpr ι} (hX : X ≤ X') (h : intervalEval X' e = some F') :
                                  ∃ (F : NonemptyInterval ℝ), intervalEval X e = some F ∧ F ≤ F'

                                  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
                                    theorem ConvexAnalysis.ArithExpr.eval_congr {ι : Type u_1} {e : ArithExpr ι} {x y : ι → ℝ} (h : ∀ i ∈ e.vars, x i = y i) :
                                    eval x e = eval y e

                                    The value of e depends only on the variables that occur in e.

                                    theorem ConvexAnalysis.ArithExpr.image2_image_eval {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {e₁ e₂ : ArithExpr ι} (hd : Disjoint e₁.vars e₂.vars) (op : ℝ → ℝ → ℝ) :
                                    Set.image2 op ((fun (x : ι → ℝ) => eval x e₁) '' IntervalArith.box X) ((fun (x : ι → ℝ) => eval x e₂) '' IntervalArith.box X) = (fun (x : ι → ℝ) => op (eval x e₁) (eval x e₂)) '' IntervalArith.box X

                                    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.

                                    theorem ConvexAnalysis.ArithExpr.coe_intervalEval_of_isSingleUse {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {F : NonemptyInterval ℝ} {e : ArithExpr ι} (hs : e.IsSingleUse) (h : intervalEval X e = some F) :
                                    ↑F = (fun (x : ι → ℝ) => eval x e) '' IntervalArith.box X

                                    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
                                    Instances For
                                      theorem ConvexAnalysis.ArithExpr.le_of_intervalEval_eq_some {ι : Type u_1} {X : ι → NonemptyInterval ℝ} {F : NonemptyInterval ℝ} {e : ArithExpr ι} {X₀ : ι → NonemptyInterval ℝ} {F₀ : NonemptyInterval ℝ} (hX : X ≤ X₀) (h₀ : intervalEval X₀ e = some F₀) (h : intervalEval X e = some F) :
                                      F ≤ F₀

                                      If the natural interval extension is defined on X₀ and X ≤ X₀, then its value on X lies in its value on X₀.

                                      theorem ConvexAnalysis.ArithExpr.exists_length_intervalEval_le {ι : Type u_1} {e : ArithExpr ι} [Fintype ι] {X₀ : ι → NonemptyInterval ℝ} {F₀ : NonemptyInterval ℝ} (h₀ : intervalEval X₀ e = some F₀) (hs : SqrtArgPos X₀ e) :
                                      ∃ (C : ℝ), 0 ≤ C ∧ ∀ X ≤ X₀, ∀ (F : NonemptyInterval ℝ), intervalEval X e = some F → F.length ≤ C * IntervalArith.width 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).

                                      theorem ConvexAnalysis.ArithExpr.exists_lipschitzOnWith_eval {ι : Type u_1} {e : ArithExpr ι} [Fintype ι] {X₀ : ι → NonemptyInterval ℝ} {F₀ : NonemptyInterval ℝ} (h₀ : intervalEval X₀ e = some F₀) (hs : SqrtArgPos X₀ e) :
                                      ∃ (K : NNReal), LipschitzOnWith K (fun (x : ι → ℝ) => eval x e) (IntervalArith.box X₀)

                                      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‖.

                                      theorem ConvexAnalysis.ArithExpr.exists_length_intervalEval_le_modulus {ι : Type u_1} {e : ArithExpr ι} [Fintype ι] {X₀ : ι → NonemptyInterval ℝ} {F₀ : NonemptyInterval ℝ} (h₀ : intervalEval X₀ e = some F₀) :
                                      ∃ (ω : ℝ → ℝ), Filter.Tendsto ω (nhds 0) (nhds 0) ∧ ∀ X ≤ X₀, ∀ (F : NonemptyInterval ℝ), intervalEval X e = some F → F.length ≤ ω (IntervalArith.width X)

                                      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.

                                      theorem ConvexAnalysis.ArithExpr.exists_abs_eval_sub_le {ι : Type u_1} {e : ArithExpr ι} [Fintype ι] {X₀ : ι → NonemptyInterval ℝ} {F₀ : NonemptyInterval ℝ} (h₀ : intervalEval X₀ e = some F₀) :
                                      ∃ (ω : ℝ → ℝ), Filter.Tendsto ω (nhds 0) (nhds 0) ∧ ∀ x ∈ IntervalArith.box X₀, ∀ y ∈ IntervalArith.box X₀, |eval x e - eval y e| ≤ ω ‖x - y‖

                                      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₀.

                                      theorem ConvexAnalysis.ArithExpr.continuousOn_eval {ι : Type u_1} {e : ArithExpr ι} [Fintype ι] {X₀ : ι → NonemptyInterval ℝ} {F₀ : NonemptyInterval ℝ} (h₀ : intervalEval X₀ e = some F₀) :
                                      ContinuousOn (fun (x : ι → ℝ) => eval x e) (IntervalArith.box X₀)

                                      An expression whose natural interval extension is defined on the box X₀ is continuous on X₀ (ArithExpr.exists_abs_eval_sub_le).

                                      theorem ConvexAnalysis.ArithExpr.not_exists_length_intervalEval_sqrt_var_le :
                                      ¬∃ (C : ℝ), ∀ X ≤ fun (x : Unit) => { fst := 0, snd := 1, fst_le_snd := ⋯ }, ∀ (F : NonemptyInterval ℝ), intervalEval X (var ()).sqrt = some F → F.length ≤ C * IntervalArith.width X

                                      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 #

                                      theorem ConvexAnalysis.IntervalArith.sum_mem_sum {ι : Type u_1} {s : Finset ι} {a : ι → ℝ} {F : ι → NonemptyInterval ℝ} (h : ∀ i ∈ s, a i ∈ F i) :
                                      ∑ i ∈ s, a i ∈ ∑ i ∈ s, F i

                                      The inclusion property of interval sums over a finite set.

                                      theorem ConvexAnalysis.IntervalArith.fst_sum {ι : Type u_1} (s : Finset ι) (F : ι → NonemptyInterval ℝ) :
                                      (∑ i ∈ s, F i).toProd.1 = ∑ i ∈ s, (F i).toProd.1

                                      The lower endpoint of a sum of intervals is the sum of the lower endpoints.

                                      theorem ConvexAnalysis.IntervalArith.snd_sum {ι : Type u_1} (s : Finset ι) (F : ι → NonemptyInterval ℝ) :
                                      (∑ i ∈ s, F i).toProd.2 = ∑ i ∈ s, (F i).toProd.2

                                      The upper endpoint of a sum of intervals is the sum of the upper endpoints.

                                      theorem ConvexAnalysis.IntervalArith.apply_eq_sum {ι : Type u_1} [Fintype ι] [DecidableEq ι] (L : StrongDual ℝ (ι → ℝ)) (v : ι → ℝ) :
                                      L v = ∑ i : ι, v i * L (Pi.single i 1)

                                      A linear functional on ι → ℝ is the sum of the coordinates weighted by its values on the standard basis (the partial derivatives, for a derivative).

                                      noncomputable def ConvexAnalysis.IntervalArith.meanValueForm {ι : Type u_1} [Fintype ι] (fc : ℝ) (G X : ι → NonemptyInterval ℝ) (c : ι → ℝ) :

                                      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
                                      Instances For
                                        theorem ConvexAnalysis.IntervalArith.exists_sub_eq_sum {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {X : ι → NonemptyInterval ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) {x y : ι → ℝ} (hx : x ∈ box X) (hy : y ∈ box X) :
                                        ∃ z ∈ box X, f y - f x = ∑ i : ι, (y i - x i) * (f' z) (Pi.single i 1)

                                        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.

                                        theorem ConvexAnalysis.IntervalArith.mem_meanValueForm {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G X : ι → NonemptyInterval ℝ} {c : ι → ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) (hG : ∀ x ∈ box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G i) (hc : c ∈ box X) {x : ι → ℝ} (hx : x ∈ box X) :
                                        f x ∈ meanValueForm (f c) G X c

                                        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.

                                        theorem ConvexAnalysis.IntervalArith.mem_add_sum_of_mem {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G X : ι → NonemptyInterval ℝ} {c : ι → ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) (hG : ∀ x ∈ box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G i) (hc : c ∈ box X) {Fc : NonemptyInterval ℝ} (hFc : f c ∈ Fc) {x : ι → ℝ} (hx : x ∈ box X) :
                                        f x ∈ Fc + ∑ i : ι, mul (G i) (X i - NonemptyInterval.pure (c i))

                                        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.

                                        theorem ConvexAnalysis.IntervalArith.exists_le_fst_meanValueForm_add_sum {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G X : ι → NonemptyInterval ℝ} {c : ι → ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) (hG : ∀ x ∈ box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G i) (hc : c ∈ box X) :
                                        ∃ y ∈ box X, f y ≤ (meanValueForm (f c) G X c).toProd.1 + ∑ i : ι, (G i).length * mag (X i - NonemptyInterval.pure (c i))

                                        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).

                                        theorem ConvexAnalysis.IntervalArith.exists_snd_meanValueForm_sub_sum_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G X : ι → NonemptyInterval ℝ} {c : ι → ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) (hG : ∀ x ∈ box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G i) (hc : c ∈ box X) :
                                        ∃ y ∈ box X, (meanValueForm (f c) G X c).toProd.2 - ∑ i : ι, (G i).length * mag (X i - NonemptyInterval.pure (c i)) ≤ f y

                                        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.

                                        theorem ConvexAnalysis.IntervalArith.exists_le_fst_meanValueForm {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G X : ι → NonemptyInterval ℝ} {c : ι → ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) (hG : ∀ x ∈ box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G i) (hc : c ∈ box X) {L : ℝ} (hGw : ∀ (i : ι), (G i).length ≤ L * width X) :
                                        ∃ y ∈ box X, f y ≤ (meanValueForm (f c) G X c).toProd.1 + ↑(Fintype.card ι) * L * width X ^ 2

                                        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.

                                        theorem ConvexAnalysis.IntervalArith.exists_snd_meanValueForm_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G X : ι → NonemptyInterval ℝ} {c : ι → ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) (hG : ∀ x ∈ box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G i) (hc : c ∈ box X) {L : ℝ} (hGw : ∀ (i : ι), (G i).length ≤ L * width X) :
                                        ∃ y ∈ box X, (meanValueForm (f c) G X c).toProd.2 - ↑(Fintype.card ι) * L * width X ^ 2 ≤ f y

                                        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.

                                        theorem ConvexAnalysis.IntervalArith.abs_sub_le_sum_mag_mul_width {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G X : ι → NonemptyInterval ℝ} (hf : ∀ x ∈ box X, HasFDerivWithinAt f (f' x) (box X) x) (hG : ∀ x ∈ box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G i) {x y : ι → ℝ} (hx : x ∈ box X) (hy : y ∈ box X) :
                                        |f y - f x| ≤ (∑ i : ι, mag (G i)) * width 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 #

                                        noncomputable def ConvexAnalysis.BranchAndBound.intervalBox {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (a b : ι → ℝ) (p : List Bool) :

                                        The interval vector of the box at the node p of the bisection tree of Icc a b.

                                        Equations
                                        Instances For
                                          noncomputable def ConvexAnalysis.BranchAndBound.bisectionCenter {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (a b : ι → ℝ) (p : List Bool) :
                                          ι → ℝ

                                          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
                                          Instances For
                                            theorem ConvexAnalysis.BranchAndBound.box_intervalBox {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} (hab : a ≤ b) (p : List Bool) :

                                            The box of intervalBox a b p is the box of the node p of the bisection tree.

                                            theorem ConvexAnalysis.BranchAndBound.intervalBox_le {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} (hab : a ≤ b) (p : List Bool) :

                                            The boxes of the bisection tree lie in the root box.

                                            theorem ConvexAnalysis.BranchAndBound.intervalBox_cons_le {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} (hab : a ≤ b) (p : List Bool) (c : Bool) :
                                            intervalBox a b (c :: p) ≤ intervalBox a b p

                                            The box of a child lies in the box of its parent.

                                            The width of the box of a node is its diameter.

                                            theorem ConvexAnalysis.BranchAndBound.bisectionCenter_mem {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} (hab : a ≤ b) (p : List Bool) :

                                            The center of the box of a node is a feasible point of the node.

                                            noncomputable def ConvexAnalysis.BranchAndBound.intervalBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (e : ArithExpr ι) (a b : ι → ℝ) (p : List Bool) :

                                            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
                                              noncomputable def ConvexAnalysis.BranchAndBound.intervalUpperBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (e : ArithExpr ι) (a b : ι → ℝ) (p : List Bool) :

                                              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.

                                                theorem ConvexAnalysis.BranchAndBound.eval_mem_Icc_intervalBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} {F₀ : NonemptyInterval ℝ} (hab : a ≤ b) (h₀ : ArithExpr.intervalEval (IntervalArith.ofCorners a b) e = some F₀) (p : List Bool) {y : ι → ℝ} (hy : y ∈ Box.bisectionSet a b p) :

                                                The natural interval extension encloses the values of e on every box of the bisection tree.

                                                theorem ConvexAnalysis.BranchAndBound.isLowerBound_intervalBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} {F₀ : NonemptyInterval ℝ} (hab : a ≤ b) (h₀ : ArithExpr.intervalEval (IntervalArith.ofCorners a b) e = some F₀) :
                                                IsLowerBound (Set.Icc a b) (fun (x : ι → ℝ) => ArithExpr.eval x e) (Box.bisectionSet a b) (intervalBound e a b)

                                                The interval bounds are lower bounds.

                                                theorem ConvexAnalysis.BranchAndBound.intervalBound_le_cons {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} {F₀ : NonemptyInterval ℝ} (hab : a ≤ b) (h₀ : ArithExpr.intervalEval (IntervalArith.ofCorners a b) e = some F₀) (p : List Bool) (c : Bool) :
                                                intervalBound e a b p ≤ intervalBound e a b (c :: p)

                                                The interval bounds do not decrease from a node to its children, by inclusion isotonicity.

                                                theorem ConvexAnalysis.BranchAndBound.isConsistent_intervalBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} {F₀ : NonemptyInterval ℝ} (hab : a ≤ b) (h₀ : ArithExpr.intervalEval (IntervalArith.ofCorners a b) e = some F₀) :
                                                IsConsistent (Set.Icc a b) (fun (x : ι → ℝ) => ArithExpr.eval x e) (Box.bisectionSet a b) (intervalBound e a b)

                                                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).

                                                noncomputable def ConvexAnalysis.BranchAndBound.intervalNode {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (e : ArithExpr ι) (a b : ι → ℝ) (k : ℕ) :

                                                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
                                                  noncomputable def ConvexAnalysis.BranchAndBound.intervalPoint {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (e : ArithExpr ι) (a b : ι → ℝ) (k : ℕ) :
                                                  ι → ℝ

                                                  The point at which the interval branch and bound method evaluates e at step k: the center of the selected box.

                                                  Equations
                                                  Instances For
                                                    theorem ConvexAnalysis.BranchAndBound.isRun_interval {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} (hab : a ≤ b) :
                                                    IsRun (Set.Icc a b) (fun (x : ι → ℝ) => ArithExpr.eval x e) (Box.bisectionSet a b) (intervalBound e a b) (bestFirstPartition (intervalBound e a b)) (intervalNode e a b) (intervalPoint e a b)

                                                    The interval branch and bound method is a branch and bound run.

                                                    theorem ConvexAnalysis.BranchAndBound.monotone_intervalBound_intervalNode {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} {F₀ : NonemptyInterval ℝ} (hab : a ≤ b) (h₀ : ArithExpr.intervalEval (IntervalArith.ofCorners a b) e = some F₀) :
                                                    Monotone fun (k : ℕ) => intervalBound e a b (intervalNode e a b k)

                                                    The lower bounds of the interval branch and bound method increase.

                                                    theorem ConvexAnalysis.BranchAndBound.exists_isMinOn_and_tendsto_interval {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} {F₀ : NonemptyInterval ℝ} (hab : a ≤ b) (h₀ : ArithExpr.intervalEval (IntervalArith.ofCorners a b) e = some F₀) :
                                                    ∃ z ∈ Set.Icc a b, IsMinOn (fun (x : ι → ℝ) => ArithExpr.eval x e) (Set.Icc a b) z ∧ Filter.Tendsto (fun (k : ℕ) => intervalBound e a b (intervalNode e a b k)) Filter.atTop (nhds (ArithExpr.eval z e)) ∧ Filter.Tendsto (incumbent (fun (x : ι → ℝ) => ArithExpr.eval x e) (intervalPoint e a b)) Filter.atTop (nhds (ArithExpr.eval z e))

                                                    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.

                                                    theorem ConvexAnalysis.BranchAndBound.exists_incumbent_sub_intervalBound_le {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {e : ArithExpr ι} {F₀ : NonemptyInterval ℝ} (hab : a ≤ b) (h₀ : ArithExpr.intervalEval (IntervalArith.ofCorners a b) e = some F₀) {ε : ℝ} (hε : 0 < ε) :
                                                    ∃ (k : ℕ), incumbent (fun (x : ι → ℝ) => ArithExpr.eval x e) (intervalPoint e a b) k - intervalBound e a b (intervalNode e a b k) ≤ ε ∧ ∃ j ≤ k, ∀ y ∈ Set.Icc a b, ArithExpr.eval (intervalPoint e a b j) e ≤ ArithExpr.eval y e + ε

                                                    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.

                                                    noncomputable def ConvexAnalysis.BranchAndBound.meanValueBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (f : (ι → ℝ) → ℝ) (G : (ι → NonemptyInterval ℝ) → ι → NonemptyInterval ℝ) (a b : ι → ℝ) (p : List Bool) :

                                                    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
                                                      theorem ConvexAnalysis.BranchAndBound.isLowerBound_meanValueBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G : (ι → NonemptyInterval ℝ) → ι → NonemptyInterval ℝ} (hab : a ≤ b) (hf : ∀ x ∈ Set.Icc a b, HasFDerivWithinAt f (f' x) (Set.Icc a b) x) (hG : ∀ X ≤ IntervalArith.ofCorners a b, ∀ x ∈ IntervalArith.box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G X i) :

                                                      The mean value bounds are lower bounds.

                                                      theorem ConvexAnalysis.BranchAndBound.isConsistent_meanValueBound_of_length_le {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G : (ι → NonemptyInterval ℝ) → ι → NonemptyInterval ℝ} (hab : a ≤ b) (hf : ∀ x ∈ Set.Icc a b, HasFDerivWithinAt f (f' x) (Set.Icc a b) x) (hG : ∀ X ≤ IntervalArith.ofCorners a b, ∀ x ∈ IntervalArith.box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G X i) {K : ℝ} (hGb : ∀ X ≤ IntervalArith.ofCorners a b, ∀ (i : ι), (G X i).length ≤ K) :

                                                      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.

                                                      theorem ConvexAnalysis.BranchAndBound.isConsistent_meanValueBound {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G : (ι → NonemptyInterval ℝ) → ι → NonemptyInterval ℝ} {L : ℝ} (hab : a ≤ b) (hf : ∀ x ∈ Set.Icc a b, HasFDerivWithinAt f (f' x) (Set.Icc a b) x) (hG : ∀ X ≤ IntervalArith.ofCorners a b, ∀ x ∈ IntervalArith.box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G X i) (hGw : ∀ X ≤ IntervalArith.ofCorners a b, ∀ (i : ι), (G X i).length ≤ L * IntervalArith.width X) :

                                                      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).

                                                      noncomputable def ConvexAnalysis.BranchAndBound.meanValueNode {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] (f : (ι → ℝ) → ℝ) (G : (ι → NonemptyInterval ℝ) → ι → NonemptyInterval ℝ) (a b : ι → ℝ) (k : ℕ) :

                                                      The node selected at step k of interval branch and bound with the mean value form.

                                                      Equations
                                                      Instances For
                                                        theorem ConvexAnalysis.BranchAndBound.exists_isMinOn_and_tendsto_meanValue_of_length_le {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G : (ι → NonemptyInterval ℝ) → ι → NonemptyInterval ℝ} (hab : a ≤ b) (hf : ∀ x ∈ Set.Icc a b, HasFDerivWithinAt f (f' x) (Set.Icc a b) x) (hG : ∀ X ≤ IntervalArith.ofCorners a b, ∀ x ∈ IntervalArith.box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G X i) {K : ℝ} (hGb : ∀ X ≤ IntervalArith.ofCorners a b, ∀ (i : ι), (G X i).length ≤ K) :
                                                        ∃ z ∈ Set.Icc a b, IsMinOn f (Set.Icc a b) z ∧ Filter.Tendsto (fun (k : ℕ) => meanValueBound f G a b (meanValueNode f G a b k)) Filter.atTop (nhds (f z)) ∧ Filter.Tendsto (incumbent f fun (k : ℕ) => bisectionCenter a b (meanValueNode f G a b k)) Filter.atTop (nhds (f z))

                                                        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.

                                                        theorem ConvexAnalysis.BranchAndBound.exists_isMinOn_and_tendsto_meanValue {ι : Type u_1} [Fintype ι] [Nonempty ι] [DecidableEq ι] {a b : ι → ℝ} {f : (ι → ℝ) → ℝ} {f' : (ι → ℝ) → StrongDual ℝ (ι → ℝ)} {G : (ι → NonemptyInterval ℝ) → ι → NonemptyInterval ℝ} {L : ℝ} (hab : a ≤ b) (hf : ∀ x ∈ Set.Icc a b, HasFDerivWithinAt f (f' x) (Set.Icc a b) x) (hG : ∀ X ≤ IntervalArith.ofCorners a b, ∀ x ∈ IntervalArith.box X, ∀ (i : ι), (f' x) (Pi.single i 1) ∈ G X i) (hGw : ∀ X ≤ IntervalArith.ofCorners a b, ∀ (i : ι), (G X i).length ≤ L * IntervalArith.width X) :
                                                        ∃ z ∈ Set.Icc a b, IsMinOn f (Set.Icc a b) z ∧ Filter.Tendsto (fun (k : ℕ) => meanValueBound f G a b (meanValueNode f G a b k)) Filter.atTop (nhds (f z)) ∧ Filter.Tendsto (incumbent f fun (k : ℕ) => bisectionCenter a b (meanValueNode f G a b k)) Filter.atTop (nhds (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.

                                                        Equations
                                                        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
                                                            theorem ConvexAnalysis.IntervalArith.ofInclusion_mk {α : Type u_1} (f : α → ℝ) (a b : α) :
                                                            ofInclusion f { lb := ↑a, ub := ↑b } = if h : f a ≤ f b then some { fst := f a, snd := f b, fst_le_snd := h } else none

                                                            ofInclusion of an interval with finite endpoints.

                                                            theorem ConvexAnalysis.IntervalArith.ofInclusion_bot {α : Type u_1} (f : α → ℝ) (ub : WithTop α) :
                                                            ofInclusion f { lb := ⊥, ub := ub } = none

                                                            An interval unbounded below has no conversion.

                                                            theorem ConvexAnalysis.IntervalArith.ofInclusion_top {α : Type u_1} (f : α → ℝ) (lb : WithBot α) :
                                                            ofInclusion f { lb := lb, ub := ⊤ } = none

                                                            An interval unbounded above has no conversion.

                                                            theorem ConvexAnalysis.IntervalArith.ofInclusion_eq_some_iff {α : Type u_1} {f : α → ℝ} {I : Inclusion.Interval α} {X : NonemptyInterval ℝ} :
                                                            ofInclusion f I = some X ↔ ∃ (a : α) (b : α), I = { lb := ↑a, ub := ↑b } ∧ X.toProd.1 = f a ∧ X.toProd.2 = f b

                                                            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].

                                                            theorem ConvexAnalysis.IntervalArith.mem_ofInclusion_iff {α : Type u_1} {f : α → ℝ} {I : Inclusion.Interval α} {X : NonemptyInterval ℝ} (h : ofInclusion f I = some X) {x : ℝ} :
                                                            x ∈ X ↔ x ∈ I.map f

                                                            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.

                                                            theorem ConvexAnalysis.IntervalArith.exists_ofInclusion_eq_some {α : Type u_1} {f : α → ℝ} {K : Inclusion.Interval α} {a b : α} (hK : K = { lb := ↑a, ub := ↑b }) {x : ℝ} (hx : x ∈ K.map f) :

                                                            The conversion of an interval with finite endpoints that contains a point is defined.

                                                            theorem ConvexAnalysis.IntervalArith.ofInclusion_add {α : Type u_1} {I J : Inclusion.Interval α} {X Y : NonemptyInterval ℝ} [AddZero α] (f : α →+ ℝ) (hI : ofInclusion (⇑f) I = some X) (hJ : ofInclusion (⇑f) J = some Y) :
                                                            ofInclusion (⇑f) (I.add J) = some (X + Y)

                                                            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.

                                                            theorem ConvexAnalysis.IntervalArith.ofInclusion_neg {α : Type u_1} {I : Inclusion.Interval α} {X : NonemptyInterval ℝ} [AddGroup α] (f : α →+ ℝ) (hI : ofInclusion (⇑f) I = some X) :
                                                            ofInclusion (⇑f) I.neg = some (-X)

                                                            Negation of the inclusion tactic is exact on finite intervals.

                                                            theorem ConvexAnalysis.IntervalArith.ofInclusion_sub {α : Type u_1} {I J : Inclusion.Interval α} {X Y : NonemptyInterval ℝ} [AddGroup α] (f : α →+ ℝ) (hI : ofInclusion (⇑f) I = some X) (hJ : ofInclusion (⇑f) J = some Y) :
                                                            ofInclusion (⇑f) (I.sub J) = some (X - Y)

                                                            Subtraction of the inclusion tactic is exact on finite intervals.

                                                            theorem ConvexAnalysis.IntervalArith.mul_le_of_ofInclusion {α : Type u_1} {I J : Inclusion.Interval α} {X Y : NonemptyInterval ℝ} [Mul α] [Zero α] [LinearOrder α] (f : α ↪o ℝ) (map_zero : f 0 = 0) (map_mul : ∀ (a b : α), f (a * b) = f a * f b) (hI : ofInclusion (⇑f) I = some X) (hJ : ofInclusion (⇑f) J = some Y) :
                                                            ∃ (Z : NonemptyInterval ℝ), ofInclusion (⇑f) (I.mul J) = some Z ∧ mul X Y ≤ Z

                                                            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.