reserve n for Nat;
reserve p for Point of TOP-REAL n, r for Real;

theorem
  for r being positive Real,
      f being Function of Tunit_ball(n), Tball(p,r) st n <> 0
  & for a being Point of Tunit_ball(n), b being Point of TOP-REAL n
      st a = b holds f.a = r*b+p
  holds f is being_homeomorphism
proof
  let r be positive Real,
  f being Function of Tunit_ball(n), Tball(p,r) such that
  A1: n <> 0 and
  A2: for a being Point of Tunit_ball(n), b being Point of TOP-REAL n st
  a = b holds f.a = r*b+p;
  reconsider n1 = n as non zero Element of NAT by A1,ORDINAL1:def 12;
  reconsider x = p as Point of TOP-REAL n1;
  defpred P[Point of TOP-REAL n1,set] means $2 = r*$1+x;
  set U = Tunit_ball(n), B = Tball(x,r);
  A3: for u being Point of TOP-REAL n1
  ex y being Point of TOP-REAL n1 st P[u,y];
  consider F being Function of TOP-REAL n1, TOP-REAL n1 such that
  A4: for x being Point of TOP-REAL n1 holds P[x,F.x] from FUNCT_2:sch 3(A3);
  defpred R[Point of TOP-REAL n1,set] means $2 = 1/r*($1-x);
  A5: for u being Point of TOP-REAL n1
  ex y being Point of TOP-REAL n1 st R[u,y];
  consider G being Function of TOP-REAL n1, TOP-REAL n1 such that
  A6: for a being Point of TOP-REAL n1 holds R[a,G.a] from FUNCT_2:sch 3(A5);
  set f2 = (TOP-REAL n1) --> x;
  set f1 = id TOP-REAL n1;
  dom G = the carrier of TOP-REAL n by FUNCT_2:def 1; then
  A7: dom (G|Ball(x,r)) = Ball(x,r) by RELAT_1:62;
  for p being Point of TOP-REAL n1 holds G.p = 1/r * f1.p + (-1/r) * f2.p
  proof
    let p be Point of TOP-REAL n1;
    thus 1/r * f1.p + (-1/r) * f2.p = 1/r*p + (-1/r)*f2.p
    .= 1/r*p + (-1/r)*x by FUNCOP_1:7 .= 1/r*p - 1/r*x by RLVECT_1:79
    .= 1/r*(p-x) by RLVECT_1:34 .= G.p by A6;
  end; then
  A8: G is continuous by TOPALG_1:16;
  A9: dom f = [#]U by FUNCT_2:def 1;
  A10: dom f = the carrier of U by FUNCT_2:def 1;
  for p being Point of TOP-REAL n1 holds F.p = r * f1.p + 1 * f2.p
  proof
    let p be Point of TOP-REAL n1;
    thus r * f1.p + 1 * f2.p = r*f1.p + f2.p by RLVECT_1:def 8
    .= r*p + f2.p .= r*p + x by FUNCOP_1:7 .= F.p by A4;
  end;
  then
  A11: F is continuous by TOPALG_1:16;
  A12: the carrier of B = Ball(x,r) by MFOLD_0:2;
  A13: the carrier of U = Ball(0.TOP-REAL n,1) by MFOLD_0:2;
  A14: for a being object st a in dom f
holds f.a = (F|Ball(0.TOP-REAL n,1)).a
  proof
    let a be object such that
    A15: a in dom f;
    reconsider y = a as Point of TOP-REAL n1 by A15,PRE_TOPC:25;
    thus f.a = r*y+x by A2,A15 .= F.y by A4
    .= (F|Ball(0.TOP-REAL n,1)).a by A13,A15,FUNCT_1:49;
  end;
  A16: 1/r*r = 1 by XCMPLX_1:87;
  A17: rng f = [#]B
  proof
    now
      let b be object;
      assume A18: b in [#]B;
      then reconsider c = b as Point of TOP-REAL n1 by PRE_TOPC:25;
      reconsider r1=1/r as Real;
      set a = r1 * (c - x);
      A19: |.a-0.TOP-REAL n1.| = |.a.| by RLVECT_1:13
      .= |.r1.|*|. c-x .| by TOPRNS_1:7
      .= r1*|. c-x .| by ABSVALUE:def 1;
     :: |. c-x .| < r by A12,A18,TOPREAL9:7; then
      1/r*|. c-x .| < 1/r*r by XREAL_1:68,A12,A18,TOPREAL9:7; then
      A20: a in Ball(0.TOP-REAL n, 1) by A16,A19;
      then f.a = r*a+x by A2,A13 .= r*(1/r)*(c-x)+x by RLVECT_1:def 7
      .= c-x+x by A16,RLVECT_1:def 8 .= b by RLVECT_4:1;
      hence b in rng f by A13,A10,A20,FUNCT_1:def 3;
    end; then
    [#]B c= rng f;
    hence thesis by XBOOLE_0:def 10;
  end;
  now
    let a, b be object such that
    A21: a in dom f and
    A22: b in dom f and
    A23: f.a = f.b;
    reconsider a1 = a, b1 = b as Point of TOP-REAL n1 by A13,A10,A21,A22;
    A24: f.b1 = r*b1+x by A2,A22;
    f.a1 = r*a1+x by A2,A21;
    then r*a1 = r*b1+x-x by A23,A24,RLVECT_4:1;
    hence a=b by RLVECT_1:36,RLVECT_4:1;
  end; then
  A25: f is one-to-one;
  A26: for a being object st a in dom(f") holds f".a = (G|Ball(x,r)).a
  proof
    reconsider ff = f as Function;
    let a be object such that
    A27: a in dom (f");
    reconsider y = a as Point of TOP-REAL n1 by A27,PRE_TOPC:25;
    reconsider r1=1/r as Real;
    set e = 1/r * (y - x);
A28: f is onto by A17,FUNCT_2:def 3;
    A29: |.e-0.TOP-REAL n1.| = |.e.| by RLVECT_1:13
    .= |.r1.|*|. y-x .| by TOPRNS_1:7 .= r1*|. y-x .| by ABSVALUE:def 1;
    ::|. y-x .| < r by A27,A12,TOPREAL9:7; then
    1/r*|. y-x .| < 1/r*r by XREAL_1:68,A27,A12,TOPREAL9:7; then
    A30: 1/r * (y - x) in Ball(0.TOP-REAL n,1) by A16,A29;
    then f.e = r*e+x by A2,A13 .= r*(1/r)*(y-x)+x by RLVECT_1:def 7
    .= y-x+x by A16,RLVECT_1:def 8 .= y by RLVECT_4:1;
    then ff".a = 1/r * (y - x) by A13,A10,A25,A30,FUNCT_1:32;
    hence f".a = 1/r*(y-x) by A28,A25,TOPS_2:def 4
    .= G.y by A6 .= (G|Ball(x,r)).a by A12,A27,FUNCT_1:49;
  end;
  dom F = the carrier of TOP-REAL n by FUNCT_2:def 1; then
  dom (F|Ball(0.TOP-REAL n,1)) = Ball(0.TOP-REAL n,1) by RELAT_1:62; then
  A31: f is continuous by A13,A10,A11,A14,BORSUK_4:44,FUNCT_1:2;
  A32: dom (f") = the carrier of B by FUNCT_2:def 1;
  f" is continuous by A32,A12,A7,A8,A26,BORSUK_4:44,FUNCT_1:2;
  hence thesis by A9,A17,A25,A31,TOPS_2:def 5;
end;
