Metamath Proof Explorer


Theorem zofldiv2

Description: The floor of an odd integer divided by 2 is equal to the integer first decreased by 1 and then divided by 2. (Contributed by AV, 7-Jun-2020)

Ref Expression
Assertion zofldiv2 NN+12N2=N12

Proof

Step Hyp Ref Expression
1 zcn NN
2 npcan1 NN-1+1=N
3 2 eqcomd NN=N-1+1
4 1 3 syl NN=N-1+1
5 4 oveq1d NN2=N-1+12
6 peano2zm NN1
7 6 zcnd NN1
8 1cnd N1
9 2cnne0 220
10 9 a1i N220
11 divdir N11220N-1+12=N12+12
12 7 8 10 11 syl3anc NN-1+12=N12+12
13 5 12 eqtrd NN2=N12+12
14 13 fveq2d NN2=N12+12
15 14 adantr NN+12N2=N12+12
16 halfge0 012
17 halflt1 12<1
18 16 17 pm3.2i 01212<1
19 zob NN+12N12
20 19 biimpa NN+12N12
21 halfre 12
22 flbi2 N1212N12+12=N1201212<1
23 20 21 22 sylancl NN+12N12+12=N1201212<1
24 18 23 mpbiri NN+12N12+12=N12
25 15 24 eqtrd NN+12N2=N12