
theorem Th17:
  for p be FinSequence of REAL, n,m be Nat
  st n+1 < m <= len p holds
    ex pM1 be FinSequence of REAL
    st len pM1 = m-(n+1)-1 & rng pM1 c= rng p
     & for i be Nat st i in dom pM1 holds pM1.i = p.(i+n+1)
  proof
    let p be FinSequence of REAL, n,m be Nat;
    assume
    A1: n+1 < m <= len p;
    set n1 = n+1;
    A2: n1 + 1 <= m by A1,NAT_1:13;
    per cases;
    suppose
      A3: n1 + 1 = m;
      set pM1 = <*>REAL;
      take pM1;
      thus len pM1 = m-(n+1)-1 by A3;
      thus rng pM1 c= rng p;
      thus for i be Nat st i in dom pM1 holds pM1.i = p.(i+n+1);
    end;
    suppose
      n1 + 1 <> m; then
      n1 + 1 < m by A2,XXREAL_0:1; then
      consider TM1 be FinSequence of REAL such that
      A4: len TM1 = m-(n1+1) & rng TM1 c= rng p
        & for i be Nat st i in dom TM1 holds TM1.i = p.(i+n1)
          by A1,Th15;
      take TM1;
      thus len TM1 = m-(n+1)-1 by A4;
      thus rng TM1 c= rng p by A4;
      let i be Nat;
      assume i in dom TM1;
      hence TM1.i = p.(i+n1) by A4
                 .= p.(i+n+1);
    end;
  end;
