reserve u,v,x,x1,x2,y,y1,y2,z,p,a for object,
        A,B,X,X1,X2,X3,X4,Y,Y1,Y2,Z,N,M for set;

theorem
  (for x,y holds [x,y] in [:X1,Y1:] iff [x,y] in [:X2,Y2:]) implies [:X1
  ,Y1:]=[:X2,Y2:]
proof
  assume
A1: for x,y holds [x,y] in [:X1,Y1:] iff [x,y] in [:X2,Y2:];
  now
    let z;
    thus z in [:X1,Y1:] implies z in [:X2,Y2:]
    proof
      assume
A2:   z in [:X1,Y1:];
      then ex x,y st x in X1 & y in Y1 & [x,y]=z by Def2;
      hence thesis by A1,A2;
    end;
    assume
A3: z in [:X2,Y2:];
    then ex x,y st x in X2 & y in Y2 & [x,y]=z by Def2;
    hence z in [:X1,Y1:] by A1,A3;
  end;
  hence thesis by TARSKI:2;
end;
