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 Th13:
  for p2 being Element of CQC-WFF(Al2), S being CQC_Substitution of Al,
  S2 being CQC_Substitution of Al2, x2 being bound_QC-variable of Al2, x, p
  st p = p2 & S = S2 & x = x2 holds RestrictSub(x,p,S) = RestrictSub(x2,p2,S2)
proof
  let p2 be Element of CQC-WFF(Al2), S be CQC_Substitution of Al, S2 be
   CQC_Substitution of Al2, x2 be bound_QC-variable of Al2, x, p such that
A1: p = p2 & S = S2 & x = x2;
  set rset = {y where y is bound_QC-variable of Al : y in still_not-bound_in p
   & y is Element of dom S & y <> x & y <> S.y};
  set rset2 = {y2 where y2 is bound_QC-variable of Al2 : y2 in
   still_not-bound_in p2 & y2 is Element of dom S2 & y2 <> x2 & y2 <> S2.y2};
  rset = rset2
  proof
    for s being object st s in rset holds s in rset2
    proof
      let s be object such that
A2:    s in rset;
      consider y being bound_QC-variable of Al such that
A3:    s = y & y in still_not-bound_in p & y is Element of dom S & y <> x &
       y <> S.y by A2;
      reconsider y as bound_QC-variable of Al2 by Th4,TARSKI:def 3;
      p2 = Al2-Cast(p) by A1;
      then y in still_not-bound_in p2 & y is Element of dom S2 & y <> x2 &
       y <> S2.y by A1,A3,Th12;
      hence s in rset2 by  A3;
    end;
    hence rset c= rset2;
    for s2 being object st s2 in rset2 holds s2 in rset
    proof
      let s2 be object such that
A4:    s2 in rset2;
      consider y2 being bound_QC-variable of Al2 such that
A5:    s2 = y2 & y2 in still_not-bound_in p2 & y2 is Element of dom S2 &
       y2 <> x2 & y2 <> S2.y2 by A4;
      p2 = Al2-Cast(p) by A1;
      then
A6:   y2 in still_not-bound_in p by A5,Th12;
      then reconsider y2 as bound_QC-variable of Al;
      thus s2 in rset by A1,A5,A6;
    end;
    hence rset2 c= rset;
  end;
  then S|rset = S2|rset2 & S|rset = RestrictSub(x,p,S) &
   S2|rset2 = RestrictSub(x2,p2,S2) by A1,SUBSTUT1:def 6;
  hence thesis;
end;
