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;

theorem Th1:
  for f,g,h,h1,h2 being Function st dom h1 c= dom h & dom h2 c= dom
  h holds f+*g+*h = (f+*h1)+*(g+*h2)+*h
proof
  let f,g,h,h1,h2 be Function such that
A1: dom h1 c= dom h and
A2: dom h2 c= dom h;
  dom (f+*h1) = (dom f \/ dom h1) & dom (g+*h2) = (dom g \/ dom h2) by
FUNCT_4:def 1;
  then dom ((f+*h1)+*(g+*h2)) = ((dom f \/ dom h1) \/ (dom g \/ dom h2)) by
FUNCT_4:def 1;
  then
  dom ((f+*h1)+*(g+*h2)+*h) = ((dom f \/ dom h1) \/ (dom g \/ dom h2)) \/
  dom h by FUNCT_4:def 1;
  then dom ((f+*h1)+*(g+*h2)+*h) = (dom f \/ dom h1) \/ ((dom g \/ dom h2) \/
  dom h) by XBOOLE_1:4;
  then dom ((f+*h1)+*(g+*h2)+*h) = (dom f \/ dom h1) \/ (dom g \/ (dom h2 \/
  dom h)) by XBOOLE_1:4;
  then
  dom ((f+*h1)+*(g+*h2)+*h) = (dom f \/ dom h1) \/ (dom g \/ dom h) by A2,
XBOOLE_1:12;
  then dom ((f+*h1)+*(g+*h2)+*h) = ((dom f \/ dom h1) \/ dom h) \/ dom g by
XBOOLE_1:4;
  then dom ((f+*h1)+*(g+*h2)+*h) = (dom f \/ (dom h1 \/ dom h)) \/ dom g by
XBOOLE_1:4;
  then
A3: dom ((f+*h1)+*(g+*h2)+*h) = (dom f \/ dom h) \/ dom g by A1,XBOOLE_1:12;
A4: for b being object st b in dom (f+*g+*h)
holds (f+*g+*h).b = ((f+*h1)+*(g+*h2)+*h).b
  proof
    let b be object such that
    b in dom (f+*g+*h);
A5: now
      assume
A6:   not b in dom h;
      then
A7:   ((f+*h1)+*(g+*h2)+*h).b = ((f+*h1)+*(g+*h2)).b by FUNCT_4:11;
A8:   (f+*g+*h).b = (f+*g).b by A6,FUNCT_4:11;
A9:   now
A10:    not b in dom h2 by A2,A6;
        assume
A11:    b in dom g;
        dom g c= (dom g \/ dom h2) by XBOOLE_1:7;
        then b in dom g \/ dom h2 by A11;
        then b in dom (g+*h2) by FUNCT_4:def 1;
        then
A12:    ((f+*h1)+*(g+*h2)+*h).b = (g+*h2).b by A7,FUNCT_4:13;
        (f+*g+*h).b = g.b by A8,A11,FUNCT_4:13;
        hence thesis by A12,A10,FUNCT_4:11;
      end;
      now
A13:    not b in dom h1 by A1,A6;
        assume
A14:    not b in dom g;
        not b in dom h2 by A2,A6;
        then not b in dom g \/ dom h2 by A14,XBOOLE_0:def 3;
        then not b in dom (g+*h2) by FUNCT_4:def 1;
        then
A15:    ((f+*h1)+*(g+*h2)+*h).b = (f+*h1).b by A7,FUNCT_4:11;
        (f+*g+*h).b = f.b by A8,A14,FUNCT_4:11;
        hence thesis by A15,A13,FUNCT_4:11;
      end;
      hence thesis by A9;
    end;
    now
      assume
A16:  b in dom h;
      then (f+*g+*h).b = h.b by FUNCT_4:13;
      hence thesis by A16,FUNCT_4:13;
    end;
    hence thesis by A5;
  end;
  dom (f+*g) = dom f \/ dom g by FUNCT_4:def 1;
  then dom (f+*g+*h) = (dom f \/ dom g) \/ dom h by FUNCT_4:def 1;
  hence thesis by A3,A4,FUNCT_1:2,XBOOLE_1:4;
end;
