reserve x,x1,x2,y,y9,y1,y2,z,z1,z2 for object,P,X,X1,X2,Y,Y1,Y2,V,Z for set;

theorem Th1:
  for f,g being Function st
   for x being object st x in dom f /\ dom g holds f.x = g.x
  holds f \/ g is Function
proof
  let f,g be Function such that
A1: for x being object st x in dom f /\ dom g holds f.x = g.x;
  defpred P[object,object] means [$1,$2] in f \/ g;
A2: for x,y1,y2 being object st P[x,y1] & P[x,y2] holds y1 = y2
  proof
    let x,y1,y2 be object such that
A3: [x,y1] in f \/ g and
A4: [x,y2] in f \/ g;
    now
      [x,y1] in f or [x,y1] in g by A3,XBOOLE_0:def 3;
      then
A5:   x in dom f & f.x = y1 or x in dom g & g.x = y1 by FUNCT_1:1;
A6:   [x,y2] in f or [x,y2] in g by A4,XBOOLE_0:def 3;
      then
A7:   x in dom f & f.x = y2 or x in dom g & g.x = y2 by FUNCT_1:1;
      per cases by A6,XTUPLE_0:def 12;
      suppose
        x in dom f & x in dom g;
        then x in dom f /\ dom g by XBOOLE_0:def 4;
        hence thesis by A1,A5,A7;
      end;
      suppose
        x in dom f & not x in dom g;
        hence thesis by A6,A5,FUNCT_1:1;
      end;
      suppose
        not x in dom f & x in dom g;
        hence thesis by A6,A5,FUNCT_1:1;
      end;
    end;
    hence thesis;
  end;
  consider h being Function such that
A8: for x,y being object holds [x,y] in h iff x in dom f \/ dom g & P[x,y]
   from FUNCT_1:sch 1(A2);
  h = f \/ g
  proof
    let x,y be object;
    thus [x,y] in h implies [x,y] in f\/g by A8;
    assume
A9: [x,y] in f\/g;
    [x,y] in f or [x,y] in g by A9,XBOOLE_0:def 3;
    then x in dom f or x in dom g by XTUPLE_0:def 12;
    then x in dom f \/ dom g by XBOOLE_0:def 3;
    hence thesis by A8,A9;
  end;
  hence thesis;
end;
