TheoremnatLookup_some_mem
Statement
theorem natLookup_some_mem {β : Type} : ∀ (f : List (Nat × β)) (n : Nat) (e : β),
natLookup f n = some e → n ∈ f.map (·.1)
| [], _, _, h => by simp [natLookup] at h
| (k, x) :: rest, n, e, h => by
simp only [natLookup] at h
split at h
· rename_i hk; simp at hk; simp [hk]
· exact List.mem_cons_of_mem _ (natLookup_some_mem rest n e h)Proof
Proved by a term, which Lean's kernel checks directly.
Used by
In StandardElmMech/Prog/Rulings.lean: The rulings A62, A72, A77, A79, A80 and A81 as theorems, and a66_batch_order_open: a program whose batch is delivered in either order.
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.