Metamath Proof Explorer


Theorem acongrep

Description: Every integer is alternating-congruent to some number in the first half of the fundamental domain. (Contributed by Stefan O'Rear, 2-Oct-2014)

Ref Expression
Assertion acongrep A N a 0 A 2 A a N 2 A a -N

Proof

Step Hyp Ref Expression
1 2nn 2
2 simpl A N A
3 nnmulcl 2 A 2 A
4 1 2 3 sylancr A N 2 A
5 simpr A N N
6 congrep 2 A N b 0 2 A 1 2 A b N
7 4 5 6 syl2anc A N b 0 2 A 1 2 A b N
8 elfzelz b 0 2 A 1 b
9 8 zred b 0 2 A 1 b
10 9 ad2antrl A N b 0 2 A 1 2 A b N b
11 nnre A A
12 11 ad2antrr A N b 0 2 A 1 2 A b N A
13 elfzle1 b 0 2 A 1 0 b
14 13 ad2antrl A N b 0 2 A 1 2 A b N 0 b
15 14 anim1i A N b 0 2 A 1 2 A b N b A 0 b b A
16 8 ad2antrl A N b 0 2 A 1 2 A b N b
17 0zd A N b 0 2 A 1 2 A b N 0
18 nnz A A
19 18 ad2antrr A N b 0 2 A 1 2 A b N A
20 elfz b 0 A b 0 A 0 b b A
21 16 17 19 20 syl3anc A N b 0 2 A 1 2 A b N b 0 A 0 b b A
22 21 adantr A N b 0 2 A 1 2 A b N b A b 0 A 0 b b A
23 15 22 mpbird A N b 0 2 A 1 2 A b N b A b 0 A
24 simplrr A N b 0 2 A 1 2 A b N b A 2 A b N
25 24 orcd A N b 0 2 A 1 2 A b N b A 2 A b N 2 A b -N
26 id a = b a = b
27 eqidd a = b N = N
28 26 27 acongeq12d a = b 2 A a N 2 A a -N 2 A b N 2 A b -N
29 28 rspcev b 0 A 2 A b N 2 A b -N a 0 A 2 A a N 2 A a -N
30 23 25 29 syl2anc A N b 0 2 A 1 2 A b N b A a 0 A 2 A a N 2 A a -N
31 simplll A N b 0 2 A 1 2 A b N A b A
32 simplrl A N b 0 2 A 1 2 A b N A b b 0 2 A 1
33 simpr A N b 0 2 A 1 2 A b N A b A b
34 9 3ad2ant2 A b 0 2 A 1 A b b
35 2re 2
36 remulcl 2 A 2 A
37 35 11 36 sylancr A 2 A
38 37 3ad2ant1 A b 0 2 A 1 A b 2 A
39 0zd A b 0 2 A 1 A b 0
40 2z 2
41 zmulcl 2 A 2 A
42 40 18 41 sylancr A 2 A
43 42 3ad2ant1 A b 0 2 A 1 A b 2 A
44 simp2 A b 0 2 A 1 A b b 0 2 A 1
45 elfzm11 0 2 A b 0 2 A 1 b 0 b b < 2 A
46 45 biimpa 0 2 A b 0 2 A 1 b 0 b b < 2 A
47 39 43 44 46 syl21anc A b 0 2 A 1 A b b 0 b b < 2 A
48 47 simp3d A b 0 2 A 1 A b b < 2 A
49 34 38 48 ltled A b 0 2 A 1 A b b 2 A
50 38 34 subge0d A b 0 2 A 1 A b 0 2 A b b 2 A
51 49 50 mpbird A b 0 2 A 1 A b 0 2 A b
52 11 3ad2ant1 A b 0 2 A 1 A b A
53 nncn A A
54 2times A 2 A = A + A
55 54 oveq1d A 2 A A = A + A - A
56 pncan2 A A A + A - A = A
57 56 anidms A A + A - A = A
58 55 57 eqtrd A 2 A A = A
59 53 58 syl A 2 A A = A
60 59 3ad2ant1 A b 0 2 A 1 A b 2 A A = A
61 simp3 A b 0 2 A 1 A b A b
62 60 61 eqbrtrd A b 0 2 A 1 A b 2 A A b
63 38 52 34 62 subled A b 0 2 A 1 A b 2 A b A
64 51 63 jca A b 0 2 A 1 A b 0 2 A b 2 A b A
65 31 32 33 64 syl3anc A N b 0 2 A 1 2 A b N A b 0 2 A b 2 A b A
66 40 19 41 sylancr A N b 0 2 A 1 2 A b N 2 A
67 66 16 zsubcld A N b 0 2 A 1 2 A b N 2 A b
68 elfz 2 A b 0 A 2 A b 0 A 0 2 A b 2 A b A
69 67 17 19 68 syl3anc A N b 0 2 A 1 2 A b N 2 A b 0 A 0 2 A b 2 A b A
70 69 adantr A N b 0 2 A 1 2 A b N A b 2 A b 0 A 0 2 A b 2 A b A
71 65 70 mpbird A N b 0 2 A 1 2 A b N A b 2 A b 0 A
72 simplr A N b 0 2 A 1 2 A b N N
73 simprr A N b 0 2 A 1 2 A b N 2 A b N
74 congsym 2 A b N 2 A b N 2 A N b
75 66 16 72 73 74 syl22anc A N b 0 2 A 1 2 A b N 2 A N b
76 72 16 zsubcld A N b 0 2 A 1 2 A b N N b
77 dvdsadd 2 A N b 2 A N b 2 A 2 A + N - b
78 66 76 77 syl2anc A N b 0 2 A 1 2 A b N 2 A N b 2 A 2 A + N - b
79 75 78 mpbid A N b 0 2 A 1 2 A b N 2 A 2 A + N - b
80 67 zcnd A N b 0 2 A 1 2 A b N 2 A b
81 zcn N N
82 81 ad2antlr A N b 0 2 A 1 2 A b N N
83 80 82 subnegd A N b 0 2 A 1 2 A b N 2 A - b - -N = 2 A - b + N
84 66 zcnd A N b 0 2 A 1 2 A b N 2 A
85 10 recnd A N b 0 2 A 1 2 A b N b
86 84 85 82 subadd23d A N b 0 2 A 1 2 A b N 2 A - b + N = 2 A + N - b
87 83 86 eqtrd A N b 0 2 A 1 2 A b N 2 A - b - -N = 2 A + N - b
88 79 87 breqtrrd A N b 0 2 A 1 2 A b N 2 A 2 A - b - -N
89 88 adantr A N b 0 2 A 1 2 A b N A b 2 A 2 A - b - -N
90 89 olcd A N b 0 2 A 1 2 A b N A b 2 A 2 A - b - N 2 A 2 A - b - -N
91 id a = 2 A b a = 2 A b
92 eqidd a = 2 A b N = N
93 91 92 acongeq12d a = 2 A b 2 A a N 2 A a -N 2 A 2 A - b - N 2 A 2 A - b - -N
94 93 rspcev 2 A b 0 A 2 A 2 A - b - N 2 A 2 A - b - -N a 0 A 2 A a N 2 A a -N
95 71 90 94 syl2anc A N b 0 2 A 1 2 A b N A b a 0 A 2 A a N 2 A a -N
96 10 12 30 95 lecasei A N b 0 2 A 1 2 A b N a 0 A 2 A a N 2 A a -N
97 7 96 rexlimddv A N a 0 A 2 A a N 2 A a -N