Elm Exactly

Theoremle_foldl_max

StandardElmMech/Prog/Dispatch.lean:43 · term proof

Statement

theorem le_foldl_max : ∀ (l : List Nat) (a : Nat), a ≤ l.foldl max a
  | [], _ => Nat.le_refl _
  | x :: xs, a => Nat.le_trans (Nat.le_max_left a x) (le_foldl_max xs (max a x))

Proof

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

In StandardElmMech/Prog/Dispatch.lean: Dispatch (4 rules, r_p_disp_*) and the executable dispatchFn with fresh identifiers, sound.

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.