Metamath Proof Explorer


Theorem oddnn02np1

Description: A nonnegative integer is odd iff it is one plus twice another nonnegative integer. (Contributed by AV, 19-Jun-2021)

Ref Expression
Assertion oddnn02np1 N 0 ¬ 2 N n 0 2 n + 1 = N

Proof

Step Hyp Ref Expression
1 eleq1 2 n + 1 = N 2 n + 1 0 N 0
2 elnn0z 2 n + 1 0 2 n + 1 0 2 n + 1
3 2tnp1ge0ge0 n 0 2 n + 1 0 n
4 3 biimpd n 0 2 n + 1 0 n
5 4 imdistani n 0 2 n + 1 n 0 n
6 5 expcom 0 2 n + 1 n n 0 n
7 elnn0z n 0 n 0 n
8 6 7 syl6ibr 0 2 n + 1 n n 0
9 2 8 simplbiim 2 n + 1 0 n n 0
10 1 9 syl6bir 2 n + 1 = N N 0 n n 0
11 10 com13 n N 0 2 n + 1 = N n 0
12 11 impcom N 0 n 2 n + 1 = N n 0
13 12 pm4.71rd N 0 n 2 n + 1 = N n 0 2 n + 1 = N
14 13 bicomd N 0 n n 0 2 n + 1 = N 2 n + 1 = N
15 14 rexbidva N 0 n n 0 2 n + 1 = N n 2 n + 1 = N
16 nn0ssz 0
17 rexss 0 n 0 2 n + 1 = N n n 0 2 n + 1 = N
18 16 17 mp1i N 0 n 0 2 n + 1 = N n n 0 2 n + 1 = N
19 nn0z N 0 N
20 odd2np1 N ¬ 2 N n 2 n + 1 = N
21 19 20 syl N 0 ¬ 2 N n 2 n + 1 = N
22 15 18 21 3bitr4rd N 0 ¬ 2 N n 0 2 n + 1 = N