theorem Th9:
  for f1,i1,i2 st 1<=i2 & i2<=i1 & i1<=len f1 holds
    len mid(f1,i1, i2)=i1-'i2+1
proof
  let f1,i1,i2;
  assume that
A1: 1<= i2 and
A2: i2<=i1 and
A3: i1<= len f1;
  per cases by A2,XXREAL_0:1;
  suppose
    i1=i2;
    hence thesis by A1,A3,Th117;
  end;
  suppose
A4: i2<i1;
A5: i2<=len f1 by A2,A3,XXREAL_0:2;
    1<=i1 by A1,A2,XXREAL_0:2;
    hence thesis by A1,A3,A4,A5,Th117;
  end;
end;
