reserve X,Y for set, x,y,z for object, i,j,n for natural number;
reserve
  n for non empty Nat,
  S for non empty non void n PC-correct PCLangSignature,
  L for language MSAlgebra over S,
  F for PC-theory of L,
  A,B,C,D for Formula of L;
reserve
  J for non empty non void Signature,
  T for non-empty MSAlgebra over J,
  X for non empty-yielding GeneratorSet of T,
  S1 for J-extension non empty non void n PC-correct QC-correct
  QCLangSignature over Union X,
  L for non-empty Language of X extended_by ({},the carrier of S1), S1,
  G for QC-theory of L,
  A,B,C,D for Formula of L;
reserve x,y,z for Element of Union X;
reserve x0,y0,z0 for Element of Union (X extended_by ({},the carrier of S1));
reserve a for SortSymbol of J;
reserve
  L for
    non-empty T-extension Language of X extended_by ({},the carrier of S1), S1,
  G for QC-theory of L,
  G1 for QC-theory_with_equality of L,
  A,B,C,D for Formula of L,
  s,s1 for SortSymbol of S1,
  t,t9 for Element of L,s,
  t1,t2,t3 for Element of L,s1;

theorem
  L is subst-correct3 vf-finite subst-correct2 subst-correct subst-eq-correct
  vf-qc-correct vf-eq-correct &
  x = x0 in X.s & y = y0 in X.s & x <> y nin (vf A).s & X.s is infinite implies
  \for(x,A\iff\ex(y, x '=' (y,L)\and(A/(x0,y0)))) in G1
  proof
    set Y = X extended_by({}, the carrier of S1);
    assume that
A0: L is subst-correct3 vf-finite subst-correct2 subst-correct subst-eq-correct
    vf-qc-correct vf-eq-correct and
A1: x = x0 in X.s & y = y0 in X.s & x <> y nin (vf A).s & X.s is infinite;
A2: s in dom X = the carrier of J by A1,FUNCT_1:def 2,PARTFUN1:def 2;
    then X.s c= (the Sorts of T).s = (the Sorts of L).s
    by Th16,PBOOLE:def 2,def 18;
    then reconsider t1 = x0, t2 = y0 as Element of L,s by A1;
    reconsider j = s as SortSymbol of J by A2;
    reconsider q1 = t1, q2 = t2 as Element of T,j by Th16;
A3: t2 '=' (t1,L)\imp(A/(x0,y0)/(y0,t2)\imp(A/(x0,y0)/(y0,t1))) in G1
    by A1,Def42;
    t1 '=' (t2,L)\imp(t2 '=' (t1,L)) in G1 by A0,A1,A2,ThOne;
    then
A8: t1 '=' (t2,L)\imp(A/(x0,y0)/(y0,t2)\imp(A/(x0,y0)/(y0,t1))) in G1
    by A3,Th45;
    dom Y = the carrier of S1 by PARTFUN1:def 2;
    then
A4: X.s = Y.s & (the Sorts of L).the formula-sort of S1 <> {} &
    Y is ManySortedSubset of the Sorts of L by A2,Th1,Th23;
    then
A5: A/(x0,y0)/(y0,t1) = A/(x0,y0)/(y0,x0) by A1,Th14
    .= A by A0,A1,A4;
A6: A/(x0,y0)/(y0,t2) = A/(x0,y0)/(y0,y0) by A1,A4,Th14
    .= A/(x0,y0) by A0,A1,A4;
    (t1 '=' (t2,L)\imp(A/(x0,y0)\impA))\imp
    (t1 '=' (t2,L)\and(A/(x0,y0))\impA) in G1 by Th48;
    then t1 '=' (t2,L)\and(A/(x0,y0))\impA in G1 by A8,A5,A6,Def38;
    then \for(y,t1 '=' (t2,L)\and(A/(x0,y0))\impA) in G1 &
    \for(y,t1 '=' (t2,L)\and(A/(x0,y0))\impA)\imp
    (\ex(y,t1 '=' (t2,L)\and(A/(x0,y0)))\impA) in G1
    by A0,A1,A2,Th120,Def39;
    then
A9: \ex(y,t1 '=' (t2,L)\and(A/(x0,y0)))\impA in G1 by Def38;
B1: (t1 '=' (t2,L)\and(A/(x0,y0)))/(y0,x0)\imp
    \ex(y, t1 '=' (t2,L)\and(A/(x0,y0))) in G1
    by A0,A1,A2,Th110;
    vf t1 = s-singleton x0 by A0,A1;
    then (vf t1).s = {x0} by AOFA_A00:6;
    then
B2: y0 nin (vf t1).s by A1,TARSKI:def 1;
B3: (t1 '=' (t2,L)\and(A/(x0,y0)))/(y0,x0)
    = ((t1 '=' (t2,L))/(y0,x0))\and(A/(x0,y0)/(y0,x0))
    by A0,A1,A4,Th27
    .= ((t1 '=' (t2,L))/(y0,x0))\andA by A0,A1,A4
    .= ((t1 '=' (t2,L))/(y0,t1))\andA by A1,A4,Th14
    .= t1/(y0,t1) '=' (t2/(y0,t1),L)\andA by A0,A1
    .= t1 '=' (t2/(y0,t1),L)\andA by B2,A0,A1,A4
    .= t1 '=' (t1,L)\andA by A0,A1,A4;
    q1 '=' (q1,L) in G1 by Def42;
    then A\imp(t1 '=' (t1,L)) in G1 & A\impA in G1 by Th34,Th44;
    then A\imp(t1 '=' (t1,L))\andA in G1 by Th201;
    then A\imp\ex(y, t1 '=' (t2,L)\and(A/(x0,y0))) in G1 by B1,B3,Th45;
    then A\iff\ex(y, t1 '=' (t2,L)\and(A/(x0,y0))) in G1 by A9,Th43;
    hence thesis by A1,Def39;
  end;
