Metamath Proof Explorer


Theorem bcpasc

Description: Pascal's rule for the binomial coefficient, generalized to all integers K . Equation 2 of Gleason p. 295. (Contributed by NM, 13-Jul-2005) (Revised by Mario Carneiro, 10-Mar-2014)

Ref Expression
Assertion bcpasc N 0 K ( N K) + ( N K 1 ) = ( N + 1 K)

Proof

Step Hyp Ref Expression
1 peano2nn0 N 0 N + 1 0
2 elfzp12 N + 1 0 K 0 N + 1 K = 0 K 0 + 1 N + 1
3 nn0uz 0 = 0
4 2 3 eleq2s N + 1 0 K 0 N + 1 K = 0 K 0 + 1 N + 1
5 1 4 syl N 0 K 0 N + 1 K = 0 K 0 + 1 N + 1
6 1p0e1 1 + 0 = 1
7 bcn0 N 0 ( N 0 ) = 1
8 0z 0
9 1z 1
10 zsubcl 0 1 0 1
11 8 9 10 mp2an 0 1
12 0re 0
13 ltm1 0 0 1 < 0
14 12 13 ax-mp 0 1 < 0
15 14 orci 0 1 < 0 N < 0 1
16 bcval4 N 0 0 1 0 1 < 0 N < 0 1 ( N 0 1 ) = 0
17 11 15 16 mp3an23 N 0 ( N 0 1 ) = 0
18 7 17 oveq12d N 0 ( N 0 ) + ( N 0 1 ) = 1 + 0
19 bcn0 N + 1 0 ( N + 1 0 ) = 1
20 1 19 syl N 0 ( N + 1 0 ) = 1
21 6 18 20 3eqtr4a N 0 ( N 0 ) + ( N 0 1 ) = ( N + 1 0 )
22 oveq2 K = 0 ( N K) = ( N 0 )
23 oveq1 K = 0 K 1 = 0 1
24 23 oveq2d K = 0 ( N K 1 ) = ( N 0 1 )
25 22 24 oveq12d K = 0 ( N K) + ( N K 1 ) = ( N 0 ) + ( N 0 1 )
26 oveq2 K = 0 ( N + 1 K) = ( N + 1 0 )
27 25 26 eqeq12d K = 0 ( N K) + ( N K 1 ) = ( N + 1 K) ( N 0 ) + ( N 0 1 ) = ( N + 1 0 )
28 21 27 syl5ibrcom N 0 K = 0 ( N K) + ( N K 1 ) = ( N + 1 K)
29 simpr N 0 K 0 + 1 N + 1 K 0 + 1 N + 1
30 0p1e1 0 + 1 = 1
31 30 oveq1i 0 + 1 N + 1 = 1 N + 1
32 29 31 eleqtrdi N 0 K 0 + 1 N + 1 K 1 N + 1
33 nn0p1nn N 0 N + 1
34 nnuz = 1
35 33 34 eleqtrdi N 0 N + 1 1
36 fzm1 N + 1 1 K 1 N + 1 K 1 N + 1 - 1 K = N + 1
37 36 biimpa N + 1 1 K 1 N + 1 K 1 N + 1 - 1 K = N + 1
38 35 37 sylan N 0 K 1 N + 1 K 1 N + 1 - 1 K = N + 1
39 nn0cn N 0 N
40 ax-1cn 1
41 pncan N 1 N + 1 - 1 = N
42 39 40 41 sylancl N 0 N + 1 - 1 = N
43 42 oveq2d N 0 1 N + 1 - 1 = 1 N
44 43 eleq2d N 0 K 1 N + 1 - 1 K 1 N
45 44 biimpa N 0 K 1 N + 1 - 1 K 1 N
46 fz1ssfz0 1 N 0 N
47 46 sseli K 1 N K 0 N
48 bcp1n K 0 N ( N + 1 K) = ( N K) N + 1 N + 1 - K
49 47 48 syl K 1 N ( N + 1 K) = ( N K) N + 1 N + 1 - K
50 bcrpcl K 0 N ( N K) +
51 47 50 syl K 1 N ( N K) +
52 51 rpcnd K 1 N ( N K)
53 elfzuz2 K 1 N N 1
54 53 34 eleqtrrdi K 1 N N
55 54 peano2nnd K 1 N N + 1
56 55 nncnd K 1 N N + 1
57 54 nncnd K 1 N N
58 1cnd K 1 N 1
59 elfzelz K 1 N K
60 59 zcnd K 1 N K
61 57 58 60 addsubd K 1 N N + 1 - K = N - K + 1
62 fznn0sub K 1 N N K 0
63 nn0p1nn N K 0 N - K + 1
64 62 63 syl K 1 N N - K + 1
65 61 64 eqeltrd K 1 N N + 1 - K
66 65 nncnd K 1 N N + 1 - K
67 65 nnne0d K 1 N N + 1 - K 0
68 52 56 66 67 div12d K 1 N ( N K) N + 1 N + 1 - K = N + 1 ( N K) N + 1 - K
69 65 nnrpd K 1 N N + 1 - K +
70 51 69 rpdivcld K 1 N ( N K) N + 1 - K +
71 70 rpcnd K 1 N ( N K) N + 1 - K
72 56 71 mulcomd K 1 N N + 1 ( N K) N + 1 - K = ( N K) N + 1 - K N + 1
73 68 72 eqtrd K 1 N ( N K) N + 1 N + 1 - K = ( N K) N + 1 - K N + 1
74 56 60 npcand K 1 N N + 1 - K + K = N + 1
75 74 oveq2d K 1 N ( N K) N + 1 - K N + 1 - K + K = ( N K) N + 1 - K N + 1
76 71 66 60 adddid K 1 N ( N K) N + 1 - K N + 1 - K + K = ( N K) N + 1 - K N + 1 - K + ( N K) N + 1 - K K
77 73 75 76 3eqtr2d K 1 N ( N K) N + 1 N + 1 - K = ( N K) N + 1 - K N + 1 - K + ( N K) N + 1 - K K
78 52 66 67 divcan1d K 1 N ( N K) N + 1 - K N + 1 - K = ( N K)
79 elfznn K 1 N K
80 79 nnne0d K 1 N K 0
81 52 66 60 67 80 divdiv2d K 1 N ( N K) N + 1 - K K = ( N K) K N + 1 - K
82 bcm1k K 1 N ( N K) = ( N K 1 ) N K 1 K
83 57 60 58 subsub3d K 1 N N K 1 = N + 1 - K
84 83 oveq1d K 1 N N K 1 K = N + 1 - K K
85 84 oveq2d K 1 N ( N K 1 ) N K 1 K = ( N K 1 ) N + 1 - K K
86 82 85 eqtrd K 1 N ( N K) = ( N K 1 ) N + 1 - K K
87 fzelp1 K 1 N K 1 N + 1
88 55 nnzd K 1 N N + 1
89 elfzm1b K N + 1 K 1 N + 1 K 1 0 N + 1 - 1
90 59 88 89 syl2anc K 1 N K 1 N + 1 K 1 0 N + 1 - 1
91 87 90 mpbid K 1 N K 1 0 N + 1 - 1
92 57 40 41 sylancl K 1 N N + 1 - 1 = N
93 92 oveq2d K 1 N 0 N + 1 - 1 = 0 N
94 91 93 eleqtrd K 1 N K 1 0 N
95 bcrpcl K 1 0 N ( N K 1 ) +
96 94 95 syl K 1 N ( N K 1 ) +
97 96 rpcnd K 1 N ( N K 1 )
98 79 nnrpd K 1 N K +
99 69 98 rpdivcld K 1 N N + 1 - K K +
100 99 rpcnd K 1 N N + 1 - K K
101 99 rpne0d K 1 N N + 1 - K K 0
102 52 97 100 101 divmul3d K 1 N ( N K) N + 1 - K K = ( N K 1 ) ( N K) = ( N K 1 ) N + 1 - K K
103 86 102 mpbird K 1 N ( N K) N + 1 - K K = ( N K 1 )
104 52 60 66 67 div23d K 1 N ( N K) K N + 1 - K = ( N K) N + 1 - K K
105 81 103 104 3eqtr3rd K 1 N ( N K) N + 1 - K K = ( N K 1 )
106 78 105 oveq12d K 1 N ( N K) N + 1 - K N + 1 - K + ( N K) N + 1 - K K = ( N K) + ( N K 1 )
107 49 77 106 3eqtrrd K 1 N ( N K) + ( N K 1 ) = ( N + 1 K)
108 45 107 syl N 0 K 1 N + 1 - 1 ( N K) + ( N K 1 ) = ( N + 1 K)
109 oveq2 K = N + 1 ( N K) = ( N N + 1 )
110 33 nnzd N 0 N + 1
111 nn0re N 0 N
112 111 ltp1d N 0 N < N + 1
113 112 olcd N 0 N + 1 < 0 N < N + 1
114 bcval4 N 0 N + 1 N + 1 < 0 N < N + 1 ( N N + 1 ) = 0
115 110 113 114 mpd3an23 N 0 ( N N + 1 ) = 0
116 109 115 sylan9eqr N 0 K = N + 1 ( N K) = 0
117 oveq1 K = N + 1 K 1 = N + 1 - 1
118 117 42 sylan9eqr N 0 K = N + 1 K 1 = N
119 118 oveq2d N 0 K = N + 1 ( N K 1 ) = ( N N)
120 bcnn N 0 ( N N) = 1
121 120 adantr N 0 K = N + 1 ( N N) = 1
122 119 121 eqtrd N 0 K = N + 1 ( N K 1 ) = 1
123 116 122 oveq12d N 0 K = N + 1 ( N K) + ( N K 1 ) = 0 + 1
124 oveq2 K = N + 1 ( N + 1 K) = ( N + 1 N + 1 )
125 bcnn N + 1 0 ( N + 1 N + 1 ) = 1
126 1 125 syl N 0 ( N + 1 N + 1 ) = 1
127 124 126 sylan9eqr N 0 K = N + 1 ( N + 1 K) = 1
128 30 123 127 3eqtr4a N 0 K = N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
129 108 128 jaodan N 0 K 1 N + 1 - 1 K = N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
130 38 129 syldan N 0 K 1 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
131 32 130 syldan N 0 K 0 + 1 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
132 131 ex N 0 K 0 + 1 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
133 28 132 jaod N 0 K = 0 K 0 + 1 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
134 5 133 sylbid N 0 K 0 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
135 134 imp N 0 K 0 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
136 135 adantlr N 0 K K 0 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
137 00id 0 + 0 = 0
138 fzelp1 K 0 N K 0 N + 1
139 138 con3i ¬ K 0 N + 1 ¬ K 0 N
140 bcval3 N 0 K ¬ K 0 N ( N K) = 0
141 140 3expa N 0 K ¬ K 0 N ( N K) = 0
142 139 141 sylan2 N 0 K ¬ K 0 N + 1 ( N K) = 0
143 simpll N 0 K ¬ K 0 N + 1 N 0
144 simplr N 0 K ¬ K 0 N + 1 K
145 peano2zm K K 1
146 144 145 syl N 0 K ¬ K 0 N + 1 K 1
147 39 adantr N 0 K N
148 147 40 41 sylancl N 0 K N + 1 - 1 = N
149 148 oveq2d N 0 K 0 N + 1 - 1 = 0 N
150 149 eleq2d N 0 K K 1 0 N + 1 - 1 K 1 0 N
151 id K K
152 1 nn0zd N 0 N + 1
153 151 152 89 syl2anr N 0 K K 1 N + 1 K 1 0 N + 1 - 1
154 fz1ssfz0 1 N + 1 0 N + 1
155 154 sseli K 1 N + 1 K 0 N + 1
156 153 155 syl6bir N 0 K K 1 0 N + 1 - 1 K 0 N + 1
157 150 156 sylbird N 0 K K 1 0 N K 0 N + 1
158 157 con3dimp N 0 K ¬ K 0 N + 1 ¬ K 1 0 N
159 bcval3 N 0 K 1 ¬ K 1 0 N ( N K 1 ) = 0
160 143 146 158 159 syl3anc N 0 K ¬ K 0 N + 1 ( N K 1 ) = 0
161 142 160 oveq12d N 0 K ¬ K 0 N + 1 ( N K) + ( N K 1 ) = 0 + 0
162 143 1 syl N 0 K ¬ K 0 N + 1 N + 1 0
163 simpr N 0 K ¬ K 0 N + 1 ¬ K 0 N + 1
164 bcval3 N + 1 0 K ¬ K 0 N + 1 ( N + 1 K) = 0
165 162 144 163 164 syl3anc N 0 K ¬ K 0 N + 1 ( N + 1 K) = 0
166 137 161 165 3eqtr4a N 0 K ¬ K 0 N + 1 ( N K) + ( N K 1 ) = ( N + 1 K)
167 136 166 pm2.61dan N 0 K ( N K) + ( N K 1 ) = ( N + 1 K)