reserve x,y,z for set;
reserve f,f1,f2,f3 for FinSequence,
  p,p1,p2,p3 for set,
  i,k for Nat;
reserve D for non empty set,
  p,p1,p2,p3 for Element of D,
  f,f1,f2 for FinSequence of D;

theorem
  f is circular & f just_once_values p2 implies
  Rotate(Rotate(f,p1),p2) = Rotate(f,p2)
proof
  per cases;
  suppose
A1: p1 in rng f;
    assume that
A2: f is circular and
A3: f just_once_values p2;
A4: p2 in rng f by A3,FINSEQ_4:45;
    now
      per cases;
      suppose
        rng f is trivial;
        then p1 = p2 by A1,A4,ZFMISC_1:def 10;
        hence thesis by Th93;
      end;
      suppose
A5:     rng f is not trivial;
        then f = <*f/.1*>^(f/^1) by FINSEQ_5:29,RELAT_1:38;
        then
A6:     rng f = rng<*f/.1*> \/ rng(f/^1) by FINSEQ_1:31;
        now
          f qua set is non trivial by A5;
          then len f >= 1 + 1 by NAT_D:60;
          then
A7:       1 < len f by NAT_1:13;
          assume
A8:       not p2 in rng(f/^1);
          then p2 in rng<*f/.1*> by A4,A6,XBOOLE_0:def 3;
          then p2 in {f/.1} by FINSEQ_1:39;
          then p2 = f/.1 by TARSKI:def 1;
          then
A9:       p2 = f/.len f by A2;
          len f in dom f by A5,FINSEQ_5:6,RELAT_1:38;
          hence contradiction by A8,A9,A7,Th58;
        end;
        hence thesis by A3,Th104;
      end;
    end;
    hence thesis;
  end;
  suppose
    not p1 in rng f;
    hence thesis by Def2;
  end;
end;
