MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  bcval Structured version   Visualization version   GIF version

Theorem bcval 13658
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 13659 for the value in the standard domain. (Contributed by NM, 10-Jul-2005.) (Revised by Mario Carneiro, 7-Nov-2013.)
Assertion
Ref Expression
bcval ((𝑁 ∈ ℕ0𝐾 ∈ ℤ) → (𝑁C𝐾) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))), 0))

Proof of Theorem bcval
Dummy variables 𝑘 𝑛 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 oveq2 7146 . . . 4 (𝑛 = 𝑁 → (0...𝑛) = (0...𝑁))
21eleq2d 2901 . . 3 (𝑛 = 𝑁 → (𝑘 ∈ (0...𝑛) ↔ 𝑘 ∈ (0...𝑁)))
3 fveq2 6651 . . . 4 (𝑛 = 𝑁 → (!‘𝑛) = (!‘𝑁))
4 fvoveq1 7161 . . . . 5 (𝑛 = 𝑁 → (!‘(𝑛𝑘)) = (!‘(𝑁𝑘)))
54oveq1d 7153 . . . 4 (𝑛 = 𝑁 → ((!‘(𝑛𝑘)) · (!‘𝑘)) = ((!‘(𝑁𝑘)) · (!‘𝑘)))
63, 5oveq12d 7156 . . 3 (𝑛 = 𝑁 → ((!‘𝑛) / ((!‘(𝑛𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))))
72, 6ifbieq1d 4471 . 2 (𝑛 = 𝑁 → if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛𝑘)) · (!‘𝑘))), 0) = if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))), 0))
8 eleq1 2903 . . 3 (𝑘 = 𝐾 → (𝑘 ∈ (0...𝑁) ↔ 𝐾 ∈ (0...𝑁)))
9 oveq2 7146 . . . . . 6 (𝑘 = 𝐾 → (𝑁𝑘) = (𝑁𝐾))
109fveq2d 6655 . . . . 5 (𝑘 = 𝐾 → (!‘(𝑁𝑘)) = (!‘(𝑁𝐾)))
11 fveq2 6651 . . . . 5 (𝑘 = 𝐾 → (!‘𝑘) = (!‘𝐾))
1210, 11oveq12d 7156 . . . 4 (𝑘 = 𝐾 → ((!‘(𝑁𝑘)) · (!‘𝑘)) = ((!‘(𝑁𝐾)) · (!‘𝐾)))
1312oveq2d 7154 . . 3 (𝑘 = 𝐾 → ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))))
148, 13ifbieq1d 4471 . 2 (𝑘 = 𝐾 → if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))), 0) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))), 0))
15 df-bc 13657 . 2 C = (𝑛 ∈ ℕ0, 𝑘 ∈ ℤ ↦ if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛𝑘)) · (!‘𝑘))), 0))
16 ovex 7171 . . 3 ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))) ∈ V
17 c0ex 10620 . . 3 0 ∈ V
1816, 17ifex 4496 . 2 if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))), 0) ∈ V
197, 14, 15, 18ovmpo 7292 1 ((𝑁 ∈ ℕ0𝐾 ∈ ℤ) → (𝑁C𝐾) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))), 0))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 399   = wceq 1538  wcel 2115  ifcif 4448  cfv 6336  (class class class)co 7138  0cc0 10522   · cmul 10527  cmin 10855   / cdiv 11282  0cn0 11883  cz 11967  ...cfz 12883  !cfa 13627  Ccbc 13656
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1912  ax-6 1971  ax-7 2016  ax-8 2117  ax-9 2125  ax-10 2146  ax-11 2162  ax-12 2179  ax-ext 2796  ax-sep 5184  ax-nul 5191  ax-pr 5311  ax-1cn 10580  ax-icn 10581  ax-addcl 10582  ax-mulcl 10584  ax-i2m1 10590
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3an 1086  df-tru 1541  df-ex 1782  df-nf 1786  df-sb 2071  df-mo 2624  df-eu 2655  df-clab 2803  df-cleq 2817  df-clel 2896  df-nfc 2964  df-ral 3137  df-rex 3138  df-rab 3141  df-v 3481  df-sbc 3758  df-dif 3921  df-un 3923  df-in 3925  df-ss 3935  df-nul 4275  df-if 4449  df-sn 4549  df-pr 4551  df-op 4555  df-uni 4820  df-br 5048  df-opab 5110  df-id 5441  df-xp 5542  df-rel 5543  df-cnv 5544  df-co 5545  df-dm 5546  df-iota 6295  df-fun 6338  df-fv 6344  df-ov 7141  df-oprab 7142  df-mpo 7143  df-bc 13657
This theorem is referenced by:  bcval2  13659  bcval3  13660  bcneg1  32986  bccolsum  32989  fwddifnp1  33644
  Copyright terms: Public domain W3C validator