MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  m1lgs Structured version   Visualization version   Unicode version

Theorem m1lgs 24290
Description: The first supplement to the law of quadratic reciprocity. Negative one is a square mod an odd prime  P iff  P  ==  1 mod 4. (Contributed by Mario Carneiro, 19-Jun-2015.)
Assertion
Ref Expression
m1lgs  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  /L P )  =  1  <->  ( P  mod  4 )  =  1 ) )

Proof of Theorem m1lgs
StepHypRef Expression
1 neg1z 10973 . . . . . . . . 9  |-  -u 1  e.  ZZ
2 oddprm 14765 . . . . . . . . . 10  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  NN )
32nnnn0d 10925 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  NN0 )
4 zexpcl 12287 . . . . . . . . 9  |-  ( (
-u 1  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )  ->  ( -u 1 ^ ( ( P  - 
1 )  /  2
) )  e.  ZZ )
51, 3, 4sylancr 669 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( -u 1 ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
65peano2zd 11043 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  e.  ZZ )
7 eldifi 3555 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  Prime )
8 prmnn 14625 . . . . . . . 8  |-  ( P  e.  Prime  ->  P  e.  NN )
97, 8syl 17 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  NN )
106, 9zmodcld 12117 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( ( -u
1 ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P )  e.  NN0 )
1110nn0cnd 10927 . . . . 5  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( ( -u
1 ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P )  e.  CC )
12 1cnd 9659 . . . . 5  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
1  e.  CC )
1311, 12, 12subaddd 10004 . . . 4  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( ( ( ( -u 1 ^ ( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  -  1 )  =  1  <->  ( 1  +  1 )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
) ) )
14 2re 10679 . . . . . . . 8  |-  2  e.  RR
1514a1i 11 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
2  e.  RR )
169nnrpd 11339 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  RR+ )
17 0le2 10700 . . . . . . . 8  |-  0  <_  2
1817a1i 11 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
0  <_  2 )
19 eldifsni 4098 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  =/=  2 )
209nnred 10624 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  RR )
21 prmuz2 14642 . . . . . . . . . . 11  |-  ( P  e.  Prime  ->  P  e.  ( ZZ>= `  2 )
)
227, 21syl 17 . . . . . . . . . 10  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  ( ZZ>= ` 
2 ) )
23 eluzle 11171 . . . . . . . . . 10  |-  ( P  e.  ( ZZ>= `  2
)  ->  2  <_  P )
2422, 23syl 17 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
2  <_  P )
2515, 20, 24leltned 9788 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 2  <  P  <->  P  =/=  2 ) )
2619, 25mpbird 236 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
2  <  P )
27 modid 12121 . . . . . . 7  |-  ( ( ( 2  e.  RR  /\  P  e.  RR+ )  /\  ( 0  <_  2  /\  2  <  P ) )  ->  ( 2  mod  P )  =  2 )
2815, 16, 18, 26, 27syl22anc 1269 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 2  mod  P
)  =  2 )
29 df-2 10668 . . . . . 6  |-  2  =  ( 1  +  1 )
3028, 29syl6eq 2501 . . . . 5  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 2  mod  P
)  =  ( 1  +  1 ) )
3130eqeq1d 2453 . . . 4  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( 2  mod 
P )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  <->  ( 1  +  1 )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
) ) )
3219neneqd 2629 . . . . . . . . . . 11  |-  ( P  e.  ( Prime  \  {
2 } )  ->  -.  P  =  2
)
33 2prm 14640 . . . . . . . . . . . 12  |-  2  e.  Prime
34 dvdsprm 14647 . . . . . . . . . . . 12  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  2  e.  Prime )  ->  ( P  ||  2  <->  P  = 
2 ) )
3522, 33, 34sylancl 668 . . . . . . . . . . 11  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( P  ||  2  <->  P  =  2 ) )
3632, 35mtbird 303 . . . . . . . . . 10  |-  ( P  e.  ( Prime  \  {
2 } )  ->  -.  P  ||  2 )
3736adantr 467 . . . . . . . . 9  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  -.  P  ||  2 )
38 1cnd 9659 . . . . . . . . . . . . . . . 16  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  1  e.  CC )
392adantr 467 . . . . . . . . . . . . . . . 16  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  (
( P  -  1 )  /  2 )  e.  NN )
40 simpr 463 . . . . . . . . . . . . . . . 16  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  -.  2  ||  ( ( P  -  1 )  / 
2 ) )
41 oexpneg 14368 . . . . . . . . . . . . . . . 16  |-  ( ( 1  e.  CC  /\  ( ( P  - 
1 )  /  2
)  e.  NN  /\  -.  2  ||  ( ( P  -  1 )  /  2 ) )  ->  ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  = 
-u ( 1 ^ ( ( P  - 
1 )  /  2
) ) )
4238, 39, 40, 41syl3anc 1268 . . . . . . . . . . . . . . 15  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  ( -u 1 ^ ( ( P  -  1 )  /  2 ) )  =  -u ( 1 ^ ( ( P  - 
1 )  /  2
) ) )
4339nnzd 11039 . . . . . . . . . . . . . . . . 17  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  (
( P  -  1 )  /  2 )  e.  ZZ )
44 1exp 12301 . . . . . . . . . . . . . . . . 17  |-  ( ( ( P  -  1 )  /  2 )  e.  ZZ  ->  (
1 ^ ( ( P  -  1 )  /  2 ) )  =  1 )
4543, 44syl 17 . . . . . . . . . . . . . . . 16  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  (
1 ^ ( ( P  -  1 )  /  2 ) )  =  1 )
4645negeqd 9869 . . . . . . . . . . . . . . 15  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  -u (
1 ^ ( ( P  -  1 )  /  2 ) )  =  -u 1 )
4742, 46eqtrd 2485 . . . . . . . . . . . . . 14  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  ( -u 1 ^ ( ( P  -  1 )  /  2 ) )  =  -u 1 )
4847oveq1d 6305 . . . . . . . . . . . . 13  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  (
( -u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 )  =  ( -u 1  +  1 ) )
49 ax-1cn 9597 . . . . . . . . . . . . . 14  |-  1  e.  CC
50 neg1cn 10713 . . . . . . . . . . . . . 14  |-  -u 1  e.  CC
51 1pneg1e0 10718 . . . . . . . . . . . . . 14  |-  ( 1  +  -u 1 )  =  0
5249, 50, 51addcomli 9825 . . . . . . . . . . . . 13  |-  ( -u
1  +  1 )  =  0
5348, 52syl6eq 2501 . . . . . . . . . . . 12  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  (
( -u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 )  =  0 )
5453oveq2d 6306 . . . . . . . . . . 11  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  (
2  -  ( (
-u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 ) )  =  ( 2  -  0 ) )
55 2cn 10680 . . . . . . . . . . . 12  |-  2  e.  CC
5655subid1i 9946 . . . . . . . . . . 11  |-  ( 2  -  0 )  =  2
5754, 56syl6eq 2501 . . . . . . . . . 10  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  (
2  -  ( (
-u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 ) )  =  2 )
5857breq2d 4414 . . . . . . . . 9  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  ( P  ||  ( 2  -  ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 ) )  <->  P  ||  2
) )
5937, 58mtbird 303 . . . . . . . 8  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  -.  2  ||  ( ( P  - 
1 )  /  2
) )  ->  -.  P  ||  ( 2  -  ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 ) ) )
6059ex 436 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( -.  2  ||  ( ( P  - 
1 )  /  2
)  ->  -.  P  ||  ( 2  -  (
( -u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 ) ) ) )
6160con4d 109 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( P  ||  (
2  -  ( (
-u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 ) )  ->  2  ||  ( ( P  - 
1 )  /  2
) ) )
62 2z 10969 . . . . . . . 8  |-  2  e.  ZZ
6362a1i 11 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
2  e.  ZZ )
64 moddvds 14312 . . . . . . 7  |-  ( ( P  e.  NN  /\  2  e.  ZZ  /\  (
( -u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 )  e.  ZZ )  -> 
( ( 2  mod 
P )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  <->  P  ||  ( 2  -  ( ( -u
1 ^ ( ( P  -  1 )  /  2 ) )  +  1 ) ) ) )
659, 63, 6, 64syl3anc 1268 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( 2  mod 
P )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  <->  P  ||  ( 2  -  ( ( -u
1 ^ ( ( P  -  1 )  /  2 ) )  +  1 ) ) ) )
66 4z 10971 . . . . . . . . . 10  |-  4  e.  ZZ
6766a1i 11 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
4  e.  ZZ )
68 4ne0 10706 . . . . . . . . . 10  |-  4  =/=  0
6968a1i 11 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
4  =/=  0 )
70 nnm1nn0 10911 . . . . . . . . . . 11  |-  ( P  e.  NN  ->  ( P  -  1 )  e.  NN0 )
719, 70syl 17 . . . . . . . . . 10  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( P  -  1 )  e.  NN0 )
7271nn0zd 11038 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( P  -  1 )  e.  ZZ )
73 dvdsval2 14308 . . . . . . . . 9  |-  ( ( 4  e.  ZZ  /\  4  =/=  0  /\  ( P  -  1 )  e.  ZZ )  -> 
( 4  ||  ( P  -  1 )  <-> 
( ( P  - 
1 )  /  4
)  e.  ZZ ) )
7467, 69, 72, 73syl3anc 1268 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 4  ||  ( P  -  1 )  <-> 
( ( P  - 
1 )  /  4
)  e.  ZZ ) )
7571nn0cnd 10927 . . . . . . . . . . 11  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( P  -  1 )  e.  CC )
7655a1i 11 . . . . . . . . . . 11  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
2  e.  CC )
77 2ne0 10702 . . . . . . . . . . . 12  |-  2  =/=  0
7877a1i 11 . . . . . . . . . . 11  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
2  =/=  0 )
7975, 76, 76, 78, 78divdiv1d 10414 . . . . . . . . . 10  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( ( P  -  1 )  / 
2 )  /  2
)  =  ( ( P  -  1 )  /  ( 2  x.  2 ) ) )
80 2t2e4 10759 . . . . . . . . . . 11  |-  ( 2  x.  2 )  =  4
8180oveq2i 6301 . . . . . . . . . 10  |-  ( ( P  -  1 )  /  ( 2  x.  2 ) )  =  ( ( P  - 
1 )  /  4
)
8279, 81syl6eq 2501 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( ( P  -  1 )  / 
2 )  /  2
)  =  ( ( P  -  1 )  /  4 ) )
8382eleq1d 2513 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( ( ( P  -  1 )  /  2 )  / 
2 )  e.  ZZ  <->  ( ( P  -  1 )  /  4 )  e.  ZZ ) )
8474, 83bitr4d 260 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 4  ||  ( P  -  1 )  <-> 
( ( ( P  -  1 )  / 
2 )  /  2
)  e.  ZZ ) )
852nnzd 11039 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  ZZ )
86 dvdsval2 14308 . . . . . . . 8  |-  ( ( 2  e.  ZZ  /\  2  =/=  0  /\  (
( P  -  1 )  /  2 )  e.  ZZ )  -> 
( 2  ||  (
( P  -  1 )  /  2 )  <-> 
( ( ( P  -  1 )  / 
2 )  /  2
)  e.  ZZ ) )
8763, 78, 85, 86syl3anc 1268 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 2  ||  (
( P  -  1 )  /  2 )  <-> 
( ( ( P  -  1 )  / 
2 )  /  2
)  e.  ZZ ) )
8884, 87bitr4d 260 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 4  ||  ( P  -  1 )  <->  2  ||  ( ( P  -  1 )  /  2 ) ) )
8961, 65, 883imtr4d 272 . . . . 5  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( 2  mod 
P )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  ->  4  ||  ( P  -  1
) ) )
9050a1i 11 . . . . . . . . . . 11  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  -u 1  e.  CC )
91 neg1ne0 10715 . . . . . . . . . . . 12  |-  -u 1  =/=  0
9291a1i 11 . . . . . . . . . . 11  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  -u 1  =/=  0 )
9362a1i 11 . . . . . . . . . . 11  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  2  e.  ZZ )
9484biimpa 487 . . . . . . . . . . 11  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( (
( P  -  1 )  /  2 )  /  2 )  e.  ZZ )
95 expmulz 12318 . . . . . . . . . . 11  |-  ( ( ( -u 1  e.  CC  /\  -u 1  =/=  0 )  /\  (
2  e.  ZZ  /\  ( ( ( P  -  1 )  / 
2 )  /  2
)  e.  ZZ ) )  ->  ( -u 1 ^ ( 2  x.  ( ( ( P  -  1 )  / 
2 )  /  2
) ) )  =  ( ( -u 1 ^ 2 ) ^
( ( ( P  -  1 )  / 
2 )  /  2
) ) )
9690, 92, 93, 94, 95syl22anc 1269 . . . . . . . . . 10  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( -u 1 ^ ( 2  x.  ( ( ( P  -  1 )  / 
2 )  /  2
) ) )  =  ( ( -u 1 ^ 2 ) ^
( ( ( P  -  1 )  / 
2 )  /  2
) ) )
972nncnd 10625 . . . . . . . . . . . . 13  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  CC )
9897, 76, 78divcan2d 10385 . . . . . . . . . . . 12  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 2  x.  (
( ( P  - 
1 )  /  2
)  /  2 ) )  =  ( ( P  -  1 )  /  2 ) )
9998adantr 467 . . . . . . . . . . 11  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( 2  x.  ( ( ( P  -  1 )  /  2 )  / 
2 ) )  =  ( ( P  - 
1 )  /  2
) )
10099oveq2d 6306 . . . . . . . . . 10  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( -u 1 ^ ( 2  x.  ( ( ( P  -  1 )  / 
2 )  /  2
) ) )  =  ( -u 1 ^ ( ( P  - 
1 )  /  2
) ) )
101 neg1sqe1 12370 . . . . . . . . . . . 12  |-  ( -u
1 ^ 2 )  =  1
102101oveq1i 6300 . . . . . . . . . . 11  |-  ( (
-u 1 ^ 2 ) ^ ( ( ( P  -  1 )  /  2 )  /  2 ) )  =  ( 1 ^ ( ( ( P  -  1 )  / 
2 )  /  2
) )
103 1exp 12301 . . . . . . . . . . . 12  |-  ( ( ( ( P  - 
1 )  /  2
)  /  2 )  e.  ZZ  ->  (
1 ^ ( ( ( P  -  1 )  /  2 )  /  2 ) )  =  1 )
10494, 103syl 17 . . . . . . . . . . 11  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( 1 ^ ( ( ( P  -  1 )  /  2 )  / 
2 ) )  =  1 )
105102, 104syl5eq 2497 . . . . . . . . . 10  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( ( -u 1 ^ 2 ) ^ ( ( ( P  -  1 )  /  2 )  / 
2 ) )  =  1 )
10696, 100, 1053eqtr3d 2493 . . . . . . . . 9  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  =  1 )
107106oveq1d 6305 . . . . . . . 8  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( ( -u 1 ^ ( ( P  -  1 )  /  2 ) )  +  1 )  =  ( 1  +  1 ) )
108107, 29syl6reqr 2504 . . . . . . 7  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  2  =  ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 ) )
109108oveq1d 6305 . . . . . 6  |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  4  ||  ( P  -  1 ) )  ->  ( 2  mod  P )  =  ( ( ( -u
1 ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P ) )
110109ex 436 . . . . 5  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( 4  ||  ( P  -  1 )  ->  ( 2  mod 
P )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
) ) )
11189, 110impbid 194 . . . 4  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( 2  mod 
P )  =  ( ( ( -u 1 ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  <->  4  ||  ( P  -  1 ) ) )
11213, 31, 1113bitr2d 285 . . 3  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( ( ( ( -u 1 ^ ( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  -  1 )  =  1  <->  4  ||  ( P  -  1 ) ) )
113 lgsval3 24242 . . . . 5  |-  ( (
-u 1  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( -u 1  /L P )  =  ( ( ( (
-u 1 ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  - 
1 ) )
1141, 113mpan 676 . . . 4  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( -u 1  /L
P )  =  ( ( ( ( -u
1 ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P )  -  1 ) )
115114eqeq1d 2453 . . 3  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  /L P )  =  1  <->  ( ( ( ( -u 1 ^ ( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  -  1 )  =  1 ) )
116 4nn 10769 . . . . 5  |-  4  e.  NN
117116a1i 11 . . . 4  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
4  e.  NN )
118 prmz 14626 . . . . 5  |-  ( P  e.  Prime  ->  P  e.  ZZ )
1197, 118syl 17 . . . 4  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  ZZ )
120 1zzd 10968 . . . 4  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
1  e.  ZZ )
121 moddvds 14312 . . . 4  |-  ( ( 4  e.  NN  /\  P  e.  ZZ  /\  1  e.  ZZ )  ->  (
( P  mod  4
)  =  ( 1  mod  4 )  <->  4  ||  ( P  -  1
) ) )
122117, 119, 120, 121syl3anc 1268 . . 3  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  mod  4 )  =  ( 1  mod  4 )  <->  4  ||  ( P  -  1 ) ) )
123112, 115, 1223bitr4d 289 . 2  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  /L P )  =  1  <->  ( P  mod  4 )  =  ( 1  mod  4 ) ) )
124 1re 9642 . . . 4  |-  1  e.  RR
125 nnrp 11311 . . . . 5  |-  ( 4  e.  NN  ->  4  e.  RR+ )
126116, 125ax-mp 5 . . . 4  |-  4  e.  RR+
127 0le1 10137 . . . 4  |-  0  <_  1
128 1lt4 10781 . . . 4  |-  1  <  4
129 modid 12121 . . . 4  |-  ( ( ( 1  e.  RR  /\  4  e.  RR+ )  /\  ( 0  <_  1  /\  1  <  4
) )  ->  (
1  mod  4 )  =  1 )
130124, 126, 127, 128, 129mp4an 679 . . 3  |-  ( 1  mod  4 )  =  1
131130eqeq2i 2463 . 2  |-  ( ( P  mod  4 )  =  ( 1  mod  4 )  <->  ( P  mod  4 )  =  1 )
132123, 131syl6bb 265 1  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  /L P )  =  1  <->  ( P  mod  4 )  =  1 ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 188    /\ wa 371    = wceq 1444    e. wcel 1887    =/= wne 2622    \ cdif 3401   {csn 3968   class class class wbr 4402   ` cfv 5582  (class class class)co 6290   CCcc 9537   RRcr 9538   0cc0 9539   1c1 9540    + caddc 9542    x. cmul 9544    < clt 9675    <_ cle 9676    - cmin 9860   -ucneg 9861    / cdiv 10269   NNcn 10609   2c2 10659   4c4 10661   NN0cn0 10869   ZZcz 10937   ZZ>=cuz 11159   RR+crp 11302    mod cmo 12096   ^cexp 12272    || cdvds 14305   Primecprime 14622    /Lclgs 24222
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1669  ax-4 1682  ax-5 1758  ax-6 1805  ax-7 1851  ax-8 1889  ax-9 1896  ax-10 1915  ax-11 1920  ax-12 1933  ax-13 2091  ax-ext 2431  ax-rep 4515  ax-sep 4525  ax-nul 4534  ax-pow 4581  ax-pr 4639  ax-un 6583  ax-cnex 9595  ax-resscn 9596  ax-1cn 9597  ax-icn 9598  ax-addcl 9599  ax-addrcl 9600  ax-mulcl 9601  ax-mulrcl 9602  ax-mulcom 9603  ax-addass 9604  ax-mulass 9605  ax-distr 9606  ax-i2m1 9607  ax-1ne0 9608  ax-1rid 9609  ax-rnegex 9610  ax-rrecex 9611  ax-cnre 9612  ax-pre-lttri 9613  ax-pre-lttrn 9614  ax-pre-ltadd 9615  ax-pre-mulgt0 9616  ax-pre-sup 9617
This theorem depends on definitions:  df-bi 189  df-or 372  df-an 373  df-3or 986  df-3an 987  df-tru 1447  df-ex 1664  df-nf 1668  df-sb 1798  df-eu 2303  df-mo 2304  df-clab 2438  df-cleq 2444  df-clel 2447  df-nfc 2581  df-ne 2624  df-nel 2625  df-ral 2742  df-rex 2743  df-reu 2744  df-rmo 2745  df-rab 2746  df-v 3047  df-sbc 3268  df-csb 3364  df-dif 3407  df-un 3409  df-in 3411  df-ss 3418  df-pss 3420  df-nul 3732  df-if 3882  df-pw 3953  df-sn 3969  df-pr 3971  df-tp 3973  df-op 3975  df-uni 4199  df-int 4235  df-iun 4280  df-br 4403  df-opab 4462  df-mpt 4463  df-tr 4498  df-eprel 4745  df-id 4749  df-po 4755  df-so 4756  df-fr 4793  df-we 4795  df-xp 4840  df-rel 4841  df-cnv 4842  df-co 4843  df-dm 4844  df-rn 4845  df-res 4846  df-ima 4847  df-pred 5380  df-ord 5426  df-on 5427  df-lim 5428  df-suc 5429  df-iota 5546  df-fun 5584  df-fn 5585  df-f 5586  df-f1 5587  df-fo 5588  df-f1o 5589  df-fv 5590  df-riota 6252  df-ov 6293  df-oprab 6294  df-mpt2 6295  df-om 6693  df-1st 6793  df-2nd 6794  df-wrecs 7028  df-recs 7090  df-rdg 7128  df-1o 7182  df-2o 7183  df-oadd 7186  df-er 7363  df-map 7474  df-en 7570  df-dom 7571  df-sdom 7572  df-fin 7573  df-sup 7956  df-inf 7957  df-card 8373  df-cda 8598  df-pnf 9677  df-mnf 9678  df-xr 9679  df-ltxr 9680  df-le 9681  df-sub 9862  df-neg 9863  df-div 10270  df-nn 10610  df-2 10668  df-3 10669  df-4 10670  df-n0 10870  df-z 10938  df-uz 11160  df-q 11265  df-rp 11303  df-fz 11785  df-fzo 11916  df-fl 12028  df-mod 12097  df-seq 12214  df-exp 12273  df-hash 12516  df-cj 13162  df-re 13163  df-im 13164  df-sqrt 13298  df-abs 13299  df-dvds 14306  df-gcd 14469  df-prm 14623  df-phi 14714  df-pc 14787  df-lgs 24223
This theorem is referenced by:  2sqlem11  24303  2sqblem  24305
  Copyright terms: Public domain W3C validator