reserve A, B for non empty set,
  A1, A2, A3 for non empty Subset of A;

theorem Th2:
  for g being Function of A1 \/ A2,B, g1 being Function of A1,B,
      g2 being Function of A2,B st
   g|A1 = g1 & g|A2 = g2 holds g = g1 union g2
proof
  let g be Function of A1 \/ A2,B, g1 be Function of A1,B, g2 be Function of
  A2,B;
  assume
A1: g|A1 = g1 & g|A2 = g2;
  A2 c= A1 \/ A2 by XBOOLE_1:7;
  then reconsider f2 = g|A2 as Function of A2,B by FUNCT_2:32;
  A1 c= A1 \/ A2 by XBOOLE_1:7;
  then reconsider f1 = g|A1 as Function of A1,B by FUNCT_2:32;
  set h = g1 union g2;
C1:dom g = A1 \/ A2 by FUNCT_2:def 1 .= dom h by FUNCT_2:def 1;
  for x being object st x in dom g holds g.x = h.x
  proof
    let x be object;
    assume x in dom g; then
D0: x in A1 or x in A2 by XBOOLE_0:def 3;
    per cases;
    suppose
D1:   x in dom g2; then
      h.x = g2.x by FUNCT_4:13 .= g.x by A1,FUNCT_1:49,D1;
      hence thesis;
    end;
    suppose D1: not x in dom g2; then
D2:   x in A1 by D0,FUNCT_2:def 1;
      h.x = g1.x by D1,FUNCT_4:11 .= g.x by A1,FUNCT_1:49,D2;
      hence thesis;
    end;
  end;
  hence thesis by C1,FUNCT_1:2;
end;
