
theorem
  for p be Safe Prime st p > 5 holds p mod 8 = 3 or p mod 8 = 7
proof
  8 = 2*4;
  then
A1: 2 divides 8 by NAT_D:def 3;
  let p be Safe Prime;
  set k = p mod 8;
  consider q be Prime such that
A2: 2*q+1 = p by Def1;
  assume
A3: p > 5;
A4: now
    assume
A5: (k = 0 or ... or k = 2) or (k = 4 or ... or k = 6);
    now
      per cases by A5;
      suppose
        k = 0;
        then 8 divides p by INT_1:62;
        then 2 divides p by A1,INT_2:9;
        then 2 = p by INT_2:def 4;
        hence contradiction by Th2;
      end;
      suppose
        k=1;
        then (p div 8)*8+1 = 2*q+1 by A2,INT_1:59;
        then q = (p div 8)*4;
        then 4 divides q by INT_1:def 3;
        hence contradiction by INT_2:29,def 4;
      end;
      suppose
        k=2;
        then p = (p div 8)*8+2 by INT_1:59
          .=((p div 8)*4+1)*2;
        then 2 divides p by INT_1:def 3;
        then 2 = p by INT_2:def 4;
        hence contradiction by Th2;
      end;
      suppose
        k = 4;
        then p=(p div 8)*8+4 by INT_1:59
          .=((p div 8)*4+2)*2;
        then 2 divides p by INT_1:def 3;
        then 2 = p by INT_2:def 4;
        hence contradiction by Th2;
      end;
      suppose
        k = 5;
        then (p div 8)*8+5 = 2*q+1 by A2,INT_1:59;
        then q = ((p div 8)*2+1)*2;
        then 2 divides q by INT_1:def 3;
        then 2 = q by INT_2:def 4;
        hence contradiction by A3,A2;
      end;
      suppose
        k = 6;
        then p=(p div 8)*8+6 by INT_1:59
          .= ((p div 8)*4+3)*2;
        then 2 divides p by INT_1:def 3;
        then 2 = p by INT_2:def 4;
        hence contradiction by Th2;
      end;
    end;
    hence contradiction;
  end;
  k < 7+1 by NAT_D:62;
  then k <= 0+7 by NAT_1:13;
  then k = 0 or ... or k = 7;
  hence thesis by A4;
end;
