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 Th83:
  @RestrictSub(x,All(x,p),Sub) = @Sub \ ((@Sub)|RSub1(All(x,p)) +*
  (@Sub)|RSub2(All(x,p),Sub))
proof
  set X = {y : y in still_not-bound_in All(x,p) & y is Element of dom Sub & y
  <> x & y <> Sub.y};
  thus @RestrictSub(x,All(x,p),Sub) c= @Sub \ ((@Sub)|RSub1(All(x,p)) +* (@Sub
  )|RSub2(All(x,p),Sub))
  proof
    let b be object;
A1: dom ((@Sub)|RSub1(All(x,p))) misses dom ((@Sub)|RSub2(All(x,p),Sub))
    by Th82;
    assume b in @RestrictSub(x,All(x,p),Sub);
    then b in RestrictSub(x,All(x,p),Sub) by SUBSTUT1:def 2;
    then b in Sub|X by SUBSTUT1:def 6;
    then b in (@Sub)|X by SUBSTUT1:def 2;
    then
A2: b in @Sub /\ [:X,rng (@Sub):] by RELAT_1:67;
    then b in [:X,rng @Sub:] by XBOOLE_0:def 4;
    then consider c,d being object such that
A3: c in X and
    d in rng @Sub and
A4: b = [c,d] by ZFMISC_1:def 2;
A5: ex y1 st y1 = c & y1 in still_not-bound_in All(x,p) & y1 is Element of
    dom Sub & y1 <> x & y1 <> Sub.y1 by A3;
    now
      assume c in RSub2(All(x,p),Sub);
      then ex y st y = c & y in still_not-bound_in All(x,p) & y = (@Sub).y by
Def10;
      hence contradiction by A5,SUBSTUT1:def 2;
    end;
    then not b in [:RSub2(All(x,p),Sub),rng @Sub:] by A4,ZFMISC_1:87;
    then not b in @Sub /\ [:RSub2(All(x,p),Sub),rng @Sub:] by XBOOLE_0:def 4;
    then
A6: not b in (@Sub)|RSub2(All(x,p),Sub) by RELAT_1:67;
    now
      assume c in RSub1(All(x,p));
      then ex y st y = c & not y in still_not-bound_in All(x,p) by Def9;
      hence contradiction by A5;
    end;
    then not b in [:RSub1(All(x,p)),rng @Sub:] by A4,ZFMISC_1:87;
    then not b in @Sub /\ [:RSub1(All(x,p)),rng @Sub:] by XBOOLE_0:def 4;
    then not b in (@Sub)|RSub1(All(x,p)) by RELAT_1:67;
    then not b in (@Sub)|RSub1(All(x,p)) \/ (@Sub)|RSub2(All(x,p),Sub) by A6,
XBOOLE_0:def 3;
    then
A7: not b in (@Sub)|RSub1(All(x,p)) +* (@Sub)|RSub2(All(x,p),Sub) by A1,
FUNCT_4:31;
    b in @Sub by A2,XBOOLE_0:def 4;
    hence thesis by A7,XBOOLE_0:def 5;
  end;
  thus @Sub \ ((@Sub)|RSub1(All(x,p)) +* (@Sub)|RSub2(All(x,p),Sub)) c= @
  RestrictSub(x,All(x,p),Sub)
  proof
A8: dom ((@Sub)|RSub1(All(x,p))) misses dom ((@Sub)|RSub2(All(x,p),Sub))
    by Th82;
    let b be object;
    assume
A9: b in @Sub \ ((@Sub)|RSub1(All(x,p)) +* (@Sub)|RSub2(All(x,p),Sub) );
    then
A10: b in @Sub by XBOOLE_0:def 5;
    consider c,d being object such that
A11: b = [c,d] by A9,RELAT_1:def 1;
A12: c in dom (@Sub) by A10,A11,FUNCT_1:1;
    then reconsider z = c as bound_QC-variable of Al;
A13: d = (@Sub).c by A10,A11,FUNCT_1:1;
    then
A14: d in rng @Sub by A12,FUNCT_1:3;
    not b in ((@Sub)|RSub1(All(x,p)) +* (@Sub)|RSub2(All(x,p),Sub)) by A9,
XBOOLE_0:def 5;
    then
A15: not b in (@Sub)|RSub1(All(x,p)) \/ (@Sub)|RSub2(All(x,p),Sub) by A8,
FUNCT_4:31;
    then not b in (@Sub)|RSub1(All(x,p)) by XBOOLE_0:def 3;
    then not b in (@Sub /\ [:RSub1(All(x,p)),rng @Sub:]) by RELAT_1:67;
    then not [z,d] in [:RSub1(All(x,p)),rng @Sub:] by A10,A11,XBOOLE_0:def 4;
    then
A16: not z in RSub1(All(x,p)) by A14,ZFMISC_1:87;
    then
A17: z in still_not-bound_in All(x,p) by Def9;
    then z in (still_not-bound_in p) \ {x} by QC_LANG3:12;
    then not z in {x} by XBOOLE_0:def 5;
    then
A18: z <> x by TARSKI:def 1;
A19: d in rng @Sub by A12,A13,FUNCT_1:3;
    not b in (@Sub)|RSub2(All(x,p), Sub) by A15,XBOOLE_0:def 3;
    then not b in (@Sub /\ [:RSub2(All(x,p),Sub),rng @Sub:]) by RELAT_1:67;
    then not [z,d] in [:RSub2(All(x,p),Sub),rng @Sub:] by A10,A11,
XBOOLE_0:def 4;
    then not z in RSub2(All(x,p),Sub) by A19,ZFMISC_1:87;
    then not z in still_not-bound_in All(x,p) or z <> (@Sub).z by Def10;
    then
A20: z <> Sub.z by A16,Def9,SUBSTUT1:def 2;
A21: d in rng @Sub by A12,A13,FUNCT_1:3;
    z is Element of dom Sub by A12,SUBSTUT1:def 2;
    then z in X by A17,A18,A20;
    then [z,d] in [:X,rng @Sub:] by A21,ZFMISC_1:87;
    then b in @Sub /\ [:X,rng (@Sub):] by A10,A11,XBOOLE_0:def 4;
    then b in (@Sub)|X by RELAT_1:67;
    then b in Sub|X by SUBSTUT1:def 2;
    then b in RestrictSub(x,All(x,p),Sub) by SUBSTUT1:def 6;
    hence thesis by SUBSTUT1:def 2;
  end;
end;
