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 14019 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 7283 | . . . 4 ⊢ (𝑛 = 𝑁 → (0...𝑛) = (0...𝑁)) | |
2 | 1 | eleq2d 2824 | . . 3 ⊢ (𝑛 = 𝑁 → (𝑘 ∈ (0...𝑛) ↔ 𝑘 ∈ (0...𝑁))) |
3 | fveq2 6774 | . . . 4 ⊢ (𝑛 = 𝑁 → (!‘𝑛) = (!‘𝑁)) | |
4 | fvoveq1 7298 | . . . . 5 ⊢ (𝑛 = 𝑁 → (!‘(𝑛 − 𝑘)) = (!‘(𝑁 − 𝑘))) | |
5 | 4 | oveq1d 7290 | . . . 4 ⊢ (𝑛 = 𝑁 → ((!‘(𝑛 − 𝑘)) · (!‘𝑘)) = ((!‘(𝑁 − 𝑘)) · (!‘𝑘))) |
6 | 3, 5 | oveq12d 7293 | . . 3 ⊢ (𝑛 = 𝑁 → ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘)))) |
7 | 2, 6 | ifbieq1d 4483 | . 2 ⊢ (𝑛 = 𝑁 → if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))), 0) = if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))), 0)) |
8 | eleq1 2826 | . . 3 ⊢ (𝑘 = 𝐾 → (𝑘 ∈ (0...𝑁) ↔ 𝐾 ∈ (0...𝑁))) | |
9 | oveq2 7283 | . . . . . 6 ⊢ (𝑘 = 𝐾 → (𝑁 − 𝑘) = (𝑁 − 𝐾)) | |
10 | 9 | fveq2d 6778 | . . . . 5 ⊢ (𝑘 = 𝐾 → (!‘(𝑁 − 𝑘)) = (!‘(𝑁 − 𝐾))) |
11 | fveq2 6774 | . . . . 5 ⊢ (𝑘 = 𝐾 → (!‘𝑘) = (!‘𝐾)) | |
12 | 10, 11 | oveq12d 7293 | . . . 4 ⊢ (𝑘 = 𝐾 → ((!‘(𝑁 − 𝑘)) · (!‘𝑘)) = ((!‘(𝑁 − 𝐾)) · (!‘𝐾))) |
13 | 12 | oveq2d 7291 | . . 3 ⊢ (𝑘 = 𝐾 → ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾)))) |
14 | 8, 13 | ifbieq1d 4483 | . 2 ⊢ (𝑘 = 𝐾 → if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))), 0) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0)) |
15 | df-bc 14017 | . 2 ⊢ C = (𝑛 ∈ ℕ0, 𝑘 ∈ ℤ ↦ if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))), 0)) | |
16 | ovex 7308 | . . 3 ⊢ ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))) ∈ V | |
17 | c0ex 10969 | . . 3 ⊢ 0 ∈ V | |
18 | 16, 17 | ifex 4509 | . 2 ⊢ if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0) ∈ V |
19 | 7, 14, 15, 18 | ovmpo 7433 | 1 ⊢ ((𝑁 ∈ ℕ0 ∧ 𝐾 ∈ ℤ) → (𝑁C𝐾) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0)) |
Colors of variables: wff setvar class |
Syntax hints: → wi 4 ∧ wa 396 = wceq 1539 ∈ wcel 2106 ifcif 4459 ‘cfv 6433 (class class class)co 7275 0cc0 10871 · cmul 10876 − cmin 11205 / cdiv 11632 ℕ0cn0 12233 ℤcz 12319 ...cfz 13239 !cfa 13987 Ccbc 14016 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1798 ax-4 1812 ax-5 1913 ax-6 1971 ax-7 2011 ax-8 2108 ax-9 2116 ax-10 2137 ax-11 2154 ax-12 2171 ax-ext 2709 ax-sep 5223 ax-nul 5230 ax-pr 5352 ax-1cn 10929 ax-icn 10930 ax-addcl 10931 ax-mulcl 10933 ax-i2m1 10939 |
This theorem depends on definitions: df-bi 206 df-an 397 df-or 845 df-3an 1088 df-tru 1542 df-fal 1552 df-ex 1783 df-nf 1787 df-sb 2068 df-mo 2540 df-eu 2569 df-clab 2716 df-cleq 2730 df-clel 2816 df-nfc 2889 df-ral 3069 df-rex 3070 df-rab 3073 df-v 3434 df-sbc 3717 df-dif 3890 df-un 3892 df-in 3894 df-ss 3904 df-nul 4257 df-if 4460 df-sn 4562 df-pr 4564 df-op 4568 df-uni 4840 df-br 5075 df-opab 5137 df-id 5489 df-xp 5595 df-rel 5596 df-cnv 5597 df-co 5598 df-dm 5599 df-iota 6391 df-fun 6435 df-fv 6441 df-ov 7278 df-oprab 7279 df-mpo 7280 df-bc 14017 |
This theorem is referenced by: bcval2 14019 bcval3 14020 bcneg1 33702 bccolsum 33705 fwddifnp1 34467 |
Copyright terms: Public domain | W3C validator |