reserve Al for QC-alphabet;
reserve PHI for Consistent Subset of CQC-WFF(Al),
        p,q,r,s for Element of CQC-WFF(Al),
        A for non empty set,
        J for interpretation of Al,A,
        v for Element of Valuations_in(Al,A),
        m,n,i,j,k for Nat,
        l for CQC-variable_list of k,Al,
        P for QC-pred_symbol of k,Al,
        x,y,z for bound_QC-variable of Al,
        b for QC-symbol of Al,
        PR for FinSequence of [:set_of_CQC-WFF-seq(Al),Proof_Step_Kinds:];
reserve Al2 for Al-expanding QC-alphabet,
        J2 for interpretation of Al2,A,
        Jp for interpretation of Al,A,
        v2 for Element of Valuations_in(Al2,A),
        vp for Element of Valuations_in(Al,A);

theorem Th14:
  for p2 being Element of CQC-WFF(Al2), S being finite CQC_Substitution of Al,
  S2 being finite CQC_Substitution of Al2, p st S = S2 & p = p2 holds
  upVar(S,p) = upVar(S2,p2)
proof
  let p2 be Element of CQC-WFF(Al2), S be finite CQC_Substitution of
   Al, S2 being finite CQC_Substitution of Al2, p such that
A1: S = S2 & p = p2;
A2: Sub_Var(S) = Sub_Var(S2)
  proof
    for s being object st s in Sub_Var(S) holds s in Sub_Var(S2)
    proof
      let s be object such that
A3:    s in Sub_Var(S);
      s in {t where t is QC-symbol of Al : x.t in rng S} by A3,SUBSTUT1:def 10;
      then consider s2 being QC-symbol of Al such that
A4:    s = s2 & x.s2 in rng S;
      s2 in QC-symbols(Al) & QC-symbols(Al) c= QC-symbols(Al2) by Th2;
      then consider s3 being QC-symbol of Al2 such that
A5:    s3 = s2;
      x.s2 =[4,s2] by QC_LANG3:def 2 .= x.s3 by A5,QC_LANG3:def 2;
      then s3 in {t where t is QC-symbol of Al2 : x.t in rng S2} by A1,A4;
      hence thesis by A4,A5,SUBSTUT1:def 10;
    end;
    hence Sub_Var(S) c= Sub_Var(S2);
    for s being object st s in Sub_Var(S2) holds s in Sub_Var(S)
    proof
      let s be object such that
A6:    s in Sub_Var(S2);
      s in {t where t is QC-symbol of Al2:x.t in rng S2} by A6,SUBSTUT1:def 10;
      then consider s2 being QC-symbol of Al2 such that
A7:   s = s2 & x.s2 in rng S2;
A8:   rng @S c= bound_QC-variables(Al) by SUBSTUT1:39;
      x.s2 in rng @S by A1,A7,SUBSTUT1:def 2;
      then x.s2 in bound_QC-variables(Al) by A8;
      then [4,s2] in [:{4},QC-symbols(Al):] by QC_LANG3:def 2;
      then s2 in QC-symbols(Al) by ZFMISC_1:87;
      then consider s3 being QC-symbol of Al such that
A9:   s3 = s2;
      x.s2 =[4,s2] by QC_LANG3:def 2.= x.s3 by A9,QC_LANG3:def 2;
      then s3 in {t where t is QC-symbol of Al : x.t in rng S} by A1,A7;
      hence thesis by A7,A9,SUBSTUT1:def 10;
    end;
    hence Sub_Var(S2) c= Sub_Var(S);
  end;
  defpred P[Element of QC-WFF(Al)] means for q2 being Element of CQC-WFF(Al2)
   st $1 = q2 holds Bound_Vars($1) = Bound_Vars(q2);
A10: P[VERUM(Al)]
  proof
    let q2 be Element of CQC-WFF(Al2) such that
A11: q2 = VERUM(Al);
    q2 = VERUM(Al2) by A11;
    hence Bound_Vars(q2)={} by SUBSTUT1:2.=Bound_Vars(VERUM(Al)) by SUBSTUT1:2;
  end;
A12: for k,P,l holds P[P!l]
  proof
    let k,P,l;
    set P2 = Al2-Cast(P);
    set l2 = Al2-Cast(l);
    let q2 be Element of CQC-WFF(Al2) such that
A13: P!l = q2;
A14: q2 = Al2-Cast(P!l) by A13 .= P2!l2 by Th8;
    thus Bound_Vars(P!l) = still_not-bound_in (P!l) by SUBLEMMA:43
     .= still_not-bound_in (Al2-Cast(P!l)) by Th12
     .= still_not-bound_in (P2!l2) by Th8
     .= Bound_Vars(q2) by A14,SUBLEMMA:43;
  end;
A15: for r,s st P[r] & P[s] holds P[r '&' s]
  proof
    let r,s such that
A16: P[r] & P[s];
    set q = r '&' s;
    set r2 = Al2-Cast(r);
    set s2 = Al2-Cast(s);
    let q2 be Element of CQC-WFF(Al2) such that
A17: r '&' s = q2;
A18: q2 = r2 '&' s2 by A17;
    then q is conjunctive & q2 is conjunctive;
    then
A19: the_left_argument_of q = r & the_right_argument_of q = s &
    the_left_argument_of q2 = r2 & the_right_argument_of q2 = s2
    by A18,QC_LANG1:def 25, def 26;
A20: Bound_Vars(r) = Bound_Vars(r2) & Bound_Vars(s) = Bound_Vars(s2) by A16;
    thus Bound_Vars(q) = Bound_Vars(r) \/ Bound_Vars(s)
     by A19,SUBSTUT1:5,QC_LANG1:def 20
     .= Bound_Vars(q2) by A18,A19,A20,SUBSTUT1:5,QC_LANG1:def 20;
  end;
A21: for r st P[r] holds P['not' r]
  proof
    let r such that
A22: P[r];
    set q = 'not' r;
    set r2 = Al2-Cast(r);
    let q2 be Element of CQC-WFF(Al2) such that
A23: q = q2;
A24: q2 = 'not' r2 by A23;
    then q is negative & q2 is negative;
    then
A25: the_argument_of q = r & the_argument_of q2 = r2 by A24,QC_LANG1:def 24;
    thus Bound_Vars(q) = Bound_Vars(r) by A25,SUBSTUT1:4,QC_LANG1:def 19
     .= Bound_Vars(r2) by A22 .= Bound_Vars(q2)
     by A24,A25,SUBSTUT1:4,QC_LANG1:def 19;
  end;
A26: for x,r st P[r] holds P[All(x,r)]
  proof
    let x,r such that
A27: P[r];
    set q = All(x,r);
    set r2 = Al2-Cast(r);
    set x2 = Al2-Cast(x);
    let q2 be Element of CQC-WFF(Al2) such that
A28: q = q2;
A29: q2 = All(x2,r2) by A28;
    then q is universal & q2 is universal;
    then
A30: the_scope_of q = r & bound_in q = x & the_scope_of q2 = r2 &
     bound_in q2 = x2 by A29,QC_LANG1:def 27,def 28;
    thus Bound_Vars(q) = Bound_Vars(r) \/ {x}
     by A30,SUBSTUT1:6,QC_LANG1:def 21
     .= Bound_Vars(r2) \/ {x2} by A27 .= Bound_Vars(q2)
     by A29,A30,SUBSTUT1:6,QC_LANG1:def 21;
  end;
A31: for r,s,x,k,l,P holds P[VERUM(Al)] & P[P!l] & (P[r] implies P['not' r]) &
  (P[r] & P[s] implies P[r '&' s]) & (P[r] implies P[All(x, r)])
   by A10,A12,A15,A21,A26;
A32: for q being Element of CQC-WFF(Al) holds P[q] from CQC_LANG:sch 1(A31);
A33: Dom_Bound_Vars p = Dom_Bound_Vars p2
  proof
    for s being object st s in Dom_Bound_Vars p holds s in Dom_Bound_Vars p2
    proof
      let s be object such that
A34:   s in Dom_Bound_Vars p;
      s in {b where b is QC-symbol of Al : x.b in Bound_Vars p}
       by A34,SUBSTUT1:def 9;
      then consider s2 being QC-symbol of Al such that
A35:   s = s2 & x.s2 in Bound_Vars p;
      x.s2 in Bound_Vars p2 by A1,A32,A35;
      then x.s2 in bound_QC-variables(Al2);
      then [4,s2] in [:{4},QC-symbols(Al2):] by QC_LANG3:def 2;
      then s2 in QC-symbols(Al2) by ZFMISC_1:87;
      then consider s3 being QC-symbol of Al2 such that
A36:   s3 = s2;
      x.s2 =[4,s2] by QC_LANG3:def 2 .= x.s3 by A36,QC_LANG3:def 2;
      then x.s3 in Bound_Vars p2 by A1,A32,A35;
      then s3 in {b where b is QC-symbol of Al2 : x.b in Bound_Vars p2};
      hence thesis by A35,A36,SUBSTUT1:def 9;
    end;
    hence Dom_Bound_Vars p c= Dom_Bound_Vars p2;
    for s being object st s in Dom_Bound_Vars p2 holds s in Dom_Bound_Vars p
    proof
      let s be object such that
A37:   s in Dom_Bound_Vars p2;
      s in {b where b is QC-symbol of Al2 : x.b in Bound_Vars p2}
       by A37,SUBSTUT1:def 9;
      then consider s2 being QC-symbol of Al2 such that
A38:   s = s2 & x.s2 in Bound_Vars p2;
      x.s2 in Bound_Vars p by A1,A32,A38;
      then x.s2 in bound_QC-variables(Al);
      then [4,s2] in [:{4},QC-symbols(Al):] by QC_LANG3:def 2;
      then s2 in QC-symbols(Al) by ZFMISC_1:87;
      then consider s3 being QC-symbol of Al such that
A39:   s3 = s2;
      x.s2 =[4,s2] by QC_LANG3:def 2 .= x.s3 by A39,QC_LANG3:def 2;
      then x.s3 in Bound_Vars p by A1,A32,A38;
      then s3 in {b where b is QC-symbol of Al : x.b in Bound_Vars p};
      hence thesis by A38,A39,SUBSTUT1:def 9;
    end;
    hence Dom_Bound_Vars p2 c= Dom_Bound_Vars p;
  end;
A40: NSub(p,S) = NAT\(Dom_Bound_Vars(p)\/Sub_Var(S)) by SUBSTUT1:def 11
   .= NSub(p2,S2) by A2,A33,SUBSTUT1:def 11;
  thus upVar(S,p) = the Element of NSub(p,S) by SUBSTUT1:def 12
   .= upVar(S2,p2) by A40,SUBSTUT1:def 12;
end;
