Elm Exactly

TheoremfloatToRat?_decimal

StandardElmMech/Eff/Properties.lean:281, Numbers: a float's exact value is decimal · tactic proof

Statement

theorem floatToRat?_decimal {x : Float} {q : Rat} (h : floatToRat? x = some q) : isDecimal q = true

Proof

by
  unfold floatToRat? at h
  simp only at h
  split at h
  · cases h
  · simp only [Option.some.injEq] at h
    subst h
    split
    all_goals first
      | (obtain ⟨k, hk⟩ := dyadic_den_dvd _ _; exact isDecimal_of_den_dvd (k := k) (by rw [Rat.neg_den]; exact hk))
      | (obtain ⟨k, hk⟩ := dyadic_den_dvd _ _; exact isDecimal_of_den_dvd hk)

Proved with tactics, which Lean expands into a proof term that its kernel checks.

Theorems it uses

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.