Fixpoint FormulasToFormula (n w m : nat)
 (vs : Vector.t (Formula * naryFunc n) m) {struct vs} : Formula :=
  match vs with
  | Vector.nil => equal (var 0) (var 0)
  | Vector.cons v m' vs' =>
      andH (substituteFormula LNN (fst v) 0 (var (S m' + w)))
        (FormulasToFormula n w m' vs')
  end.Fixpoint FormulasToFuncs (n m : nat) (vs : Vector.t (Formula * naryFunc n) m)
 {struct vs} : Vector.t (naryFunc n) m :=
  match vs in (Vector.t _ m) return (Vector.t (naryFunc n) m) with
  | Vector.nil => Vector.nil _
  | Vector.cons v m' vs' => Vector.cons _ (snd v) m' (FormulasToFuncs n m' vs')
  end.Fixpoint RepresentablesHelp (n m : nat)
 (vs : Vector.t (Formula * naryFunc n) m) {struct vs} : Prop :=
  match vs with
  | Vector.nil => True
  | Vector.cons a m' vs' =>
      RepresentableHelp _ (snd a) (fst a) /\ RepresentablesHelp n m' vs'
  end.Remark succRepresentable : Representable 1 S succFormula.Remark zeroRepresentable : Representable 0 0 zeroFormula.Remark projRepresentable :
 forall (n m : nat) (pr : m < n),
 Representable n (evalProjFunc n m pr) (projFormula m).Remark composeSigmaRepresentable :
 forall n w m : nat,
 n <= w ->
 forall (A : Vector.t (Formula * naryFunc n) m) (B : Formula) (g : naryFunc m),
 RepresentablesHelp n m A ->
 Vector.t_rect (Formula * naryFunc n) (fun _ _ => Prop) True
   (fun (pair : Formula * naryFunc n) (m : nat) (v : Vector.t _ m) (rec : Prop) =>
    (forall v : nat, In v (freeVarFormula LNN (fst pair)) -> v <= n) /\ rec)
   m A ->
 Representable m g B ->
 Representable n (evalComposeFunc n m (FormulasToFuncs n m A) g)
   (composeSigmaFormula n w m A B).(*
Local composePiFormula [n,w,m:nat][A:(vector Formula*(naryFunc n) m)][B:Formula] : Formula :=
(addForalls (S w) m (impH (FormulasToFormula n w m A)
(subAllFormula LNN B [x:nat]
     (Cases x of O => (var O) | (S x')=>(var (plus (S x') w))end)))).

Remark composePiRepresentable : (n,w,m:nat)(le n w)->(A:(vector Formula*(naryFunc n) m))
(B:Formula)(g:(naryFunc m))
(RepresentablesHelp n m A)->
(vector_rect Formula*(naryFunc n) [_][_]Prop
 True
 [pair:(Formula*(naryFunc n))][m:nat][v:(vector ? m)][rec:Prop]
 ((v:nat)(In v (freeVarFormula LNN (Fst pair)))->(le v n))/\rec
  m A)->
(Representable m g B)->
(Representable n (evalComposeFunc n m (FormulasToFuncs n m A) g)
 (composePiFormula n w m A B)).
Proof.
Assert (n,w,m:nat)(le n w)->(A:(vector Formula*(naryFunc n) m))
(B:Formula)(g:(naryFunc m))
(RepresentablesHelp n m A)->
(vector_rect Formula*(naryFunc n) [_][_]Prop
 True
 [pair:(Formula*(naryFunc n))][m:nat][v:(vector ? m)][rec:Prop]
 ((v:nat)(In v (freeVarFormula LNN (Fst pair)))->(le v n))/\rec
  m A)->
(Representable m g B)->
(RepresentableHelp n (evalComposeFunc n m (FormulasToFuncs n m A) g)
 (composePiFormula n w m A B)).
Intro.
Induction n; Simpl.
Intros w m H v.
Induction v; Simpl; Intros.
Unfold composePiFormula.
Simpl.
Replace (subAllFormula LNN B
           [x:nat]
            Cases x of
              0 => (var (0))
            | (S x') => (var (S (plus x' w)))
            end)
with (subAllFormula LNN B [x:nat](var x)).
Apply iffTrans with B.
Apply iffTrans with (subAllFormula LNN B [x:nat](var x)).
Apply iffI;
Apply impI.
Apply impE with (equal (var (0)) (var (0))).
Apply Axm; Right; Constructor.
Apply eqRefl.
Apply impI.
Apply Axm; Left; Right; Constructor.
Apply (subAllFormulaId LNN).
Induction H2.
Auto.
Apply subAllFormula_ext.
Intros.
NewDestruct m.
Auto.
Elim (le_Sn_O n).
Induction H2.
Apply H2.
Auto.
Induction H0.
Induction H1.
Induction H2.
Assert (a:nat)(SysPrf NN
	    (iffH (composePiFormula (0) w n v (substituteFormula LNN B (S n) (natToTerm a)))
              (equal (var (0))
                (natToTerm
                  (evalList n (FormulasToFuncs (0) n v) (g a)))))).
Intros.
Apply Hrecv.
Auto.
Auto.
Split.
Intros.
NewInduction (freeVarSubFormula3 ? ? ? ? ? H6).
Assert (In v0 (freeVarFormula LNN B)).
EApply In_list_remove1.
Apply H7.
NewInduction (le_lt_or_eq ? ? (H2 ? H8)).
Apply lt_n_Sm_le.
Auto.
Elim (In_list_remove2 ? ? ? ? ? H7).
Auto.
Elim (closedNatToTerm ? ? H7).
Apply H5.
Clear Hrecv.
Unfold composePiFormula.
Unfold composePiFormula in H6.
Simpl.
Apply iffTrans with (addForalls (S w) n
              (impH (FormulasToFormula (0) w n v)
                (subAllFormula LNN
                  (substituteFormula LNN B (S n) (natToTerm (Snd a)))
                  [x:nat]
                   Cases x of
                     0 => (var (0))
                   | (S x') => (var (S (plus x' w)))
                   end)));
[Idtac | Apply H6].
Clear H6.
Apply iffTrans with (forallH (plus n (S w))
         (addForalls (S w) n
           (impH
             (andH
               (substituteFormula LNN (equal (var (0)) (natToTerm (Snd a))) (0) (var (S (plus n w))))
               (FormulasToFormula (0) w n v))
             (subAllFormula LNN B
               [x:nat]
                Cases x of
                  0 => (var (0))
                | (S x') => (var (S (plus x' w)))
                end)))).
Apply (reduceForall LNN).
Apply closedNN.
Apply reduceAddForalls.
Apply (reduceImp LNN); Try Apply iffRefl.
Apply (reduceAnd LNN); Try Apply iffRefl.
Apply (reduceSub LNN).
Apply closedNN.
Auto.
Rewrite (subFormulaEqual LNN).
Rewrite (subTermVar1 LNN).
Rewrite (subTermNil LNN).
Apply iffTrans with (forallH (plus n (S w))
       (impH         (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
        (addForalls (S w) n
             (impH
               (FormulasToFormula (0) w n v)
             (subAllFormula LNN B
               [x:nat]
                Cases x of
                  0 => (var (0))
                | (S x') => (var (S (plus x' w)))
                end))))).
Apply (reduceForall LNN).
Apply closedNN.
Apply iffI.
Repeat Apply impI.
Cut (SysPrf
     (Ensembles.Add (fol.Formula LNN)
       (Ensembles.Add (fol.Formula LNN) NN
           (impH
             (andH
               (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
               (FormulasToFormula (0) w n v))
             (subAllFormula LNN B
               [x:nat]
                Cases x of
                  0 => (var (0))
                | (S x') => (var (S (plus x' w)))
                end)))
       (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a))))
       (impH (FormulasToFormula (0) w n v)
         (subAllFormula LNN B
           [x:nat]
            Cases x of
              0 => (var (0))
            | (S x') => (var (S (plus x' w)))
            end))).
Generalize (impH
             (andH
               (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
               (FormulasToFormula (0) w n v))
             (subAllFormula LNN B
               [x:nat]
                Cases x of
                  0 => (var (0))
                | (S x') => (var (S (plus x' w)))
                end)) (impH (FormulasToFormula (0) w n v)
       (subAllFormula LNN B
         [x:nat]
          Cases x of
            0 => (var (0))
          | (S x') => (var (S (plus x' w)))
          end)).
Cut (lt (plus n w) (S (plus n w))).
Generalize (S (plus n w)).
Intros.
Clear H5 H2 H4 H1 H3 H0 g B v.
Induction n.
Simpl.
Auto.
Simpl.
Apply forallI.
Simpl; Unfold not; Intros.
Induction H0; Induction H0.
Induction H1.
Induction H1.
Elim closedNN with (plus n (S w)).
Exists x; Auto.
Induction H1.
Simpl in H0.
Elim (In_list_remove2 ? ? ? ? ? H0).
Auto.
Induction H1.
Induction H0.
Rewrite <- plus_Snm_nSm in H0.
Rewrite H0 in H6.
Elim (lt_n_n ? H6).
Simpl in H0.
Elim (closedNatToTerm ? ? H0).
Apply impE with (fol.equal LNN (var n0) (natToTerm (Snd a))).
Apply impE with (addForalls (S w) n f).
Repeat Apply sysWeaken.
Repeat Apply impI.
Apply Hrecn.
EApply lt_trans.
Apply lt_n_Sn.
Auto.
Apply forallSimp with (plus n (S w)).
Apply Axm; Left; Right; Constructor.
Apply Axm; Right; Constructor.
Apply lt_n_Sn.
Apply impI.
Apply impE with (andH
               (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
               (FormulasToFormula (0) w n v)).
Apply Axm; Left; Left; Right; Constructor.
Apply andI.
Apply Axm; Left; Right; Constructor.
Apply Axm; Right; Constructor.
Apply impI.
Cut (SysPrf
     (Ensembles.Add (fol.Formula LNN) NN
       (impH (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
           (impH (FormulasToFormula (0) w n v)
             (subAllFormula LNN B
               [x:nat]
                Cases x of
                  0 => (var (0))
                | (S x') => (var (S (plus x' w)))
                end))))
       (impH
         (andH (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
           (FormulasToFormula (0) w n v))
         (subAllFormula LNN B
           [x:nat]
            Cases x of
              0 => (var (0))
            | (S x') => (var (S (plus x' w)))
            end))).
Generalize (impH (FormulasToFormula (0) w n v)
               (subAllFormula LNN B
                 [x:nat]
                  Cases x of
                    0 => (var (0))
                  | (S x') => (var (S (plus x' w)))
                  end))
(impH
           (andH
             (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
             (FormulasToFormula (0) w n v))
           (subAllFormula LNN B
             [x:nat]
              Cases x of
                0 => (var (0))
              | (S x') => (var (S (plus x' w)))
              end)).
Cut (lt (plus n w) (S (plus n w))).
Generalize (S (plus n w)).
Intros.
Clear H5 H2 H4 H1 H3 H0 g B v.
Induction n.
Auto.
Simpl.
Apply forallI.
Unfold not; Intros.
Induction H0; Induction H0.
Induction H1.
Elim closedNN with (plus n (S w)).
Exists x; Auto.
Induction H1.
Simpl in H0.
Induction H0.
Rewrite <- plus_Snm_nSm in H0.
Rewrite <- H0 in H6.
Elim (lt_n_n ? H6).
NewInduction (in_app_or H0).
Elim (closedNatToTerm ? ? H1).
Elim (In_list_remove2 ? ? ? ? ? H1).
Auto.
Apply impE with (impH (fol.equal LNN (var n0) (natToTerm (Snd a)))
         (addForalls (S w) n f)).
Apply sysWeaken.
Apply impI.
Apply Hrecn.
EApply lt_trans.
Apply lt_n_Sn.
Apply H6.
Apply impI.
EApply forallSimp.
Apply impE with (fol.equal LNN (var n0) (natToTerm (Snd a))).
Apply Axm; Left; Right; Constructor.
Apply Axm; Right; Constructor.
Apply lt_n_Sn.
Apply impI.
Apply impE with (FormulasToFormula (0) w n v).
Apply impE with (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a))).
Apply Axm; Left; Right; Constructor.
EApply andE1.
Apply Axm; Right; Constructor.
EApply andE2.
Apply Axm; Right; Constructor.
Apply iffTrans with (substituteFormula LNN (addForalls (S w) n
             (impH (FormulasToFormula (0) w n v)
               (subAllFormula LNN B
                 [x:nat]
                  Cases x of
                    0 => (var (0))
                  | (S x') => (var (S (plus x' w)))
                  end))) (plus (S n) w) (natToTerm (Snd a))).
Rewrite <- plus_Snm_nSm.
Apply iffI.
Apply impI.
Apply impE with (substituteFormula LNN
 (fol.equal LNN (var (S (plus n w))) (natToTerm (Snd a)))
 (S (plus n w)) (natToTerm (Snd a))).
Rewrite <- (subFormulaImp LNN).
Apply forallE.
Apply Axm; Right; Constructor.
Rewrite subFormulaEqual.
Rewrite (subTermVar1 LNN).
Rewrite (subTermNil LNN).
Apply eqRefl.
Apply closedNatToTerm.
Apply impI.
Apply forallI.
Unfold not; Intros.
Induction H6; Induction H6.
Induction H7.
Elim closedNN with (plus (S n) w).
Exists x; Auto.
Induction H7.
Simpl in H6.
NewInduction (freeVarSubFormula3 ? ? ? ? ? H6).
Elim (In_list_remove2 ? ? ? ? ? H7).
Auto.
Elim (closedNatToTerm ? ? H7).
Apply impI.
Rewrite <- (subFormulaId LNN (addForalls (S w) n
       (impH (FormulasToFormula (0) w n v)
         (subAllFormula LNN B
           [x:nat]
            Cases x of
              0 => (var (0))
            | (S x') => (var (S (plus x' w)))
            end))) (S (plus n w))).
Apply impE with (substituteFormula LNN
       (addForalls (S w) n
         (impH (FormulasToFormula (0) w n v)
           (subAllFormula LNN B
             [x:nat]
              Cases x of
                0 => (var (0))
              | (S x') => (var (S (plus x' w)))
              end))) (S (plus n w)) (natToTerm (Snd a))).
Apply (subWithEquals LNN).
Apply eqSym.
Apply Axm; Right; Constructor.
Rewrite subFormulaId.
Apply Axm; Left; Right; Constructor.
Rewrite subAddForallsNice.
Apply reduceAddForalls.
Rewrite (subFormulaImp LNN).
Apply (reduceImp LNN).
Apply (subFormulaNil LNN).
Cut (lt (plus n w) (plus (S n) w)).
Generalize (plus (S n) w).
Clear H5 H3 g H2.
Induction v; Unfold not; Intros.
Simpl in H3.
Decompose Sum H3.
Rewrite <- H5 in H2.
Elim (lt_n_O ? H2).
Rewrite <- H6 in H2.
Elim (lt_n_O ? H2).
Simpl in H3.
NewInduction (in_app_or H3).
Simpl in H4.
NewInduction (freeVarSubFormula3 ? ? ? ? ? H5).
Elim (le_not_lt n0 O).
Decompose Record H4.
Apply H7.
EApply In_list_remove1.
Apply H6.
Apply lt_trans with (plus (S n) w).
Simpl; Apply lt_O_Sn.
Auto.
Induction H6.
Rewrite <- H6 in H2.
Elim (lt_n_n ? H2).
Elim H6.
Elim Hrecv with n0:=n0.
Simpl in H4.
Tauto.
EApply lt_trans.
Apply lt_n_Sn.
Auto.
Auto.
Simpl.
Apply lt_n_Sn.
EApply iffTrans.
Apply (subSubAllFormula LNN).
Apply iffSym.
EApply iffTrans.
Apply (subAllSubFormula LNN).
Replace (subAllFormula LNN B
         [n1:nat]
          (substituteTerm LNN
            Cases n1 of
              0 => (var (0))
            | (S x') => (var (S (plus x' w)))
            end (plus (S n) w) (natToTerm (Snd a))))
with (subAllFormula LNN B
         [x:nat]
          Cases (eq_nat_dec (S n) x) of
            (left _) => 
             (subAllTerm LNN (natToTerm (Snd a))
               [x0:nat]
                Cases x0 of
                  0 => (var (0))
                | (S x') => (var (S (plus x' w)))
                end)
          | (right _) => 
             ([x0:nat]
               Cases x0 of
                 0 => (var (0))
               | (S x') => (var (S (plus x' w)))
               end x)
          end).
Apply iffRefl.
Apply subAllFormula_ext.
Intros.
NewInduction (eq_nat_dec (S n) m).
Rewrite <- a0.
Rewrite (subTermVar1 LNN).
Clear H0.
NewInduction (Snd a).
Simpl.
Reflexivity.
Simpl.
Rewrite IHn0.
Reflexivity.
NewDestruct m.
Simpl.
Reflexivity.
Rewrite (subTermVar2 LNN).
Reflexivity.
Unfold not; Intros; Elim b.
Apply simpl_plus_l with w.
Repeat Rewrite (plus_sym w).
Apply H7.
Left.
Rewrite <- (plus_Snm_nSm).
Apply le_n.
Intros.
Elim (closedNatToTerm ? ? H6).
Apply closedNatToTerm.
Intros.
LetTac v' := (vector_rec Formula*(nat->(naryFunc n)) [m:nat][v:(vector ? m)](vector Formula*(naryFunc n) m)
(Vnil ?)
[pair:Formula*(nat->(naryFunc n))][m:nat][v:(vector ? m)][rec:(vector Formula*(naryFunc n) m)]
(Vcons ? ((substituteFormula LNN (Fst pair) (S n) (natToTerm a)),
          (Snd pair a)) m rec)
? A).
Assert (RepresentableHelp n
                     (evalComposeFunc n m (FormulasToFuncs n m v') g)
                     (addForalls (S w) m
                       (impH (FormulasToFormula n w m v')
                         (subAllFormula LNN B
                           [x:nat]
                            Cases x of
                              0 => (var (0))
                            | (S x') => (var (S (plus x' w)))
                            end)))).
Unfold composePiFormula in Hrecn.
Simpl in Hrecn.
Apply Hrecn.
EApply le_trans.
Apply le_n_Sn.
Auto.
Clear B g H2.
Induction A;
Simpl in v';
Simpl.
Auto.
Split.
Simpl in H0.
Induction H0.
Apply H0.
Apply HrecA.
Induction H0.
Auto.
Simpl in H1.
Induction H1.
Auto.
Simpl in H1.
Clear H2 H0 g B.
Induction A.
Simpl.
Auto.
Simpl.
Split.
Simpl in H1.
Induction H1.
Intros.
NewInduction (freeVarSubFormula3 ? ? ? ? ? H2).
Assert (le v (S n)).
Apply H0.
EApply In_list_remove1.
Apply H3.
NewInduction (le_lt_or_eq ? ? H4).
Apply lt_n_Sm_le.
Auto.
Elim (In_list_remove2 ? ? ? ? ? H3).
Auto.
Elim (closedNatToTerm ? ? H3).
Apply HrecA.
Induction H1.
Auto.
Auto.
Unfold composePiFormula.
Clear Hrecn.
Apply RepresentableAlternate with (addForalls (S w) m
           (impH (FormulasToFormula n w m v')
             (subAllFormula LNN B
               [x:nat]
                Cases x of
                  0 => (var (0))
                | (S x') => (var (S (plus x' w)))
                end))).
Rewrite subAddForallsNice.
Apply reduceAddForalls.
Rewrite (subFormulaImp LNN).
Apply (reduceImp LNN).
Clear H3 H2 H1 H0 g B.
Induction A.
Simpl.
Apply iffSym.
Apply (subFormulaNil LNN).
Simpl.
Unfold not; Intros.
Decompose Sum H0.
Discriminate H1.
Discriminate H2.
Simpl.
Rewrite (subFormulaAnd LNN).
Apply (reduceAnd LNN); [Idtac | Apply HrecA].
Apply (subFormulaExch LNN).
Discriminate.
Apply closedNatToTerm.
Unfold not; Intros.
Induction H0.
Rewrite <- H0 in H.
Elim (le_not_lt ? ? H).
Apply le_lt_n_Sm.
Apply le_plus_r.
Apply H0.
Apply iffSym.
Apply (subFormulaNil LNN).
Unfold not; Intros.
Decompose Record (freeVarSubAllFormula1 ? ? ? ? H4).
NewDestruct x.
Induction H7.
Discriminate H5.
Elim H5.
Induction H7.
Rewrite <- H5 in H.
Elim (le_not_lt ? ? H).
Apply le_lt_n_Sm.
Apply le_plus_r.
Apply H5.
Right.
Apply le_lt_n_Sm.
Auto.
Intros.
Elim (closedNatToTerm ? ? H4).
Apply Representable_ext with (evalComposeFunc n m (FormulasToFuncs n m v') g).
Clear H3 H2 H1 H0 B.
Apply extEqualCompose.
Unfold extEqualVector.
Clear g.
Induction A; Simpl.
Auto.
Split.
Apply extEqualRefl.
Apply HrecA.
Apply extEqualRefl.
Apply H3.
Intros.
Split.
Intros.
Unfold composePiFormula in H4.
Assert (In v (freeVarFormula LNN
             (impH (FormulasToFormula n w m A)
               (subAllFormula LNN B
                 [x:nat]
                  Cases x of
                    0 => (var (0))
                  | (S x') => (var (plus (S x') w))
                  end)))).
EApply freeVarAddForalls1.
Apply H4.
Simpl in H5.
NewInduction (in_app_or H5).
Assert (le (plus m (S w)) v)\/(lt v (S w)).
EApply freeVarAddForalls2.
Apply H4.
Clear H5 H4 H3 H1 g B.
Induction A.
Simpl in H6.
Decompose Sum H6.
Rewrite <- H1.
Apply le_O_n.
Rewrite <- H3.
Apply le_O_n.
Simpl in H6.
NewInduction (in_app_or H6).
Simpl in H2.
Induction H2.
NewInduction (freeVarSubFormula3 ? ? ? ? ? H1).
Apply H2.
EApply In_list_remove1.
Apply H4.
Induction H4.
Rewrite <- H4 in H7.
Induction H7.
Rewrite <- plus_Snm_nSm in H5.
Simpl in H5.
Elim (le_Sn_n ? H5).
Elim (lt_not_le ? ? H5).
Apply le_n_S.
Apply le_plus_r.
Elim H4.
Apply HrecA; Auto.
Simpl in H2.
Tauto.
Induction H7.
Left.
Simpl in H3.
EApply le_trans.
Apply le_n_Sn.
Apply H3.
Auto.
Decompose Record (freeVarSubAllFormula1 ? ? ? ? H6).
NewDestruct x.
Induction H9.
Rewrite <- H7.
Apply le_O_n.
Elim H7.
Induction H9.
Rewrite <- H7.
Induction H3.
Assert (le (S n0) m).
Apply H3.
Auto.
NewInduction (freeVarAddForalls2 ? ? ? ? H4).
Rewrite <- H7 in H11.
Rewrite <- plus_Snm_nSm in H11.
Simpl in H11.
Elim (le_not_lt m n0).
Apply simpl_le_plus_l with w.
Repeat Rewrite (plus_sym w).
Apply le_S_n.
Auto.
Apply lt_S_n.
Apply le_lt_n_Sm.
Auto.
Rewrite <- H7 in H11.
Elim (lt_not_le ? ? H11).
Apply le_n_S.
Apply le_plus_r.
Elim H7.
Apply H; Auto.
Qed.
*)

Remark boundedCheck :
 forall P : nat -> Prop,
 (forall x : nat, decidable (P x)) ->
 forall c : nat,
 (forall d : nat, d < c -> ~ P d) \/ (exists d : nat, d < c /\ P d).Remark smallestExists :
 forall P : nat -> Prop,
 (forall x : nat, decidable (P x)) ->
 forall c : nat,
 P c -> exists a : nat, P a /\ (forall b : nat, b < a -> ~ P b).Remark minimize1 :
 forall (A B : Formula) (v x : nat),
 v <> x ->
 ~ In x (freeVarFormula LNN B) ->
 forall a : nat,
 SysPrf NN (substituteFormula LNN A v (natToTerm a)) ->
 SysPrf NN (substituteFormula LNN B v (natToTerm a)) ->
 (forall b : nat,
  b < a -> SysPrf NN (notH (substituteFormula LNN A v (natToTerm b)))) ->
 (forall b : nat,
  b < a -> SysPrf NN (notH (substituteFormula LNN B v (natToTerm b)))) ->
 SysPrf NN (iffH (minimize A B v x) (equal (var v) (natToTerm a))).

Lemma freeVarPrimRecPiFormulaHelp1 : forall (n : nat) (A B : Formula) (v : nat), In v (freeVarFormula LNN (primRecPiFormulaHelp n A B)) -> In v (freeVarFormula LNN A) \/ In v (freeVarFormula LNN B) \/ v = S (S n) \/ v = S n.