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

theorem Th24:
  for x,y,z being Element of [:REAL,REAL:] holds Eukl_dist2.(x,z)
  <= Eukl_dist2.(x,y) + Eukl_dist2.(y,z)
proof
  let x,y,z be Element of [:REAL,REAL:];
  reconsider x1 = x`1, x2 = x`2, y1 = y`1, y2 = y`2, z1 = z`1, z2 = z`2 as
  Element of REAL;
A1: x = [x1,x2];
  set d5 = real_dist.(x2,y2);
  set d3 = real_dist.(y1,z1);
  set d1 = real_dist.(x1,z1);
A2: y = [y1,y2];
  set d6 = real_dist.(y2,z2);
  set d4 = real_dist.(x2,z2);
  set d2 = real_dist.(x1,y1);
A3: z = [z1,z2];
  d4 = |.x2 - z2.| by METRIC_1:def 12;
  then 0 <= d4 by COMPLEX1:46;
  then
A4: d4^2 <= (d5 + d6)^2 by METRIC_1:10,SQUARE_1:15;
  0 <= d1^2 & 0 <= d4^2 by XREAL_1:63;
  then
A5: 0 + 0 <= d1^2 + d4^2 by XREAL_1:7;
  d1 = |.x1 - z1.| by METRIC_1:def 12;
  then 0 <= d1 by COMPLEX1:46;
  then d1^2 <= (d2 + d3)^2 by METRIC_1:10,SQUARE_1:15;
  then d1^2 + d4^2 <= (d2 + d3)^2 + (d5 + d6)^2 by A4,XREAL_1:7;
  then
A6: sqrt(d1^2 + d4^2)<= sqrt((d2 + d3)^2 + (d5 + d6)^2) by A5,SQUARE_1:26;
  d6 = |.y2 - z2.| by METRIC_1:def 12;
  then
A7: 0 <= d6 by COMPLEX1:46;
  d5 = |.x2 - y2.| by METRIC_1:def 12;
  then
A8: 0 <= d5 by COMPLEX1:46;
  d3 = |.y1 - z1.| by METRIC_1:def 12;
  then
A9: 0 <= d3 by COMPLEX1:46;
  d2 = |.x1 - y1.| by METRIC_1:def 12;
  then 0 <= d2 by COMPLEX1:46;
  then
  sqrt((d2 + d3)^2 + (d5 + d6)^2) <= sqrt(d2^2 + d5^2) + sqrt(d3^2 + d6^2
  ) by A9,A8,A7,Th12;
  then sqrt(d1^2 + d4^2) <= sqrt(d2^2 + d5^2) + sqrt(d3^2 + d6^2) by A6,
XXREAL_0:2;
  then Eukl_dist2.(x,z) <= sqrt(d2^2 + (d5)^2) + sqrt(d3^2 + d6^2) by A1,A3
,Def18;
  then Eukl_dist2.(x,z) <= Eukl_dist2.(x,y) + sqrt(d3^2 + d6^2) by A1,A2,Def18;
  hence thesis by A2,A3,Def18;
end;
