Section Substitution_Properties.

(* Specifications: *)
Lemma subTermId :
forall (t : fol.Term L) (v : nat), substituteTerm t v (var v) = t.
Lemma subTermsId :
forall (n : nat) (ts : fol.Terms L n) (v : nat),
substituteTerms n ts v (var v) = ts.
Lemma subFormulaId :
forall (f : fol.Formula L) (v : nat), substituteFormula f v (var v) = f.
Lemma subFormulaForall2 :
forall (f : fol.Formula L) (x v : nat) (s : fol.Term L),
exists nv : nat,
~ In nv (freeVarTerm s) /\
nv <> v /\
~ In nv (list_remove _ eq_nat_dec x (freeVarFormula f)) /\
substituteFormula (forallH x f) v s =
match eq_nat_dec x v with
| left _ => forallH x f
| right _ =>
forallH nv (substituteFormula (substituteFormula f x (var nv)) v s)
end.