reserve n,k for Element of NAT;
reserve x,y,X for set;
reserve g,r,p for Real;
reserve S for RealNormSpace;
reserve rseq for Real_Sequence;
reserve seq,seq1 for sequence of S;
reserve x0 for Point of S;
reserve Y for Subset of S;
reserve S,T for RealNormSpace;
reserve f,f1,f2 for PartFunc of S,T;
reserve s1 for sequence of S;
reserve x0 for Point of S;
reserve h for (0.S)-convergent sequence of S;
reserve c for constant sequence of S;

theorem
  for R be PartFunc of S,T st R is total holds
  R is RestFunc-like iff
  for r be Real st r > 0 ex d be Real st d > 0 &
  for z be Point of S st z <> 0.S &
  ||.z.|| < d holds ( ||.z.||"* ||. R/.z .||) < r
proof
  let R be PartFunc of S,T such that
A1: R is total;
A2: now
    assume
A3: R is RestFunc-like;
    assume not
    (for r be Real st r > 0
    ex d be Real st d > 0 & for z be Point
    of S st z <> 0.S & ||.z.|| < d holds ( ||.z.||"* ||. R/.z .||) < r );
    then consider r be Real such that
A4: r > 0 and
A5: for d be Real st d > 0
    ex z be Point of S st z <> 0.S & ||.z
    .|| < d & not ( ||.z.||"* ||. R/.z .||) < r;
    defpred P[Nat,Point of S] means $2 <> 0.S & ||.$2.|| < (1/($1+1
    )) & not ( ( ||.$2.||"* ||. R/.$2 .||) < r );
A6: for n be Element of NAT ex z be Point of S st P[n,z]
    proof
      let n be Element of NAT;
      0 < 1 * (n + 1)";
      then 0 < 1/(n + 1) by XCMPLX_0:def 9;
      hence thesis by A5;
    end;
    consider s be sequence of S such that
A7: for n being Element of NAT holds P[n,s.n] from FUNCT_2:sch 3(A6);
A8: for n being Nat holds P[n,s.n]
     proof let n be Nat;
       n in NAT by ORDINAL1:def 12;
      hence thesis by A7;
     end;
A9: now
      let p be Real;
      assume
A10:   0<p;
      consider n being Nat such that
A11:  p"<n by SEQ_4:3;
      p" + 0 < n + 1 by A11,XREAL_1:8;
      then 1/(n+1) < 1/p" by A10,XREAL_1:76;
      then
A12:  1/(n+1) < p by XCMPLX_1:216;
       reconsider n as Nat;
      take n;
      let m be Nat;
      assume n<=m;
      then
A13:  n + 1 <= m + 1 by XREAL_1:6;
      ||.s.m.|| < (1/(m+1)) by A8;
      then
A14:  ||.s.m-0.S.|| < (1/(m+1)) by RLVECT_1:13;
      1/(m+1) <= 1/(n+1) by A13,XREAL_1:118;
      then ||.s.m - 0.S.|| < 1/(n+1) by A14,XXREAL_0:2;
      hence ||.s.m - 0.S.|| <p by A12,XXREAL_0:2;
    end;
    then
A15: s is convergent;
    then
    lim s = 0.S by A9,NORMSP_1:def 7;
    then reconsider s as (0.S)-convergent sequence of S
      by A15,Def4;
    s is non-zero by A8,Th7;
    then
    (||.s.||")(#)(R/*s) is convergent & lim ((||.s.||")(#)(R/*s)) = 0.T
    by A3;
    then consider n be Nat such that
A16: for m be Nat st n <=m holds ||. ((||.s.||")(#)(R/*s)).
    m- 0.T.|| < r by A4,NORMSP_1:def 7;
A17:   n in NAT by ORDINAL1:def 12;
A18: ||. ((||.s.||")(#)(R/*s)).n- 0.T.|| < r by A16;
    s.n <> 0.S by A8;
    then ||.s.n.|| <> 0 by NORMSP_0:def 5;
    then
A19: ||.s.n.|| > 0 by NORMSP_1:4;
A20: ||.(||.s.n.||)"*(R/.(s.n)).|| = |.(||.s.n.||)".| * ||.(R/.(s.n)).||
    by NORMSP_1:def 1
      .=(||.s.n.||)" * ||.(R/.(s.n)).|| by A19,ABSVALUE:def 1;
    dom R = the carrier of S by A1,PARTFUN1:def 2;
    then
A21: rng s c= dom R;
    ||. ((||.s.||")(#)(R/*s)).n- 0.T.|| = ||. ((||.s.||")(#)(R/*s)).n .||
    by RLVECT_1:13
      .= ||.(||.s.||".n)*((R/*s).n).|| by Def2
      .= ||.(||.s.||.n)"*((R/*s).n).|| by VALUED_1:10
      .= ||.(||.s.n.||)"*((R/*s).n).|| by NORMSP_0:def 4
      .= ||.(||.s.n.||)"*(R/.(s.n)).|| by A21,FUNCT_2:109,A17;
    hence
    for r be Real
    st r > 0 ex d be Real st d > 0 & for z be Point of S st
    z <> 0.S & ||.z.|| < d holds ( ||.z.||"* ||. R/.z .||) < r
               by A8,A18,A20;
  end;
  now
    assume
A22: for r be Real st r > 0
    ex d be Real st d > 0 & for z be Point of
    S st z <> 0.S & ||.z.|| < d holds ( ||.z.||"* ||. R/.z .||) < r;
    now
      let s be (0.S)-convergent sequence of S
         such that A23: s is non-zero;
A24:  s is convergent & lim s = 0.S by Def4;
A25:  now
        let r be Real;
        assume r > 0;
        then consider d be Real such that
A26:    d > 0 and
A27:    for z be Point of S st z <> 0.S & ||.z.|| < d holds ( ||.z.||
        "* ||. R/.z .||) < r by A22;
        consider n be Nat such that
A28:    for m be Nat st n <=m holds ||.s.m-0.S.|| < d by A24,A26,
NORMSP_1:def 7;
        take n;
        thus for m be Nat st n <=m holds ||. ((||.s.||")(#)(R/*s)).
        m- 0.T.|| < r
        proof
          dom R = the carrier of S by A1,PARTFUN1:def 2;
          then
A29:      rng s c= dom R;
          let m be Nat;
A30:   m in NAT by ORDINAL1:def 12;
          assume n <=m;
          then ||.s.m-0.S .|| < d by A28;
          then
A31:      ||.s.m.|| < d by RLVECT_1:13;
A32:      s.m <> 0.S by Th7,A23;
          then ||.s.m.|| <> 0 by NORMSP_0:def 5;
          then ||.s.m.|| > 0 by NORMSP_1:4;
          then
          (||.s.m.||)" * ||.(R/.(s.m)).|| =|.(||.s.m.||)".| * ||.(R/.(s.
          m)).|| by ABSVALUE:def 1
            .= ||.(||.s.m.||)"*(R/.(s.m)).|| by NORMSP_1:def 1
            .= ||.(||.s.m.||)"*((R/*s).m).|| by A29,FUNCT_2:109,A30
            .= ||.(||.s.||.m)"*((R/*s).m).|| by NORMSP_0:def 4
            .= ||.(||.s.||".m)*((R/*s).m).|| by VALUED_1:10
            .= ||. ((||.s.||")(#)(R/*s)).m .|| by Def2
            .= ||. ((||.s.||")(#)(R/*s)).m- 0.T.|| by RLVECT_1:13;
          hence thesis by A27,A31,A32;
        end;
      end;
      hence (||.s.||")(#)(R/*s) is convergent;
      hence lim ((||.s.||")(#)(R/*s)) = 0.T by A25,NORMSP_1:def 7;
    end;
    hence R is RestFunc-like by A1;
  end;
  hence thesis by A2;
end;
