reserve Al for QC-alphabet;
reserve a,b,b1 for object,
  i,j,k,n for Nat,
  p,q,r,s for Element of CQC-WFF(Al),
  x,y,y1 for bound_QC-variable of Al,
  P for QC-pred_symbol of k,Al,
  l,ll for CQC-variable_list of k,Al,
  Sub,Sub1 for CQC_Substitution of Al,
  S,S1,S2 for Element of CQC-Sub-WFF(Al),
  P1,P2 for Element of QC-pred_symbols(Al);

theorem Th7:
  x in rng RestrictSub(x,All(x,p),Sub) implies S_Bound([All(x,p),
  Sub]) = x.upVar(RestrictSub(x,All(x,p),Sub),p)
proof
  set finSub = RestrictSub(x,All(x,p),Sub);
  set S = [All(x,p),Sub];
  assume
A1: x in rng finSub;
  reconsider q = S`1 as Element of CQC-WFF(Al);
A2: S`2 = Sub;
  bound_in q = x & the_scope_of q = p by QC_LANG2:7;
  hence thesis by A1,A2,SUBSTUT1:def 36;
end;
