
theorem MOP:
  for a be Nat, p be Prime holds
    a|^(p - 1) mod p = 0 or a|^(p - 1) mod p = 1
  proof
    let a be Nat, p be Prime;
    reconsider k = p - 1 as non zero Nat;
    per cases;
    suppose
      B1: k + 1 divides a;
      a|^1 divides a|^k by NEWTON:89,NAT_1:14; then
      p divides a|^k by B1,INT_2:9;
      hence thesis by INT_1:62;
    end;
    suppose
      B1: not k + 1 divides a; then
      reconsider a as non zero Nat by INT_2:12;
      k + 1 divides a|^k - 1 by B1,NEWTON02:157; then
      B2: (a|^k - 1) mod p = 0 by INT_1:62; then
      ((a|^k - 1) + 1) mod p = ((a|^k - 1) mod p) + 1 by NAT_D:70;
      hence thesis by B2;
    end;
  end;
