reserve F for RealNormSpace;
reserve G for RealNormSpace;
reserve y,X for set;
reserve x,x0,x1,x2,g,g1,g2,r,r1,s,p,p1,p2 for Real;
reserve i,m,k for Element of NAT;
reserve n,k for non zero Element of NAT;
reserve Y for Subset of REAL;
reserve Z for open Subset of REAL;
reserve s1,s3 for Real_Sequence;
reserve seq,seq1 for sequence of G;
reserve f,f1,f2 for PartFunc of REAL,REAL n;
reserve g,g1,g2 for PartFunc of REAL,REAL-NS n;
reserve h for 0-convergent non-zero Real_Sequence;
reserve c for constant Real_Sequence;
reserve GR,R for RestFunc of REAL-NS n;
reserve DFG,L for LinearFunc of REAL-NS n;

theorem Th23:
  for R be PartFunc of REAL,REAL-NS n
    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 Real
    st z <> 0 & |. z .| < d holds |.z.|"* ||. R/.z .|| < r
proof
  let R be PartFunc of REAL,REAL-NS n such that
A1: R is total;
A2: now
    assume
A3: R is RestFunc-like;
    given r be Real such that
A4: r > 0 and
A5: for d be Real st d > 0
    ex z be Real st z <> 0 & |. z .| < d
    & not ( |. z .|"* ||. R/.z .||) < r;
    defpred P[Nat,Real ] means
     $2 <> 0 & |. $2 .| < (1/($1+1)) &
     not ( ( |. $2 .|"* ||. R/.$2 .||) < r );
A6: for n be Element of NAT ex z be Element of REAL st P[n,z]
    proof
      let n be Element of NAT;
       consider z be Real such that
A7: z <> 0 & |. z .| < 1/(n+1)
    & not ( |. z .|"* ||. R/.z .||) < r by A5;
       reconsider z as Element of REAL by XREAL_0:def 1;
      take z;
     z <> 0 & |. z .| < 1/(n+1) &
     not ( ( |. z .|"* ||. R/.z .||) < r ) by A7;
      then P[n,z];
     hence thesis;
    end;
    consider s be Real_Sequence such that
A8: for n being Element of NAT holds P[n,s.n] from FUNCT_2:sch 3(A6);
A9: for n being Nat holds P[n,s.n]
   proof let n be Nat;
     n in NAT by ORDINAL1:def 12;
    hence thesis by A8;
   end;
A10: now
      let p be Real;
      assume
A11:   0<p;
      consider n be Nat such that
A12:  p"<n by SEQ_4:3;
      reconsider q0=0,q1=1 as Real;
      p" + q0 < n + q1 by A12,XREAL_1:8;
      then
A13:  1/(n+1) < 1/p" by A11,XREAL_1:76;
      take n;
      let m be Nat;
      assume n<=m;
      then
A14:  n + 1 <= m + 1 by XREAL_1:6;
      1/(m+1) <= 1/(n+1) by A14,XREAL_1:118;
      then |. s.m - 0 .| < 1/(n+1) by A9,XXREAL_0:2;
      hence |. s.m - 0 .| <p by A13,XXREAL_0:2;
    end;
A15: s is convergent by A10,SEQ_2:def 6;
    then
A16: lim s = 0 by A10,SEQ_2:def 7;
    s is non-zero by A9,SEQ_1:5;
    then reconsider s as 0-convergent non-zero Real_Sequence
      by A15,A16,FDIFF_1:def 1;
      (s")(#)(R/*s) is convergent
     & lim ((s")(#)(R/*s)) = 0.(REAL-NS n)
      by A3,NDIFF_3:def 1;
    then consider n0 be Nat such that
A17: for m be Nat st n0 <=m holds ||. ((s")(#)(R/*s)).
    m- 0.(REAL-NS n).|| < r by A4,NORMSP_1:def 7;
A18: ||. ((s")(#)(R/*s)).n0- 0.(REAL-NS n).|| < r by A17;
A19: ||.(s.n0)"*(R/.(s.n0)).|| = |.(s.n0)".| * ||.(R/.(s.n0)).||
    by NORMSP_1:def 1
      .=|. s.n0 .|" * ||.(R/.(s.n0)).|| by COMPLEX1:66;
    dom R = REAL by A1,PARTFUN1:def 2;
    then
A20: rng s c= dom R;
A21:  n0 in NAT by ORDINAL1:def 12;
    ||. ((s")(#)(R/*s)).n0- 0.(REAL-NS n) .||
            = ||. ((s")(#)(R/*s)).n0 .|| by RLVECT_1:13
      .= ||.(s".n0)*((R/*s).n0).|| by NDIFF_1:def 2
      .= ||.(s.n0)"*((R/*s).n0).|| by VALUED_1:10
      .= ||.(s.n0)"*(R/.(s.n0)).|| by A20,A21,FUNCT_2:109;
    hence
    for r be Real st r > 0
   ex d be Real st d > 0 & for z be Real st
    z <> 0 & |. z .| < d holds ( |. z .|"* ||. R/.z .||) < r by A9,A18,A19;
  end;
  now
    assume
A22: for r be Real st r > 0
    ex d be Real st d > 0 &
   for z be Real
     st z <> 0 & |. z .| < d holds ( |. z .|"* ||. R/.z .||) < r;
    now
      let s be 0-convergent non-zero Real_Sequence;
A23:  s is convergent & lim s = 0;
A24:  now
        let r be Real;
        assume r > 0;
        then consider d be Real such that
A25:    d > 0 and
A26:    for z be Real st z <> 0 & |. z .| < d holds ( |. z .|
        "* ||. R/.z .||) < r by A22;
        consider n0 be Nat such that
A27:    for m be Nat st n0 <=m holds |. s.m-0 .| < d by A23,A25,SEQ_2:def 7;
        take n0;
        thus for m be Nat st n0 <=m holds ||. ((s")(#)(R/*s)).
        m- 0.(REAL-NS n).|| < r
        proof
          dom R = REAL by A1,PARTFUN1:def 2;
          then
A28:      rng s c= dom R;
          let m be Nat;
          assume n0 <=m;
          then
A29:      |. s.m-0 .| < d by A27;
A30:      s.m <> 0 by SEQ_1:5;
A31:       m in NAT by ORDINAL1:def 12;
          |. s.m .|" * ||.(R/.(s.m)).|| =|.(s.m)".| * ||.(R/.(s.m)).||
            by COMPLEX1:66
            .= ||.(s.m)"*(R/.(s.m)).|| by NORMSP_1:def 1
            .= ||.(s.m)"*((R/*s).m).|| by A28,A31,FUNCT_2:109
            .= ||.(s".m)*((R/*s).m).|| by VALUED_1:10
            .= ||. ((s")(#)(R/*s)).m .|| by NDIFF_1:def 2
            .= ||. ((s")(#)(R/*s)).m- 0.(REAL-NS n).|| by RLVECT_1:13;
          hence thesis by A26,A29,A30;
        end;
      end;
      hence
     (s")(#)(R/*s) is convergent by NORMSP_1:def 6;
      hence lim ((s")(#)(R/*s)) = 0.(REAL-NS n) by A24,NORMSP_1:def 7;
    end;
    hence R is RestFunc-like by A1,NDIFF_3:def 1;
  end;
  hence thesis by A2;
end;
