Require Import String. Inductive term : Set := | Var : string -> term | Abs : string -> term -> term | App: term -> term -> term. Fixpoint subst (rep : term) (x: string) (e:term) : term := match e with | Var y => if string_dec y x then rep else Var y | Abs y e1 => Abs y (if string_dec y x then e1 else subst rep x e1) | App e1 e2 => App (subst rep x e1) (subst rep x e2) end. Parameter s : string. Parameter z : string. Definition zero := Abs s (Abs z (Var(z))). Definition one := Abs s (Abs z (App (Var(s)) (Var(z)))). Theorem mytheorem: forall x y t, x <> y -> y <> t -> (subst (Var(t)) y (Abs x (App (Var(x)) (Var(y))))) = (Abs x (App (Var(x)) (Var(t)))). Proof. intros;simpl. destruct (string_dec x y). congruence. destruct (string_dec y y). congruence. congruence. Qed.