Elm Exactly

Theoremkeys_valBind

StandardElmMech/Stat/RefuseScope.lean:539, The keys of the value environments of patterns and bindings · term proof

Statement

theorem keys_valBind : (vb : AValBind) → KeysIn vb.ve (vbVars vb.erase)
  | .var x ann τ e none => by
    simp only [AValBind.ve, AValBind.erase, AValBind.eraseOpt, vbVars, vbVarsOpt]
    exact keysIn_modify (keysIn_single (by simp)) (keysIn_nil _)
  | .var x ann τ e (some vb) => by
    simp only [AValBind.ve, AValBind.erase, AValBind.eraseOpt, vbVars, vbVarsOpt]
    refine keysIn_modify (keysIn_single (by simp)) ?_
    exact keysIn_mono (keys_valBind vb) (by intro y hy; simp [hy])
  | .pat p e => by
    simp only [AValBind.ve, AValBind.erase, vbVars]
    exact keys_atPat p

Proof

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

Used by

In StandardElmMech/Stat/RefuseScope.lean: Refusals by scope, constructor arity and imports, for one module and for a module after a helper (scopeFailB).

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.