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

Theorem bcval 11317
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 11318 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 5866 . . . 4  |-  ( n  =  N  ->  (
0 ... n )  =  ( 0 ... N
) )
21eleq2d 2350 . . 3  |-  ( n  =  N  ->  (
k  e.  ( 0 ... n )  <->  k  e.  ( 0 ... N
) ) )
3 fveq2 5525 . . . 4  |-  ( n  =  N  ->  ( ! `  n )  =  ( ! `  N ) )
4 oveq1 5865 . . . . . 6  |-  ( n  =  N  ->  (
n  -  k )  =  ( N  -  k ) )
54fveq2d 5529 . . . . 5  |-  ( n  =  N  ->  ( ! `  ( n  -  k ) )  =  ( ! `  ( N  -  k
) ) )
65oveq1d 5873 . . . 4  |-  ( n  =  N  ->  (
( ! `  (
n  -  k ) )  x.  ( ! `
 k ) )  =  ( ( ! `
 ( N  -  k ) )  x.  ( ! `  k
) ) )
73, 6oveq12d 5876 . . 3  |-  ( n  =  N  ->  (
( ! `  n
)  /  ( ( ! `  ( n  -  k ) )  x.  ( ! `  k ) ) )  =  ( ( ! `
 N )  / 
( ( ! `  ( N  -  k
) )  x.  ( ! `  k )
) ) )
8 eqidd 2284 . . 3  |-  ( n  =  N  ->  0  =  0 )
92, 7, 8ifbieq12d 3587 . 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 2343 . . 3  |-  ( k  =  K  ->  (
k  e.  ( 0 ... N )  <->  K  e.  ( 0 ... N
) ) )
11 oveq2 5866 . . . . . 6  |-  ( k  =  K  ->  ( N  -  k )  =  ( N  -  K ) )
1211fveq2d 5529 . . . . 5  |-  ( k  =  K  ->  ( ! `  ( N  -  k ) )  =  ( ! `  ( N  -  K
) ) )
13 fveq2 5525 . . . . 5  |-  ( k  =  K  ->  ( ! `  k )  =  ( ! `  K ) )
1412, 13oveq12d 5876 . . . 4  |-  ( k  =  K  ->  (
( ! `  ( N  -  k )
)  x.  ( ! `
 k ) )  =  ( ( ! `
 ( N  -  K ) )  x.  ( ! `  K
) ) )
1514oveq2d 5874 . . 3  |-  ( k  =  K  ->  (
( ! `  N
)  /  ( ( ! `  ( N  -  k ) )  x.  ( ! `  k ) ) )  =  ( ( ! `
 N )  / 
( ( ! `  ( N  -  K
) )  x.  ( ! `  K )
) ) )
16 eqidd 2284 . . 3  |-  ( k  =  K  ->  0  =  0 )
1710, 15, 16ifbieq12d 3587 . 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 11316 . 2  |-  _C  =  ( n  e.  NN0 ,  k  e.  ZZ  |->  if ( k  e.  ( 0 ... n ) ,  ( ( ! `
 n )  / 
( ( ! `  ( n  -  k
) )  x.  ( ! `  k )
) ) ,  0 ) )
19 ovex 5883 . . 3  |-  ( ( ! `  N )  /  ( ( ! `
 ( N  -  K ) )  x.  ( ! `  K
) ) )  e. 
_V
20 c0ex 8832 . . 3  |-  0  e.  _V
2119, 20ifex 3623 . 2  |-  if ( K  e.  ( 0 ... N ) ,  ( ( ! `  N )  /  (
( ! `  ( N  -  K )
)  x.  ( ! `
 K ) ) ) ,  0 )  e.  _V
229, 17, 18, 21ovmpt2 5983 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 1623    e. wcel 1684   ifcif 3565   ` cfv 5255  (class class class)co 5858   0cc0 8737    x. cmul 8742    - cmin 9037    / cdiv 9423   NN0cn0 9965   ZZcz 10024   ...cfz 10782   !cfa 11288    _C cbc 11315
This theorem is referenced by:  bcval2  11318  bcval3  11319
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-sep 4141  ax-nul 4149  ax-pr 4214  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-mulcl 8799  ax-i2m1 8805
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-ral 2548  df-rex 2549  df-rab 2552  df-v 2790  df-sbc 2992  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-nul 3456  df-if 3566  df-sn 3646  df-pr 3647  df-op 3649  df-uni 3828  df-br 4024  df-opab 4078  df-id 4309  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-iota 5219  df-fun 5257  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-bc 11316
  Copyright terms: Public domain W3C validator