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