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

Theorem bcval 12428
Description: Value of the binomial coefficient,  N choose  K. Definition of binomial coefficient in [Gleason] p. 295. As suggested by Gleason, we define it to be 0 when  0  <_  K  <_  N does not hold. See bcval2 12429 for the value in the standard domain. (Contributed by NM, 10-Jul-2005.) (Revised by Mario Carneiro, 7-Nov-2013.)
Assertion
Ref Expression
bcval  |-  ( ( N  e.  NN0  /\  K  e.  ZZ )  ->  ( N  _C  K
)  =  if ( K  e.  ( 0 ... N ) ,  ( ( ! `  N )  /  (
( ! `  ( N  -  K )
)  x.  ( ! `
 K ) ) ) ,  0 ) )

Proof of Theorem bcval
Dummy variables  k  n are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 oveq2 6288 . . . 4  |-  ( n  =  N  ->  (
0 ... n )  =  ( 0 ... N
) )
21eleq2d 2474 . . 3  |-  ( n  =  N  ->  (
k  e.  ( 0 ... n )  <->  k  e.  ( 0 ... N
) ) )
3 fveq2 5851 . . . 4  |-  ( n  =  N  ->  ( ! `  n )  =  ( ! `  N ) )
4 oveq1 6287 . . . . . 6  |-  ( n  =  N  ->  (
n  -  k )  =  ( N  -  k ) )
54fveq2d 5855 . . . . 5  |-  ( n  =  N  ->  ( ! `  ( n  -  k ) )  =  ( ! `  ( N  -  k
) ) )
65oveq1d 6295 . . . 4  |-  ( n  =  N  ->  (
( ! `  (
n  -  k ) )  x.  ( ! `
 k ) )  =  ( ( ! `
 ( N  -  k ) )  x.  ( ! `  k
) ) )
73, 6oveq12d 6298 . . 3  |-  ( n  =  N  ->  (
( ! `  n
)  /  ( ( ! `  ( n  -  k ) )  x.  ( ! `  k ) ) )  =  ( ( ! `
 N )  / 
( ( ! `  ( N  -  k
) )  x.  ( ! `  k )
) ) )
82, 7ifbieq1d 3910 . 2  |-  ( n  =  N  ->  if ( k  e.  ( 0 ... n ) ,  ( ( ! `
 n )  / 
( ( ! `  ( n  -  k
) )  x.  ( ! `  k )
) ) ,  0 )  =  if ( k  e.  ( 0 ... N ) ,  ( ( ! `  N )  /  (
( ! `  ( N  -  k )
)  x.  ( ! `
 k ) ) ) ,  0 ) )
9 eleq1 2476 . . 3  |-  ( k  =  K  ->  (
k  e.  ( 0 ... N )  <->  K  e.  ( 0 ... N
) ) )
10 oveq2 6288 . . . . . 6  |-  ( k  =  K  ->  ( N  -  k )  =  ( N  -  K ) )
1110fveq2d 5855 . . . . 5  |-  ( k  =  K  ->  ( ! `  ( N  -  k ) )  =  ( ! `  ( N  -  K
) ) )
12 fveq2 5851 . . . . 5  |-  ( k  =  K  ->  ( ! `  k )  =  ( ! `  K ) )
1311, 12oveq12d 6298 . . . 4  |-  ( k  =  K  ->  (
( ! `  ( N  -  k )
)  x.  ( ! `
 k ) )  =  ( ( ! `
 ( N  -  K ) )  x.  ( ! `  K
) ) )
1413oveq2d 6296 . . 3  |-  ( k  =  K  ->  (
( ! `  N
)  /  ( ( ! `  ( N  -  k ) )  x.  ( ! `  k ) ) )  =  ( ( ! `
 N )  / 
( ( ! `  ( N  -  K
) )  x.  ( ! `  K )
) ) )
159, 14ifbieq1d 3910 . 2  |-  ( k  =  K  ->  if ( k  e.  ( 0 ... N ) ,  ( ( ! `
 N )  / 
( ( ! `  ( N  -  k
) )  x.  ( ! `  k )
) ) ,  0 )  =  if ( K  e.  ( 0 ... N ) ,  ( ( ! `  N )  /  (
( ! `  ( N  -  K )
)  x.  ( ! `
 K ) ) ) ,  0 ) )
16 df-bc 12427 . 2  |-  _C  =  ( n  e.  NN0 ,  k  e.  ZZ  |->  if ( k  e.  ( 0 ... n ) ,  ( ( ! `
 n )  / 
( ( ! `  ( n  -  k
) )  x.  ( ! `  k )
) ) ,  0 ) )
17 ovex 6308 . . 3  |-  ( ( ! `  N )  /  ( ( ! `
 ( N  -  K ) )  x.  ( ! `  K
) ) )  e. 
_V
18 c0ex 9622 . . 3  |-  0  e.  _V
1917, 18ifex 3955 . 2  |-  if ( K  e.  ( 0 ... N ) ,  ( ( ! `  N )  /  (
( ! `  ( N  -  K )
)  x.  ( ! `
 K ) ) ) ,  0 )  e.  _V
208, 15, 16, 19ovmpt2 6421 1  |-  ( ( N  e.  NN0  /\  K  e.  ZZ )  ->  ( N  _C  K
)  =  if ( K  e.  ( 0 ... N ) ,  ( ( ! `  N )  /  (
( ! `  ( N  -  K )
)  x.  ( ! `
 K ) ) ) ,  0 ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1407    e. wcel 1844   ifcif 3887   ` cfv 5571  (class class class)co 6280   0cc0 9524    x. cmul 9529    - cmin 9843    / cdiv 10249   NN0cn0 10838   ZZcz 10907   ...cfz 11728   !cfa 12399    _C cbc 12426
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1641  ax-4 1654  ax-5 1727  ax-6 1773  ax-7 1816  ax-9 1848  ax-10 1863  ax-11 1868  ax-12 1880  ax-13 2028  ax-ext 2382  ax-sep 4519  ax-nul 4527  ax-pr 4632  ax-1cn 9582  ax-icn 9583  ax-addcl 9584  ax-mulcl 9586  ax-i2m1 9592
This theorem depends on definitions:  df-bi 187  df-or 370  df-an 371  df-3an 978  df-tru 1410  df-ex 1636  df-nf 1640  df-sb 1766  df-eu 2244  df-mo 2245  df-clab 2390  df-cleq 2396  df-clel 2399  df-nfc 2554  df-ne 2602  df-ral 2761  df-rex 2762  df-rab 2765  df-v 3063  df-sbc 3280  df-dif 3419  df-un 3421  df-in 3423  df-ss 3430  df-nul 3741  df-if 3888  df-sn 3975  df-pr 3977  df-op 3981  df-uni 4194  df-br 4398  df-opab 4456  df-id 4740  df-xp 4831  df-rel 4832  df-cnv 4833  df-co 4834  df-dm 4835  df-iota 5535  df-fun 5573  df-fv 5579  df-ov 6283  df-oprab 6284  df-mpt2 6285  df-bc 12427
This theorem is referenced by:  bcval2  12429  bcval3  12430  bcneg1  29958  bccolsum  29961  fwddifnp1  30516
  Copyright terms: Public domain W3C validator