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 Th104:
  p2 in rng(f/^1) & 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: p2 in rng(f/^1) and
A3: f just_once_values p2;
    f = (f -| p1) ^ <* p1 *> ^ (f |-- p1) by A1,FINSEQ_4:51;
    then
A4: p2 in rng((f -| p1)^<* p1 *>) \+\ rng(f |-- p1) by A3,Th16;
A5: now
      per cases by A4,XBOOLE_0:1;
      case that
        p2 in rng((f -| p1)^<* p1 *>) and
A6:     not p2 in rng(f |-- p1);
        now
          per cases;
          case
            not p2 in rng<* p1 *>;
            then not p2 in rng(f |-- p1) \/ rng<* p1 *> by A6,XBOOLE_0:def 3;
            then not p2 in rng(<* p1 *>^(f |-- p1)) by FINSEQ_1:31;
            hence not p2 in rng(f:-p1) by A1,Th41;
          end;
          case
            p2 in rng<* p1 *>;
            then p2 in { p1 } by FINSEQ_1:39;
            hence p2 = p1 by TARSKI:def 1;
          end;
        end;
        hence p2 in rng(f:-p1) implies p1 = p2;
      end;
      case
        not p2 in rng((f -| p1)^<* p1 *>);
        hence not p2 in rng(f-:p1) by A1,Th40;
      end;
    end;
A7: p2 in rng f by A3,FINSEQ_4:5;
    then f = <*f/.1*>^(f/^1) by FINSEQ_5:29,RELAT_1:38;
    then p2 in rng<*f/.1*> \+\ rng(f/^1) by A3,Th16;
    then not p2 in rng<*f/.1*> by A2,XBOOLE_0:1;
    then not p2 in {f/.1} by FINSEQ_1:39;
    then p2 <> f/.1 by TARSKI:def 1;
    then
A8: p2..f <> 1 by A7,FINSEQ_5:38;
    now
      per cases by A7,A5,XBOOLE_0:def 5;
      suppose
        p1 = p2;
        hence thesis by Th93;
      end;
      suppose
        p2 in rng f \ rng(f-:p1);
        hence thesis by Th102;
      end;
      suppose
        p2 in rng f \ rng(f:-p1);
        hence thesis by A8,Th103;
      end;
    end;
    hence thesis;
  end;
  suppose
    not p1 in rng f;
    hence thesis by Def2;
  end;
end;
