
theorem Th16:
  for M being non empty MetrSpace holds for x being Point of M
  holds dist(x) is continuous
proof
  let M be non empty MetrSpace;
  let x be Point of M;
A1: for P being Subset of R^1 st P is open holds (dist x)"P is open
  proof
    let P be Subset of R^1;
    assume
A2: P is open;
    for p being Point of M st p in (dist(x))"P ex r being Real st r
    >0 & Ball(p,r) c= (dist(x))"P
    proof
      let p be Point of M;
      dist(p,x) in REAL by XREAL_0:def 1;
      then consider y being Point of RealSpace such that
A3:   y = dist(p,x) by METRIC_1:def 13;
      assume p in (dist(x))"P;
      then
A4:   (dist(x)).p in P by FUNCT_1:def 7;
      reconsider P as Subset of TopSpaceMetr(RealSpace) by TOPMETR:def 6;
      y in P by A4,A3,Def4;
      then consider r being Real such that
A5:   r>0 and
A6:   Ball(y,r) c= P by A2,TOPMETR:15,def 6;
      reconsider r as Real;
      take r;
      Ball(p,r) c= (dist(x))"P
      proof
        let z be object;
        assume
A7:     z in Ball(p,r);
        then reconsider z as Point of M;
        dist(z,x) in REAL by XREAL_0:def 1;
        then consider q being Point of RealSpace such that
A8:     q = dist(z,x) by METRIC_1:def 13;
        dist(p,z) < r by A7,METRIC_1:11;
        then |.dist(p,x)-dist(z,x).|+dist(p,z) < r+dist(p,z) by METRIC_6:1
,XREAL_1:8;
        then |.dist(p,x)-dist(z,x).| < r by XREAL_1:6;
        then dist(y,q) < r by A3,A8,TOPMETR:11;
        then q in Ball(y,r) by METRIC_1:11;
        then q in P by A6;
        then
A9:     (dist(x)).z in P by A8,Def4;
        dom (dist(x)) = the carrier of TopSpaceMetr(M) by FUNCT_2:def 1;
        then dom (dist(x)) = the carrier of M by TOPMETR:12;
        hence thesis by A9,FUNCT_1:def 7;
      end;
      hence thesis by A5;
    end;
    hence (dist(x))"P is open by TOPMETR:15;
  end;
  [#]R^1 <> {};
  hence thesis by A1,TOPS_2:43;
end;
