Metamath Proof Explorer


Theorem sticksstones9

Description: Establish mapping between strictly monotone functions and functions that sum to a fixed non-negative integer. (Contributed by metakunt, 6-Oct-2024)

Ref Expression
Hypotheses sticksstones9.1 φ N 0
sticksstones9.2 φ K = 0
sticksstones9.3 G = b B if K = 0 1 N k 1 K + 1 if k = K + 1 N + K - b K if k = 1 b 1 1 b k - b k 1 - 1
sticksstones9.4 A = g | g : 1 K + 1 0 i = 1 K + 1 g i = N
sticksstones9.5 B = f | f : 1 K 1 N + K x 1 K y 1 K x < y f x < f y
Assertion sticksstones9 φ G : B A

Proof

Step Hyp Ref Expression
1 sticksstones9.1 φ N 0
2 sticksstones9.2 φ K = 0
3 sticksstones9.3 G = b B if K = 0 1 N k 1 K + 1 if k = K + 1 N + K - b K if k = 1 b 1 1 b k - b k 1 - 1
4 sticksstones9.4 A = g | g : 1 K + 1 0 i = 1 K + 1 g i = N
5 sticksstones9.5 B = f | f : 1 K 1 N + K x 1 K y 1 K x < y f x < f y
6 2 iftrued φ if K = 0 1 N k 1 K + 1 if k = K + 1 N + K - b K if k = 1 b 1 1 b k - b k 1 - 1 = 1 N
7 6 adantr φ b B if K = 0 1 N k 1 K + 1 if k = K + 1 N + K - b K if k = 1 b 1 1 b k - b k 1 - 1 = 1 N
8 eqid 1 N = 1 N
9 1nn 1
10 9 a1i φ 1
11 fsng 1 N 0 1 N : 1 N 1 N = 1 N
12 10 1 11 syl2anc φ 1 N : 1 N 1 N = 1 N
13 8 12 mpbiri φ 1 N : 1 N
14 1 snssd φ N 0
15 13 14 jca φ 1 N : 1 N N 0
16 fss 1 N : 1 N N 0 1 N : 1 0
17 15 16 syl φ 1 N : 1 0
18 2 oveq1d φ K + 1 = 0 + 1
19 0p1e1 0 + 1 = 1
20 18 19 eqtrdi φ K + 1 = 1
21 20 oveq2d φ 1 K + 1 = 1 1
22 1zzd φ 1
23 fzsn 1 1 1 = 1
24 22 23 syl φ 1 1 = 1
25 21 24 eqtrd φ 1 K + 1 = 1
26 25 eqcomd φ 1 = 1 K + 1
27 26 feq2d φ 1 N : 1 0 1 N : 1 K + 1 0
28 17 27 mpbid φ 1 N : 1 K + 1 0
29 25 sumeq1d φ i = 1 K + 1 1 N i = i 1 1 N i
30 fvsng 1 N 0 1 N 1 = N
31 10 1 30 syl2anc φ 1 N 1 = N
32 1 nn0cnd φ N
33 31 32 eqeltrd φ 1 N 1
34 10 33 jca φ 1 1 N 1
35 fveq2 i = 1 1 N i = 1 N 1
36 35 sumsn 1 1 N 1 i 1 1 N i = 1 N 1
37 34 36 syl φ i 1 1 N i = 1 N 1
38 10 1 jca φ 1 N 0
39 38 30 syl φ 1 N 1 = N
40 37 39 eqtrd φ i 1 1 N i = N
41 29 40 eqtrd φ i = 1 K + 1 1 N i = N
42 28 41 jca φ 1 N : 1 K + 1 0 i = 1 K + 1 1 N i = N
43 42 adantr φ b B 1 N : 1 K + 1 0 i = 1 K + 1 1 N i = N
44 snex 1 N V
45 feq1 g = 1 N g : 1 K + 1 0 1 N : 1 K + 1 0
46 simpl g = 1 N i 1 K + 1 g = 1 N
47 46 fveq1d g = 1 N i 1 K + 1 g i = 1 N i
48 47 sumeq2dv g = 1 N i = 1 K + 1 g i = i = 1 K + 1 1 N i
49 48 eqeq1d g = 1 N i = 1 K + 1 g i = N i = 1 K + 1 1 N i = N
50 45 49 anbi12d g = 1 N g : 1 K + 1 0 i = 1 K + 1 g i = N 1 N : 1 K + 1 0 i = 1 K + 1 1 N i = N
51 50 elabg 1 N V 1 N g | g : 1 K + 1 0 i = 1 K + 1 g i = N 1 N : 1 K + 1 0 i = 1 K + 1 1 N i = N
52 44 51 ax-mp 1 N g | g : 1 K + 1 0 i = 1 K + 1 g i = N 1 N : 1 K + 1 0 i = 1 K + 1 1 N i = N
53 43 52 sylibr φ b B 1 N g | g : 1 K + 1 0 i = 1 K + 1 g i = N
54 4 a1i φ b B A = g | g : 1 K + 1 0 i = 1 K + 1 g i = N
55 53 54 eleqtrrd φ b B 1 N A
56 7 55 eqeltrd φ b B if K = 0 1 N k 1 K + 1 if k = K + 1 N + K - b K if k = 1 b 1 1 b k - b k 1 - 1 A
57 56 3 fmptd φ G : B A