reserve X, Y, Z, W for non empty MetrSpace;

theorem Th4:
  for x,y being Element of [:the carrier of X,the carrier of Y,the
  carrier of Z:] holds dist_cart3(X,Y,Z).(x,y) = 0 iff x = y
proof
  let x,y be Element of [:the carrier of X,the carrier of Y,the carrier of Z:];
  reconsider x1 = x`1_3, y1 = y`1_3 as Element of X;
  reconsider x2 = x`2_3, y2 = y`2_3 as Element of Y;
  reconsider x3 = x`3_3, y3 = y`3_3 as Element of Z;
A1: x = [x1,x2,x3] & y = [y1,y2,y3];
  thus dist_cart3(X,Y,Z).(x,y) = 0 implies x = y
  proof
    set d3 = dist(x3,y3);
    set d2 = dist(x2,y2);
    set d1 = dist(x1,y1);
    set d4 = d1 + d2;
    assume dist_cart3(X,Y,Z).(x,y) = 0;
    then
A2: d4 + d3 = 0 by A1,Def4;
A3: 0 <= d1 & 0 <= d2 by METRIC_1:5;
    then
A4: 0 <= d3 & 0 + 0 <= d1 + d2 by METRIC_1:5,XREAL_1:7;
    then
A5: d4 = 0 by A2,XREAL_1:27;
    then d1 = 0 by A3,XREAL_1:27;
    then
A6: x1 = y1 by METRIC_1:2;
    d3 = 0 by A2,A4,XREAL_1:27;
    then
A7: x3 = y3 by METRIC_1:2;
    d2 = 0 by A3,A5,XREAL_1:27;
    hence thesis by A1,A7,A6,METRIC_1:2;
  end;
  assume
A8: x = y;
  then
A9: dist(x1,y1) = 0 & dist(x2,y2) = 0 by METRIC_1:1;
  dist_cart3(X,Y,Z).(x,y) = (dist(x1,y1) + dist(x2,y2)) + dist(x3,y3) by A1
,Def4
    .= 0 by A8,A9,METRIC_1:1;
  hence thesis;
end;
