
theorem
  for i be Integer holds (i|^4) mod 5 = 0 or (i|^4) mod 5 = 1
  proof
    let i be Integer;
    A1: i|^2 mod 5 = (i*i) mod 5 by NEWTON:81
    .= ((i mod 5)*(i mod 5)) mod 5 by NAT_D:67;
    A2: (i|^(2+2)) mod 5 = ((i|^2)*(i|^2)) mod 5 by NEWTON:8
    .= ((((i mod 5)*(i mod 5))mod 5)* (((i mod 5)*(i mod 5))mod 5)) mod 5
       by A1,NAT_D:67
    .= (((i mod 5)*(i mod 5))*((i mod 5)*(i mod 5))) mod 5 by NAT_D:67
    .= ((i mod 5)*(i mod 5)*(i mod 5)*(i mod 5)) mod 5;
    i mod (4+1) = 0 or ... or i mod (4+1) = 4 by NUMBER03:11; then
    per cases;
    suppose
      i mod (4+1) = 0;
      hence thesis by A2;
    end;
    suppose
      i mod (4+1) = 1;
      hence thesis by A2;
    end;
    suppose
      i mod (4+1)= 2; then
       (i|^4) mod (4+1)= (5*3 + 1) mod 5 by A2
      .= 1 mod (1 + 4)
      .= 1;
      hence thesis;
    end;
    suppose
      i mod (4+1) = 3; then
       (i|^4) mod (4+1) = (5*16 + 1) mod 5 by A2
      .= 1 mod (1 + 4)
      .= 1;
      hence thesis;
    end;
    suppose
      i mod (4+1) = 4; then
       (i|^4) mod (4+1) = (51*5 + 1) mod 5 by A2
      .= 1 mod (1 + 4)
      .= 1;
      hence thesis;
    end;
  end;
