reserve n,k,k1,m,m1,n1,n2,l for Nat;
reserve r,r1,r2,p,p1,g,g1,g2,s,s1,s2,t for Real;
reserve seq,seq1,seq2 for Real_Sequence;
reserve Nseq for increasing sequence of NAT;
reserve x for set;
reserve X,Y for Subset of REAL;
reserve k,n for Nat,
  r,r9,r1,r2 for Real,
  c,c9,c1,c2,c3 for Element of COMPLEX;
reserve z,z1,z2 for FinSequence of COMPLEX;
reserve x,z,z1,z2,z3 for Element of COMPLEX n,
  A,B for Subset of COMPLEX n;

theorem Th128:
  A <> {} & B <> {} implies dist(x,A) + dist(x,B) >= dist(A,B)
proof
  defpred Y[set] means $1 in B;
  deffunc g(Element of COMPLEX n) = |.x - $1.|;
  deffunc g1(Element of COMPLEX n) = In(|.x - $1.|,REAL);
  reconsider Y = {g1(z) : Y[z]} as Subset of REAL from DOMAIN_1:sch 8;
  defpred P[set,set] means $1 in A & $2 in B;
  defpred X[set] means $1 in A;
  deffunc f(Element of COMPLEX n,Element of COMPLEX n) = In(|.$1 - $2.|,REAL);
  deffunc f1(Element of COMPLEX n,Element of COMPLEX n) = |.$1 - $2.|;
  reconsider X = {g1(z) : X[z]} as Subset of REAL from DOMAIN_1:sch 8;
  assume that
A1: A <> {} and
A2: B <> {};
  consider z2 such that
A3: z2 in B by A2,SUBSET_1:4;
A4: Y <> {} & Y is bounded_below
  proof
    g1(z2) in Y by A3;
    hence Y <> {};
    take 0;
    let r be ExtReal;
    assume r in Y;
    then ex z1 st r = g1(z1) & z1 in B;
    hence thesis by Th94;
  end;
A5: g1(z) = g(z);
A6: {g1(z): Y[z]} ={g(z1): Y[z1]} from FRAENKEL:sch 5(A5);
 {g1(z): X[z]} ={g(z1): X[z1]} from FRAENKEL:sch 5(A5);
then
A7: lower_bound X = dist(x,A) & lower_bound Y = dist(x,B) by Def17,A6;
A8: g1(z2) in Y by A3;
  reconsider Z = {f(z1,z) where z1,z: P[z1,z]} as Subset of REAL
  from DOMAIN_1:sch 9;
  consider z1 such that
A9: z1 in A by A1,SUBSET_1:4;
  X++Y c= REAL by MEMBERED:3;
  then reconsider XY = X++Y as Subset of REAL;
A10: for r st r in XY ex r1 st r1 in Z & r1 <= r
proof
    let r;
    assume r in XY; then
    r in {r2+r1 where r2,r1 is Complex
       : r2 in X & r1 in Y} by MEMBER_1:def 6;
    then consider r2,r1 being Complex such that
A11: r = r2 + r1 and
A12: r2 in X and
A13: r1 in Y;
    consider z2 such that
A14: r1 = g1(z2) & z2 in B by A13;
    consider z1 such that
A15: r2 = g1(z1) and
A16: z1 in A by A12;
    take r3 = f(z1,z2);
    r2 = |.z1 - x.| by A15,Th103;
    hence r3 in Z & r3 <= r by A11,A16,A14,Th104;
  end;
A17: Z is bounded_below
  proof
    take 0;
    let r be ExtReal;
    assume r in Z;
    then ex z1,z st r = f(z1,z) & P[z1,z];
    hence thesis by Th94;
  end;
A18: X <> {} & X is bounded_below
  proof
    g1(z1) in X by A9;
    hence X <> {};
    take 0;
    let r be ExtReal;
    assume r in X;
    then ex z st r = g1(z) & z in A;
    hence thesis by Th94;
  end;
A19: for z3,z holds f(z3,z) = f1(z3,z);
 {f(z3,z) where z3,z is Element of COMPLEX n: P[z3,z]}
= {f1(z3,z) where z3,z is Element of COMPLEX n: P[z3,z]}
      from FRAENKEL:sch 7(A19);
  then
A20: lower_bound Z = dist(A,B) by Def19;
  g1(z1) in X by A9;
  then |.x - z1.| + |.x - z2 .| in X ++ Y by A8,MEMBER_1:46;
  then XY <> {};
  then lower_bound XY >= lower_bound Z by A17,A10,Th125;
  hence thesis by A18,A4,A7,A20,Th124;
end;
