Documentation

ConvexAnalysis.IntervalBranchAndBound

Verified bounds and global minima by dyadic branch and bound #

With the dyadic evaluator of ConvexAnalysis.IntervalDyadic, a bound c ≤ e(x) for all x in a box is a computation: enclose the range of e on the box in interval arithmetic and compare the lower endpoint with c. If the enclosure is too wide, bisect the box and test the halves. This file makes this a Bool-valued function that the kernel evaluates, with a bound on the depth of the bisection, and proves that its result true implies the bound. From a lower bound on a box and an upper bound at a point of the box follows a verified enclosure [L, U] of the global minimum of e on the box, and the same bisection proves that a system of equations has no zero in a box.

Main definitions #

Main statements #

Implementation notes #

References #

Tags #

interval arithmetic, dyadic numbers, branch and bound, bisection, global optimization, verified global minimum, exclusion test, mean value form, computer-assisted proof

Bisection of dyadic boxes #

The point where a dyadic interval D = [a, b] is split: the midpoint of a and b (Inclusion.IntervalDyadicReal.midpoint), kept in [a, b].

Equations
Instances For

    The split point lies above the lower endpoint.

    The split point lies below the upper endpoint.

    The lower half [a, m] of D = [a, b], for the split point m.

    Equations
    Instances For

      The upper half [m, b] of D = [a, b], for the split point m.

      Equations
      Instances For

        The width b - a of a dyadic interval [a, b].

        Equations
        Instances For

          Every side of the box X has width at most w.

          Equations
          Instances For

            The index of a widest side of a box of dyadic intervals (the first one), or none if the box has no sides.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              The bisection of a box X of dyadic intervals: the two boxes obtained by splitting a widest side (ConvexAnalysis.DyadicInterval.widest) at its midpoint.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem ConvexAnalysis.DyadicInterval.mem_box_bisect {n : ℕ} {X : Fin n → NonemptyInterval Dyadic} {x : Fin n → ℝ} (hx : x ∈ IntervalArith.box fun (i : Fin n) => toReal (X i)) :
                (x ∈ IntervalArith.box fun (i : Fin n) => toReal ((bisect X).1 i)) ∨ x ∈ IntervalArith.box fun (i : Fin n) => toReal ((bisect X).2 i)

                The two halves of a bisection cover the box.

                The bisection test allPieces P d X: P X holds, or d > 0 and the bisection test with depth d - 1 succeeds on both halves of X (ConvexAnalysis.DyadicInterval.bisect). So true means that P holds on every piece of a subdivision of X by at most d successive bisections.

                Equations
                Instances For
                  theorem ConvexAnalysis.DyadicInterval.forall_of_allPieces {n : ℕ} {P : (Fin n → NonemptyInterval Dyadic) → Bool} {Q : (Fin n → ℝ) → Prop} (hP : ∀ (X : Fin n → NonemptyInterval Dyadic), P X = true → ∀ x ∈ IntervalArith.box fun (i : Fin n) => toReal (X i), Q x) {d : ℕ} {X : Fin n → NonemptyInterval Dyadic} (h : allPieces P d X = true) (x : Fin n → ℝ) :
                  (x ∈ IntervalArith.box fun (i : Fin n) => toReal (X i)) → Q x

                  Soundness of the bisection test: if P X implies a property Q at every point of the box X, for every box X, and the bisection test allPieces P d X succeeds, then Q holds at every point of the box X.

                  def ConvexAnalysis.DyadicInterval.ratBox {n : ℕ} (prec : ℕ) (lo hi : Fin n → ℚ) :

                  The box of dyadic intervals [⌊lo i⌋, ⌈hi i⌉] containing the rational box [lo, hi] (ConvexAnalysis.DyadicInterval.ofRat).

                  Equations
                  Instances For
                    theorem ConvexAnalysis.DyadicInterval.mem_box_ratBox {n : ℕ} {x : Fin n → ℝ} {prec : ℕ} {lo hi : Fin n → ℚ} (hx : x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) :
                    x ∈ IntervalArith.box fun (i : Fin n) => toReal (ratBox prec lo hi i)

                    The rational box [lo, hi] lies in the box ConvexAnalysis.DyadicInterval.ratBox.

                    Enclosures on a box: the natural extension and the mean value form #

                    The mean value form of e on the box X of dyadic intervals, computed in dyadic interval arithmetic at the precision 2⁻ᵖʳᵉᶜ: F(c) + ∑ i, Gᵢ (Xᵢ - cᵢ), where c is the center of X (the split points), F(c) the dyadic evaluation of e at c and Gᵢ the dyadic evaluation of the symbolic partial derivative ConvexAnalysis.RatArithExpr.pderiv i e on X. It is none if one of these evaluations fails or the result is unbounded.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      The computed mean value form encloses the range (Neumaier, Theorem 2.3.3, with derivative enclosures by interval differentiation and all operations rounded outward): if ConvexAnalysis.RatArithExpr.meanValueEval prec e X = some D, the value of e at every point of the box X lies in D. This is ConvexAnalysis.ArithExpr.mem_meanValueForm_pderiv with the computed enclosures.

                      def ConvexAnalysis.RatArithExpr.boxTest {n : ℕ} (prec : ℕ) (e : RatArithExpr (Fin n)) (ok : Dyadic → Dyadic → Bool) (mvfWidth : ℚ) (X : Fin n → NonemptyInterval Dyadic) :

                      The box test boxTest prec e ok mvfWidth X: the predicate ok a b holds for the endpoints [a, b] of the dyadic natural interval extension ConvexAnalysis.RatArithExpr.dyadicEval of e on X, or, if not and every side of X has width at most mvfWidth, for those of the mean value form ConvexAnalysis.RatArithExpr.meanValueEval.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem ConvexAnalysis.RatArithExpr.forall_of_boxTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {X : Fin n → NonemptyInterval Dyadic} {x : Fin n → ℝ} {mvfWidth : ℚ} {ok : Dyadic → Dyadic → Bool} {Q : ℝ → Prop} (hok : ∀ (a b : Dyadic), ok a b = true → ∀ (y : ℝ), Inclusion.IntervalDyadicReal.Dyadic.toReal a ≤ y → y ≤ Inclusion.IntervalDyadicReal.Dyadic.toReal b → Q y) (h : boxTest prec e ok mvfWidth X = true) (hx : x ∈ IntervalArith.box fun (i : Fin n) => DyadicInterval.toReal (X i)) :

                        Soundness of the box test: if ok a b implies a property Q of all reals in [a, b] and the box test succeeds on X, then Q (e x) holds at every point x of the box X.

                        Bound tests and the exclusion test #

                        def ConvexAnalysis.RatArithExpr.boundTest {n : ℕ} (prec : ℕ) (e : RatArithExpr (Fin n)) (ok : Dyadic → Dyadic → Bool) (lo hi : Fin n → ℚ) (depth : ℕ) (mvfWidth : ℚ) :

                        The bound test with the predicate ok on the rational box [lo, hi]: the bisection test ConvexAnalysis.DyadicInterval.allPieces with the box test ConvexAnalysis.RatArithExpr.boxTest, of depth depth, on the dyadic box ConvexAnalysis.DyadicInterval.ratBox prec lo hi.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem ConvexAnalysis.RatArithExpr.forall_of_boundTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {ok : Dyadic → Dyadic → Bool} {Q : ℝ → Prop} {lo hi : Fin n → ℚ} {depth : ℕ} {mvfWidth : ℚ} (hok : ∀ (a b : Dyadic), ok a b = true → ∀ (y : ℝ), Inclusion.IntervalDyadicReal.Dyadic.toReal a ≤ y → y ≤ Inclusion.IntervalDyadicReal.Dyadic.toReal b → Q y) (h : boundTest prec e ok lo hi depth mvfWidth = true) (x : Fin n → ℝ) :
                          (x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) → Q (ArithExpr.eval x e.toArithExpr)

                          Soundness of the bound test: if ok a b implies Q on [a, b] and the bound test succeeds, then Q (e x) holds for every x in the box [lo, hi].

                          def ConvexAnalysis.RatArithExpr.lowerBoundTest {n : ℕ} (prec : ℕ) (e : RatArithExpr (Fin n)) (lo hi : Fin n → ℚ) (c : ℚ) (depth : ℕ) (mvfWidth : ℚ) :

                          The lower bound test for c ≤ e(x) on the box [lo, hi], by bisection of depth at most depth (ConvexAnalysis.RatArithExpr.le_eval_of_lowerBoundTest).

                          Equations
                          Instances For
                            def ConvexAnalysis.RatArithExpr.strictLowerBoundTest {n : ℕ} (prec : ℕ) (e : RatArithExpr (Fin n)) (lo hi : Fin n → ℚ) (c : ℚ) (depth : ℕ) (mvfWidth : ℚ) :

                            The strict lower bound test for c < e(x) on the box [lo, hi] (ConvexAnalysis.RatArithExpr.lt_eval_of_strictLowerBoundTest).

                            Equations
                            Instances For
                              def ConvexAnalysis.RatArithExpr.upperBoundTest {n : ℕ} (prec : ℕ) (e : RatArithExpr (Fin n)) (lo hi : Fin n → ℚ) (c : ℚ) (depth : ℕ) (mvfWidth : ℚ) :

                              The upper bound test for e(x) ≤ c on the box [lo, hi] (ConvexAnalysis.RatArithExpr.eval_le_of_upperBoundTest).

                              Equations
                              Instances For
                                def ConvexAnalysis.RatArithExpr.strictUpperBoundTest {n : ℕ} (prec : ℕ) (e : RatArithExpr (Fin n)) (lo hi : Fin n → ℚ) (c : ℚ) (depth : ℕ) (mvfWidth : ℚ) :

                                The strict upper bound test for e(x) < c on the box [lo, hi] (ConvexAnalysis.RatArithExpr.eval_lt_of_strictUpperBoundTest).

                                Equations
                                Instances For
                                  theorem ConvexAnalysis.RatArithExpr.le_eval_of_lowerBoundTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {lo hi : Fin n → ℚ} {c : ℚ} {depth : ℕ} {mvfWidth : ℚ} (h : lowerBoundTest prec e lo hi c depth mvfWidth = true) (x : Fin n → ℝ) :
                                  (x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) → ↑c ≤ ArithExpr.eval x e.toArithExpr

                                  A verified lower bound: if the lower bound test ConvexAnalysis.RatArithExpr.lowerBoundTest succeeds, then c ≤ e(x) for every x in the box [lo, hi].

                                  theorem ConvexAnalysis.RatArithExpr.lt_eval_of_strictLowerBoundTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {lo hi : Fin n → ℚ} {c : ℚ} {depth : ℕ} {mvfWidth : ℚ} (h : strictLowerBoundTest prec e lo hi c depth mvfWidth = true) (x : Fin n → ℝ) :
                                  (x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) → ↑c < ArithExpr.eval x e.toArithExpr

                                  A verified strict lower bound: if the test ConvexAnalysis.RatArithExpr.strictLowerBoundTest succeeds, then c < e(x) for every x in the box [lo, hi].

                                  theorem ConvexAnalysis.RatArithExpr.eval_le_of_upperBoundTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {lo hi : Fin n → ℚ} {c : ℚ} {depth : ℕ} {mvfWidth : ℚ} (h : upperBoundTest prec e lo hi c depth mvfWidth = true) (x : Fin n → ℝ) :
                                  (x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) → ArithExpr.eval x e.toArithExpr ≤ ↑c

                                  A verified upper bound: if the upper bound test ConvexAnalysis.RatArithExpr.upperBoundTest succeeds, then e(x) ≤ c for every x in the box [lo, hi].

                                  theorem ConvexAnalysis.RatArithExpr.eval_lt_of_strictUpperBoundTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {lo hi : Fin n → ℚ} {c : ℚ} {depth : ℕ} {mvfWidth : ℚ} (h : strictUpperBoundTest prec e lo hi c depth mvfWidth = true) (x : Fin n → ℝ) :
                                  (x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) → ArithExpr.eval x e.toArithExpr < ↑c

                                  A verified strict upper bound: if the test ConvexAnalysis.RatArithExpr.strictUpperBoundTest succeeds, then e(x) < c for every x in the box [lo, hi].

                                  def ConvexAnalysis.RatArithExpr.exclusionTest {n m : ℕ} (prec : ℕ) (F : Fin m → RatArithExpr (Fin n)) (lo hi : Fin n → ℚ) (depth : ℕ) (mvfWidth : ℚ) :

                                  The exclusion test for the system F : Fin m → RatArithExpr (Fin n) on the box [lo, hi]: the bisection test of depth depth in which a piece passes if the enclosure of some component F k (the natural interval extension, or the mean value form on pieces of width at most mvfWidth, ConvexAnalysis.RatArithExpr.boxTest) does not contain 0 (ConvexAnalysis.RatArithExpr.forall_exists_ne_zero_of_exclusionTest).

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem ConvexAnalysis.RatArithExpr.forall_exists_ne_zero_of_exclusionTest {n prec : ℕ} {lo hi : Fin n → ℚ} {depth : ℕ} {mvfWidth : ℚ} {m : ℕ} {F : Fin m → RatArithExpr (Fin n)} (h : exclusionTest prec F lo hi depth mvfWidth = true) (x : Fin n → ℝ) :
                                    (x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) → ∃ (k : Fin m), ArithExpr.eval x (F k).toArithExpr ≠ 0

                                    A verified exclusion of zeros: if the exclusion test ConvexAnalysis.RatArithExpr.exclusionTest succeeds, the system (F k).toArithExpr.eval x = 0 has no solution x in the box [lo, hi]: at every point some equation fails.

                                    Verified global minima #

                                    def ConvexAnalysis.RatArithExpr.minimumTest {n : ℕ} (prec : ℕ) (e : RatArithExpr (Fin n)) (lo hi p : Fin n → ℚ) (L U : ℚ) (depth : ℕ) (mvfWidth : ℚ) :

                                    The global minimum test for e on the box [lo, hi] with a rational point p, the bounds L and U and the depth depth: p lies in the box, the natural interval extension of e is defined on the box, the dyadic evaluation of e at p is at most U, and the lower bound test for L succeeds (ConvexAnalysis.RatArithExpr.exists_isMinOn_of_minimumTest). The condition on the natural extension gives the continuity of e on the box; it can fail for a continuous e whose natural extension on the whole box overestimates too much, for example (x² - x + 1)⁻¹ on [0, 1], where the extension of the denominator is [0, 2].

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem ConvexAnalysis.RatArithExpr.exists_isMinOn_of_minimumTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {lo hi : Fin n → ℚ} {depth : ℕ} {mvfWidth : ℚ} {p : Fin n → ℚ} {L U : ℚ} (h : minimumTest prec e lo hi p L U depth mvfWidth = true) :
                                      ∃ x ∈ Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i), IsMinOn (fun (x : Fin n → ℝ) => ArithExpr.eval x e.toArithExpr) (Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) x ∧ ArithExpr.eval x e.toArithExpr ∈ Set.Icc ↑L ↑U

                                      A verified global minimum: if the minimum test ConvexAnalysis.RatArithExpr.minimumTest succeeds, then e attains its minimum on the box [lo, hi], and the minimum value lies in [L, U]. The upper bound comes from the point p (e(p) ≤ U), the lower bound from the lower bound test (ConvexAnalysis.RatArithExpr.le_eval_of_lowerBoundTest); the minimum is attained since e is continuous on the box, where its natural interval extension is defined (ConvexAnalysis.ArithExpr.continuousOn_eval).

                                      theorem ConvexAnalysis.RatArithExpr.sInf_mem_Icc_of_minimumTest {n prec : ℕ} {e : RatArithExpr (Fin n)} {lo hi : Fin n → ℚ} {depth : ℕ} {mvfWidth : ℚ} {p : Fin n → ℚ} {L U : ℚ} (h : minimumTest prec e lo hi p L U depth mvfWidth = true) :
                                      sInf ((fun (x : Fin n → ℝ) => ArithExpr.eval x e.toArithExpr) '' Set.Icc (fun (i : Fin n) => ↑(lo i)) fun (i : Fin n) => ↑(hi i)) ∈ Set.Icc ↑L ↑U

                                      A verified enclosure of the infimum: if the minimum test ConvexAnalysis.RatArithExpr.minimumTest succeeds, the infimum of e on the box [lo, hi] lies in [L, U] (and is a minimum, ConvexAnalysis.RatArithExpr.exists_isMinOn_of_minimumTest).