(** *** Step-indexed self-interpreter *)
Definition E := Eval cbv in
rho (.\ "Eval","n","u";"u"
(.\"";!none)
(.\"s","t"; "n" !none
(.\"n"; "Eval" "n" "s"
(.\"s"; "Eval" "n" "t"
(.\"t"; "s"
(.\""; !none)
(.\"",""; !none)
(.\"s"; "Eval" "n" (!Subst "s" !Zero "t")))
!none)
!none))
(.\"s"; !some (!Lam "s"))).
Definition cLam s := lambda(lambda(lambda(0 s))).
Hint Unfold cLam : cbv.

Lemma E_rec_app_Sn_3 s t n t1 : proc t1
-> E (enc n) (tenc s) ≡ some (cLam t1)
-> E (enc n) (tenc t) ≡ none
-> E (enc (S n)) (tenc (s t)) ≡ none.