The larger of two dyadic numbers.
Instances For
The smaller of two dyadic numbers.
Instances For
For x > 0: smallest t : Int with x ≤ 2^t; junk 0 for x ≤ 0.
For x = n·2^{−k} with odd n > 0: ceilLog2 n − k.
Equations
- Hex.Dyadic.ceilLog2 Dyadic.zero = 0
- Hex.Dyadic.ceilLog2 (Dyadic.ofOdd n k hn) = if n < 0 then 0 else ↑(Hex.ceilLog2 n.toNat) - k
Instances For
A Gaussian dyadic number re + im·i, represented as the pair
(re, im).
Equations
Instances For
The Gaussian dyadic i + 0·i for an integer i.
Equations
Instances For
Sum of two Gaussian dyadics, (a+bi) + (c+di) = (a+c) + (b+d)i.
Instances For
Difference of two Gaussian dyadics, (a+bi) − (c+di) = (a−c) + (b−d)i.
Instances For
Complex conjugate a − b·i of a + b·i.
Instances For
The squared distance |z − w|² between two Gaussian dyadics, an
exact dyadic.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Gaussian-dyadic centre re + im·i of the square.
Instances For
The half-width 2^{−prec} of the square, an exact dyadic.
Equations
- s.halfWidth = Dyadic.ofIntWithPrec 1 s.prec
Instances For
The circumscribed discs of s and t intersect (closed discs):
distSq centres ≤ (r_s + r_t)² with r = √2·2^{−prec}, so
(r_s + r_t)² = 2·4^{−p_s} + 2·4^{−p_t} + 4·2^{−p_s−p_t}, all exact dyadics.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The circumscribed disc of s contains the Gaussian-dyadic point z,
including boundary contact. Squaring the radius removes the irrational √2,
so the test is one exact dyadic comparison.
Equations
- s.discContains z = decide (s.center.distSq z ≤ 2 * Dyadic.ofIntWithPrec 1 (2 * s.prec))
Instances For
inner's closed square is contained in outer's closed square:
max |Δre| |Δim| + 2^{−p_i} ≤ 2^{−p_o} (exact dyadics).
Equations
- inner.squareInside outer = decide (Hex.Dyadic.max (Hex.Dyadic.abs (inner.re - outer.re)) (Hex.Dyadic.abs (inner.im - outer.im)) + inner.halfWidth ≤ outer.halfWidth)
Instances For
An uncertified component in the refinement worklist: an
edge-connected set of grid squares at a common prec, plus the root
count of its most recently certified ancestor. candidateK only
selects the order of the speculative Newton step; it is never
trusted, since every output is re-certified.
- squares : Array DyadicSquare
The component's grid squares: nonempty, common
prec, edge-connected. - candidateK : Nat
Root count carried from the most recently certified ancestor; an untrusted hint for step ordering.
Instances For
Extend exact coordinate bounds by one dyadic square.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add one square to an optional bounding box.
Equations
- Hex.SquareBounds.extend none s = some s.bounds
- Hex.SquareBounds.extend (some b_2) s = some (b_2.merge s)
Instances For
Exact bounding box of an array of dyadic squares.
Equations
- Hex.boundingBox squares = Array.foldl Hex.SquareBounds.extend none squares
Instances For
The smallest square with power-of-two half-width, centred at the
bounding-box centre, containing every square. Junk ⟨0,0,0⟩ on the
empty array (callers keep components nonempty).
Each square contributes its own half-width to the bounding box
(robust to mixed prec), the centre is the exact midpoint of the
box (a right shift by one bit), and the result prec is chosen so
that its half-width 2^{−q} is the smallest power of two at least
the box half-width. On a single square input this returns that
square exactly.
Equations
- One or more equations did not get rendered due to their size.
Instances For
p has only simple complex roots when the executable rational gcd of p
and p' is constant. This is definitionally
Hex.ZPoly.SquareFreeRat; the Mathlib bridge proves its equivalence to
polynomial squarefreeness when p ≠ 0.