reserve a,b,p,x,x9,x1,x19,x2,y,y9,y1,y19,y2,z,z9,z1,z2 for object,
   X,X9,Y,Y9,Z,Z9 for set;
reserve A,D,D9 for non empty set;
reserve f,g,h for Function;

theorem Th1:
  (for z being object st z in Z holds ex x,y being object st z = [x,y])
   implies ex X,Y st Z c= [:X,Y:]
proof
  assume
A1: for z being object st z in Z holds ex x,y being object st z = [x,y];
  defpred P[object] means ex y being object st [ $1,y] in Z;
  consider X such that
A2: for x being object holds
    x in X iff x in union union Z & P[ x] from XBOOLE_0:sch 1;
  defpred P[object] means ex x being object st [x,$1] in Z;
  consider Y such that
A3:  for y being object holds
y in Y iff y in union union Z & P[y] from XBOOLE_0:sch 1;
  take X,Y;
  let z be object;
  assume
A4: z in Z;
  then consider x,y being object such that
A5: z = [x,y] by A1;
  x in union union Z by A4,A5,ZFMISC_1:134;
  then
A6: x in X by A2,A4,A5;
  y in union union Z by A4,A5,ZFMISC_1:134;
  then y in Y by A3,A4,A5;
  hence thesis by A5,A6,ZFMISC_1:87;
end;
