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

Theorem bcval 13131
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 13132 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 6698 . . . 4 (𝑛 = 𝑁 → (0...𝑛) = (0...𝑁))
21eleq2d 2716 . . 3 (𝑛 = 𝑁 → (𝑘 ∈ (0...𝑛) ↔ 𝑘 ∈ (0...𝑁)))
3 fveq2 6229 . . . 4 (𝑛 = 𝑁 → (!‘𝑛) = (!‘𝑁))
4 oveq1 6697 . . . . . 6 (𝑛 = 𝑁 → (𝑛𝑘) = (𝑁𝑘))
54fveq2d 6233 . . . . 5 (𝑛 = 𝑁 → (!‘(𝑛𝑘)) = (!‘(𝑁𝑘)))
65oveq1d 6705 . . . 4 (𝑛 = 𝑁 → ((!‘(𝑛𝑘)) · (!‘𝑘)) = ((!‘(𝑁𝑘)) · (!‘𝑘)))
73, 6oveq12d 6708 . . 3 (𝑛 = 𝑁 → ((!‘𝑛) / ((!‘(𝑛𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))))
82, 7ifbieq1d 4142 . 2 (𝑛 = 𝑁 → if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛𝑘)) · (!‘𝑘))), 0) = if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))), 0))
9 eleq1 2718 . . 3 (𝑘 = 𝐾 → (𝑘 ∈ (0...𝑁) ↔ 𝐾 ∈ (0...𝑁)))
10 oveq2 6698 . . . . . 6 (𝑘 = 𝐾 → (𝑁𝑘) = (𝑁𝐾))
1110fveq2d 6233 . . . . 5 (𝑘 = 𝐾 → (!‘(𝑁𝑘)) = (!‘(𝑁𝐾)))
12 fveq2 6229 . . . . 5 (𝑘 = 𝐾 → (!‘𝑘) = (!‘𝐾))
1311, 12oveq12d 6708 . . . 4 (𝑘 = 𝐾 → ((!‘(𝑁𝑘)) · (!‘𝑘)) = ((!‘(𝑁𝐾)) · (!‘𝐾)))
1413oveq2d 6706 . . 3 (𝑘 = 𝐾 → ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))) = ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))))
159, 14ifbieq1d 4142 . 2 (𝑘 = 𝐾 → if(𝑘 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝑘)) · (!‘𝑘))), 0) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))), 0))
16 df-bc 13130 . 2 C = (𝑛 ∈ ℕ0, 𝑘 ∈ ℤ ↦ if(𝑘 ∈ (0...𝑛), ((!‘𝑛) / ((!‘(𝑛𝑘)) · (!‘𝑘))), 0))
17 ovex 6718 . . 3 ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))) ∈ V
18 c0ex 10072 . . 3 0 ∈ V
1917, 18ifex 4189 . 2 if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))), 0) ∈ V
208, 15, 16, 19ovmpt2 6838 1 ((𝑁 ∈ ℕ0𝐾 ∈ ℤ) → (𝑁C𝐾) = if(𝐾 ∈ (0...𝑁), ((!‘𝑁) / ((!‘(𝑁𝐾)) · (!‘𝐾))), 0))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 383   = wceq 1523  wcel 2030  ifcif 4119  cfv 5926  (class class class)co 6690  0cc0 9974   · cmul 9979  cmin 10304   / cdiv 10722  0cn0 11330  cz 11415  ...cfz 12364  !cfa 13100  Ccbc 13129
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1762  ax-4 1777  ax-5 1879  ax-6 1945  ax-7 1981  ax-9 2039  ax-10 2059  ax-11 2074  ax-12 2087  ax-13 2282  ax-ext 2631  ax-sep 4814  ax-nul 4822  ax-pr 4936  ax-1cn 10032  ax-icn 10033  ax-addcl 10034  ax-mulcl 10036  ax-i2m1 10042
This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-3an 1056  df-tru 1526  df-ex 1745  df-nf 1750  df-sb 1938  df-eu 2502  df-mo 2503  df-clab 2638  df-cleq 2644  df-clel 2647  df-nfc 2782  df-ral 2946  df-rex 2947  df-rab 2950  df-v 3233  df-sbc 3469  df-dif 3610  df-un 3612  df-in 3614  df-ss 3621  df-nul 3949  df-if 4120  df-sn 4211  df-pr 4213  df-op 4217  df-uni 4469  df-br 4686  df-opab 4746  df-id 5053  df-xp 5149  df-rel 5150  df-cnv 5151  df-co 5152  df-dm 5153  df-iota 5889  df-fun 5928  df-fv 5934  df-ov 6693  df-oprab 6694  df-mpt2 6695  df-bc 13130
This theorem is referenced by:  bcval2  13132  bcval3  13133  bcneg1  31748  bccolsum  31751  fwddifnp1  32397
  Copyright terms: Public domain W3C validator