reserve n,n1,m,k for Nat;
reserve x,y for set;
reserve s,g,g1,g2,r,p,p2,q,t for Real;
reserve s1,s2,s3 for Real_Sequence;
reserve Nseq for increasing sequence of NAT;
reserve X for Subset of REAL;

theorem Th5:
  [.s,g.] is closed
proof
  for s1 st rng s1 c= [.s,g.] & s1 is convergent holds lim s1 in [.s,g.]
  proof
    let s1;
    assume that
A1: rng s1 c= [.s,g.] and
A2: s1 is convergent;
A3: s <= lim s1
    proof
      set s2 = seq_const s;
A4:   now
        let n;
     n in NAT by ORDINAL1:def 12;
        then n in dom s1 by FUNCT_2:def 1;
        then s1.n in rng s1 by FUNCT_1:def 3;
        then s1.n in [.s,g.] by A1;
        then ex p st s1.n = p & s <= p & p<=g;
        hence s2.n<=s1.n by SEQ_1:57;
      end;
      s2.0 = s by SEQ_1:57;
      then lim s2 = s by SEQ_4:25;
      hence thesis by A2,A4,SEQ_2:18;
    end;
    lim s1 <= g
    proof
      set s2 = seq_const g;
A5:   now
        let n;
     n in NAT by ORDINAL1:def 12;
        then n in dom s1 by FUNCT_2:def 1;
        then s1.n in rng s1 by FUNCT_1:def 3;
        then s1.n in [.s,g.] by A1;
        then ex p st s1.n = p & s <= p & p<=g;
        hence s1.n<=s2.n by SEQ_1:57;
      end;
      s2.0 = g by SEQ_1:57;
      then lim s2 = g by SEQ_4:25;
      hence thesis by A2,A5,SEQ_2:18;
    end;
    hence thesis by A3;
  end;
  hence thesis;
end;
