Metamath Proof Explorer


Theorem lgsmod

Description: The Legendre (Jacobi) symbol is preserved under reduction mod n when n is odd. (Contributed by Mario Carneiro, 4-Feb-2015)

Ref Expression
Assertion lgsmod A N ¬ 2 N A mod N / L N = A / L N

Proof

Step Hyp Ref Expression
1 zmodcl A N A mod N 0
2 1 3adant3 A N ¬ 2 N A mod N 0
3 2 nn0zd A N ¬ 2 N A mod N
4 3 ad2antrr A N ¬ 2 N n n N A mod N
5 simpr A N ¬ 2 N n n
6 5 adantr A N ¬ 2 N n n N n
7 simpl3 A N ¬ 2 N n ¬ 2 N
8 breq1 n = 2 n N 2 N
9 8 notbid n = 2 ¬ n N ¬ 2 N
10 7 9 syl5ibrcom A N ¬ 2 N n n = 2 ¬ n N
11 10 necon2ad A N ¬ 2 N n n N n 2
12 11 imp A N ¬ 2 N n n N n 2
13 eldifsn n 2 n n 2
14 6 12 13 sylanbrc A N ¬ 2 N n n N n 2
15 oddprm n 2 n 1 2
16 14 15 syl A N ¬ 2 N n n N n 1 2
17 16 nnnn0d A N ¬ 2 N n n N n 1 2 0
18 zexpcl A mod N n 1 2 0 A mod N n 1 2
19 4 17 18 syl2anc A N ¬ 2 N n n N A mod N n 1 2
20 19 zred A N ¬ 2 N n n N A mod N n 1 2
21 simpll1 A N ¬ 2 N n n N A
22 zexpcl A n 1 2 0 A n 1 2
23 21 17 22 syl2anc A N ¬ 2 N n n N A n 1 2
24 23 zred A N ¬ 2 N n n N A n 1 2
25 1red A N ¬ 2 N n n N 1
26 prmnn n n
27 26 ad2antlr A N ¬ 2 N n n N n
28 27 nnrpd A N ¬ 2 N n n N n +
29 prmz n n
30 29 ad2antlr A N ¬ 2 N n n N n
31 simp2 A N ¬ 2 N N
32 31 ad2antrr A N ¬ 2 N n n N N
33 32 nnzd A N ¬ 2 N n n N N
34 4 21 zsubcld A N ¬ 2 N n n N A mod N A
35 simpr A N ¬ 2 N n n N n N
36 21 zred A N ¬ 2 N n n N A
37 32 nnrpd A N ¬ 2 N n n N N +
38 modabs2 A N + A mod N mod N = A mod N
39 36 37 38 syl2anc A N ¬ 2 N n n N A mod N mod N = A mod N
40 moddvds N A mod N A A mod N mod N = A mod N N A mod N A
41 32 4 21 40 syl3anc A N ¬ 2 N n n N A mod N mod N = A mod N N A mod N A
42 39 41 mpbid A N ¬ 2 N n n N N A mod N A
43 30 33 34 35 42 dvdstrd A N ¬ 2 N n n N n A mod N A
44 moddvds n A mod N A A mod N mod n = A mod n n A mod N A
45 27 4 21 44 syl3anc A N ¬ 2 N n n N A mod N mod n = A mod n n A mod N A
46 43 45 mpbird A N ¬ 2 N n n N A mod N mod n = A mod n
47 modexp A mod N A n 1 2 0 n + A mod N mod n = A mod n A mod N n 1 2 mod n = A n 1 2 mod n
48 4 21 17 28 46 47 syl221anc A N ¬ 2 N n n N A mod N n 1 2 mod n = A n 1 2 mod n
49 modadd1 A mod N n 1 2 A n 1 2 1 n + A mod N n 1 2 mod n = A n 1 2 mod n A mod N n 1 2 + 1 mod n = A n 1 2 + 1 mod n
50 20 24 25 28 48 49 syl221anc A N ¬ 2 N n n N A mod N n 1 2 + 1 mod n = A n 1 2 + 1 mod n
51 50 oveq1d A N ¬ 2 N n n N A mod N n 1 2 + 1 mod n 1 = A n 1 2 + 1 mod n 1
52 lgsval3 A mod N n 2 A mod N / L n = A mod N n 1 2 + 1 mod n 1
53 4 14 52 syl2anc A N ¬ 2 N n n N A mod N / L n = A mod N n 1 2 + 1 mod n 1
54 lgsval3 A n 2 A / L n = A n 1 2 + 1 mod n 1
55 21 14 54 syl2anc A N ¬ 2 N n n N A / L n = A n 1 2 + 1 mod n 1
56 51 53 55 3eqtr4d A N ¬ 2 N n n N A mod N / L n = A / L n
57 56 oveq1d A N ¬ 2 N n n N A mod N / L n n pCnt N = A / L n n pCnt N
58 3 ad2antrr A N ¬ 2 N n ¬ n N A mod N
59 29 ad2antlr A N ¬ 2 N n ¬ n N n
60 lgscl A mod N n A mod N / L n
61 58 59 60 syl2anc A N ¬ 2 N n ¬ n N A mod N / L n
62 61 zcnd A N ¬ 2 N n ¬ n N A mod N / L n
63 62 exp0d A N ¬ 2 N n ¬ n N A mod N / L n 0 = 1
64 simpll1 A N ¬ 2 N n ¬ n N A
65 lgscl A n A / L n
66 64 59 65 syl2anc A N ¬ 2 N n ¬ n N A / L n
67 66 zcnd A N ¬ 2 N n ¬ n N A / L n
68 67 exp0d A N ¬ 2 N n ¬ n N A / L n 0 = 1
69 63 68 eqtr4d A N ¬ 2 N n ¬ n N A mod N / L n 0 = A / L n 0
70 31 adantr A N ¬ 2 N n N
71 pceq0 n N n pCnt N = 0 ¬ n N
72 5 70 71 syl2anc A N ¬ 2 N n n pCnt N = 0 ¬ n N
73 72 biimpar A N ¬ 2 N n ¬ n N n pCnt N = 0
74 73 oveq2d A N ¬ 2 N n ¬ n N A mod N / L n n pCnt N = A mod N / L n 0
75 73 oveq2d A N ¬ 2 N n ¬ n N A / L n n pCnt N = A / L n 0
76 69 74 75 3eqtr4d A N ¬ 2 N n ¬ n N A mod N / L n n pCnt N = A / L n n pCnt N
77 57 76 pm2.61dan A N ¬ 2 N n A mod N / L n n pCnt N = A / L n n pCnt N
78 77 ifeq1da A N ¬ 2 N if n A mod N / L n n pCnt N 1 = if n A / L n n pCnt N 1
79 78 mpteq2dv A N ¬ 2 N n if n A mod N / L n n pCnt N 1 = n if n A / L n n pCnt N 1
80 79 seqeq3d A N ¬ 2 N seq 1 × n if n A mod N / L n n pCnt N 1 = seq 1 × n if n A / L n n pCnt N 1
81 80 fveq1d A N ¬ 2 N seq 1 × n if n A mod N / L n n pCnt N 1 N = seq 1 × n if n A / L n n pCnt N 1 N
82 eqid n if n A mod N / L n n pCnt N 1 = n if n A mod N / L n n pCnt N 1
83 82 lgsval4a A mod N N A mod N / L N = seq 1 × n if n A mod N / L n n pCnt N 1 N
84 3 31 83 syl2anc A N ¬ 2 N A mod N / L N = seq 1 × n if n A mod N / L n n pCnt N 1 N
85 eqid n if n A / L n n pCnt N 1 = n if n A / L n n pCnt N 1
86 85 lgsval4a A N A / L N = seq 1 × n if n A / L n n pCnt N 1 N
87 86 3adant3 A N ¬ 2 N A / L N = seq 1 × n if n A / L n n pCnt N 1 N
88 81 84 87 3eqtr4d A N ¬ 2 N A mod N / L N = A / L N