Elm Exactly

Theorema74_nonfinite_null

StandardElmMech/Eff/Properties.lean:53, A74 · native_decide (trusts the compiled evaluator)

A74: NaN and the infinities encode as null. A float's bits are the C library's (Lean's Float is opaque to the kernel), so this is proved by native_decide. [native]

Statement

theorem a74_nonfinite_null :
    Enc .float (.sv (.float fNaN)) .null ∧ Enc .float (.sv (.float fInf)) .null ∧
    Enc .float (.sv (.float (-fInf))) .null

Proof

by
  refine ⟨(enc_iff _ _ _).mpr ?_, (enc_iff _ _ _).mpr ?_, (enc_iff _ _ _).mpr ?_⟩ <;> native_decide

Proved by native_decide: the decision procedure is compiled and run, and its answer is trusted. This is used where values are compared as they print, floats above all, which the kernel cannot compare.

Theorems it uses

About ruling A74 of the book, where the implementations disagreed or were silent and the definition decides.

In StandardElmMech/Eff/Properties.lean: APPLY of the effect values has one member; the rulings A74, A76, A88 and A92; canonical payload types, the decimality of a float's exact value, and that every value of a payload type has a canonical encoding (enc_total).

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.