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

Theorem bcval 11333
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 11334 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 5882 . . . 4  |-  ( n  =  N  ->  (
0 ... n )  =  ( 0 ... N
) )
21eleq2d 2363 . . 3  |-  ( n  =  N  ->  (
k  e.  ( 0 ... n )  <->  k  e.  ( 0 ... N
) ) )
3 fveq2 5541 . . . 4  |-  ( n  =  N  ->  ( ! `  n )  =  ( ! `  N ) )
4 oveq1 5881 . . . . . 6  |-  ( n  =  N  ->  (
n  -  k )  =  ( N  -  k ) )
54fveq2d 5545 . . . . 5  |-  ( n  =  N  ->  ( ! `  ( n  -  k ) )  =  ( ! `  ( N  -  k
) ) )
65oveq1d 5889 . . . 4  |-  ( n  =  N  ->  (
( ! `  (
n  -  k ) )  x.  ( ! `
 k ) )  =  ( ( ! `
 ( N  -  k ) )  x.  ( ! `  k
) ) )
73, 6oveq12d 5892 . . 3  |-  ( n  =  N  ->  (
( ! `  n
)  /  ( ( ! `  ( n  -  k ) )  x.  ( ! `  k ) ) )  =  ( ( ! `
 N )  / 
( ( ! `  ( N  -  k
) )  x.  ( ! `  k )
) ) )
8 eqidd 2297 . . 3  |-  ( n  =  N  ->  0  =  0 )
92, 7, 8ifbieq12d 3600 . 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 ) )
10 eleq1 2356 . . 3  |-  ( k  =  K  ->  (
k  e.  ( 0 ... N )  <->  K  e.  ( 0 ... N
) ) )
11 oveq2 5882 . . . . . 6  |-  ( k  =  K  ->  ( N  -  k )  =  ( N  -  K ) )
1211fveq2d 5545 . . . . 5  |-  ( k  =  K  ->  ( ! `  ( N  -  k ) )  =  ( ! `  ( N  -  K
) ) )
13 fveq2 5541 . . . . 5  |-  ( k  =  K  ->  ( ! `  k )  =  ( ! `  K ) )
1412, 13oveq12d 5892 . . . 4  |-  ( k  =  K  ->  (
( ! `  ( N  -  k )
)  x.  ( ! `
 k ) )  =  ( ( ! `
 ( N  -  K ) )  x.  ( ! `  K
) ) )
1514oveq2d 5890 . . 3  |-  ( k  =  K  ->  (
( ! `  N
)  /  ( ( ! `  ( N  -  k ) )  x.  ( ! `  k ) ) )  =  ( ( ! `
 N )  / 
( ( ! `  ( N  -  K
) )  x.  ( ! `  K )
) ) )
16 eqidd 2297 . . 3  |-  ( k  =  K  ->  0  =  0 )
1710, 15, 16ifbieq12d 3600 . 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 ) )
18 df-bc 11332 . 2  |-  _C  =  ( n  e.  NN0 ,  k  e.  ZZ  |->  if ( k  e.  ( 0 ... n ) ,  ( ( ! `
 n )  / 
( ( ! `  ( n  -  k
) )  x.  ( ! `  k )
) ) ,  0 ) )
19 ovex 5899 . . 3  |-  ( ( ! `  N )  /  ( ( ! `
 ( N  -  K ) )  x.  ( ! `  K
) ) )  e. 
_V
20 c0ex 8848 . . 3  |-  0  e.  _V
2119, 20ifex 3636 . 2  |-  if ( K  e.  ( 0 ... N ) ,  ( ( ! `  N )  /  (
( ! `  ( N  -  K )
)  x.  ( ! `
 K ) ) ) ,  0 )  e.  _V
229, 17, 18, 21ovmpt2 5999 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 set class
Syntax hints:    -> wi 4    /\ wa 358    = wceq 1632    e. wcel 1696   ifcif 3578   ` cfv 5271  (class class class)co 5874   0cc0 8753    x. cmul 8758    - cmin 9053    / cdiv 9439   NN0cn0 9981   ZZcz 10040   ...cfz 10798   !cfa 11304    _C cbc 11331
This theorem is referenced by:  bcval2  11334  bcval3  11335
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-sep 4157  ax-nul 4165  ax-pr 4230  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-mulcl 8815  ax-i2m1 8821
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-ral 2561  df-rex 2562  df-rab 2565  df-v 2803  df-sbc 3005  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-nul 3469  df-if 3579  df-sn 3659  df-pr 3660  df-op 3662  df-uni 3844  df-br 4040  df-opab 4094  df-id 4325  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-iota 5235  df-fun 5273  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-bc 11332
  Copyright terms: Public domain W3C validator