Metamath Proof Explorer


Theorem bitsuz

Description: The bits of a number are all at least N iff the number is divisible by 2 ^ N . (Contributed by Mario Carneiro, 21-Sep-2016)

Ref Expression
Assertion bitsuz A N 0 2 N A bits A N

Proof

Step Hyp Ref Expression
1 bitsres A N 0 bits A N = bits A 2 N 2 N
2 1 eqeq1d A N 0 bits A N = bits A bits A 2 N 2 N = bits A
3 simpl A N 0 A
4 3 zred A N 0 A
5 2nn 2
6 5 a1i A N 0 2
7 simpr A N 0 N 0
8 6 7 nnexpcld A N 0 2 N
9 4 8 nndivred A N 0 A 2 N
10 9 flcld A N 0 A 2 N
11 8 nnzd A N 0 2 N
12 10 11 zmulcld A N 0 A 2 N 2 N
13 bitsf1 bits : 1-1 𝒫 0
14 f1fveq bits : 1-1 𝒫 0 A 2 N 2 N A bits A 2 N 2 N = bits A A 2 N 2 N = A
15 13 14 mpan A 2 N 2 N A bits A 2 N 2 N = bits A A 2 N 2 N = A
16 12 3 15 syl2anc A N 0 bits A 2 N 2 N = bits A A 2 N 2 N = A
17 dvdsmul2 A 2 N 2 N 2 N A 2 N 2 N
18 10 11 17 syl2anc A N 0 2 N A 2 N 2 N
19 breq2 A 2 N 2 N = A 2 N A 2 N 2 N 2 N A
20 18 19 syl5ibcom A N 0 A 2 N 2 N = A 2 N A
21 8 nnne0d A N 0 2 N 0
22 dvdsval2 2 N 2 N 0 A 2 N A A 2 N
23 11 21 3 22 syl3anc A N 0 2 N A A 2 N
24 23 biimpa A N 0 2 N A A 2 N
25 flid A 2 N A 2 N = A 2 N
26 24 25 syl A N 0 2 N A A 2 N = A 2 N
27 26 oveq1d A N 0 2 N A A 2 N 2 N = A 2 N 2 N
28 3 zcnd A N 0 A
29 28 adantr A N 0 2 N A A
30 8 nncnd A N 0 2 N
31 30 adantr A N 0 2 N A 2 N
32 2cnd A N 0 2 N A 2
33 2ne0 2 0
34 33 a1i A N 0 2 N A 2 0
35 7 nn0zd A N 0 N
36 35 adantr A N 0 2 N A N
37 32 34 36 expne0d A N 0 2 N A 2 N 0
38 29 31 37 divcan1d A N 0 2 N A A 2 N 2 N = A
39 27 38 eqtrd A N 0 2 N A A 2 N 2 N = A
40 39 ex A N 0 2 N A A 2 N 2 N = A
41 20 40 impbid A N 0 A 2 N 2 N = A 2 N A
42 2 16 41 3bitrrd A N 0 2 N A bits A N = bits A
43 df-ss bits A N bits A N = bits A
44 42 43 bitr4di A N 0 2 N A bits A N