Metamath Proof Explorer


Theorem sticksstones7

Description: Closure property of sticks and stones function. (Contributed by metakunt, 1-Oct-2024)

Ref Expression
Hypotheses sticksstones7.1 φ N 0
sticksstones7.2 φ K 0
sticksstones7.3 φ G : 1 K + 1 0
sticksstones7.4 φ X 1 K
sticksstones7.5 F = x 1 K x + i = 1 x G i
sticksstones7.6 φ i = 1 K + 1 G i = N
Assertion sticksstones7 φ F X 1 N + K

Proof

Step Hyp Ref Expression
1 sticksstones7.1 φ N 0
2 sticksstones7.2 φ K 0
3 sticksstones7.3 φ G : 1 K + 1 0
4 sticksstones7.4 φ X 1 K
5 sticksstones7.5 F = x 1 K x + i = 1 x G i
6 sticksstones7.6 φ i = 1 K + 1 G i = N
7 5 a1i φ F = x 1 K x + i = 1 x G i
8 simpr φ x = X x = X
9 8 oveq2d φ x = X 1 x = 1 X
10 9 sumeq1d φ x = X i = 1 x G i = i = 1 X G i
11 8 10 oveq12d φ x = X x + i = 1 x G i = X + i = 1 X G i
12 elfznn X 1 K X
13 4 12 syl φ X
14 13 nnnn0d φ X 0
15 fzfid φ 1 X Fin
16 1zzd φ i 1 X 1
17 2 nn0zd φ K
18 17 adantr φ i 1 X K
19 18 peano2zd φ i 1 X K + 1
20 elfzelz i 1 X i
21 20 adantl φ i 1 X i
22 elfzle1 i 1 X 1 i
23 22 adantl φ i 1 X 1 i
24 21 zred φ i 1 X i
25 13 nnred φ X
26 25 adantr φ i 1 X X
27 19 zred φ i 1 X K + 1
28 elfzle2 i 1 X i X
29 28 adantl φ i 1 X i X
30 2 nn0red φ K
31 1red φ 1
32 30 31 readdcld φ K + 1
33 elfzle2 X 1 K X K
34 4 33 syl φ X K
35 30 lep1d φ K K + 1
36 25 30 32 34 35 letrd φ X K + 1
37 36 adantr φ i 1 X X K + 1
38 24 26 27 29 37 letrd φ i 1 X i K + 1
39 16 19 21 23 38 elfzd φ i 1 X i 1 K + 1
40 3 adantr φ i 1 X G : 1 K + 1 0
41 40 ffvelrnda φ i 1 X i 1 K + 1 G i 0
42 39 41 mpdan φ i 1 X G i 0
43 15 42 fsumnn0cl φ i = 1 X G i 0
44 14 43 nn0addcld φ X + i = 1 X G i 0
45 7 11 4 44 fvmptd φ F X = X + i = 1 X G i
46 1zzd φ 1
47 1 nn0zd φ N
48 47 17 zaddcld φ N + K
49 44 nn0zd φ X + i = 1 X G i
50 eqid 1 = 1
51 1p0e1 1 + 0 = 1
52 50 51 eqtr4i 1 = 1 + 0
53 52 a1i φ 1 = 1 + 0
54 0red φ 0
55 43 nn0red φ i = 1 X G i
56 13 nnge1d φ 1 X
57 43 nn0ge0d φ 0 i = 1 X G i
58 31 54 25 55 56 57 le2addd φ 1 + 0 X + i = 1 X G i
59 53 58 eqbrtrd φ 1 X + i = 1 X G i
60 1 nn0red φ N
61 fzfid φ X + 1 K + 1 Fin
62 46 adantr φ i X + 1 K + 1 1
63 17 peano2zd φ K + 1
64 63 adantr φ i X + 1 K + 1 K + 1
65 elfzelz i X + 1 K + 1 i
66 65 adantl φ i X + 1 K + 1 i
67 31 adantr φ i X + 1 K + 1 1
68 25 adantr φ i X + 1 K + 1 X
69 68 67 readdcld φ i X + 1 K + 1 X + 1
70 66 zred φ i X + 1 K + 1 i
71 56 adantr φ i X + 1 K + 1 1 X
72 68 lep1d φ i X + 1 K + 1 X X + 1
73 67 68 69 71 72 letrd φ i X + 1 K + 1 1 X + 1
74 elfzle1 i X + 1 K + 1 X + 1 i
75 74 adantl φ i X + 1 K + 1 X + 1 i
76 67 69 70 73 75 letrd φ i X + 1 K + 1 1 i
77 elfzle2 i X + 1 K + 1 i K + 1
78 77 adantl φ i X + 1 K + 1 i K + 1
79 62 64 66 76 78 elfzd φ i X + 1 K + 1 i 1 K + 1
80 3 ffvelrnda φ i 1 K + 1 G i 0
81 80 adantlr φ i X + 1 K + 1 i 1 K + 1 G i 0
82 79 81 mpdan φ i X + 1 K + 1 G i 0
83 61 82 fsumnn0cl φ i = X + 1 K + 1 G i 0
84 83 nn0ge0d φ 0 i = X + 1 K + 1 G i
85 83 nn0red φ i = X + 1 K + 1 G i
86 55 85 addge01d φ 0 i = X + 1 K + 1 G i i = 1 X G i i = 1 X G i + i = X + 1 K + 1 G i
87 84 86 mpbid φ i = 1 X G i i = 1 X G i + i = X + 1 K + 1 G i
88 25 ltp1d φ X < X + 1
89 fzdisj X < X + 1 1 X X + 1 K + 1 =
90 88 89 syl φ 1 X X + 1 K + 1 =
91 14 nn0zd φ X
92 46 63 91 56 36 elfzd φ X 1 K + 1
93 fzsplit X 1 K + 1 1 K + 1 = 1 X X + 1 K + 1
94 92 93 syl φ 1 K + 1 = 1 X X + 1 K + 1
95 fzfid φ 1 K + 1 Fin
96 nn0cn G i 0 G i
97 80 96 syl φ i 1 K + 1 G i
98 90 94 95 97 fsumsplit φ i = 1 K + 1 G i = i = 1 X G i + i = X + 1 K + 1 G i
99 87 98 breqtrrd φ i = 1 X G i i = 1 K + 1 G i
100 6 eqcomd φ N = i = 1 K + 1 G i
101 99 100 breqtrrd φ i = 1 X G i N
102 25 55 30 60 34 101 le2addd φ X + i = 1 X G i K + N
103 2 nn0cnd φ K
104 1 nn0cnd φ N
105 103 104 addcomd φ K + N = N + K
106 102 105 breqtrd φ X + i = 1 X G i N + K
107 46 48 49 59 106 elfzd φ X + i = 1 X G i 1 N + K
108 45 107 eqeltrd φ F X 1 N + K