Coefficient range for decimal square root #
Halving the base-ten logarithm of the squared scaled value determines the square-root grid. The proofs use integer logarithm bounds, without approximating the square root.
theorem
FloatLib.Floats.Formats.DecimalInterchange.sqrtScaleShift_upper
(p : ℕ)
{x : ℚ}
(hx : 0 ≤ x)
:
theorem
FloatLib.Floats.Formats.DecimalInterchange.sqrtQuantum_le_of_valid
(f : Format)
(s : Bool)
(c : ℕ)
(q : ℤ)
(hvalid : Datum.Valid f (Datum.finite s c q))
:
Every valid representation of an exact root is on a grid no finer than the selected grid.
theorem
FloatLib.Floats.Formats.DecimalInterchange.div_sqrtQuantum_lt
(f : Format)
{x : ℚ}
(hx : 0 ≤ x)
:
The square of the scaled coefficient is strictly below the squared coefficient bound.
theorem
FloatLib.Floats.Formats.DecimalInterchange.sqrtScaleShift_lower
{p : ℕ}
(hp : 0 < p)
{x : ℚ}
(hx : 0 ≤ x)
(hk : 0 < sqrtScaleShift p x)
:
A nonzero square-root grid shift retains a full leading digit before rounding.
theorem
FloatLib.Floats.Formats.DecimalInterchange.payloadBound_sq_le_div_sqrtQuantum
(f : Format)
{x : ℚ}
(hx : 0 ≤ x)
(hq : f.minQuantum < sqrtQuantum f x)
:
Above the subnormal grid, the scaled radicand is at least the square of a full leading digit.