Metamath Proof Explorer


Theorem smupvallem

Description: If A only has elements less than N , then all elements of the partial sum sequence past N already equal the final value. (Contributed by Mario Carneiro, 20-Sep-2016)

Ref Expression
Hypotheses smuval.a φ A 0
smuval.b φ B 0
smuval.p P = seq 0 p 𝒫 0 , m 0 p sadd n 0 | m A n m B n 0 if n = 0 n 1
smuval.n φ N 0
smupvallem.a φ A 0 ..^ N
smupvallem.m φ M N
Assertion smupvallem φ P M = A smul B

Proof

Step Hyp Ref Expression
1 smuval.a φ A 0
2 smuval.b φ B 0
3 smuval.p P = seq 0 p 𝒫 0 , m 0 p sadd n 0 | m A n m B n 0 if n = 0 n 1
4 smuval.n φ N 0
5 smupvallem.a φ A 0 ..^ N
6 smupvallem.m φ M N
7 1 2 3 smupf φ P : 0 𝒫 0
8 eluznn0 N 0 M N M 0
9 4 6 8 syl2anc φ M 0
10 7 9 ffvelrnd φ P M 𝒫 0
11 10 elpwid φ P M 0
12 11 sseld φ k P M k 0
13 1 2 3 smufval φ A smul B = k 0 | k P k + 1
14 ssrab2 k 0 | k P k + 1 0
15 13 14 eqsstrdi φ A smul B 0
16 15 sseld φ k A smul B k 0
17 1 ad2antrr φ k 0 N k + 1 A 0
18 2 ad2antrr φ k 0 N k + 1 B 0
19 simplr φ k 0 N k + 1 k 0
20 6 adantr φ k 0 M N
21 uztrn M N N k + 1 M k + 1
22 20 21 sylan φ k 0 N k + 1 M k + 1
23 17 18 3 19 22 smuval2 φ k 0 N k + 1 k A smul B k P M
24 23 bicomd φ k 0 N k + 1 k P M k A smul B
25 6 ad2antrr φ k 0 k + 1 N M N
26 simpll φ k 0 k + 1 N φ
27 fveqeq2 x = N P x = P N P N = P N
28 27 imbi2d x = N φ P x = P N φ P N = P N
29 fveqeq2 x = k P x = P N P k = P N
30 29 imbi2d x = k φ P x = P N φ P k = P N
31 fveqeq2 x = k + 1 P x = P N P k + 1 = P N
32 31 imbi2d x = k + 1 φ P x = P N φ P k + 1 = P N
33 fveqeq2 x = M P x = P N P M = P N
34 33 imbi2d x = M φ P x = P N φ P M = P N
35 eqidd φ P N = P N
36 1 adantr φ k N A 0
37 2 adantr φ k N B 0
38 eluznn0 N 0 k N k 0
39 4 38 sylan φ k N k 0
40 36 37 3 39 smupp1 φ k N P k + 1 = P k sadd n 0 | k A n k B
41 4 nn0red φ N
42 41 adantr φ k N N
43 39 nn0red φ k N k
44 eluzle k N N k
45 44 adantl φ k N N k
46 42 43 45 lensymd φ k N ¬ k < N
47 5 adantr φ k N A 0 ..^ N
48 47 sseld φ k N k A k 0 ..^ N
49 elfzolt2 k 0 ..^ N k < N
50 48 49 syl6 φ k N k A k < N
51 50 adantrd φ k N k A n k B k < N
52 46 51 mtod φ k N ¬ k A n k B
53 52 ralrimivw φ k N n 0 ¬ k A n k B
54 rabeq0 n 0 | k A n k B = n 0 ¬ k A n k B
55 53 54 sylibr φ k N n 0 | k A n k B =
56 55 oveq2d φ k N P k sadd n 0 | k A n k B = P k sadd
57 7 adantr φ k N P : 0 𝒫 0
58 57 39 ffvelrnd φ k N P k 𝒫 0
59 58 elpwid φ k N P k 0
60 sadid1 P k 0 P k sadd = P k
61 59 60 syl φ k N P k sadd = P k
62 40 56 61 3eqtrd φ k N P k + 1 = P k
63 62 eqeq1d φ k N P k + 1 = P N P k = P N
64 63 biimprd φ k N P k = P N P k + 1 = P N
65 64 expcom k N φ P k = P N P k + 1 = P N
66 65 a2d k N φ P k = P N φ P k + 1 = P N
67 28 30 32 34 35 66 uzind4i M N φ P M = P N
68 25 26 67 sylc φ k 0 k + 1 N P M = P N
69 simpr φ k 0 k + 1 N k + 1 N
70 28 30 32 32 35 66 uzind4i k + 1 N φ P k + 1 = P N
71 69 26 70 sylc φ k 0 k + 1 N P k + 1 = P N
72 68 71 eqtr4d φ k 0 k + 1 N P M = P k + 1
73 72 eleq2d φ k 0 k + 1 N k P M k P k + 1
74 1 ad2antrr φ k 0 k + 1 N A 0
75 2 ad2antrr φ k 0 k + 1 N B 0
76 simplr φ k 0 k + 1 N k 0
77 74 75 3 76 smuval φ k 0 k + 1 N k A smul B k P k + 1
78 73 77 bitr4d φ k 0 k + 1 N k P M k A smul B
79 simpr φ k 0 k 0
80 79 nn0zd φ k 0 k
81 80 peano2zd φ k 0 k + 1
82 4 nn0zd φ N
83 82 adantr φ k 0 N
84 uztric k + 1 N N k + 1 k + 1 N
85 81 83 84 syl2anc φ k 0 N k + 1 k + 1 N
86 24 78 85 mpjaodan φ k 0 k P M k A smul B
87 86 ex φ k 0 k P M k A smul B
88 12 16 87 pm5.21ndd φ k P M k A smul B
89 88 eqrdv φ P M = A smul B