Documentation

HexRoots.SoftPellet

The existing rational lower bound 181/128 < √2, duplicated here under a kernel-specific name so this module remains below Pellet in the import graph.

Equations
Instances For

    The existing rational upper bound √2 < 1449/1024.

    Equations
    Instances For
      structure Hex.CoeffBall :

      A Gaussian dyadic centre with an error radius. The computational constructors below always produce a nonnegative radius; keeping that fact out of the structure leaves proof fields out of the hot path.

      • center : GaussDyadic

        Rounded Gaussian-dyadic centre of the enclosure.

      • radius : Dyadic

        Nonnegative error radius around center.

      Instances For
        def Hex.instDecidableEqCoeffBall.decEq (x✝ x✝¹ : CoeffBall) :
        Decidable (x✝ = x✝¹)
        Equations
        Instances For

          The exact zero coefficient ball.

          Equations
          Instances For

            |re z| + |im z|, an executable upper bound for the complex modulus.

            Equations
            Instances For
              def Hex.CoeffBall.sigPrec (bits : Nat) (x : Dyadic) :

              Signed endpoint precision retaining roughly bits significant binary digits.

              Equations
              Instances For

                Round a nonnegative error bound upward while retaining about bits significant binary digits.

                Equations
                Instances For

                  Round a Gaussian centre and add the exact displacement to an existing error bound.

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

                    A rounded ball enclosing one exact Gaussian dyadic.

                    Equations
                    Instances For

                      Outward-rounded sum.

                      Equations
                      Instances For

                        Outward-rounded difference.

                        Equations
                        Instances For

                          Outward-rounded product. The error formula is the standard -submultiplicative bound |cx|₁·ey + |cy|₁·ex + ex·ey.

                          Equations
                          Instances For

                            Lower modulus bound: max(|re c|, |im c|) - error, clamped at zero.

                            Equations
                            Instances For

                              Upper modulus bound from the centre's norm plus the error radius.

                              Equations
                              Instances For

                                One step of the soft Taylor coefficient fold.

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

                                  State after n terms of one soft Taylor coefficient.

                                  Equations
                                  Instances For
                                    def Hex.softTaylorCoeff (p : ZPoly) (c : GaussDyadic) (h : Dyadic) (bits k : Nat) :

                                    One bounded-precision coefficient of p(c + hX). The Taylor sum carries the next power of c in its fold, so all coefficients together cost O(n²) ball operations rather than recomputing powers.

                                    Equations
                                    Instances For

                                      Coefficient balls for the locally scaled Taylor polynomial p(s.center + 2^(−s.prec) X).

                                      Equations
                                      Instances For

                                        Rounded balls made from a supplied exact Taylor coefficient array.

                                        Equations
                                        Instances For

                                          Rounded balls made from a freshly computed exact Taylor shift. This compatibility wrapper is used by proof-facing and standalone callers; cached certification paths pass their existing coefficients to seededTaylorBalls.

                                          Equations
                                          Instances For
                                            def Hex.graeffeEven (bits : Nat) (cs : Array CoeffBall) (k : Nat) :

                                            Even-even convolution contributing coefficient k of one Graeffe step.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def Hex.graeffeOdd (bits : Nat) (cs : Array CoeffBall) (k : Nat) :

                                              Odd-odd convolution contributing the shifted coefficient k+1 of one Graeffe step.

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

                                                One outward-rounded Graeffe step. The output retains the input array size; out-of-range convolution terms are exact zero balls.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  @[simp]
                                                  theorem Hex.graeffe_size (bits : Nat) (cs : Array CoeffBall) :
                                                  (graeffe bits cs).size = cs.size

                                                  A Graeffe step preserves the number of stored coefficients.

                                                  def Hex.softPelletAt (cs : Array CoeffBall) (k : Nat) (rlo rhi : Dyadic) :

                                                  One Pellet comparison on coefficient balls. The lower bound of the selected coefficient is compared with upper bounds for every other coefficient.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    def Hex.graeffeRounds (degree : Nat) :

                                                    BSSY's number of Graeffe rounds. The nested logarithm is tiny (at most nine rounds through degree 255), while the added five rounds give their fixed isolation-ratio constants.

                                                    Equations
                                                    Instances For
                                                      structure Hex.SoftRadii :

                                                      The three radius intervals transported together through Graeffe iteration. All six endpoints are stored explicitly because every radius, not merely the base radius, must be squared after roots are squared.

                                                      • baseLo : Dyadic

                                                        Lower endpoint for the base-radius interval.

                                                      • baseHi : Dyadic

                                                        Upper endpoint for the base-radius interval.

                                                      • twoLo : Dyadic

                                                        Lower endpoint for the doubled-radius interval.

                                                      • twoHi : Dyadic

                                                        Upper endpoint for the doubled-radius interval.

                                                      • fourLo : Dyadic

                                                        Lower endpoint for the quadrupled-radius interval.

                                                      • fourHi : Dyadic

                                                        Upper endpoint for the quadrupled-radius interval.

                                                      Instances For
                                                        def Hex.instDecidableEqSoftRadii.decEq (x✝ x✝¹ : SoftRadii) :
                                                        Decidable (x✝ = x✝¹)
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For

                                                          Initial local-coordinate bounds for √2, 2√2, and 4√2.

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

                                                            Transport all three radius intervals through one root-squaring step.

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

                                                              Check the three transported Pellet radii at this Graeffe level.

                                                              Equations
                                                              Instances For

                                                                Try the initial locally scaled Taylor polynomial and every Graeffe level through rounds. Squaring the radius bounds in lockstep matches the root squaring transformation.

                                                                Equations
                                                                Instances For
                                                                  def Hex.softWitnessAt (p : ZPoly) (s : DyadicSquare) (k bits : Nat) :

                                                                  One working-precision attempt at the three-radius soft Graeffe witness.

                                                                  Equations
                                                                  Instances For
                                                                    def Hex.softSeededWitness (p : ZPoly) (s : DyadicSquare) (k bits : Nat) :

                                                                    Three-radius Graeffe witness seeded from one exact Taylor shift. This is the tighter and cheaper shallow-centre variant.

                                                                    Equations
                                                                    Instances For

                                                                      Three-radius exact-seeded witness reusing an existing Taylor shift.

                                                                      Equations
                                                                      Instances For
                                                                        theorem Hex.TaylorShift.softSeededWitness_eq {p : ZPoly} (s : DyadicSquare) (shift : TaylorShift p s.center) (k bits : Nat) :
                                                                        softSeededWitness s shift k bits = Hex.softSeededWitness p s k bits

                                                                        A valid cached shift gives the standalone exact-seeded witness.

                                                                        Working precisions tried by the soft filter. Failure at all tiers is not negative evidence: callers retain the exact Pellet fallback.

                                                                        Equations
                                                                        Instances For

                                                                          Adaptive soft Graeffe witness reusing an existing exact shift on the shallow seeded route.

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

                                                                            Adaptive soft Graeffe witness. Standalone callers compute the shallow exact seed once; cached certifiers use TaylorShift.softWitnessCheck.

                                                                            Equations
                                                                            Instances For

                                                                              No soft root-count witness can select a coefficient outside the polynomial's coefficient array.

                                                                              Any valid cached shift gives the same adaptive soft witness as the public standalone wrapper.

                                                                              First positive root count whose three-radius comparison succeeds at one Graeffe level.

                                                                              Equations
                                                                              Instances For

                                                                                Scan all candidate counts at each Graeffe level before transforming the coefficient array once.

                                                                                Equations
                                                                                Instances For
                                                                                  def Hex.softCandidateAt? (p : ZPoly) (s : DyadicSquare) (ks : List Nat) (bits : Nat) :

                                                                                  One working-precision all-count candidate search.

                                                                                  Equations
                                                                                  Instances For
                                                                                    def Hex.softSeededCandidate? (p : ZPoly) (s : DyadicSquare) (ks : List Nat) (bits : Nat) :

                                                                                    One-precision all-count candidate search seeded from an exact Taylor shift.

                                                                                    Equations
                                                                                    Instances For

                                                                                      One-precision all-count candidate search reusing an existing exact Taylor shift for its coefficient balls.

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

                                                                                        Try an all-count candidate search at each working precision.

                                                                                        Equations
                                                                                        Instances For

                                                                                          Adaptive all-count soft Graeffe search.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Certification search tuned for subdivision and reusing its cached exact shift: one seeded 64-bit pass while exact centres are still cheap, then the fully soft ladder once centre bit-length reaches 32.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Standalone refinement candidate search. Cached certifiers call the TaylorShift method directly.

                                                                                              Equations
                                                                                              Instances For

                                                                                                A valid cached shift gives the public standalone candidate result.

                                                                                                First candidate count at one base radius. Unlike firstSoftCandidate?, this includes k = 0, so callers can distinguish a certified discard from a certified positive root count.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  def Hex.softRootCountLoop (bits : Nat) (ks : List Nat) :

                                                                                                  Search all requested root counts at the base radius, reusing each Graeffe transform for the whole list.

                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    def Hex.softSeededRootCount? (p : ZPoly) (s : DyadicSquare) (ks : List Nat) (bits : Nat) :

                                                                                                    Base-radius all-count filter seeded by one exact Taylor shift.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      theorem Hex.firstSoftCandidate?_sound {cs : Array CoeffBall} {rs : SoftRadii} {ks : List Nat} {k : Nat} (h : firstSoftCandidate? cs rs ks = some k) :
                                                                                                      0 < k softPelletThree cs k rs = true

                                                                                                      A returned first-level candidate is positive and passes its comparison.

                                                                                                      theorem Hex.softCandidateLoop_sound {bits : Nat} {ks : List Nat} {rounds : Nat} {cs : Array CoeffBall} {rs : SoftRadii} {k : Nat} (h : softCandidateLoop bits ks rounds cs rs = some k) :
                                                                                                      0 < k softGraeffeLoop bits k rounds cs rs = true

                                                                                                      An all-count loop result is also a successful per-count loop result.

                                                                                                      theorem Hex.softCandidateAt?_sound {p : ZPoly} {s : DyadicSquare} {ks : List Nat} {bits k : Nat} (h : softCandidateAt? p s ks bits = some k) :
                                                                                                      0 < k softWitnessAt p s k bits = true

                                                                                                      One-precision candidate search implies the ordinary witness check at that precision.

                                                                                                      theorem Hex.softSeededCandidate?_sound {p : ZPoly} {s : DyadicSquare} {ks : List Nat} {bits k : Nat} (h : softSeededCandidate? p s ks bits = some k) :
                                                                                                      0 < k softSeededWitness p s k bits = true

                                                                                                      An exact-seeded candidate is accepted by its exact-seeded per-count witness.

                                                                                                      theorem Hex.softCandidate?_sound {p : ZPoly} {s : DyadicSquare} {ks : List Nat} {k : Nat} (h : softCandidate? p s ks = some k) :

                                                                                                      The adaptive all-count search returns only a positive count accepted by the public per-count soft witness.

                                                                                                      The depth-aware candidate search still returns an ordinary public soft witness.

                                                                                                      Base-radius T₀ comparison at the initial level and every Graeffe level. Unlike the three-radius atom witness, exclusion needs only the square's circumscribed disc.

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        def Hex.softRootFreeAt (p : ZPoly) (s : DyadicSquare) (bits : Nat) :

                                                                                                        Soft single-radius Graeffe T₀ filter for subdivision.

                                                                                                        Equations
                                                                                                        Instances For

                                                                                                          Adaptive soft T₀ discard.

                                                                                                          Equations
                                                                                                          Instances For