Elm Exactly

Theoremmem_le_foldl_max

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

Statement

theorem mem_le_foldl_max : ∀ (l : List Nat) (a n : Nat), n ∈ l → n ≤ l.foldl max a
  | [], _, _, h => by simp at h
  | x :: xs, a, n, h => by
    simp only [List.mem_cons] at h
    simp only [List.foldl_cons]
    rcases h with rfl | h
    · exact Nat.le_trans (Nat.le_max_right a n) (le_foldl_max xs _)
    · exact mem_le_foldl_max xs _ n h

Proof

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

Used by

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.