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

theorem Th6:
  for x,y,z being Element of [:the carrier of X,the carrier of Y,
  the carrier of Z:] holds dist_cart3(X,Y,Z).(x,z) <= dist_cart3(X,Y,Z).(x,y) +
  dist_cart3(X,Y,Z).(y,z)
proof
  let x,y,z be Element of [:the carrier of X,the carrier of Y,the carrier of Z
  :];
  reconsider x1 = x`1_3, y1 = y`1_3, z1 = z`1_3 as Element of X;
  reconsider x2 = x`2_3, y2 = y`2_3, z2 = z`2_3 as Element of Y;
  reconsider x3 = x`3_3, y3 = y`3_3, z3 = z`3_3 as Element of Z;
A1: x = [x1,x2,x3];
  set d4 = dist(x2,z2), d5 = dist(x2,y2), d6 = dist(y2,z2);
A2: z = [z1,z2,z3];
  set d7 = dist(x3,z3), d8 = dist(x3,y3), d9 = dist(y3,z3);
  set d1 = dist(x1,z1), d2 = dist(x1,y1), d3 = dist(y1,z1);
A3: y = [y1,y2,y3];
  set d10 = d1 + d4;
  d1 <= d2 + d3 & d4 <= d5 + d6 by METRIC_1:4;
  then
A4: d10 <= (d2 + d3) + (d5 + d6) by XREAL_1:7;
  d7 <= d8 + d9 by METRIC_1:4;
  then
A5: d10 + d7 <= ((d2 + d3) + (d5 + d6)) + (d8 + d9) by A4,XREAL_1:7;
  ((d2 + d3) + (d5 + d6)) + (d8 + d9) = ((d2 + d5) + d8) + ((d3 + d6) + d9)
    .= dist_cart3(X,Y,Z).(x,y) + ((d3 +d6) + d9) by A1,A3,Def4
    .= dist_cart3(X,Y,Z).(x,y) + dist_cart3(X,Y,Z).(y,z) by A3,A2,Def4;
  hence thesis by A1,A2,A5,Def4;
end;
