Metamath Proof Explorer


Theorem ex-ind-dvds

Description: Example of a proof by induction (divisibility result). (Contributed by Stanislas Polu, 9-Mar-2020) (Revised by BJ, 24-Mar-2020)

Ref Expression
Assertion ex-ind-dvds N 0 3 4 N + 2

Proof

Step Hyp Ref Expression
1 oveq2 k = 0 4 k = 4 0
2 1 oveq1d k = 0 4 k + 2 = 4 0 + 2
3 2 breq2d k = 0 3 4 k + 2 3 4 0 + 2
4 oveq2 k = n 4 k = 4 n
5 4 oveq1d k = n 4 k + 2 = 4 n + 2
6 5 breq2d k = n 3 4 k + 2 3 4 n + 2
7 oveq2 k = n + 1 4 k = 4 n + 1
8 7 oveq1d k = n + 1 4 k + 2 = 4 n + 1 + 2
9 8 breq2d k = n + 1 3 4 k + 2 3 4 n + 1 + 2
10 oveq2 k = N 4 k = 4 N
11 10 oveq1d k = N 4 k + 2 = 4 N + 2
12 11 breq2d k = N 3 4 k + 2 3 4 N + 2
13 3z 3
14 iddvds 3 3 3
15 13 14 ax-mp 3 3
16 4nn0 4 0
17 16 numexp0 4 0 = 1
18 17 oveq1i 4 0 + 2 = 1 + 2
19 1p2e3 1 + 2 = 3
20 18 19 eqtri 4 0 + 2 = 3
21 15 20 breqtrri 3 4 0 + 2
22 13 a1i n 0 3 4 n + 2 3
23 16 a1i n 0 3 4 n + 2 4 0
24 simpl n 0 3 4 n + 2 n 0
25 23 24 nn0expcld n 0 3 4 n + 2 4 n 0
26 25 nn0zd n 0 3 4 n + 2 4 n
27 2z 2
28 27 a1i n 0 3 4 n + 2 2
29 26 28 zaddcld n 0 3 4 n + 2 4 n + 2
30 4z 4
31 30 a1i n 0 3 4 n + 2 4
32 29 31 zmulcld n 0 3 4 n + 2 4 n + 2 4
33 22 28 zmulcld n 0 3 4 n + 2 3 2
34 16 a1i n 0 4 0
35 id n 0 n 0
36 34 35 nn0expcld n 0 4 n 0
37 36 nn0zd n 0 4 n
38 37 adantr n 0 3 4 n + 2 4 n
39 38 28 zaddcld n 0 3 4 n + 2 4 n + 2
40 simpr n 0 3 4 n + 2 3 4 n + 2
41 22 39 31 40 dvdsmultr1d n 0 3 4 n + 2 3 4 n + 2 4
42 dvdsmul1 3 2 3 3 2
43 13 27 42 mp2an 3 3 2
44 43 a1i n 0 3 4 n + 2 3 3 2
45 22 32 33 41 44 dvds2subd n 0 3 4 n + 2 3 4 n + 2 4 3 2
46 36 nn0cnd n 0 4 n
47 2cnd n 0 2
48 4cn 4
49 48 a1i n 0 4
50 46 47 49 adddird n 0 4 n + 2 4 = 4 n 4 + 2 4
51 50 oveq1d n 0 4 n + 2 4 2 3 = 4 n 4 + 2 4 - 2 3
52 3cn 3
53 2cn 2
54 52 53 mulcomi 3 2 = 2 3
55 54 a1i n 0 3 2 = 2 3
56 55 oveq2d n 0 4 n + 2 4 3 2 = 4 n + 2 4 2 3
57 49 35 expp1d n 0 4 n + 1 = 4 n 4
58 ax-1cn 1
59 3p1e4 3 + 1 = 4
60 52 58 59 addcomli 1 + 3 = 4
61 60 eqcomi 4 = 1 + 3
62 58 52 61 mvrraddi 4 3 = 1
63 62 oveq2i 2 4 3 = 2 1
64 53 48 52 subdii 2 4 3 = 2 4 2 3
65 2t1e2 2 1 = 2
66 63 64 65 3eqtr3ri 2 = 2 4 2 3
67 66 a1i n 0 2 = 2 4 2 3
68 57 67 oveq12d n 0 4 n + 1 + 2 = 4 n 4 + 2 4 - 2 3
69 46 49 mulcld n 0 4 n 4
70 47 49 mulcld n 0 2 4
71 52 a1i n 0 3
72 47 71 mulcld n 0 2 3
73 69 70 72 addsubassd n 0 4 n 4 + 2 4 - 2 3 = 4 n 4 + 2 4 - 2 3
74 68 73 eqtr4d n 0 4 n + 1 + 2 = 4 n 4 + 2 4 - 2 3
75 51 56 74 3eqtr4rd n 0 4 n + 1 + 2 = 4 n + 2 4 3 2
76 75 adantr n 0 3 4 n + 2 4 n + 1 + 2 = 4 n + 2 4 3 2
77 45 76 breqtrrd n 0 3 4 n + 2 3 4 n + 1 + 2
78 77 ex n 0 3 4 n + 2 3 4 n + 1 + 2
79 3 6 9 12 21 78 nn0ind N 0 3 4 N + 2