TorchLean API

FloatLib.Floats.Formats.P3109.Arithmetic.External.Proof

Exact encoding of external P3109 results #

Report precision rounding and saturation produce representable dyadics. The binary encoder therefore preserves every finite projected value, including a significand carry. The executable result decodes to that exact rational, with no second rounding. Exceptional results use the specified signed infinity or canonical quiet NaN; zero is encoded with positive sign.

A grid value in the external finite range is encoded exactly, including a binade carry.

theorem FloatLib.Floats.Formats.P3109.Arithmetic.External.project_finite (format : BinaryInterchange.FloatFormat) (hformat : format.isIEEE = true) (policy : ProjectionPolicy) (input : Numerics.NumericalValue ) (result : Numerics.Dyadic) (hresult : projectValue format policy input = Numerics.NumericalValue.finite result) :
(project format hformat policy input).isFinite = true (project format hformat policy input).toReal = result.toReal

Every finite projected result is encoded with its exact real value.

The exact external decoder agrees with the real interpretation on every finite word.

Finite external results refine the exact report projection through the executable decoder.

A projected infinity retains its sign in the external encoding.

A projected NaN becomes the canonical quiet external NaN.

theorem FloatLib.Floats.Formats.P3109.Arithmetic.External.project_zero (format : BinaryInterchange.FloatFormat) (hformat : format.isIEEE = true) (policy : ProjectionPolicy) (input : Numerics.NumericalValue ) (result : Numerics.Dyadic) (hresult : projectValue format policy input = Numerics.NumericalValue.finite result) (hzero : result.significand = 0) :
project format hformat policy input = BinaryInterchange.Model.zero format false

Every projected zero uses the external positive-zero encoding.

Exact finite decoding, with the report's prescribed external exceptional encodings.

Instances For
    theorem FloatLib.Floats.Formats.P3109.Arithmetic.External.project_refines (format : BinaryInterchange.FloatFormat) (hformat : format.isIEEE = true) (policy : ProjectionPolicy) (input : Numerics.NumericalValue ) :
    Encodes (project format hformat policy input) (projectValue format policy input)

    External projection refines its rounded and saturated datum on every input class.

    A configured carrier preserves every bit of the external report projection.

    theorem FloatLib.Floats.Formats.P3109.Arithmetic.External.mixed_binary_refines {Left LeftExact Right RightExact : Type} [ExecFloat.ExactDecoder Left LeftExact] [ExecFloat.ExactMap LeftExact ] [ExecFloat.ExactDecoder Right RightExact] [ExecFloat.ExactMap RightExact ] (format : BinaryInterchange.FloatFormat) (hformat : format.isIEEE = true) (policy : ProjectionPolicy) (operation : Numerics.NumericalValue Numerics.NumericalValue Numerics.NumericalValue ) (left : Left) (right : Right) :
    Encodes (Mixed.binary (destination format hformat) policy operation left right) (projectValue format policy (operation (Mixed.decode left) (Mixed.decode right)))

    External mixed binary arithmetic has the same total refinement as direct projection.

    theorem FloatLib.Floats.Formats.P3109.Arithmetic.External.mixed_ternary_refines {Left LeftExact Right RightExact Third ThirdExact : Type} [ExecFloat.ExactDecoder Left LeftExact] [ExecFloat.ExactMap LeftExact ] [ExecFloat.ExactDecoder Right RightExact] [ExecFloat.ExactMap RightExact ] [ExecFloat.ExactDecoder Third ThirdExact] [ExecFloat.ExactMap ThirdExact ] (format : BinaryInterchange.FloatFormat) (hformat : format.isIEEE = true) (policy : ProjectionPolicy) (operation : Numerics.NumericalValue Numerics.NumericalValue Numerics.NumericalValue Numerics.NumericalValue ) (left : Left) (right : Right) (third : Third) :
    Encodes (Mixed.ternary (destination format hformat) policy operation left right third) (projectValue format policy (operation (Mixed.decode left) (Mixed.decode right) (Mixed.decode third)))

    External fused arithmetic preserves the complete ternary expression through encoding.