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
- Hex.softSqrt2Hi = Dyadic.ofIntWithPrec 1449 10
Instances For
A Gaussian dyadic centre with an L¹ 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
L¹error radius aroundcenter.
Instances For
The exact zero coefficient ball.
Instances For
|re z| + |im z|, an executable upper bound for the complex modulus.
Equations
Instances For
Signed endpoint precision retaining roughly bits significant binary
digits.
Equations
- Hex.CoeffBall.sigPrec bits x = ↑bits - Hex.Dyadic.ceilLog2 (Hex.Dyadic.abs x)
Instances For
Round a nonnegative error bound upward while retaining about bits
significant binary digits.
Equations
- Hex.CoeffBall.roundRadius bits x = x.roundUp (Hex.CoeffBall.sigPrec bits x)
Instances For
Round a Gaussian centre and add the exact L¹ 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
- Hex.CoeffBall.point bits z = Hex.CoeffBall.normalize bits z 0
Instances For
Outward-rounded sum.
Equations
- Hex.CoeffBall.add bits x y = Hex.CoeffBall.normalize bits (x.center.add y.center) (x.radius + y.radius)
Instances For
Outward-rounded difference.
Equations
- Hex.CoeffBall.sub bits x y = Hex.CoeffBall.normalize bits (x.center.sub y.center) (x.radius + y.radius)
Instances For
Outward-rounded product. The error formula is the standard
L¹-submultiplicative bound
|cx|₁·ey + |cy|₁·ex + ex·ey.
Equations
- Hex.CoeffBall.mul bits x y = Hex.CoeffBall.normalize bits (x.center.mul y.center) (Hex.CoeffBall.normOne x.center * y.radius + Hex.CoeffBall.normOne y.center * x.radius + x.radius * y.radius)
Instances For
Lower modulus bound: max(|re c|, |im c|) - error, clamped at zero.
Equations
- x.lo = Hex.Dyadic.max 0 (Hex.Dyadic.max (Hex.Dyadic.abs x.center.fst) (Hex.Dyadic.abs x.center.snd) - x.radius)
Instances For
Upper modulus bound from the centre's L¹ norm plus the error radius.
Instances For
State after n terms of one soft Taylor coefficient.
Equations
- Hex.softTaylorState p c bits k n = List.foldl (Hex.softTaylorStep p c bits k) (Hex.CoeffBall.zero, Hex.CoeffBall.point bits (Hex.GaussDyadic.ofInt 1)) (List.range n)
Instances For
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
- Hex.softTaylorCoeff p c h bits k = Hex.CoeffBall.mul bits (Hex.softTaylorState p c bits k (Hex.DensePoly.size p - k)).fst (Hex.CoeffBall.point bits (h ^ k, 0))
Instances For
Coefficient balls for the locally scaled Taylor polynomial
p(s.center + 2^(−s.prec) X).
Equations
- Hex.taylorBalls p s bits = Array.map (fun (k : Nat) => Hex.softTaylorCoeff p s.center (Dyadic.ofIntWithPrec 1 s.prec) bits k) (Array.range (Hex.DensePoly.size p))
Instances For
Rounded balls made from a supplied exact Taylor coefficient array.
Equations
- Hex.seededTaylorBalls cs s bits = Array.map (fun (k : Nat) => Hex.CoeffBall.point bits ((cs.getD k (0, 0)).mul (Dyadic.ofIntWithPrec 1 s.prec ^ k, 0))) (Array.range cs.size)
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
- Hex.exactTaylorBalls p s bits = Hex.seededTaylorBalls (Hex.taylor p s.center) s bits
Instances For
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
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
- Hex.graeffeRounds degree = Hex.ceilLog2 (1 + Hex.ceilLog2 (Nat.max 2 degree)) + 5
Instances For
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
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
- Hex.softPelletThree cs k rs = (Hex.softPelletAt cs k rs.baseLo rs.baseHi && Hex.softPelletAt cs k rs.twoLo rs.twoHi && Hex.softPelletAt cs k rs.fourLo rs.fourHi)
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
- Hex.softGraeffeLoop bits k 0 x✝¹ x✝ = Hex.softPelletThree x✝¹ k x✝
- Hex.softGraeffeLoop bits k rounds.succ x✝¹ x✝ = (Hex.softPelletThree x✝¹ k x✝ || Hex.softGraeffeLoop bits k rounds (Hex.graeffe bits x✝¹) x✝.square)
Instances For
One working-precision attempt at the three-radius soft Graeffe witness.
Equations
- Hex.softWitnessAt p s k bits = Hex.softGraeffeLoop bits k (Hex.graeffeRounds (Hex.DensePoly.natDegree p)) (Hex.taylorBalls p s bits) Hex.SoftRadii.initial
Instances For
Three-radius Graeffe witness seeded from one exact Taylor shift. This is the tighter and cheaper shallow-centre variant.
Equations
- Hex.softSeededWitness p s k bits = Hex.softGraeffeLoop bits k (Hex.graeffeRounds (Hex.DensePoly.natDegree p)) (Hex.exactTaylorBalls p s bits) Hex.SoftRadii.initial
Instances For
Three-radius exact-seeded witness reusing an existing Taylor shift.
Equations
- Hex.TaylorShift.softSeededWitness s shift k bits = Hex.softGraeffeLoop bits k (Hex.graeffeRounds (Hex.DensePoly.natDegree p)) (Hex.seededTaylorBalls shift.coeffs s bits) Hex.SoftRadii.initial
Instances For
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.
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
- Hex.firstSoftCandidate? cs rs [] = none
- Hex.firstSoftCandidate? cs rs (k :: ks) = if (decide (0 < k) && Hex.softPelletThree cs k rs) = true then some k else Hex.firstSoftCandidate? cs rs ks
Instances For
Scan all candidate counts at each Graeffe level before transforming the coefficient array once.
Equations
- One or more equations did not get rendered due to their size.
- Hex.softCandidateLoop bits ks 0 x✝¹ x✝ = Hex.firstSoftCandidate? x✝¹ x✝ ks
Instances For
One working-precision all-count candidate search.
Equations
- Hex.softCandidateAt? p s ks bits = Hex.softCandidateLoop bits ks (Hex.graeffeRounds (Hex.DensePoly.natDegree p)) (Hex.taylorBalls p s bits) Hex.SoftRadii.initial
Instances For
One-precision all-count candidate search seeded from an exact Taylor shift.
Equations
- Hex.softSeededCandidate? p s ks bits = Hex.softCandidateLoop bits ks (Hex.graeffeRounds (Hex.DensePoly.natDegree p)) (Hex.exactTaylorBalls p s bits) Hex.SoftRadii.initial
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
- Hex.softCandidateAdaptive? p s ks [] = none
- Hex.softCandidateAdaptive? p s ks (k :: ks_1) = (Hex.softCandidateAt? p s ks k).orElse fun (x : Unit) => Hex.softCandidateAdaptive? p s ks ks_1
Instances For
Adaptive all-count soft Graeffe search.
Equations
- Hex.softCandidate? p s ks = Hex.softCandidateAdaptive? p s ks Hex.softPrecisions
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
- Hex.TaylorShift.softRefinementCandidate? s shift ks = if s.prec < 32 then Hex.TaylorShift.softSeededCandidate? s shift ks 64 else Hex.softCandidate? p s ks
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
- Hex.firstSoftRootCount? cs rlo rhi [] = none
- Hex.firstSoftRootCount? cs rlo rhi (k :: ks) = if Hex.softPelletAt cs k rlo rhi = true then some k else Hex.firstSoftRootCount? cs rlo rhi ks
Instances For
Search all requested root counts at the base radius, reusing each Graeffe transform for the whole list.
Equations
- One or more equations did not get rendered due to their size.
- Hex.softRootCountLoop bits ks 0 x✝² x✝¹ x✝ = Hex.firstSoftRootCount? x✝² x✝¹ x✝ ks
Instances For
Base-radius all-count filter seeded by one exact Taylor shift.
Equations
- Hex.softSeededRootCount? p s ks bits = Hex.softRootCountLoop bits ks (Hex.graeffeRounds (Hex.DensePoly.natDegree p)) (Hex.exactTaylorBalls p s bits) Hex.softSqrt2Lo Hex.softSqrt2Hi
Instances For
One-precision candidate search implies the ordinary witness check at that precision.
An exact-seeded candidate is accepted by its exact-seeded per-count witness.
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
- Hex.softRootFreeLoop bits 0 x✝² x✝¹ x✝ = Hex.softPelletAt x✝² 0 x✝¹ x✝
- Hex.softRootFreeLoop bits rounds.succ x✝² x✝¹ x✝ = (Hex.softPelletAt x✝² 0 x✝¹ x✝ || Hex.softRootFreeLoop bits rounds (Hex.graeffe bits x✝²) (x✝¹ * x✝¹) (x✝ * x✝))
Instances For
Soft single-radius Graeffe T₀ filter for subdivision.
Equations
- Hex.softRootFreeAt p s bits = Hex.softRootFreeLoop bits (Hex.graeffeRounds (Hex.DensePoly.natDegree p)) (Hex.taylorBalls p s bits) Hex.softSqrt2Lo Hex.softSqrt2Hi
Instances For
Adaptive soft T₀ discard.
Equations
- Hex.softRootFree p s = Hex.softPrecisions.any fun (bits : Nat) => Hex.softRootFreeAt p s bits