Metamath Proof Explorer


Theorem odd2np1

Description: An integer is odd iff it is one plus twice another integer. (Contributed by Scott Fenton, 3-Apr-2014) (Revised by Mario Carneiro, 19-Apr-2014)

Ref Expression
Assertion odd2np1 N¬2Nn2n+1=N

Proof

Step Hyp Ref Expression
1 2z 2
2 divides 2N2Nkk2=N
3 1 2 mpan N2Nkk2=N
4 3 notbid N¬2N¬kk2=N
5 elznn0 NNN0N0
6 odd2np1lem N0n2n+1=Nkk2=N
7 6 adantl NN0n2n+1=Nkk2=N
8 peano2z xx+1
9 znegcl x+1x+1
10 8 9 syl xx+1
11 10 ad2antlr Nx2x+1=Nx+1
12 zcn xx
13 2cn 2
14 mulcl 2x2x
15 13 14 mpan x2x
16 peano2cn 2x2x+1
17 15 16 syl x2x+1
18 12 17 syl x2x+1
19 18 adantl Nx2x+1
20 simpl NxN
21 20 recnd NxN
22 negcon2 2x+1N2x+1=NN=2x+1
23 19 21 22 syl2anc Nx2x+1=NN=2x+1
24 eqcom N=2x+12x+1=N
25 13 12 14 sylancr x2x
26 ax-1cn 1
27 13 26 mulcli 21
28 addsubass 2x2112x+21-1=2x+21-1
29 27 26 28 mp3an23 2x2x+21-1=2x+21-1
30 25 29 syl x2x+21-1=2x+21-1
31 2t1e2 21=2
32 31 oveq1i 211=21
33 2m1e1 21=1
34 32 33 eqtri 211=1
35 34 oveq2i 2x+21-1=2x+1
36 30 35 eqtr2di x2x+1=2x+21-1
37 adddi 2x12x+1=2x+21
38 13 26 37 mp3an13 x2x+1=2x+21
39 12 38 syl x2x+1=2x+21
40 39 oveq1d x2x+11=2x+21-1
41 36 40 eqtr4d x2x+1=2x+11
42 41 negeqd x2x+1=2x+11
43 8 zcnd xx+1
44 mulneg2 2x+12x+1=2x+1
45 13 43 44 sylancr x2x+1=2x+1
46 45 oveq1d x2x+1+1=-2x+1+1
47 mulcl 2x+12x+1
48 13 43 47 sylancr x2x+1
49 negsubdi 2x+112x+11=-2x+1+1
50 48 26 49 sylancl x2x+11=-2x+1+1
51 46 50 eqtr4d x2x+1+1=2x+11
52 42 51 eqtr4d x2x+1=2x+1+1
53 52 adantl Nx2x+1=2x+1+1
54 53 eqeq1d Nx2x+1=N2x+1+1=N
55 24 54 bitrid NxN=2x+12x+1+1=N
56 23 55 bitrd Nx2x+1=N2x+1+1=N
57 56 biimpa Nx2x+1=N2x+1+1=N
58 oveq2 n=x+12n=2x+1
59 58 oveq1d n=x+12n+1=2x+1+1
60 59 eqeq1d n=x+12n+1=N2x+1+1=N
61 60 rspcev x+12x+1+1=Nn2n+1=N
62 11 57 61 syl2anc Nx2x+1=Nn2n+1=N
63 62 rexlimdva2 Nx2x+1=Nn2n+1=N
64 znegcl yy
65 64 ad2antlr Nyy2=Ny
66 zcn yy
67 mulcl y2y2
68 66 13 67 sylancl yy2
69 recn NN
70 negcon2 y2Ny2=NN=y2
71 68 69 70 syl2anr Nyy2=NN=y2
72 eqcom N=y2y2=N
73 mulneg1 y2y2=y2
74 66 13 73 sylancl yy2=y2
75 74 adantl Nyy2=y2
76 75 eqeq1d Nyy2=Ny2=N
77 72 76 bitr4id NyN=y2y2=N
78 71 77 bitrd Nyy2=Ny2=N
79 78 biimpa Nyy2=Ny2=N
80 oveq1 k=yk2=y2
81 80 eqeq1d k=yk2=Ny2=N
82 81 rspcev yy2=Nkk2=N
83 65 79 82 syl2anc Nyy2=Nkk2=N
84 83 rexlimdva2 Nyy2=Nkk2=N
85 63 84 orim12d Nx2x+1=Nyy2=Nn2n+1=Nkk2=N
86 odd2np1lem N0x2x+1=Nyy2=N
87 85 86 impel NN0n2n+1=Nkk2=N
88 7 87 jaodan NN0N0n2n+1=Nkk2=N
89 5 88 sylbi Nn2n+1=Nkk2=N
90 halfnz ¬12
91 reeanv nk2n+1=Nk2=Nn2n+1=Nkk2=N
92 eqtr3 2n+1=Nk2=N2n+1=k2
93 zcn kk
94 mulcom k2k2=2k
95 93 13 94 sylancl kk2=2k
96 95 eqeq2d k2n+1=k22n+1=2k
97 96 adantl nk2n+1=k22n+1=2k
98 mulcl 2k2k
99 13 93 98 sylancr k2k
100 zcn nn
101 mulcl 2n2n
102 13 100 101 sylancr n2n
103 subadd 2k2n12k2n=12n+1=2k
104 26 103 mp3an3 2k2n2k2n=12n+1=2k
105 99 102 104 syl2anr nk2k2n=12n+1=2k
106 subcl knkn
107 2cnne0 220
108 eqcom kn=1212=kn
109 divmul 1kn22012=kn2kn=1
110 108 109 bitrid 1kn220kn=122kn=1
111 26 107 110 mp3an13 knkn=122kn=1
112 106 111 syl knkn=122kn=1
113 112 ancoms nkkn=122kn=1
114 subdi 2kn2kn=2k2n
115 13 114 mp3an1 kn2kn=2k2n
116 115 ancoms nk2kn=2k2n
117 116 eqeq1d nk2kn=12k2n=1
118 113 117 bitrd nkkn=122k2n=1
119 100 93 118 syl2an nkkn=122k2n=1
120 zsubcl knkn
121 eleq1 kn=12kn12
122 120 121 syl5ibcom knkn=1212
123 122 ancoms nkkn=1212
124 119 123 sylbird nk2k2n=112
125 105 124 sylbird nk2n+1=2k12
126 97 125 sylbid nk2n+1=k212
127 92 126 syl5 nk2n+1=Nk2=N12
128 127 rexlimivv nk2n+1=Nk2=N12
129 91 128 sylbir n2n+1=Nkk2=N12
130 90 129 mto ¬n2n+1=Nkk2=N
131 pm5.17 n2n+1=Nkk2=N¬n2n+1=Nkk2=Nn2n+1=N¬kk2=N
132 bicom n2n+1=N¬kk2=N¬kk2=Nn2n+1=N
133 131 132 bitri n2n+1=Nkk2=N¬n2n+1=Nkk2=N¬kk2=Nn2n+1=N
134 89 130 133 sylanblc N¬kk2=Nn2n+1=N
135 4 134 bitrd N¬2Nn2n+1=N