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

theorem Th13:
  for x,y,z being Element of [:the carrier of X,the carrier of Y:]
holds dist_cart2S(X,Y).(x,z) <= dist_cart2S(X,Y).(x,y) + dist_cart2S(X,Y).(y,z)
proof
  let x,y,z be Element of [:the carrier of X,the carrier of Y:];
  reconsider x1 = x`1, y1 = y`1, z1 = z`1 as Element of X;
  reconsider x2 = x`2, y2 = y`2, z2 = z`2 as Element of Y;
A1: x = [x1,x2];
  set d5 = dist(x2,y2);
  set d3 = dist(y1,z1);
  set d1 = dist(x1,z1);
A2: y = [y1,y2];
  set d6 = dist(y2,z2);
  set d4 = dist(x2,z2);
  set d2 = dist(x1,y1);
A3: z = [z1,z2];
  0 <= d1^2 & 0 <= d4^2 by XREAL_1:63;
  then
A4: 0 + 0 <= d1^2 + d4^2 by XREAL_1:7;
  d4 <= d5 + d6 & 0 <= d4 by METRIC_1:4,5;
  then
A5: d4^2 <= (d5 + d6)^2 by SQUARE_1:15;
  d1 <= d2 + d3 & 0 <= d1 by METRIC_1:4,5;
  then d1^2 <= (d2 + d3)^2 by SQUARE_1:15;
  then d1^2 + d4^2 <= (d2 + d3)^2 + (d5 + d6)^2 by A5,XREAL_1:7;
  then
A6: sqrt(d1^2 + d4^2)<= sqrt((d2 + d3)^2 + (d5 + d6)^2) by A4,SQUARE_1:26;
A7: 0 <= d5 & 0 <= d6 by METRIC_1:5;
  0 <= d2 & 0 <= d3 by METRIC_1:5;
  then
  sqrt((d2 + d3)^2 + (d5 + d6)^2) <= sqrt(d2^2 + d5^2) + sqrt(d3^2+ d6^2)
  by A7,Th12;
  then sqrt(d1^2 + d4^2) <= sqrt(d2^2 + d5^2) + sqrt(d3^2 + d6^2) by A6,
XXREAL_0:2;
  then
  dist_cart2S(X,Y).(x,z) <= sqrt((d2)^2 + (d5)^2) + sqrt((d3)^2 + (d6)^2)
  by A1,A3,Def10;
  then
  dist_cart2S(X,Y).(x,z) <= dist_cart2S(X,Y).(x,y) + sqrt((d3)^2 + (d6)^2
  ) by A1,A2,Def10;
  hence thesis by A2,A3,Def10;
end;
