Theorema88_int_exact
A88: JSON numbers decode at Int exactly, within IntRange; an Int encodes as itself.
Statement
theorem a88_int_exact (n : Int) :
Enc .int (.int n) (.num n) ∧ (intMin ≤ n → n ≤ intMax → Dec .int (.num n) (.int n))Proof
⟨.r_e_enc_int n, fun h1 h2 => by
have := Dec.r_e_dec_int (n : Rat) (by simp) (by simpa using h1) (by simpa using h2)
simpa using this⟩Proved by a term, which Lean's kernel checks directly.
Rules of the book it uses
About ruling A88 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.