reserve A,X,X1,X2,Y,Y1,Y2 for set, a,b,c,d,x,y,z for object;
reserve P,P1,P2,Q,R,S for Relation;

theorem
  X <> {} & Y <> {} implies dom [:X,Y:] = X & rng [:X,Y:] = Y
proof
  assume X <> {};
  then consider a being object such that
A1: a in X by XBOOLE_0:def 1;
  assume Y <> {};
  then consider b being object such that
A2: b in Y by XBOOLE_0:def 1;
A3: now
    let x be object;
    assume x in X;
    then [x,b] in [:X,Y:] by A2,ZFMISC_1:87;
    hence ex y being object st [x,y] in [:X,Y:];
  end;
  (ex y being object st [x,y] in [:X,Y:]) implies x in X by ZFMISC_1:87;
  hence dom[:X,Y:] = X by A3,XTUPLE_0:def 12;
A4: now
    let y be object;
    assume y in Y;
    then [a,y] in [:X,Y:] by A1,ZFMISC_1:87;
    hence ex x being object st [x,y] in [:X,Y:];
  end;
  (ex x being object st [x,y] in [:X,Y:]) implies y in Y by ZFMISC_1:87;
  hence thesis by A4,XTUPLE_0:def 13;
end;
