reserve r1,r2 for Real;
reserve n,i,i1,i2,j for Nat;
reserve D for non empty set;
reserve f for FinSequence of D;

theorem Th24:
  for f be FinSequence of TOP-REAL 2 for p be Point of TOP-REAL 2
st p in L~f holds R_Cut(f,p).(len R_Cut(f,p)) = p & for i be Element of NAT st
  1<=i & i<=Index(p,f) holds R_Cut(f,p).i = f.i
proof
  let f be FinSequence of TOP-REAL 2;
  let p be Point of TOP-REAL 2;
  assume
A1: p in L~f;
  then
A2: Index(p,f)<len f by Th8;
  now
    per cases;
    suppose
A3:   p<>f.1;
A4:   len (mid(f,1,Index(p,f))^<*p*>)= len mid(f,1,Index(p,f))+len <*p*>
      by FINSEQ_1:22
        .= len mid(f,1,Index(p,f))+1 by FINSEQ_1:39;
      R_Cut(f,p) = mid(f,1,Index(p,f))^<*p*> by A3,Def4;
      hence (R_Cut(f,p)).(len R_Cut(f,p)) = p by A4,FINSEQ_1:42;
    end;
    suppose
      p=f.1;
      then
A5:   R_Cut(f,p) = <*p*> by Def4;
      then len R_Cut(f,p) = 1 by FINSEQ_1:40;
      hence (R_Cut(f,p)).(len R_Cut(f,p)) = p by A5;
    end;
  end;
  hence (R_Cut(f,p)).(len R_Cut(f,p)) = p;
A6: 1<=Index(p,f) by A1,Th8;
  then len f > 1 by A2,XXREAL_0:2;
  then
A7: len mid(f,1,Index(p,f))=Index(p,f)-'1+1 by A6,A2,FINSEQ_6:118
    .= Index(p,f) by A1,Th8,XREAL_1:235;
  thus for i be Element of NAT st 1<=i & i<=Index(p,f) holds R_Cut(f,p).i=f.i
  proof
    let i be Element of NAT;
    assume that
A8: 1<=i and
A9: i<=Index(p,f);
    now
      per cases;
      case
        p<>f.1;
        then (R_Cut(f,p)).i=(mid(f,1,Index(p,f))^<*p*>).i by Def4
          .= mid(f,1,Index(p,f)).i by A7,A8,A9,FINSEQ_1:64
          .=f.i by A2,A8,A9,FINSEQ_6:123;
        hence thesis;
      end;
      case
A10:    p=f.1;
A11:    len f > 1 by A6,A2,XXREAL_0:2;
        then 1 in dom f by FINSEQ_3:25;
        then
A12:    p = f/.1 by A10,PARTFUN1:def 6;
        len f >= 1+1 by A11,NAT_1:13;
        then Index(p,f) = 1 by A12,Th11;
        then
A13:    i = 1 by A8,A9,XXREAL_0:1;
        R_Cut(f,p) = <*p*> by A10,Def4;
        hence thesis by A10,A13;
      end;
    end;
    hence thesis;
  end;
end;
