reserve x,x1,x2,y,z,z1 for set;
reserve s1,r,r1,r2 for Real;
reserve s,w1,w2 for Real;
reserve n,i for Element of NAT;
reserve X for non empty TopSpace;
reserve p,p1,p2,p3 for Point of TOP-REAL n;
reserve P for Subset of TOP-REAL n;

theorem Th16:
  for M being non empty MetrSpace,f being Function of X,
  TopSpaceMetr(M) holds (for r being Real,u being Element
of M,P being Subset of TopSpaceMetr(M) st r>0 & P=Ball(u,r) holds f"P is open)
  implies f is continuous
proof
  let M be non empty MetrSpace,f be Function of X,TopSpaceMetr(M);
  assume
A1: for r being Real, u being Element of M, P being Subset of
  TopSpaceMetr(M) st r>0 & P=Ball(u,r) holds f"P is open;
A2: for P1 being Subset of TopSpaceMetr(M) st P1 is open holds f"P1 is open
  proof
    let P1 be Subset of TopSpaceMetr(M);
    assume
A3: P1 is open;
    for x holds x in f"P1 iff ex Q being Subset of X st Q is open & Q c= f
    "P1 & x in Q
    proof
      let x;
      now
        assume
A4:     x in f"P1;
        then
A5:     x in dom f by FUNCT_1:def 7;
A6:     f.x in P1 by A4,FUNCT_1:def 7;
        then reconsider u=f.x as Element of M by TOPMETR:12;
        consider r be Real such that
A7:     r>0 and
A8:     Ball(u,r) c= P1 by A3,A6,TOPMETR:15;
        reconsider r as Real;
        reconsider PB=Ball(u,r) as Subset of TopSpaceMetr(M) by TOPMETR:12;
A9:     f"PB c= f"P1 by A8,RELAT_1:143;
        f.x in Ball(u,r) by A7,TBSP_1:11;
        then x in f"(Ball(u,r)) by A5,FUNCT_1:def 7;
        hence ex Q being Subset of X st Q is open & Q c= f"P1 & x in Q by A1,A7
,A9;
      end;
      hence thesis;
    end;
    hence thesis by TOPS_1:25;
  end;
  [#]TopSpaceMetr M <> {};
  hence thesis by A2,TOPS_2:43;
end;
