Metamath Proof Explorer


Theorem subfacp1

Description: A two-term recurrence for the subfactorial. This theorem allows to forget the combinatorial definition of the derangement number in favor of the recursive definition provided by this theorem and subfac0 , subfac1 . (Contributed by Mario Carneiro, 23-Jan-2015)

Ref Expression
Hypotheses derang.d D=xFinf|f:x1-1 ontoxyxfyy
subfac.n S=n0D1n
Assertion subfacp1 NSN+1=NSN+SN1

Proof

Step Hyp Ref Expression
1 derang.d D=xFinf|f:x1-1 ontoxyxfyy
2 subfac.n S=n0D1n
3 f1oeq1 g=fg:1N+11-1 onto1N+1f:1N+11-1 onto1N+1
4 fveq2 z=ygz=gy
5 id z=yz=y
6 4 5 neeq12d z=ygzzgyy
7 6 cbvralvw z1N+1gzzy1N+1gyy
8 fveq1 g=fgy=fy
9 8 neeq1d g=fgyyfyy
10 9 ralbidv g=fy1N+1gyyy1N+1fyy
11 7 10 bitrid g=fz1N+1gzzy1N+1fyy
12 3 11 anbi12d g=fg:1N+11-1 onto1N+1z1N+1gzzf:1N+11-1 onto1N+1y1N+1fyy
13 12 cbvabv g|g:1N+11-1 onto1N+1z1N+1gzz=f|f:1N+11-1 onto1N+1y1N+1fyy
14 1 2 13 subfacp1lem6 NSN+1=NSN+SN1