(** * Scott encoding of terms *)
Fixpoint tenc t :=
lambda ( (* var *) lambda ( (* app *) lambda ( (* lambda *)
match t with
| var n => (var 2) (enc n)
| app s t => (var 1) (tenc s) (tenc t)
| lambda s => (var 0) (tenc s)
end
))).

Lemma tenc_proc s : proc (tenc s).
Hint Resolve tenc_proc : cbv.