reserve n,k,k1,m,m1,n1,n2,l for Nat;
reserve r,r1,r2,p,p1,g,g1,g2,s,s1,s2,t for Real;
reserve seq,seq1,seq2 for Real_Sequence;
reserve Nseq for increasing sequence of NAT;
reserve x for set;
reserve X,Y for Subset of REAL;

theorem Th25:
 seq is constant & (r in rng seq or ex n st seq.n=r ) implies lim seq=r
proof
 assume
A1: seq is constant;
   then consider r1 being Element of REAL such that
A2: rng seq={r1} by FUNCT_2:111;
A3: now
    assume that
A4: r in rng seq;
    consider r2 being Element of REAL such that
A5: for n being Nat holds seq.n=r2 by A1,VALUED_0:def 18;
A6: r=r1 by A4,A2,TARSKI:def 1;
    reconsider zz=0 as Nat;
    now
      let p such that
A7:   0<p;
      take n=zz;
      let m such that
      n<=m;
      m in NAT by ORDINAL1:def 12;
      then m in dom seq by FUNCT_2:def 1;
      then seq.m in rng seq by FUNCT_1:def 3;
      then r2 in rng seq by A5;
      then r2=r by A2,A6,TARSKI:def 1;
      then seq.m=r by A5;
      hence |.(seq.m)-r.|<p by A7,ABSVALUE:2;
    end;
    hence thesis by A1,SEQ_2:def 7;
  end;
A8: now
    assume that
A9: ex n st seq.n=r;
    consider n such that
A10: seq.n=r by A9;
    n in NAT by ORDINAL1:def 12;
    then n in dom seq by FUNCT_2:def 1;
    hence thesis by A3,A10,FUNCT_1:def 3;
  end;
  assume r in rng seq or ex n st seq.n=r;
  hence thesis by A3,A8;
end;
