reserve G,F for RealLinearSpace;

theorem Th3:
  for X,Y be non empty set, D be Function
  st dom D = {1,2} & D.1 = X & D.2 = Y
  ex I be Function of [:X,Y:],product D
  st I is one-to-one & I is onto
  & for x,y be object st x in X & y in Y holds I.(x,y) = <*x,y*>
  proof
    let X,Y be non empty set, D be Function;
    assume A1: dom D ={1,2} & D.1 = X & D.2 = Y;
    defpred P[object,object,object] means $3 = <* $1,$2 *>;
    A2:for x,y be object st x in X & y in Y
    ex z be object st z in product D & P[x,y,z]
    proof
      let x,y be object;
      assume A3: x in X & y in Y;
      A4: dom <*x,y*> = Seg len <*x,y*> by FINSEQ_1:def 3
      .= {1,2} by FINSEQ_1:2,44;
      now let i be object;
        assume i in dom <*x,y*>; then
        i = 1 or i = 2 by A4,TARSKI:def 2;
        hence <*x,y*>.i in D.i by A1,A3;
      end; then
      <*x,y*> in product D by A4,A1,CARD_3:9;
      hence ex z be object st z in product D & P[x,y,z];
    end;
    consider I be Function of [:X,Y:], product D such that
    A5: for x,y be object st x in X & y in Y
    holds P[x,y,I.(x,y)] from BINOP_1:sch 1(A2);
    now assume {} in rng D; then
      ex x be object st x in dom D & D.x={} by FUNCT_1:def 3;
      hence contradiction by A1,TARSKI:def 2;
    end; then
    A6:product D <> {} by CARD_3:26;
    now let z1,z2 be object;
      assume A7: z1 in [:X,Y:] & z2 in [:X,Y:] & I.z1=I.z2; then
      consider x1,y1 be object such that
      A8:  x1 in X & y1 in Y & z1=[x1,y1] by ZFMISC_1:def 2;
      consider x2,y2 be object such that
      A9:  x2 in X & y2 in Y & z2=[x2,y2] by A7,ZFMISC_1:def 2;
      <*x1,y1*> = I.(x1,y1) by A5,A8
      .= I.(x2,y2) by A7,A8,A9
      .= <*x2,y2*> by A5,A9; then
      x1 = x2 & y1 = y2 by FINSEQ_1:77;
      hence z1=z2 by A8,A9;
    end; then
    A10:I is one-to-one by A6,FUNCT_2:19;
    now let w be object;
      assume w in product D; then
      consider g be Function such that
      A11:  w = g & dom g = dom D
      & for i be object st i in dom D holds g.i in D.i by CARD_3:def 5;
      reconsider g as FinSequence by A1,A11,FINSEQ_1:2,def 2;
      set x=g.1; set y=g.2;
      A12: len g = 2 by A1,A11,FINSEQ_1:2,def 3;
      1 in dom D & 2 in dom D by A1,TARSKI:def 2; then
      A13:x in X & y in Y & w=<*x,y*> by A11,A12,A1,FINSEQ_1:44;
      reconsider z = [x,y] as Element of [:X,Y:] by A13,ZFMISC_1:87;
      w = I.(x,y) by A5,A13
      .= I.z;
      hence w in rng I by A6,FUNCT_2:112;
    end; then
    product D c= rng I by TARSKI:def 3; then
    product D = rng I by XBOOLE_0:def 10; then
    I is onto by FUNCT_2:def 3;
    hence thesis by A5,A10;
  end;
