TheoremelmText_derivation
A text var atpat1 ... atpatn = exp, not recursive, evaluates in E by r:d-dec-nonrec (with r:d-valbind-var and r:d-exp-lambda) to the closure that InitialBasis.lean binds.
Statement
theorem elmText_derivation (E : Env) (x : Var) (p : AtPat) (ps : List AtPat) (e : Exp)
(h : isRecursive [(x, .closure p (lams ps e) E [])] (.var x (lams (p :: ps) e) none) = false) :
EvalDec E (.val (.var x (lams (p :: ps) e) none)) [(x, .closure p (lams ps e) E [])]Proof
by
have hv : EvalValBind E (.var x (lams (p :: ps) e) none) (fmPlus [(x, .closure p (lams ps e) E [])] []) :=
EvalValBind.r_d_valbind_var _ _ _ _ _ _ (EvalExp.r_d_exp_lambda E p (lams ps e)) (EvalValBindOpt.opt_none _)
have he : fmPlus [(x, Val.closure p (lams ps e) E [])] ([] : ValEnv) = [(x, .closure p (lams ps e) E [])] := by
simp [fmPlus]
rw [he] at hv
exact EvalDec.r_d_dec_nonrec _ _ _ hv hProved with tactics, which Lean expands into a proof term that its kernel checks.
Rules of the book it uses
Used by
In StandardElmMech/Theorems.lean: The command #mod_program_theorems (one theorem per program, in module form, in Lib.Btest; tagged [library] when the program names a core library value), budgetNative, the rulings stated directly, and theorems that D1 makes possible (a43_one_unique, a51_one_choice, log_order_demo).
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.