reserve a, b for Real,
  r for Real,
  rr for Real,
  i, j, n for Nat,
  M for non empty MetrSpace,
  p, q, s for Point of TOP-REAL 2,
  e for Point of Euclid 2,
  w for Point of Euclid n,
  z for Point of M,
  A, B for Subset of TOP-REAL n,
  P for Subset of TOP-REAL 2,
  D for non empty Subset of TOP-REAL 2;
reserve a, b for Real;
reserve a, b for Real;
reserve r for Real;

theorem Th40:
  p = e implies Ball(e,r) c= product((1,2)-->(].p`1-r,p`1+r.[,].p
  `2-r,p`2+r.[))
proof
  set A = ].p`1-r,p`1+r.[, B = ].p`2-r,p`2+r.[, f = (1,2)-->(A,B);
  assume that
A1: p = e;
  let a be object;
  assume
A2: a in Ball(e,r);
  then reconsider b = a as Point of Euclid 2;
  reconsider q = b as Point of TOP-REAL 2 by TOPREAL3:8;
  reconsider g = q as FinSequence;
A3: for x being object st x in dom f holds g.x in f.x
  proof
    let x be object;
    assume
A4: x in dom f;
    per cases by A4,TARSKI:def 2;
    suppose
A5:   x = 1;
A6:   f.1 = A by FUNCT_4:63;
A7:   q`1 < p`1+r by A1,A2,Th37;
      p`1-r < q`1 by A1,A2,Th37;
      hence thesis by A5,A6,A7,XXREAL_1:4;
    end;
    suppose
A8:   x = 2;
A9:   f.2 = B by FUNCT_4:63;
A10:  q`2 < p`2+r by A1,A2,Th38;
      p`2-r < q`2 by A1,A2,Th38;
      hence thesis by A8,A9,A10,XXREAL_1:4;
    end;
  end;
  q is Function of Seg 2, REAL by EUCLID:23;
  then
A11: dom g = {1,2} by FINSEQ_1:2,FUNCT_2:def 1;
  dom f = {1,2} by FUNCT_4:62;
  hence thesis by A11,A3,CARD_3:9;
end;
