reserve D for non empty set,
  f for FinSequence of D,
  g for circular FinSequence of D,
  p,p1,p2,p3,q for Element of D;
reserve f for non constant standard special_circular_sequence,
  p,p1,p2,p3,q for Point of TOP-REAL 2;

theorem Th8:
  1 < q..f & q in rng f implies (f/.1)..Rotate(f,q) = len f + 1 - q ..f
proof
  assume that
A1: 1 < q..f and
A2: q in rng f;
  set i = 1 + len f -' q..f;
A3: q..f - 1 > 0 by A1,XREAL_1:50;
A4: q..f <= len f by A2,FINSEQ_4:21;
  then
A5: q..f <= len f + 1 by NAT_1:13;
  then
A6: i = 1 + len f - q..f by XREAL_1:233;
  then i +(q..f - 1) = len f;
  then i < len f by A3,XREAL_1:29;
  then
A7: i < len Rotate(f,q) by FINSEQ_6:179;
  now
    assume q..f + 0 >= len f;
    then
A8: q..f = len f by A4,XXREAL_0:1;
    q = f/.(q..f) by A2,FINSEQ_5:38
      .= f/.1 by A8,FINSEQ_6:def 1;
    hence contradiction by A1,FINSEQ_6:43;
  end;
  then
A9: len f - q..f > 0 by XREAL_1:20;
  i = 1 + (len f - q..f) by A6;
  then
A10: 1 + 0 < i by A9,XREAL_1:6;
  then
A11: i in dom Rotate(f,q) by A7,FINSEQ_3:25;
A12: f/.1 = Rotate(f,q)/.(1 + len f -' q..f) by A1,A2,FINSEQ_6:183;
  then
A13: f/.1 = Rotate(f,q).i by A11,PARTFUN1:def 6;
  for j being object st j in dom Rotate(f,q) & j <> i
holds Rotate(f,q).j <> f/.1
  proof
    let z be object;
    assume that
A14: z in dom Rotate(f,q) and
A15: z <> i;
    reconsider j = z as Nat by A14;
    per cases by A15,XXREAL_0:1;
    suppose
A16:  j < i;
      1 <= j by A14,FINSEQ_3:25;
      then Rotate(f,q)/.j <> f/.1 by A12,A7,A16,GOBOARD7:36;
      hence thesis by A14,PARTFUN1:def 6;
    end;
    suppose
A17:  i < j;
      j <= len Rotate(f,q) by A14,FINSEQ_3:25;
      then Rotate(f,q)/.j <> f/.1 by A12,A10,A17,GOBOARD7:37;
      hence thesis by A14,PARTFUN1:def 6;
    end;
  end;
  then
A18: Rotate(f,q) just_once_values f/.1 by A11,A13,FINSEQ_4:7;
  then 1 + len f -' q..f = Rotate(f,q) <- (f/.1) by A11,A13,FINSEQ_4:def 3;
  hence f/.1..Rotate(f,q) = 1 + len f -' q..f by A18,FINSEQ_4:25
    .= len f + 1 - q..f by A5,XREAL_1:233;
end;
