reserve Al for QC-alphabet;
reserve a,b,c,d for object,
  i,k,n for Nat,
  p,q for Element of CQC-WFF(Al),
  x,y,y1 for bound_QC-variable of Al,
  A for non empty set,
  J for interpretation of Al,A,
  v,w for Element of Valuations_in(Al,A),
  f,g for Function,
  P,P9 for QC-pred_symbol of k,Al,
  ll,ll9 for CQC-variable_list of k,Al,
  l1 for FinSequence of QC-variables(Al),
  Sub,Sub9,Sub1 for CQC_Substitution of Al,
  S,S9,S1,S2 for Element of CQC-Sub-WFF(Al),
  s for QC-symbol of Al;
reserve vS,vS1,vS2 for Val_Sub of A,Al;
reserve B for Element of [:QC-Sub-WFF(Al),bound_QC-variables(Al):],
  SQ for second_Q_comp of B;
reserve B for CQC-WFF-like Element of [:QC-Sub-WFF(Al),
  bound_QC-variables(Al):],
  xSQ for second_Q_comp of [S,x],
  SQ for second_Q_comp of B;
reserve B1 for Element of [:QC-Sub-WFF(Al),bound_QC-variables(Al):];
reserve SQ1 for second_Q_comp of B1;
reserve a for Element of A;

theorem Th53:
  [S,x] is quantifiable implies for a holds Val_S(v.((S_Bound(@
CQCSub_All([S,x],xSQ)))|a),S) = NEx_Val(v.((S_Bound(@CQCSub_All([S,x],xSQ)))|a)
  ,S,x,xSQ)+*(x|a) & dom RestrictSub(x,All(x,S`1),xSQ) misses {x}
proof
  assume
A1: [S,x] is quantifiable;
  set finSub = RestrictSub(x,All(x,S`1),xSQ);
  let a;
  set S1 = CQCSub_All([S,x],xSQ);
  set z = S_Bound(@S1);
A2: S`2 = ExpandSub(x,S`1,RestrictSub(x,All(x,S`1),xSQ)) by A1,Th41;
A3: now
    reconsider F = {[x,x]} as Function;
    assume
A4: not x in rng finSub;
    then S`2 = finSub \/ F by A2,SUBSTUT1:def 13;
    then
A5: @S`2 = finSub \/ F by SUBSTUT1:def 2;
A6: now
      set q = All(x,S`1);
      set X = {y1 : y1 in still_not-bound_in q & y1 is Element of dom xSQ & y1
      <> x & y1 <> xSQ.y1};
      assume not dom finSub misses {x};
      then dom finSub /\ {x} <> {};
      then consider b being object such that
A7:   b in dom finSub /\ {x} by XBOOLE_0:def 1;
      finSub = xSQ|X by SUBSTUT1:def 6;
      then finSub = (@xSQ)|X by SUBSTUT1:def 2;
      then @finSub = (@xSQ)|X by SUBSTUT1:def 2;
      then dom @finSub = dom @xSQ /\ X by RELAT_1:61;
      then
A8:   dom @finSub c= X by XBOOLE_1:17;
      b in dom finSub by A7,XBOOLE_0:def 4;
      then b in dom @finSub by SUBSTUT1:def 2;
      then b in X by A8;
      then
A9:  ex y st y = b & y in still_not-bound_in q & y is Element of dom xSQ
      & y <> x & y <> xSQ.y;
      b in {x} by A7,XBOOLE_0:def 4;
      hence contradiction by A9,TARSKI:def 1;
    end;
    hence dom finSub misses {x};
    dom {[x,x]} = {x} by RELAT_1:9;
    then dom @finSub misses dom F by A6,SUBSTUT1:def 2;
    then
A10: @finSub \/ F = (@finSub +* F) by FUNCT_4:31;
    v.(z|a) is Element of Funcs(bound_QC-variables(Al),A) by VALUAT_1:def 1;
    then
A11: ex f st v.(z|a) = f & dom f = bound_QC-variables(Al) & rng f c= A by
FUNCT_2:def 2;
A12: rng F = {x} by RELAT_1:9;
    then dom (F*v.(z|a)) = dom F by A11,RELAT_1:27;
    then
A13: dom (F*v.(z|a)) = {x} by RELAT_1:9;
A14: {[x,x]} = x .--> x by FUNCT_4:82;
    for b being object st b in dom (x|a) holds (x|a).b = (F*v.(z|a)).b
    proof
      let b being object such that
A15:  b in dom (x|a);
A16:  (F*v.(z|a)).b = v.(z|a).(F.b) by A13,A15,FUNCT_1:12;
      b = x by A15,TARSKI:def 1;
      then (x|a).b = a & F.b = x by A14,FUNCOP_1:72;
      hence thesis by A1,A4,A16,Th49,Th52;
    end;
    then
A17: (x|a) = (F*v.(z|a)) by A13,FUNCT_1:2;
    (@finSub +* F)* v.(z|a) = (@finSub*v.(z|a)) +* (F*v.(z|a)) by A11,A12,
FUNCT_7:9;
    hence Val_S(v.(z|a),S) = NEx_Val(v.(z|a),S,x,xSQ) +* (x|a) by A10,A5,A17,
SUBSTUT1:def 2;
  end;
  now
    reconsider F = {[x,x.upVar(finSub,S`1)]} as Function;
    assume
A18: x in rng finSub;
A19: now
      set q = All(x,S`1);
      set X = {y1 : y1 in still_not-bound_in q & y1 is Element of dom xSQ & y1
      <> x & y1 <> xSQ.y1};
      assume dom finSub meets {x};
      then consider b being object such that
A20:  b in dom finSub and
A21:  b in {x} by XBOOLE_0:3;
      finSub = xSQ|X by SUBSTUT1:def 6;
      then finSub = (@xSQ)|X by SUBSTUT1:def 2;
      then @finSub = (@xSQ)|X by SUBSTUT1:def 2;
      then dom @finSub = dom @xSQ /\ X by RELAT_1:61;
      then
A22:  dom @finSub c= X by XBOOLE_1:17;
      b in dom @finSub by A20,SUBSTUT1:def 2;
      then b in X by A22;
      then ex y st y = b & y in still_not-bound_in q & y is Element of dom xSQ
      & y <> x & y <> xSQ.y;
      hence contradiction by A21,TARSKI:def 1;
    end;
    hence dom finSub misses {x};
    dom {[x,x.upVar(finSub,S`1)]} = {x} by RELAT_1:9;
    then dom @finSub misses dom F by A19,SUBSTUT1:def 2;
    then
A23: @finSub \/ F = (@finSub +* F) by FUNCT_4:31;
    v.(z|a) is Element of Funcs(bound_QC-variables(Al),A) by VALUAT_1:def 1;
    then
A24: ex f st v.(z|a) = f & dom f = bound_QC-variables(Al) & rng f c= A by
FUNCT_2:def 2;
    rng F = {x.upVar(finSub,S`1)} by RELAT_1:9;
    then dom (F*v.(z|a)) = dom F by A24,RELAT_1:27;
    then
A25: dom (F*v.(z|a)) = {x} by RELAT_1:9;
A26: {[x,x.upVar(finSub,S`1)]} = x .--> x.upVar(finSub,S`1) by FUNCT_4:82;
    for b being object st b in dom (x|a) holds (x|a).b = (F*v.(z|a)).b
    proof
      let b being object such that
A27:  b in dom (x|a);
A28:  (F*v.(z|a)).b = (v.(z|a)).(F.b) by A25,A27,FUNCT_1:12;
      b = x by A27,TARSKI:def 1;
      then (x|a).b = a & F.b = x.upVar(finSub,S`1) by A26,FUNCOP_1:72;
      hence thesis by A1,A18,A28,Th49,Th51;
    end;
    then
A29: (x|a) = (F*v.(z|a)) by A25,FUNCT_1:2;
    rng F = {x.upVar(finSub,S`1)} by RELAT_1:9;
    then
A30: (@finSub +* F)*v.(z|a) = (@finSub*v.(z|a)) +* (F*v.(z|a)) by A24,FUNCT_7:9
;
    S`2 = finSub \/ F by A2,A18,SUBSTUT1:def 13;
    then @S`2 = finSub \/ F by SUBSTUT1:def 2;
    hence Val_S(v.(z|a),S) = NEx_Val(v.(z|a),S,x,xSQ) +* (x|a) by A23,A30,A29,
SUBSTUT1:def 2;
  end;
  hence thesis by A3;
end;
