Documentation

HexRoots.Kantorovich

Floor of 1/x at precision q, for positive x: with x = n·2^{−k} (n odd positive), 1/x = 2^k/n, so the floor on the 2^{−q} grid is ⌊2^{q+k}/n⌋·2^{−q}, one integer division. This agrees with Dyadic.invAtPrec on positive arguments (both floor 1/x to the 2^{−q} grid, so 0 ≤ 1/x − result < 2^{−q}), but it kernel-reduces: invAtPrec routes through Rat normalisation, whose Nat.gcd well-founded recursion decide cannot unfold. Junk 0 on x ≤ 0 (and on q + k < 0, where the floor is 0 anyway since n ≥ 1).

Equations
Instances For
    theorem Hex.Dyadic.invFloor_eq_invAtPrec_of_pos {x : Dyadic} (hx : 0 < x) (q : Int) :

    On positive inputs, the kernel-reducible reciprocal used by nkWitnessCheck agrees with the standard dyadic reciprocal.

    The Newton-Kantorovich contraction check from an already-computed Taylor shift on the closed square s itself (sup norm), with r = 2^{−s.prec} the half-width. Requiring 2 ≤ cs.size with 0 < normSq c₁, it builds the exact reciprocal w = conj(c₁)·invFloor (normSq c₁) q (pinned precision q = 8 + max 0 (ceilLog2 (normSq c₁))), the residuals dₖ = w·cₖ, and the exact dyadic bounds y = lo(d₀), z₁ = hi(1 − d₁), and the radial Lipschitz bound z₂ = 2·Σ_{k=2}^{n} k·hi(dₖ)·ρ^{k−2} with ρ = s.radiusHi. It then returns the conjunction of the three strict exact-dyadic comparisons 0 < normSq c₁, y + z₁·r + z₂·r²/2 < r, and z₁ + z₂·r < 1.

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

      The Newton-Kantorovich contraction check on the closed square s itself, using the exact Taylor shift of p at s.center.

      Equations
      Instances For

        A Newton--Kantorovich witness needs the linear Taylor coefficient.

        @[simp]

        The centre-indexed coefficient kernel is exactly the public polynomial Newton–Kantorovich check.

        Newton-Kantorovich contraction witness on the closed square s itself (sup norm), with r = 2^{−s.prec} the half-width and y, z₁, z₂ the exact dyadic bounds:

        0 < normSq c₁ ∧ y + z₁·r + z₂·r²/2 < r ∧ z₁ + z₂·r < 1.

        Implies (Mathlib companion): p has exactly one root in the closed square, it is simple, and it lies in the open square.

        Equations
        Instances For

          An atom certificate: either certificate form for "exactly one simple root in the certified region". The two disjuncts certify different regions (the closed square for nkWitness, the circumscribed disc for the Pellet form); every consumer needs only the shared consequence that the root lies in the stored square's circumscribed disc.

          Equations
          Instances For

            Primitive positive-leading polynomial whose roots are the negatives of the roots of p. Primitive-part normalization precedes the exact X ↦ -X reflection so primitive inputs reduce directly to a parity sign change.

            Equations
            Instances For

              On primitive input, root negation is just reflection followed by one leading-sign normalization.

              @[simp]

              Root negation preserves coefficient count on primitive input.

              Reflect a square through the origin.

              Equations
              Instances For

                Structural evidence that an atom is certified. Checker-produced atoms retain their original NK/Pellet form; exact reflection transports an existing certificate without re-running either checker.

                Instances For

                  Package either checker result as structural atom evidence.

                  Equations
                  Instances For

                    Whether the certificate selects the closed square (NK) rather than the circumscribed disc (Pellet). Reflection preserves this region choice.

                    Equations
                    Instances For

                      Which atom certificates certify? attempts, and in which order. nkThenPellet is the default; the singleton strategies exist for the side-by-side comparison of the two atom forms.

                      Instances For
                        @[instance_reducible]
                        Equations
                        Equations
                        Instances For

                          An atom: one square whose certified region (the square itself for the Newton-Kantorovich disjunct, the circumscribed disc for the Pellet disjunct) contains exactly one simple root.

                          Instances For
                            inductive Hex.Certified (p : ZPoly) :

                            The result of certifying one component: an atom (either atom certificate) or a k ≥ 1 Pellet cluster.

                            Instances For

                              Repackage a certified k = 1 cluster as an atom, taking the Pellet disjunct of atomWitness on the enclosing square. Total: the cluster's Pellet witness already certifies exactly one root in the enclosing disc.

                              Equations
                              Instances For

                                Certify an arbitrary candidate square as an atom, deciding both atomWitness disjuncts fresh. This is the documented way to build a DyadicRootIsolation outside the drivers, e.g. after transforming an isolation's square (hex-number-field's inv? re-certification).

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