| 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 13092 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 6658 | . . . 4 ⊢ (𝑛 = 𝑁 → (0...𝑛) = (0...𝑁)) | |
| 2 | 1 | eleq2d 2687 | . . 3 ⊢ (𝑛 = 𝑁 → (𝑘 ∈ (0...𝑛) ↔ 𝑘 ∈ (0...𝑁))) |
| 3 | fveq2 6191 | . . . 4 ⊢ (𝑛 = 𝑁 → (!‘𝑛) = (!‘𝑁)) | |
| 4 | oveq1 6657 | . . . . . 6 ⊢ (𝑛 = 𝑁 → (𝑛 − 𝑘) = (𝑁 − 𝑘)) | |
| 5 | 4 | fveq2d 6195 | . . . . 5 ⊢ (𝑛 = 𝑁 → (!‘(𝑛 − 𝑘)) = (!‘(𝑁 − 𝑘))) |
| 6 | 5 | oveq1d 6665 | . . . 4 ⊢ (𝑛 = 𝑁 → ((!‘(𝑛 − 𝑘)) · (!‘𝑘)) = ((!‘(𝑁 − 𝑘)) · (!‘𝑘))) |
| 7 | 3, 6 | oveq12d 6668 | . . 3 ⊢ (𝑛 = 𝑁 → ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘)))) |
| 8 | 2, 7 | ifbieq1d 4109 | . 2 ⊢ (𝑛 = 𝑁 → if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))), 0) = if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))), 0)) |
| 9 | eleq1 2689 | . . 3 ⊢ (𝑘 = 𝐾 → (𝑘 ∈ (0...𝑁) ↔ 𝐾 ∈ (0...𝑁))) | |
| 10 | oveq2 6658 | . . . . . 6 ⊢ (𝑘 = 𝐾 → (𝑁 − 𝑘) = (𝑁 − 𝐾)) | |
| 11 | 10 | fveq2d 6195 | . . . . 5 ⊢ (𝑘 = 𝐾 → (!‘(𝑁 − 𝑘)) = (!‘(𝑁 − 𝐾))) |
| 12 | fveq2 6191 | . . . . 5 ⊢ (𝑘 = 𝐾 → (!‘𝑘) = (!‘𝐾)) | |
| 13 | 11, 12 | oveq12d 6668 | . . . 4 ⊢ (𝑘 = 𝐾 → ((!‘(𝑁 − 𝑘)) · (!‘𝑘)) = ((!‘(𝑁 − 𝐾)) · (!‘𝐾))) |
| 14 | 13 | oveq2d 6666 | . . 3 ⊢ (𝑘 = 𝐾 → ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾)))) |
| 15 | 9, 14 | ifbieq1d 4109 | . 2 ⊢ (𝑘 = 𝐾 → if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝑘)) · (!‘𝑘))), 0) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0)) |
| 16 | df-bc 13090 | . 2 ⊢ C = (𝑛 ∈ ℕ0, 𝑘 ∈ ℤ ↦ if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛 − 𝑘)) · (!‘𝑘))), 0)) | |
| 17 | ovex 6678 | . . 3 ⊢ ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))) ∈ V | |
| 18 | c0ex 10034 | . . 3 ⊢ 0 ∈ V | |
| 19 | 17, 18 | ifex 4156 | . 2 ⊢ if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0) ∈ V |
| 20 | 8, 15, 16, 19 | ovmpt2 6796 | 1 ⊢ ((𝑁 ∈ ℕ0 ∧ 𝐾 ∈ ℤ) → (𝑁C𝐾) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁 − 𝐾)) · (!‘𝐾))), 0)) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ∧ wa 384 = wceq 1483 ∈ wcel 1990 ifcif 4086 ‘cfv 5888 (class class class)co 6650 0cc0 9936 · cmul 9941 − cmin 10266 / cdiv 10684 ℕ0cn0 11292 ℤcz 11377 ...cfz 12326 !cfa 13060 Ccbc 13089 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1722 ax-4 1737 ax-5 1839 ax-6 1888 ax-7 1935 ax-9 1999 ax-10 2019 ax-11 2034 ax-12 2047 ax-13 2246 ax-ext 2602 ax-sep 4781 ax-nul 4789 ax-pr 4906 ax-1cn 9994 ax-icn 9995 ax-addcl 9996 ax-mulcl 9998 ax-i2m1 10004 |
| This theorem depends on definitions: df-bi 197 df-or 385 df-an 386 df-3an 1039 df-tru 1486 df-ex 1705 df-nf 1710 df-sb 1881 df-eu 2474 df-mo 2475 df-clab 2609 df-cleq 2615 df-clel 2618 df-nfc 2753 df-ral 2917 df-rex 2918 df-rab 2921 df-v 3202 df-sbc 3436 df-dif 3577 df-un 3579 df-in 3581 df-ss 3588 df-nul 3916 df-if 4087 df-sn 4178 df-pr 4180 df-op 4184 df-uni 4437 df-br 4654 df-opab 4713 df-id 5024 df-xp 5120 df-rel 5121 df-cnv 5122 df-co 5123 df-dm 5124 df-iota 5851 df-fun 5890 df-fv 5896 df-ov 6653 df-oprab 6654 df-mpt2 6655 df-bc 13090 |
| This theorem is referenced by: bcval2 13092 bcval3 13093 bcneg1 31622 bccolsum 31625 fwddifnp1 32272 |
| Copyright terms: Public domain | W3C validator |