Documentation

HexRoots.Pellet

lo(c) = max(|Re c|, |Im c|): lo(c) ≤ |c| ≤ √2·lo(c).

Equations
Instances For

    hi(c) = |Re c| + |Im c|: |c| ≤ hi(c) ≤ √2·|c|.

    Equations
    Instances For

      181/128 < √2.

      Equations
      Instances For

        √2 < 1449/1024.

        Equations
        Instances For

          (181/128)² < 2, the defining inequality of sqrt2Lo (it reduces to 32761/16384 < 2).

          2 < (1449/1024)², the defining inequality of sqrt2Hi (it reduces to 2 < 2099601/1048576).

          Dyadic lower bound sqrt2Lo·2^{−prec} for the square's circumscribed radius 2^{−prec}·√2.

          Equations
          Instances For

            Dyadic upper bound sqrt2Hi·2^{−prec} for the square's circumscribed radius 2^{−prec}·√2.

            Equations
            Instances For
              def Hex.pelletAt (cs : Array GaussDyadic) (k : Nat) (rlo rhi : Dyadic) :

              One Pellet inequality: lo(cs[k])·rlo^k > Σ_{i ≠ k} hi(cs[i])·rhi^i (strict), with cs the exact Taylor coefficients. The right side is a single fold over cs carrying the running power rhi^i, skipping the i = k term. Returns false when k ≥ cs.size (no such coefficient).

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

                Three-radius strong Pellet check from an already-computed Taylor shift. Keeping this coefficient-level kernel separate lets a certifier test every candidate root count at one centre without repeating the quadratic Taylor shift.

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

                  At shallow centre precision, try the cached exact Taylor check first; this preserves its small constant on easy canonical inputs. At deep precision, try soft Graeffe first so successful witnesses avoid evaluating the increasingly large exact coefficients.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Hex.witnessCheck (p : ZPoly) (s : DyadicSquare) (k : Nat) :

                    Three-radius strong Pellet check for k roots (with multiplicity) in the circumscribed disc of s. It accepts either the exact Taylor comparison at the base, doubled, and quadrupled radii, or an outward-rounded comparison after transporting the polynomial and all three radii through Graeffe root-squaring. Both routes imply BSSY's three-radius root-count condition.

                    Equations
                    Instances For
                      @[simp]

                      The centre-indexed combined kernel is exactly the public polynomial witness check.

                      A root-count witness cannot select a coefficient outside the polynomial.

                      theorem Hex.TaylorShift.witnessCheck_implies {p : ZPoly} (s : DyadicSquare) (shift : TaylorShift p s.center) (k : Nat) (h : witnessCheck s shift k = true) :

                      A successful exact centre-indexed check implies the public disjunctive witness check.

                      def Hex.witness (p : ZPoly) (s : DyadicSquare) (k : Nat) :

                      Strong Pellet witness accepted by the exact or outward-rounded Graeffe route. Implies (Mathlib companion): p has exactly k roots, with multiplicity, in the circumscribed disc of s and in its doubled and quadrupled concentric discs, with no roots on their boundaries.

                      Equations
                      Instances For

                        Exact single-radius T_0 exclusion: the circumscribed disc of s certifiably contains no root of p, i.e. lo(c₀) > Σ_{i ≥ 1} hi(c_i)·ρhi^i (the rlo^0 = 1 power makes the base radius bound rlo unused). This fires more often than the three-radius witness _ _ 0; discarding a square during refinement needs certification while keeping one is always sound, so refinement uses this.

                        Equations
                        Instances For

                          Graeffe T₀ discard with exact fallback. Shallow centres seed the coefficient balls from one exact Taylor shift; large centres use the fully soft constructor whose mantissas are independent of centre bit-length.

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

                            Exact exclusion remains a sufficient result for the combined filter.

                            The circumscribed disc of s as a ball, with the dyadic upper-bound radius radiusHi ( the true radius 2^{−prec}·√2).

                            Equations
                            Instances For

                              The exact zero complex ball.

                              Equations
                              Instances For

                                Minkowski sum of two closed dyadic complex balls.

                                Equations
                                Instances For

                                  Product enclosure for two closed dyadic complex balls.

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

                                    Enclose a rational number by a real-centred dyadic complex ball. Exact dyadic rationals receive radius zero; otherwise one ulp encloses the downward rounding error. At nonnegative precision the denominator test avoids materializing and normalizing a large intermediate rational.

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

                                      A ball containing p(z) for every z in the circumscribed disc of s: centred at the exact value p(centre) = c₀, with radius Σ_{i ≥ 1} hi(cᵢ)·radiusHi^i ≥ |p(z) − p(centre)| by the triangle inequality on the Taylor expansion. rootFree is the corollary lo(c₀) > radius (kept separate so the audited pelletAt shape is unchanged).

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

                                        The ball certifiably excludes 0: radius < lo(centre) ≤ |centre|, an exact dyadic comparison. The sound direction for "this value is certainly nonzero"; failing this test means only that 0 could not be excluded.

                                        Equations
                                        Instances For

                                          The closed balls intersect: squared centre distance at most the squared radius sum, all exact dyadics.

                                          Equations
                                          Instances For

                                            The ball meets the circumscribed disc of s (conservative: uses the radiusHi upper bound for the disc radius, so a false certifies disjointness from the true disc as well).

                                            Equations
                                            Instances For

                                              A certified cluster: an edge-connected set of grid squares at a common prec, whose enclosing disc contains exactly k roots with multiplicity. The component squares are the data that refinement operates on; subdividing the enclosing square instead would stall (it can equal the parent square when a root sits on a grid line, even as the component squares themselves shrink). The Pellet certificate, by contrast, is attached to the circumscribed disc of encSquare squares. This is an output type; the refinement worklist holds uncertified Component values.

                                              • The component's grid squares: nonempty, common prec, edge-connected.

                                              • k : Nat

                                                The number of roots, counted with multiplicity, in the enclosing disc.

                                              • k_pos : 0 < self.k

                                                A cluster carries at least one root.

                                              • witness : Hex.witness p (encSquare self.squares) self.k

                                                The strong Pellet certificate on the enclosing square's disc.

                                              Instances For