Metamath Proof Explorer


Theorem bcval

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 for the value in the standard domain. (Contributed by NM, 10-Jul-2005) (Revised by Mario Carneiro, 7-Nov-2013)

Ref Expression
Assertion bcval N 0 K ( N K) = if K 0 N N ! N K ! K ! 0

Proof

Step Hyp Ref Expression
1 oveq2 n = N 0 n = 0 N
2 1 eleq2d n = N k 0 n k 0 N
3 fveq2 n = N n ! = N !
4 fvoveq1 n = N n k ! = N k !
5 4 oveq1d n = N n k ! k ! = N k ! k !
6 3 5 oveq12d n = N n ! n k ! k ! = N ! N k ! k !
7 2 6 ifbieq1d n = N if k 0 n n ! n k ! k ! 0 = if k 0 N N ! N k ! k ! 0
8 eleq1 k = K k 0 N K 0 N
9 oveq2 k = K N k = N K
10 9 fveq2d k = K N k ! = N K !
11 fveq2 k = K k ! = K !
12 10 11 oveq12d k = K N k ! k ! = N K ! K !
13 12 oveq2d k = K N ! N k ! k ! = N ! N K ! K !
14 8 13 ifbieq1d k = K if k 0 N N ! N k ! k ! 0 = if K 0 N N ! N K ! K ! 0
15 df-bc ( . .) = n 0 , k if k 0 n n ! n k ! k ! 0
16 ovex N ! N K ! K ! V
17 c0ex 0 V
18 16 17 ifex if K 0 N N ! N K ! K ! 0 V
19 7 14 15 18 ovmpo N 0 K ( N K) = if K 0 N N ! N K ! K ! 0