From Undecidability.L Require Export L.
(** * Step-indexed interpreter and modesty *)
(** ** Step-indexed interpreter *)
Fixpoint eval (n : nat) (u : term) :=
match u with
| var n => None
| lambda s => Some (lambda s)
| app s t => match n with
| 0   => None
| S n => match eval n s, eval n t with
| Some (lambda s), Some t => eval n (subst s 0 t)
|   _ , _ => None
end
end
end.

Lemma equiv_eval s t : lam t -> s ≡ t -> exists n, eval n s = Some t.