Total EReal semantics helpers for IEEE32Exec #
BridgeERealTotal.lean defines toEReal? : IEEE32Exec → Option EReal, which is the canonical
extended-real interpretation we use when we want to distinguish +∞ from -∞ and treat NaN as
"unordered" (none).
In a few proof scripts, it is convenient to have a total function into EReal. We therefore
define:
Informal reading rule:
If you see a theorem stated using toEReal, it should be read under hypotheses that exclude NaNs
(isNaN x = false). Under that assumption, toEReal x agrees with the intended toEReal? meaning
and behaves exactly as you would expect:
- finite values map to
↑(toReal x), +∞/-∞map to⊤/⊥.
This file also collects small helper lemmas (toEReal_eq_ite, signed-zero simp facts, etc.) used by
multiple IEEEExec proof modules.
If toEReal? x = some r, then toEReal x = r.
If toEReal? x = none, then toEReal x = 0.
Convenient unfolding lemma for toEReal.
This is the form that works best with simp once you have established/assumed (non-)NaN and
(non-)Inf facts.
Small finiteness helpers #
These are convenience lemmas for switching between isFinite and special-value predicates in
proofs.
If x is finite, then x is not an infinity.
If x is finite, then x is not a NaN.
Signed-zero simp facts #
IEEE-754 has distinct bit patterns for +0 and -0, but both decode to real 0. In endpoint
proofs
we frequently want this fact at the toEReal level.