reserve x for set;
reserve a, b, c for Real;
reserve m, n, m1, m2 for Nat;
reserve k, l for Integer;
reserve p, q for Rational;
reserve s1, s2 for Real_Sequence;

theorem
  for s being Real_Sequence st a > 0 & (for n st n>=1 holds s.n = n
  -Root a) holds s is convergent & lim s = 1
proof
  let s be Real_Sequence;
  assume
A1: a>0;
  assume
A2: for n st n>=1 holds s.n = n -Root a;
  per cases;
  suppose
    a>=1;
    hence thesis by A2,Lm3;
  end;
  suppose
A3: a<1;
    then a/a<1/a by A1,XREAL_1:74;
    then
A4: 1<=1/a by A1,XCMPLX_1:60;
    deffunc O(Nat) = $1 -Root (1/a);
    consider s1 being Real_Sequence such that
A5: for n holds s1.n = O(n) from SEQ_1:sch 1;
A6: for n holds n>=1 implies s1.n=n -Root (1/a) by A5;
    then
A7: lim s1 = 1 by A4,Lm3;
A8: s1 is convergent by A4,A6,Lm3;
A9: now
      let b be Real;
      assume b>0;
      then consider m1 such that
A10:  for m st m1<=m holds |.s1.m-1.|<b by A8,A7,SEQ_2:def 7;
       reconsider n=m1+1 as Nat;
      take n;
      let m;
      assume
A11:  n<=m;
A12:  n>=0+1 by XREAL_1:6;
      then
A13:  1<=m by A11,XXREAL_0:2;
      then
A14:  m -Root a<1 by A1,A3,Th30;
A15:  (m -Root a) <> 0 by A1,A13,Def2;
      then
A16:  |.1/(m -Root a) - 1.| = |.1/(m -Root a) - (m -Root a)/(m -Root a
      ).| by XCMPLX_1:60
        .= |.(1 - m -Root a)/(m -Root a).|
        .= |.(1 - m -Root a)*(m -Root a)".|
        .= |.1 - m -Root a.|*|.(m -Root a)".| by COMPLEX1:65;
      0<m -Root a by A1,A3,A13,Th30;
      then (m -Root a)*(m -Root a)"<1*(m -Root a)" by A14,XREAL_1:68;
      then 1<(m -Root a)" by A15,XCMPLX_0:def 7;
      then
A17:  1<|.(m -Root a)".| by ABSVALUE:def 1;
      0<>1 - m -Root a by A1,A3,A13,Th30;
      then |.1 - m -Root a.| > 0 by COMPLEX1:47;
      then
A18:  1*|.1 - m -Root a.| < |.1 - m -Root a.|*|.(m -Root a)".| by A17,
XREAL_1:68;
      m1<=n by XREAL_1:29;
      then m1<=m by A11,XXREAL_0:2;
      then |.s1.m-1.|<b by A10;
      then |.m -Root (1/a) - 1.|<b by A5;
      then |.1/(m -Root a) - 1.|<b by A1,A13,Th23;
      then |.-(m -Root a - 1).| < b by A16,A18,XXREAL_0:2;
      then |.m -Root a - 1.| < b by COMPLEX1:52;
      hence |.s.m - 1.| < b by A2,A12,A11,XXREAL_0:2;
    end;
    hence s is convergent by SEQ_2:def 6;
    hence thesis by A9,SEQ_2:def 7;
  end;
end;
