TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Operations.Compare.Predicates.Proof

Binary predicate semantics #

All predicates use exact extended-real order on non-NaN inputs and their specified unordered truth value on NaNs. The exception theorems distinguish quiet and signaling comparisons without changing their Boolean answers.

Every quiet predicate agrees with its truth table on exact extended-real order.

Every signaling predicate has the same exact numerical truth table.

NaN operands select the predicate's unordered truth value.

Signaling comparison uses the same unordered truth value as quiet comparison.

Quiet and signaling comparisons differ only in their exception behavior.

Quiet comparisons raise invalid exactly for signaling NaN operands.

Signaling comparisons raise invalid exactly for NaN operands.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.Comparison.quiet_status {fmt : FloatFormat} (predicate : Predicate) (x y : Model fmt) :
(quiet predicate x y).status = { invalid := x.isSNaN || y.isSNaN }

Quiet comparison raises no range, division, or inexact exception.

Signaling comparison raises no range, division, or inexact exception.