Elm Exactly

TheoremmapM_bytes_comp

StandardElmMech/Eff/EncDec.lean:230, Lists and bytes · term proof

Statement

theorem mapM_bytes_comp : ∀ (os : List Nat), (∀ o ∈ os, o < 256) →
    os.mapM (byteOf? ∘ fun (o : Nat) => Val.int (o : Int)) = some os
  | [], _ => rfl
  | o :: os, h => by
    simp only [List.mapM_cons, Function.comp, byteOf?_int o (h o (by simp)),
      mapM_bytes_comp os (fun o' hm => h o' (by simp [hm]))]
    rfl

Proof

Proved by a term, which Lean's kernel checks directly.

Used by

In StandardElmMech/Eff/EncDec.lean: The book's relations Enc and Dec (15 and 14 rules, r_e_enc_*, r_e_dec_*), enc_iff, dec_iff, and that both are partial functions.

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.