TorchLean API

FloatLib.Floats.ExecFloat.Backends.Word.Small.Sqrt.Proof

Correctness of the one-word square root for small IEEE formats #

sqrtPositiveCore_eq shows that the kernel is Lean's logical unpacked square root, rounded and packed, for every nonzero mantissa and finite scale of an eligible format. sqrtPositive_eq then identifies the dispatcher with the shared finite kernel for every positive finite input.

For a nonzero mantissa below 2 ^ (fracWidth + 1) and the scale of a finite value, the kernel is Lean's logical unpacked square root of mantissa * 2 ^ (scale - (bias + fracWidth - 1)).

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.NativeSmallWordSqrt.sqrtPositive_eq {fmt : FloatFormat} (heligible : NativeSmallWord.StorageEligible fmt) (x : Model fmt) (hfinite : x.isFinite = true) (hnonzero : x.isZero = false) (hpositive : x.signBit = false) :
sqrtPositive heligible x hfinite hnonzero hpositive = NativeSmallWordFinite.sqrtPositive heligible x hfinite hnonzero hpositive

The dispatcher agrees with the shared finite kernel on every positive finite input.