Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
Mirrors > Home > MPE Home > Th. List > bcval | Structured version Visualization version GIF version |
Description: Value of the binomial coefficient, 𝑁 choose 𝐾. Definition of binomial coefficient in [Gleason] p. 295. As suggested by Gleason, we define it to be 0 when 0 ≤ 𝐾 ≤ 𝑁 does not hold. See bcval2 13664 for the value in the standard domain. (Contributed by NM, 10-Jul-2005.) (Revised by Mario Carneiro, 7-Nov-2013.) |
Ref | Expression |
---|---|
bcval | ⊢ ((𝑁 ∈ ℕ0 ∧ 𝐾 ∈ ℤ) → (𝑁C𝐾) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0)) |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | oveq2 7163 | . . . 4 ⊢ (𝑛 = 𝑁 → (0...𝑛) = (0...𝑁)) | |
2 | 1 | eleq2d 2898 | . . 3 ⊢ (𝑛 = 𝑁 → (𝑘 ∈ (0...𝑛) ↔ 𝑘 ∈ (0...𝑁))) |
3 | fveq2 6669 | . . . 4 ⊢ (𝑛 = 𝑁 → (!‘𝑛) = (!‘𝑁)) | |
4 | fvoveq1 7178 | . . . . 5 ⊢ (𝑛 = 𝑁 → (!‘(𝑛 − 𝑘)) = (!‘(𝑁 − 𝑘))) | |
5 | 4 | oveq1d 7170 | . . . 4 ⊢ (𝑛 = 𝑁 → ((!‘(𝑛 − 𝑘)) · (!‘𝑘)) = ((!‘(𝑁 − 𝑘)) · (!‘𝑘))) |
6 | 3, 5 | oveq12d 7173 | . . 3 ⊢ (𝑛 = 𝑁 → ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘)))) |
7 | 2, 6 | ifbieq1d 4489 | . 2 ⊢ (𝑛 = 𝑁 → if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))), 0) = if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))), 0)) |
8 | eleq1 2900 | . . 3 ⊢ (𝑘 = 𝐾 → (𝑘 ∈ (0...𝑁) ↔ 𝐾 ∈ (0...𝑁))) | |
9 | oveq2 7163 | . . . . . 6 ⊢ (𝑘 = 𝐾 → (𝑁 − 𝑘) = (𝑁 − 𝐾)) | |
10 | 9 | fveq2d 6673 | . . . . 5 ⊢ (𝑘 = 𝐾 → (!‘(𝑁 − 𝑘)) = (!‘(𝑁 − 𝐾))) |
11 | fveq2 6669 | . . . . 5 ⊢ (𝑘 = 𝐾 → (!‘𝑘) = (!‘𝐾)) | |
12 | 10, 11 | oveq12d 7173 | . . . 4 ⊢ (𝑘 = 𝐾 → ((!‘(𝑁 − 𝑘)) · (!‘𝑘)) = ((!‘(𝑁 − 𝐾)) · (!‘𝐾))) |
13 | 12 | oveq2d 7171 | . . 3 ⊢ (𝑘 = 𝐾 → ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾)))) |
14 | 8, 13 | ifbieq1d 4489 | . 2 ⊢ (𝑘 = 𝐾 → if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))), 0) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0)) |
15 | df-bc 13662 | . 2 ⊢ C = (𝑛 ∈ ℕ0, 𝑘 ∈ ℤ ↦ if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))), 0)) | |
16 | ovex 7188 | . . 3 ⊢ ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))) ∈ V | |
17 | c0ex 10634 | . . 3 ⊢ 0 ∈ V | |
18 | 16, 17 | ifex 4514 | . 2 ⊢ if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0) ∈ V |
19 | 7, 14, 15, 18 | ovmpo 7309 | 1 ⊢ ((𝑁 ∈ ℕ0 ∧ 𝐾 ∈ ℤ) → (𝑁C𝐾) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0)) |
Colors of variables: wff setvar class |
Syntax hints: → wi 4 ∧ wa 398 = wceq 1533 ∈ wcel 2110 ifcif 4466 ‘cfv 6354 (class class class)co 7155 0cc0 10536 · cmul 10541 − cmin 10869 / cdiv 11296 ℕ0cn0 11896 ℤcz 11980 ...cfz 12891 !cfa 13632 Ccbc 13661 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1792 ax-4 1806 ax-5 1907 ax-6 1966 ax-7 2011 ax-8 2112 ax-9 2120 ax-10 2141 ax-11 2157 ax-12 2173 ax-ext 2793 ax-sep 5202 ax-nul 5209 ax-pr 5329 ax-1cn 10594 ax-icn 10595 ax-addcl 10596 ax-mulcl 10598 ax-i2m1 10604 |
This theorem depends on definitions: df-bi 209 df-an 399 df-or 844 df-3an 1085 df-tru 1536 df-ex 1777 df-nf 1781 df-sb 2066 df-mo 2618 df-eu 2650 df-clab 2800 df-cleq 2814 df-clel 2893 df-nfc 2963 df-ral 3143 df-rex 3144 df-rab 3147 df-v 3496 df-sbc 3772 df-dif 3938 df-un 3940 df-in 3942 df-ss 3951 df-nul 4291 df-if 4467 df-sn 4567 df-pr 4569 df-op 4573 df-uni 4838 df-br 5066 df-opab 5128 df-id 5459 df-xp 5560 df-rel 5561 df-cnv 5562 df-co 5563 df-dm 5564 df-iota 6313 df-fun 6356 df-fv 6362 df-ov 7158 df-oprab 7159 df-mpo 7160 df-bc 13662 |
This theorem is referenced by: bcval2 13664 bcval3 13665 bcneg1 32968 bccolsum 32971 fwddifnp1 33626 |
Copyright terms: Public domain | W3C validator |