Correctness of direct generic dyadic rounding #
The executable integer implementation in RoundDyadicImpl.Runtime is extensionally equal to the
logical Float.Model.UnpackedFloat.round specification used by ieeeRoundDyadic. The
@[csimp] theorems install the direct implementation in compiled code while preserving the
model-facing definitions in the type theory.
The IEEE proof covers signed zero, subnormal rounding, the minimum-normal transition,
normalization carry, and overflow at arbitrary field widths. roundDyadicGeneral_eq_roundDyadic
then relates the descriptor-aware algorithm to the public specification, including non-IEEE
encoding policies.
Packing a normalized finite model value agrees with direct field construction.
The direct integer dyadic rounder computes the same result as Lean's format-parameterized logical float model. The compiler uses this checked equality to replace the logical model at runtime.
The descriptor-general nearest-even dyadic algorithm agrees exactly with the public dyadic rounding specification, including signed zero and every packed exceptional result.
Compiler substitution preserves the complete-format dyadic rounding specification.