let p be Safe Prime; :: thesis: ( p <> 5 implies p mod 4 = 3 )

set k = p mod 4;

consider q being Prime such that

A1: (2 * q) + 1 = p by Def1;

assume A2: p <> 5 ; :: thesis: p mod 4 = 3

then p mod 4 <= 0 + 3 by NAT_1:13;

then not not p mod 4 = 0 & ... & not p mod 4 = 3 ;

hence p mod 4 = 3 by A3; :: thesis: verum

set k = p mod 4;

consider q being Prime such that

A1: (2 * q) + 1 = p by Def1;

assume A2: p <> 5 ; :: thesis: p mod 4 = 3

A3: now :: thesis: ( not p mod 4 = 0 & not p mod 4 = 1 & not p mod 4 = 2 )

p mod 4 < 3 + 1
by NAT_D:62;assume A4:
( p mod 4 = 0 or p mod 4 = 1 or p mod 4 = 2 )
; :: thesis: contradiction

end;now :: thesis: contradictionend;

hence
contradiction
; :: thesis: verumper cases
( p mod 4 = 0 or p mod 4 = 1 or p mod 4 = 2 )
by A4;

end;

suppose
p mod 4 = 1
; :: thesis: contradiction

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; :: thesis: verum

end;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; :: thesis: verum

suppose
p mod 4 = 2
; :: thesis: contradiction

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; :: thesis: verum

end;.= (((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; :: thesis: verum

then p mod 4 <= 0 + 3 by NAT_1:13;

then not not p mod 4 = 0 & ... & not p mod 4 = 3 ;

hence p mod 4 = 3 by A3; :: thesis: verum