(* Specifications: *)
Lemma paZeroOrSucc : forall t : Term, SysPrf PA (orH (equal t Zero) (existH (newVar (0 :: freeVarTerm LNT t)) (equal t (Succ (var (newVar (0 :: freeVarTerm LNT t))))))).
Lemma paPlusSym : forall a b : Term, SysPrf PA (equal (Plus a b) (Plus b a)).
Lemma NN72PA : SysPrf PA (LNN2LNT_formula NN7).
Lemma NN82PA : SysPrf PA (LNN2LNT_formula NN8).
Lemma NN92PA : SysPrf PA (LNN2LNT_formula NN9).
Lemma codeForallIsPR : isPR 2 (fun a b : nat => cPair 3 (cPair a b)).
Lemma codeNotIsPR : isPR 1 codeNot.
Lemma codeImpIsPR : isPR 2 codeImp.
Lemma freeVarSubTerm1 : forall (t : Term) (v : nat) (s : Term) (x : nat), In x (freeVarTerm L t) -> v <> x -> In x (freeVarTerm L (substituteTerm L t v s)).
Lemma freeVarSubTerms1 : forall (n : nat) (ts : Terms n) (v : nat) (s : Term) (x : nat), In x (freeVarTerms L n ts) -> v <> x -> In x (freeVarTerms L n (substituteTerms L n ts v s)).
Lemma freeVarSubFormula1 : forall (f : Formula) (v : nat) (s : Term) (x : nat), v <> x -> In x (freeVarFormula L f) -> In x (freeVarFormula L (substituteFormula L f v s)).
Lemma freeVarSubTerm2 : forall (t : Term) (v : nat) (s : Term) (x : nat), In x (freeVarTerm L s) -> In v (freeVarTerm L t) -> In x (freeVarTerm L (substituteTerm L t v s)).
Lemma freeVarSubTerms2 : forall (n : nat) (ts : Terms n) (v : nat) (s : Term) (x : nat), In x (freeVarTerm L s) -> In v (freeVarTerms L n ts) -> In x (freeVarTerms L n (substituteTerms L n ts v s)).
Lemma freeVarSubFormula2 : forall (f : Formula) (v : nat) (s : Term) (x : nat), In x (freeVarTerm L s) -> In v (freeVarFormula L f) -> In x (freeVarFormula L (substituteFormula L f v s)).
Lemma freeVarSubTerm3 : forall (t : Term) (v : nat) (s : Term) (x : nat), In x (freeVarTerm L (substituteTerm L t v s)) -> In x (list_remove _ eq_nat_dec v (freeVarTerm L t)) \/ In x (freeVarTerm L s).
Lemma freeVarSubTerms3 : forall (n : nat) (ts : fol.Terms L n) (v : nat) (s : Term) (x : nat), In x (freeVarTerms L n (substituteTerms L n ts v s)) -> In x (list_remove _ eq_nat_dec v (freeVarTerms L n ts)) \/ In x (freeVarTerm L s).
Lemma freeVarSubFormula3 : forall (f : Formula) (v : nat) (s : Term) (x : nat), In x (freeVarFormula L (substituteFormula L f v s)) -> In x (list_remove _ eq_nat_dec v (freeVarFormula L f)) \/ In x (freeVarTerm L s).
Lemma freeVarSubTerm4 : forall (t : Term) (v : nat) (s : Term) (x : nat), In x (freeVarTerm L (substituteTerm L t v s)) -> ~ In v (freeVarTerm L t) -> In x (freeVarTerm L t).
Lemma freeVarSubTerms4 : forall (n : nat) (ts : Terms n) (v : nat) (s : Term) (x : nat), In x (freeVarTerms L n (substituteTerms L n ts v s)) -> ~ In v (freeVarTerms L n ts) -> In x (freeVarTerms L n ts).
Lemma freeVarSubFormula4 : forall (f : Formula) (v : nat) (s : Term) (x : nat), In x (freeVarFormula L (substituteFormula L f v s)) -> ~ In v (freeVarFormula L f) -> In x (freeVarFormula L f).
Lemma subTermNil : forall (t : Term) (v : nat) (s : Term), ~ In v (freeVarTerm L t) -> substituteTerm L t v s = t.
Lemma subTermTrans : forall (t : Term) (v1 v2 : nat) (s : Term), ~ In v2 (list_remove _ eq_nat_dec v1 (freeVarTerm L t)) -> substituteTerm L (substituteTerm L t v1 (var v2)) v2 s = substituteTerm L t v1 s.
Lemma subTermExch : forall (t : Term) (v1 v2 : nat) (s1 s2 : Term), v1 <> v2 -> ~ In v2 (freeVarTerm L s1) -> ~ In v1 (freeVarTerm L s2) -> substituteTerm L (substituteTerm L t v1 s1) v2 s2 = substituteTerm L (substituteTerm L t v2 s2) v1 s1.
Lemma subTermsNil : forall (n : nat) (ts : Terms n) (v : nat) (s : Term), ~ In v (freeVarTerms L n ts) -> substituteTerms L n ts v s = ts.
Lemma subTermsTrans : forall (n : nat) (ts : Terms n) (v1 v2 : nat) (s : Term), ~ In v2 (list_remove _ eq_nat_dec v1 (freeVarTerms L n ts)) -> substituteTerms L n (substituteTerms L n ts v1 (var v2)) v2 s = substituteTerms L n ts v1 s.
Lemma subTermsExch : forall (n : nat) (ts : Terms n) (v1 v2 : nat) (s1 s2 : Term), v1 <> v2 -> ~ In v2 (freeVarTerm L s1) -> ~ 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 s1.
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))).
Lemma closedT : forall v : nat, ~ In_freeVarSys LNN v T.
Lemma multO : forall a b : nat, a * b = 0 -> a = 0 \/ b = 0.
Lemma reduceImp : forall (f1 f2 f3 f4 : Formula) (T : System), SysPrf T (iffH f1 f3) -> SysPrf T (iffH f2 f4) -> SysPrf T (iffH (impH f1 f2) (impH f3 f4)).
Lemma reduceNot : forall (f1 f2 : Formula) (T : System), SysPrf T (iffH f1 f2) -> SysPrf T (iffH (notH f1) (notH f2)).
Lemma impForall : forall (f1 f2 : Formula) (v : nat) (T : System), ~ In_freeVarSys _ v T -> SysPrf T (impH f1 f2) -> SysPrf T (impH (forallH v f1) (forallH v f2)).
Lemma reduceForall : forall (f1 f2 : Formula) (v : nat) (T : System), ~ In_freeVarSys _ v T -> SysPrf T (iffH f1 f2) -> SysPrf T (iffH (forallH v f1) (forallH v f2)).
Lemma reduceOr : forall (f1 f2 f3 f4 : Formula) (T : System), SysPrf T (iffH f1 f3) -> SysPrf T (iffH f2 f4) -> SysPrf T (iffH (orH f1 f2) (orH f3 f4)).
Lemma reduceAnd : forall (f1 f2 f3 f4 : Formula) (T : System), SysPrf T (iffH f1 f3) -> SysPrf T (iffH f2 f4) -> SysPrf T (iffH (andH f1 f2) (andH f3 f4)).
Lemma iffExist : forall (f1 f2 : Formula) (v : nat) (T : System), ~ In_freeVarSys _ v T -> SysPrf T (impH f1 f2) -> SysPrf T (impH (existH v f1) (existH v f2)).
Lemma reduceExist : forall (f1 f2 : Formula) (v : nat) (T : System), ~ In_freeVarSys _ v T -> SysPrf T (iffH f1 f2) -> SysPrf T (iffH (existH v f1) (existH v f2)).
Lemma reduceIff : forall (f1 f2 f3 f4 : Formula) (T : System), SysPrf T (iffH f1 f3) -> SysPrf T (iffH f2 f4) -> SysPrf T (iffH (iffH f1 f2) (iffH f3 f4)).
Lemma reduceIfThenElse : forall (f1 f2 f3 f4 f5 f6 : Formula) (T : System), SysPrf T (iffH f1 f4) -> SysPrf T (iffH f2 f5) -> SysPrf T (iffH f3 f6) -> SysPrf T (iffH (ifThenElseH f1 f2 f3) (ifThenElseH f4 f5 f6)).
Lemma reduceSub : forall (T : System) (v : nat) (s : Term) (f g : Formula), ~ In_freeVarSys L v T -> SysPrf T (iffH f g) -> SysPrf T (iffH (substituteFormula L f v s) (substituteFormula L g v s)).
Lemma reduceCloseList : forall (l : list nat) (f1 f2 : Formula) (T : System), (forall v : nat, In v l -> ~ In_freeVarSys _ v T) -> SysPrf T (iffH f1 f2) -> SysPrf T (iffH (closeList L l f1) (closeList L l f2)).
Lemma natNE : forall a b : nat, a <> b -> SysPrf NN (notH (equal (natToTerm a) (natToTerm b))).
Lemma natLE : forall a b : nat, b <= a -> SysPrf NN (notH (LT (natToTerm a) (natToTerm b))).
Lemma natLT : forall a b : nat, a < b -> SysPrf NN (LT (natToTerm a) (natToTerm b)).
Lemma natPlus : forall a b : nat, SysPrf NN (equal (Plus (natToTerm a) (natToTerm b)) (natToTerm (a + b))).
Lemma natTimes : forall a b : nat, SysPrf NN (equal (Times (natToTerm a) (natToTerm b)) (natToTerm (a * b))).
Lemma boundedLT : forall (m : nat) (a : Formula) (x : nat), (forall n : nat, n < m -> SysPrf NN (substituteFormula LNN a x (natToTerm n))) -> SysPrf NN (impH (LT (var x) (natToTerm m)) a).
Lemma nnPlusNotNeeded : forall n : nat, SysPrf NN (impH (orH (LT (var 1) (natToTerm n)) (equal (var 1) (natToTerm n))) (LT (var 1) (Succ (natToTerm n)))).
Theorem DeductionTheorem : forall (T : System) (f g : Formula) (prf : SysPrf (Ensembles.Add _ T g) f), SysPrf T (impH g f).
Lemma NN2PA : forall f : fol.Formula LNN, folProof.SysPrf LNN NN f -> SysPrf PA (LNN2LNT_formula f).
Lemma PAboundedLT : forall (m : nat) (a : Formula) (x : nat), (forall n : nat, n < m -> SysPrf PA (substituteFormula LNT a x (natToTerm n))) -> SysPrf PA (impH (LNN2LNT_formula (LT (fol.var LNN x) (LNN.natToTerm m))) a).
Lemma inj_right_pair2 : forall A : Set, (forall x y : A, {x = y} + {x <> y}) -> forall (x : A) (P : A -> Set) (y y' : P x), existS P x y = existS P x y' -> y = y'.
Lemma Axm : forall (T : System) (f : Formula), mem _ T f -> SysPrf T f.
Lemma sysExtend : forall (T U : System) (f : Formula), Included _ T U -> SysPrf T f -> SysPrf U f.
Lemma sysWeaken : forall (T : System) (f g : Formula), SysPrf T f -> SysPrf (Ensembles.Add _ T g) f.
Lemma impI : forall (T : System) (f g : Formula), SysPrf (Ensembles.Add _ T g) f -> SysPrf T (impH g f).
Lemma impE : forall (T : System) (f g : Formula), SysPrf T (impH g f) -> SysPrf T g -> SysPrf T f.
Lemma contradiction : forall (T : System) (f g : Formula), SysPrf T f -> SysPrf T (notH f) -> SysPrf T g.
Lemma nnE : forall (T : System) (f : Formula), SysPrf T (notH (notH f)) -> SysPrf T f.
Lemma noMiddle : forall (T : System) (f : Formula), SysPrf T (orH (notH f) f).
Lemma nnI : forall (T : System) (f : Formula), SysPrf T f -> SysPrf T (notH (notH f)).
Lemma cp1 : forall (T : System) (f g : Formula), SysPrf T (impH (notH f) (notH g)) -> SysPrf T (impH g f).
Lemma cp2 : forall (T : System) (f g : Formula), SysPrf T (impH g f) -> SysPrf T (impH (notH f) (notH g)).
Lemma orI1 : forall (T : System) (f g : Formula), SysPrf T f -> SysPrf T (orH f g).
Lemma orI2 : forall (T : System) (f g : Formula), SysPrf T g -> SysPrf T (orH f g).
Lemma orE : forall (T : System) (f g h : Formula), SysPrf T (orH f g) -> SysPrf T (impH f h) -> SysPrf T (impH g h) -> SysPrf T h.
Lemma orSys : forall (T : System) (f g h : Formula), SysPrf (Ensembles.Add _ T f) h -> SysPrf (Ensembles.Add _ T g) h -> SysPrf (Ensembles.Add _ T (orH f g)) h.
Lemma andI : forall (T : System) (f g : Formula), SysPrf T f -> SysPrf T g -> SysPrf T (andH f g).
Lemma andE1 : forall (T : System) (f g : Formula), SysPrf T (andH f g) -> SysPrf T f.
Lemma andE2 : forall (T : System) (f g : Formula), SysPrf T (andH f g) -> SysPrf T g.
Lemma iffI : forall (T : System) (f g : Formula), SysPrf T (impH f g) -> SysPrf T (impH g f) -> SysPrf T (iffH f g).
Lemma iffE1 : forall (T : System) (f g : Formula), SysPrf T (iffH f g) -> SysPrf T (impH f g).
Lemma iffE2 : forall (T : System) (f g : Formula), SysPrf T (iffH f g) -> SysPrf T (impH g f).
Lemma forallI : forall (T : System) (f : Formula) (v : nat), ~ In_freeVarSys L v T -> SysPrf T f -> SysPrf T (forallH v f).
Lemma forallE : forall (T : System) (f : Formula) (v : nat) (t : Term), SysPrf T (forallH v f) -> SysPrf T (substituteFormula L f v t).
Lemma forallSimp : forall (T : System) (f : Formula) (v : nat), SysPrf T (forallH v f) -> SysPrf T f.
Lemma existI : forall (T : System) (f : Formula) (v : nat) (t : Term), SysPrf T (substituteFormula L f v t) -> SysPrf T (existH v f).
Lemma existE : forall (T : System) (f g : Formula) (v : nat), ~ In_freeVarSys L v T -> ~ In v (freeVarFormula L g) -> SysPrf T (existH v f) -> SysPrf T (impH f g) -> SysPrf T g.
Lemma existSimp : forall (T : System) (f : Formula) (v : nat), SysPrf T f -> SysPrf T (existH v f).
Lemma existSys : forall (T : System) (f g : Formula) (v : nat), ~ In_freeVarSys L v T -> ~ In v (freeVarFormula L g) -> SysPrf (Ensembles.Add _ T f) g -> SysPrf (Ensembles.Add _ T (existH v f)) g.
Lemma absurd1 : forall (T : System) (f : Formula), SysPrf T (impH f (notH f)) -> SysPrf T (notH f).
Lemma nImp : forall (T : System) (f g : Formula), SysPrf T (andH f (notH g)) -> SysPrf T (notH (impH f g)).
Lemma nOr : forall (T : System) (f g : Formula), SysPrf T (andH (notH f) (notH g)) -> SysPrf T (notH (orH f g)).
Lemma nAnd : forall (T : System) (f g : Formula), SysPrf T (orH (notH f) (notH g)) -> SysPrf T (notH (andH f g)).
Lemma nForall : forall (T : System) (f : Formula) (v : nat), SysPrf T (existH v (notH f)) -> SysPrf T (notH (forallH v f)).
Lemma nExist : forall (T : System) (f : Formula) (v : nat), SysPrf T (forallH v (notH f)) -> SysPrf T (notH (existH v f)).
Lemma impRefl : forall (T : System) (f : Formula), SysPrf T (impH f f).
Lemma impTrans : forall (T : System) (f g h : Formula), SysPrf T (impH f g) -> SysPrf T (impH g h) -> SysPrf T (impH f h).
Lemma orSym : forall (T : System) (f g : Formula), SysPrf T (orH f g) -> SysPrf T (orH g f).
Lemma andSym : forall (T : System) (f g : Formula), SysPrf T (andH f g) -> SysPrf T (andH g f).
Lemma iffRefl : forall (T : System) (f : Formula), SysPrf T (iffH f f).
Lemma iffSym : forall (T : System) (f g : Formula), SysPrf T (iffH f g) -> SysPrf T (iffH g f).
Lemma iffTrans : forall (T : System) (f g h : Formula), SysPrf T (iffH f g) -> SysPrf T (iffH g h) -> SysPrf T (iffH f h).
Lemma openClosed : forall (T : System) (f : Formula), SysPrf T (close L f) -> SysPrf T f.