Documentation

LeanPool.MovingSofa.Development.Geometry.Foundations.Development004

Moving sofa: related mathematical developments #

Moving sofa: related mathematical developments #

Exact rational certificate for the Gerver cap and niche areas #

This module carries the finite, kernel-checkable part of the rational area bounds for Gerver's sofa: integer interval arithmetic at scale M = 10 ^ 30, certified enclosures of the twenty-two direct parameters and of π, interval sine and cosine by the Taylor recurrence, the grid of rotation angles, the five phase formulas, the support-contact fan of the cap and the rectangle cover of the niche.

Everything here is computable and decide +kernel-checkable; the two closed numeric conclusions capOK_true and nicheOK_true are the only facts the analytic layer in MovingSofa.Gerver.Area needs from this module.

Integer interval arithmetic at scale 10 ^ 30 #

The kernel accelerates Int arithmetic but not Rat arithmetic, so the whole finite calculation is carried out on pairs of integers denoting the interval [lo / M, hi / M].

The common denominator of every interval endpoint.

Equations
Instances For

    ⟨lo, hi⟩ denotes the real interval [lo / M, hi / M].

    • lo : ℤ

      The scaled integer lower endpoint.

    • hi : ℤ

      The scaled integer upper endpoint.

    Instances For
      Equations
      Instances For

        Kernel-cheap min on ℤ.

        Equations
        Instances For

          Kernel-cheap max on ℤ.

          Equations
          Instances For

            Outward enclosure of a / b for 0 < b.

            Equations
            Instances For

              The exact interval [0, 0].

              Equations
              Instances For

                Interval addition.

                Equations
                Instances For

                  Interval negation.

                  Equations
                  Instances For

                    Interval subtraction.

                    Equations
                    Instances For

                      Interval multiplication: the extreme endpoint products, rounded outward.

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

                        Division by a positive integer.

                        Equations
                        Instances For

                          Multiplication by an integer.

                          Equations
                          Instances For

                            Real semantics and soundness #

                            z denotes the real interval [z.lo / M, z.hi / M].

                            Equations
                            Instances For

                              The scale is positive.

                              theorem MovingSofa.GerverAreaCert.SI.ediv_le_of_le {p b : ℤ} (hb : 0 < b) {r : ℝ} (h : ↑p ≤ ↑b * r) :
                              ↑(p / b) ≤ r

                              Integer floor division rounds down in the reals.

                              theorem MovingSofa.GerverAreaCert.SI.le_neg_ediv_of_le {p b : ℤ} (hb : 0 < b) {r : ℝ} (h : ↑b * r ≤ ↑p) :
                              r ≤ ↑(-(-p / b))

                              Integer ceiling division rounds up in the reals.

                              theorem MovingSofa.GerverAreaCert.SI.contains_add {x y : SI} {a b : ℝ} (hx : x.Contains a) (hy : y.Contains b) :
                              (x.add y).Contains (a + b)

                              Interval addition is sound.

                              Interval negation is sound.

                              theorem MovingSofa.GerverAreaCert.SI.contains_sub {x y : SI} {a b : ℝ} (hx : x.Contains a) (hy : y.Contains b) :
                              (x.sub y).Contains (a - b)

                              Interval subtraction is sound.

                              theorem MovingSofa.GerverAreaCert.SI.contains_mul {x y : SI} {a b : ℝ} (hx : x.Contains a) (hy : y.Contains b) :
                              (x.mul y).Contains (a * b)

                              Interval multiplication is sound.

                              theorem MovingSofa.GerverAreaCert.SI.contains_divn {x : SI} {a : ℝ} {b : ℤ} (hb : 0 < b) (hx : x.Contains a) :
                              (x.divn b).Contains (a / ↑b)

                              Interval division by a positive integer is sound.

                              theorem MovingSofa.GerverAreaCert.SI.contains_imul {x : SI} {a : ℝ} (k : ℤ) (hx : x.Contains a) :
                              (imul k x).Contains (↑k * a)

                              Interval multiplication by an integer is sound.

                              theorem MovingSofa.GerverAreaCert.SI.contains_ratI {a b : ℤ} (hb : 0 < b) :
                              (ratI a b).Contains (↑a / ↑b)

                              The outward enclosure of a rational is sound.

                              theorem MovingSofa.GerverAreaCert.SI.contains_foldl_range {f : ℕ → SI} {g : ℕ → ℝ} (n : ℕ) (hfg : ∀ i < n, (f i).Contains (g i)) :
                              (List.foldl (fun (acc : SI) (i : ℕ) => acc.add (f i)) zero (List.range n)).Contains (∑ i ∈ Finset.range n, g i)

                              A left fold of exact interval additions over an initial segment encloses the corresponding real sum.

                              theorem MovingSofa.GerverAreaCert.SI.foldl_range_int (f : ℕ → ℤ) (n : ℕ) :
                              List.foldl (fun (acc : ℤ) (i : ℕ) => acc + f i) 0 (List.range n) = ∑ i ∈ Finset.range n, f i

                              A left fold of integer additions over an initial segment is the corresponding sum.

                              Certified enclosures of the twenty-two parameters and of π #

                              Enclosure of the direct parameter k₁₁.

                              Equations
                              Instances For

                                Enclosure of the direct parameter k₁₂.

                                Equations
                                Instances For

                                  Enclosure of the direct parameter k₂₁.

                                  Equations
                                  Instances For

                                    Enclosure of the direct parameter k₂₂.

                                    Equations
                                    Instances For

                                      Enclosure of the direct parameter k₃₁.

                                      Equations
                                      Instances For

                                        Enclosure of the direct parameter k₃₂.

                                        Equations
                                        Instances For

                                          Enclosure of the direct parameter k₄₁.

                                          Equations
                                          Instances For

                                            Enclosure of the direct parameter k₄₂.

                                            Equations
                                            Instances For

                                              Enclosure of the direct parameter k₅₁.

                                              Equations
                                              Instances For

                                                Enclosure of the direct parameter k₅₂.

                                                Equations
                                                Instances For

                                                  Enclosure of the direct parameter a₁.

                                                  Equations
                                                  Instances For

                                                    Enclosure of the direct parameter a₂.

                                                    Equations
                                                    Instances For

                                                      Enclosure of the direct parameter b₁.

                                                      Equations
                                                      Instances For

                                                        Enclosure of the direct parameter b₂.

                                                        Equations
                                                        Instances For

                                                          Enclosure of the direct parameter c₁.

                                                          Equations
                                                          Instances For

                                                            Enclosure of the direct parameter c₂.

                                                            Equations
                                                            Instances For

                                                              Enclosure of the direct parameter d₁.

                                                              Equations
                                                              Instances For

                                                                Enclosure of the direct parameter d₂.

                                                                Equations
                                                                Instances For

                                                                  Enclosure of the direct parameter e₁.

                                                                  Equations
                                                                  Instances For

                                                                    Enclosure of the direct parameter e₂.

                                                                    Equations
                                                                    Instances For

                                                                      Enclosure of the first stage angle φ.

                                                                      Equations
                                                                      Instances For

                                                                        Enclosure of the second stage angle θ.

                                                                        Equations
                                                                        Instances For

                                                                          The integer enclosure of π, from the certified Machin arctangent sums.

                                                                          Equations
                                                                          Instances For

                                                                            The parameter enclosures are the certified box rows #

                                                                            The integer enclosure of π / 2.

                                                                            Sine and cosine by the degree-41/40 Taylor recurrence #

                                                                            trigIter z t n = (Sₙ, Cₙ, ∑_{k ≤ n} Sₖ, ∑_{k ≤ n} Cₖ) where Sₖ and Cₖ enclose the k-th signed sine and cosine Taylor terms and z encloses t ^ 2.

                                                                            Equations
                                                                            Instances For

                                                                              Sine and cosine enclosures of every real number in the argument interval. Valid for arguments in [0, 2].

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

                                                                                Stage endpoints and the uniform grid #

                                                                                Number of subintervals per analytic stage.

                                                                                Equations
                                                                                Instances For

                                                                                  The m-th grid angle, 0 ≤ m ≤ 5 * NN.

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

                                                                                    The analytic branch that the piecewise definitions select at the m-th grid angle.

                                                                                    Equations
                                                                                    Instances For

                                                                                      The five phase formulas and the four contact curves #

                                                                                      def MovingSofa.GerverAreaCert.evalZ (stage : ℕ) (t : SI) (kind : ℕ) :

                                                                                      kind: 0 the path, 1 A, 2 B, 3 C, 4 D.

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

                                                                                        The contact point at grid index m, evaluated on the branch the definitions select.

                                                                                        Equations
                                                                                        Instances For

                                                                                          Cap: the ordered support contacts and their fan shoelace sum #

                                                                                          Number of listed support contacts feeding the fan, excluding the anchor.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Contact kind at fan position i: A for i ≤ 5 * NN, otherwise C.

                                                                                            Equations
                                                                                            Instances For

                                                                                              The i-th fan determinant over the anchor.

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

                                                                                                Twice the signed area of the fan polygon: the shoelace sum of the listed contacts over the anchor.

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

                                                                                                  Niche: the seven roof pieces and their covering rectangles #

                                                                                                  Contact kind traced by roof piece r.

                                                                                                  Equations
                                                                                                  Instances For

                                                                                                    Analytic stage traced by roof piece r.

                                                                                                    Equations
                                                                                                    Instances For

                                                                                                      Whether roof piece r is traversed in increasing time.

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        Grid index of the left end of the j-th subinterval of row r.

                                                                                                        Equations
                                                                                                        Instances For

                                                                                                          Left horizontal bound of the covering rectangle of (r, j).

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

                                                                                                            Right horizontal bound of the covering rectangle of (r, j).

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

                                                                                                              Height bound of the covering rectangle of (r, j): the branch evaluation over the whole subinterval, widened to cover the left endpoint, which sits on the previous branch.

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

                                                                                                                Area of the covering rectangle of (r, j), in units of 1 / M ^ 2.

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

                                                                                                                  Total covering area of row r, in units of 1 / M ^ 2.

                                                                                                                  Equations
                                                                                                                  Instances For

                                                                                                                    Total covering area of the 7 * NN rectangles, in units of 1 / M ^ 2.

                                                                                                                    Equations
                                                                                                                    Instances For

                                                                                                                      The two decidable numeric conclusions #

                                                                                                                      The closed numeric cap check: 2 * 28609 / 10000 ≤ capDoubledZ.lo / M.

                                                                                                                      Instances For

                                                                                                                        The closed numeric niche check: nicheSumZ / M ^ 2 ≤ 3301 / 5000.

                                                                                                                        Instances For

                                                                                                                          The niche check passes, by kernel reduction.

                                                                                                                          The cap check passes, by kernel reduction.

                                                                                                                          Interval enclosures of the sine and cosine at scale M #

                                                                                                                          The certificate evaluates the sine and the cosine by the interval Taylor recurrence GerverAreaCert.trigIter, truncated at degree 41 and 40 and widened by one unit at scale M = 10 ^ 30. trigZ_sound is the soundness statement of that evaluator on [0, 2]: the recurrence encloses the signed Taylor terms and their partial sums (contains_trigIter), the alternating brackets of Real.sin and Real.cos control the truncation error by the first omitted term, and 2 ^ 41 * 10 ^ 30 ≤ 41! and 2 ^ 40 * 10 ^ 30 ≤ 40! justify the one-unit widening.

                                                                                                                          Sine and cosine enclosures #

                                                                                                                          theorem MovingSofa.contains_trigIter {z t : GerverAreaCert.SI} {x : ℝ} (hz : z.Contains (x * x)) (ht : t.Contains x) (n : ℕ) :
                                                                                                                          (GerverAreaCert.trigIter z t n).1.Contains ((-1) ^ n * x ^ (2 * n + 1) / ↑(2 * n + 1).factorial) ∧ (GerverAreaCert.trigIter z t n).2.1.Contains ((-1) ^ n * x ^ (2 * n) / ↑(2 * n).factorial) ∧ (GerverAreaCert.trigIter z t n).2.2.1.Contains (∑ k ∈ Finset.range (n + 1), (-1) ^ k * x ^ (2 * k + 1) / ↑(2 * k + 1).factorial) ∧ (GerverAreaCert.trigIter z t n).2.2.2.Contains (∑ k ∈ Finset.range (n + 1), (-1) ^ k * x ^ (2 * k) / ↑(2 * k).factorial)

                                                                                                                          The integer term recurrence encloses the signed Taylor terms and their partial sums. Pure interval arithmetic: an induction on n using the SI soundness lemmas.

                                                                                                                          theorem MovingSofa.trigZ_sound {t : GerverAreaCert.SI} {x : ℝ} (ht : t.Contains x) (hx0 : 0 ≤ x) (hx2 : x ≤ 2) :

                                                                                                                          Soundness of the executable sine/cosine enclosure on [0, 2].