TorchLean API

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

Correctness of native finite decoding for one-word formats #

The executable decoder and arithmetic entry points live in Finite.Runtime. Their extracted sign, significand, and stored exponent agree with the format-generic decoder. Addition, fused multiply-add, and positive square root then reuse the corresponding component kernels.

Keeping the bridge here avoids coupling every operation to storage masks and field shifts. Runtime imports remain small, and later refinements reason about exact dyadics rather than raw words.

Native one-word decoding equals the width-generic compact decoder.

Native-storage finite addition equals the generic compact finite kernel.

The runtime names the compiled addComponentsImpl; addComponentsImpl_eq identifies it with the exact addComponents used by FiniteKernel.add?.

Native-storage finite FMA equals the generic compact finite kernel.

The runtime names the compiled fmaComponentsImpl; fmaComponentsImpl_eq identifies it with the exact fmaComponents used by FiniteKernel.fma?.

Native-storage positive square root equals the generic compact finite kernel.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.NativeSmallWordFinite.sqrtPositive_eq_runtime {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 = FiniteSqrt.sqrtPositiveRuntime x hfinite hnonzero hpositive

The unchecked one-word positive square-root kernel agrees with the proof-guided generic kernel.