Numerical classification, cohorts and stored canonicality #
Zero, normal, and subnormal classification agrees with exact rational magnitudes and is preserved within a cohort. For a fixed encoding and format, canonical words are equal exactly when they decode to the same complete datum.
theorem
FloatLib.Floats.Formats.DecimalInterchange.Datum.finiteValue_eq_zero_iff
(s : Bool)
(c : ℕ)
(q : ℤ)
:
theorem
FloatLib.Floats.Formats.DecimalInterchange.Datum.sameCohort_isNormal
(f : Format)
{x y : Datum}
(h : x.SameCohort y)
:
theorem
FloatLib.Floats.Formats.DecimalInterchange.Datum.sameCohort_isSubnormal
(f : Format)
{x y : Datum}
(h : x.SameCohort y)
:
theorem
FloatLib.Floats.Formats.DecimalInterchange.Datum.classify_zero_iff
(f : Format)
(d : Datum)
:
theorem
FloatLib.Floats.Formats.DecimalInterchange.Datum.classify_normal_iff
(f : Format)
(d : Datum)
:
theorem
FloatLib.Floats.Formats.DecimalInterchange.Datum.classify_nan_iff
(f : Format)
(d : Datum)
:
@[simp]
theorem
FloatLib.Floats.Formats.DecimalInterchange.Datum.sameQuantum_trans
{x y z : Datum}
(hxy : x.sameQuantum y = true)
(hyz : y.sameQuantum z = true)
:
@[simp]
theorem
FloatLib.Floats.Formats.DecimalInterchange.Encoding.isCanonical_canonicalize
(encoding : Encoding)
(f : Format)
(w : BitVec f.bitWidth)
:
Re-encoding always produces a canonical word, including on redundant input.
theorem
FloatLib.Floats.Formats.DecimalInterchange.Encoding.eq_iff_decode_eq
(encoding : Encoding)
(f : Format)
{x y : BitVec f.bitWidth}
(hx : encoding.isCanonical f x = true)
(hy : encoding.isCanonical f y = true)
:
Two canonical encodings in the same encoding and format are equal precisely when they decode to the same complete datum.