Require Export folLogic.
Section More_Logic_Rules.
Variable L : Language.
Let Formula := Formula L.
Let Formulas := Formulas L.
Let System := System L.
Let Term := Term L.
Let Terms := Terms L.
Let var := var L.
Let apply := apply L.
Let equal := equal L.
Let atomic := atomic L.
Let impH := impH L.
Let notH := notH L.
Let forallH := forallH L.
Let orH := orH L.
Let andH := andH L.
Let existH := existH L.
Let iffH := iffH L.
Let ifThenElseH := ifThenElseH L.
Let Prf := Prf L.
Let SysPrf := SysPrf L.

(* Specifications: *)
Lemma rebindForall :
forall (T : System) (a b : nat) (f : Formula),
~ In b (freeVarFormula L (forallH a f)) ->
SysPrf T (iffH (forallH a f) (forallH b (substituteFormula L f a (var b)))).
Lemma rebindExist :
forall (T : System) (a b : nat) (f : Formula),
~ In b (freeVarFormula L (existH a f)) ->
SysPrf T (iffH (existH a f) (existH b (substituteFormula L f a (var b)))).
Lemma subSubTerm :
forall (t : Term) (v1 v2 : nat) (s1 s2 : Term),
v1 <> v2 ->
~ In v1 (freeVarTerm L s2) ->
substituteTerm L (substituteTerm L t v1 s1) v2 s2 =
substituteTerm L (substituteTerm L t v2 s2) v1 (substituteTerm L s1 v2 s2).
Lemma subSubTerms :
forall (n : nat) (ts : Terms n) (v1 v2 : nat) (s1 s2 : Term),
v1 <> v2 ->
~ In v1 (freeVarTerm L s2) ->
substituteTerms L n (substituteTerms L n ts v1 s1) v2 s2 =
substituteTerms L n (substituteTerms L n ts v2 s2) v1
(substituteTerm L s1 v2 s2).
Lemma subSubFormula :
forall (f : Formula) (v1 v2 : nat) (s1 s2 : Term),
v1 <> v2 ->
~ In v1 (freeVarTerm L s2) ->
forall T : System,
SysPrf T
(iffH (substituteFormula L (substituteFormula L f v1 s1) v2 s2)
(substituteFormula L (substituteFormula L f v2 s2) v1
(substituteTerm L s1 v2 s2))).