Metamath Proof Explorer


Theorem bj-finsumval0

Description: Value of a finite sum. (Contributed by BJ, 9-Jun-2019) (Proof shortened by AV, 5-May-2021)

Ref Expression
Hypotheses bj-finsumval0.1 φ A CMnd
bj-finsumval0.2 φ I Fin
bj-finsumval0.3 φ B : I Base A
Assertion bj-finsumval0 φ A FinSum B = ι s | m 0 f f : 1 m 1-1 onto I s = seq 1 + A n B f n I

Proof

Step Hyp Ref Expression
1 bj-finsumval0.1 φ A CMnd
2 bj-finsumval0.2 φ I Fin
3 bj-finsumval0.3 φ B : I Base A
4 df-ov A FinSum B = FinSum A B
5 df-bj-finsum FinSum = x y z | y CMnd t Fin z : t Base y ι s | m 0 f f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m
6 simpr φ x = A B x = A B
7 6 fveq2d φ x = A B 1 st x = 1 st A B
8 1 adantr φ x = A B A CMnd
9 3 2 fexd φ B V
10 9 adantr φ x = A B B V
11 op1stg A CMnd B V 1 st A B = A
12 8 10 11 syl2anc φ x = A B 1 st A B = A
13 7 12 eqtrd φ x = A B 1 st x = A
14 6 fveq2d φ x = A B 2 nd x = 2 nd A B
15 op2ndg A CMnd B V 2 nd A B = B
16 8 10 15 syl2anc φ x = A B 2 nd A B = B
17 14 16 eqtrd φ x = A B 2 nd x = B
18 17 dmeqd φ x = A B dom 2 nd x = dom B
19 3 fdmd φ dom B = I
20 19 adantr φ x = A B dom B = I
21 18 20 eqtrd φ x = A B dom 2 nd x = I
22 f1oeq3 dom 2 nd x = I f : 1 m 1-1 onto dom 2 nd x f : 1 m 1-1 onto I
23 22 biimpd dom 2 nd x = I f : 1 m 1-1 onto dom 2 nd x f : 1 m 1-1 onto I
24 23 ad2antll 1 st x = A 2 nd x = B dom 2 nd x = I f : 1 m 1-1 onto dom 2 nd x f : 1 m 1-1 onto I
25 24 adantrd 1 st x = A 2 nd x = B dom 2 nd x = I f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f : 1 m 1-1 onto I
26 25 adantr 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f : 1 m 1-1 onto I
27 eqidd f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 1 = 1
28 simprl f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I 1 st x = A
29 28 fveq2d f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I + 1 st x = + A
30 29 adantrr f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 + 1 st x = + A
31 simprrl f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I 2 nd x = B
32 31 adantr f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I n 2 nd x = B
33 32 fveq1d f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I n 2 nd x f n = B f n
34 33 mpteq2dva f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I n 2 nd x f n = n B f n
35 34 adantrr f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 n 2 nd x f n = n B f n
36 27 30 35 seqeq123d f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 seq 1 + 1 st x n 2 nd x f n = seq 1 + A n B f n
37 simprr 1 st x = A 2 nd x = B dom 2 nd x = I dom 2 nd x = I
38 37 anim1ci 1 st x = A 2 nd x = B dom 2 nd x = I m 0 m 0 dom 2 nd x = I
39 hashfz1 m 0 1 m = m
40 39 eqcomd m 0 m = 1 m
41 40 ad2antrl f : 1 m 1-1 onto dom 2 nd x m 0 dom 2 nd x = I m = 1 m
42 fzfid f : 1 m 1-1 onto dom 2 nd x m 0 dom 2 nd x = I 1 m Fin
43 19.8a f : 1 m 1-1 onto dom 2 nd x f f : 1 m 1-1 onto dom 2 nd x
44 43 adantr f : 1 m 1-1 onto dom 2 nd x m 0 dom 2 nd x = I f f : 1 m 1-1 onto dom 2 nd x
45 hasheqf1oi 1 m Fin f f : 1 m 1-1 onto dom 2 nd x 1 m = dom 2 nd x
46 42 44 45 sylc f : 1 m 1-1 onto dom 2 nd x m 0 dom 2 nd x = I 1 m = dom 2 nd x
47 simprr f : 1 m 1-1 onto dom 2 nd x m 0 dom 2 nd x = I dom 2 nd x = I
48 47 fveq2d f : 1 m 1-1 onto dom 2 nd x m 0 dom 2 nd x = I dom 2 nd x = I
49 41 46 48 3eqtrd f : 1 m 1-1 onto dom 2 nd x m 0 dom 2 nd x = I m = I
50 38 49 sylan2 f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 m = I
51 36 50 fveq12d f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 seq 1 + 1 st x n 2 nd x f n m = seq 1 + A n B f n I
52 51 eqeq2d f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 s = seq 1 + 1 st x n 2 nd x f n m s = seq 1 + A n B f n I
53 52 biimpd f : 1 m 1-1 onto dom 2 nd x 1 st x = A 2 nd x = B dom 2 nd x = I m 0 s = seq 1 + 1 st x n 2 nd x f n m s = seq 1 + A n B f n I
54 53 impancom f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m 1 st x = A 2 nd x = B dom 2 nd x = I m 0 s = seq 1 + A n B f n I
55 54 com12 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m s = seq 1 + A n B f n I
56 26 55 jcad 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f : 1 m 1-1 onto I s = seq 1 + A n B f n I
57 22 biimprd dom 2 nd x = I f : 1 m 1-1 onto I f : 1 m 1-1 onto dom 2 nd x
58 57 ad2antll 1 st x = A 2 nd x = B dom 2 nd x = I f : 1 m 1-1 onto I f : 1 m 1-1 onto dom 2 nd x
59 58 adantr 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto I f : 1 m 1-1 onto dom 2 nd x
60 59 adantrd 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto I s = seq 1 + A n B f n I f : 1 m 1-1 onto dom 2 nd x
61 eqidd f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 1 = 1
62 simpl 1 st x = A 2 nd x = B dom 2 nd x = I 1 st x = A
63 tru
64 62 63 jctir 1 st x = A 2 nd x = B dom 2 nd x = I 1 st x = A
65 64 ad2antrl f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 1 st x = A
66 simpl 1 st x = A 1 st x = A
67 66 eqcomd 1 st x = A A = 1 st x
68 65 67 syl f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 A = 1 st x
69 68 fveq2d f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 + A = + 1 st x
70 simpl 2 nd x = B dom 2 nd x = I 2 nd x = B
71 70 eqcomd 2 nd x = B dom 2 nd x = I B = 2 nd x
72 71 ad2antll f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I B = 2 nd x
73 72 adantr f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I n B = 2 nd x
74 73 fveq1d f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I n B f n = 2 nd x f n
75 74 adantlrr f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 n B f n = 2 nd x f n
76 75 mpteq2dva f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 n B f n = n 2 nd x f n
77 61 69 76 seqeq123d f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 seq 1 + A n B f n = seq 1 + 1 st x n 2 nd x f n
78 59 impcom f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto dom 2 nd x
79 simprr f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 m 0
80 37 ad2antrl f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 dom 2 nd x = I
81 78 79 80 49 syl12anc f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 m = I
82 81 eqcomd f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 I = m
83 77 82 fveq12d f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 seq 1 + A n B f n I = seq 1 + 1 st x n 2 nd x f n m
84 83 eqeq2d f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 s = seq 1 + A n B f n I s = seq 1 + 1 st x n 2 nd x f n m
85 84 biimpd f : 1 m 1-1 onto I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 s = seq 1 + A n B f n I s = seq 1 + 1 st x n 2 nd x f n m
86 85 impancom f : 1 m 1-1 onto I s = seq 1 + A n B f n I 1 st x = A 2 nd x = B dom 2 nd x = I m 0 s = seq 1 + 1 st x n 2 nd x f n m
87 86 com12 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto I s = seq 1 + A n B f n I s = seq 1 + 1 st x n 2 nd x f n m
88 60 87 jcad 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto I s = seq 1 + A n B f n I f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m
89 56 88 impbid 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f : 1 m 1-1 onto I s = seq 1 + A n B f n I
90 89 ex 1 st x = A 2 nd x = B dom 2 nd x = I m 0 f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f : 1 m 1-1 onto I s = seq 1 + A n B f n I
91 13 17 21 90 syl12anc φ x = A B m 0 f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f : 1 m 1-1 onto I s = seq 1 + A n B f n I
92 91 imp φ x = A B m 0 f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f : 1 m 1-1 onto I s = seq 1 + A n B f n I
93 92 exbidv φ x = A B m 0 f f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m f f : 1 m 1-1 onto I s = seq 1 + A n B f n I
94 93 rexbidva φ x = A B m 0 f f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m m 0 f f : 1 m 1-1 onto I s = seq 1 + A n B f n I
95 94 iotabidv φ x = A B ι s | m 0 f f : 1 m 1-1 onto dom 2 nd x s = seq 1 + 1 st x n 2 nd x f n m = ι s | m 0 f f : 1 m 1-1 onto I s = seq 1 + A n B f n I
96 eleq1 t = I t Fin I Fin
97 feq2 t = I B : t Base A B : I Base A
98 96 97 anbi12d t = I t Fin B : t Base A I Fin B : I Base A
99 98 ceqsexgv I Fin t t = I t Fin B : t Base A I Fin B : I Base A
100 2 99 syl φ t t = I t Fin B : t Base A I Fin B : I Base A
101 2 3 100 mpbir2and φ t t = I t Fin B : t Base A
102 exsimpr t t = I t Fin B : t Base A t t Fin B : t Base A
103 101 102 syl φ t t Fin B : t Base A
104 df-rex t Fin B : t Base A t t Fin B : t Base A
105 103 104 sylibr φ t Fin B : t Base A
106 eleq1 y = A y CMnd A CMnd
107 fveq2 y = A Base y = Base A
108 107 feq3d y = A z : t Base y z : t Base A
109 108 rexbidv y = A t Fin z : t Base y t Fin z : t Base A
110 106 109 anbi12d y = A y CMnd t Fin z : t Base y A CMnd t Fin z : t Base A
111 feq1 z = B z : t Base A B : t Base A
112 111 rexbidv z = B t Fin z : t Base A t Fin B : t Base A
113 112 anbi2d z = B A CMnd t Fin z : t Base A A CMnd t Fin B : t Base A
114 110 113 opelopabg A CMnd B V A B y z | y CMnd t Fin z : t Base y A CMnd t Fin B : t Base A
115 1 9 114 syl2anc φ A B y z | y CMnd t Fin z : t Base y A CMnd t Fin B : t Base A
116 1 105 115 mpbir2and φ A B y z | y CMnd t Fin z : t Base y
117 iotaex ι s | m 0 f f : 1 m 1-1 onto I s = seq 1 + A n B f n I V
118 117 a1i φ ι s | m 0 f f : 1 m 1-1 onto I s = seq 1 + A n B f n I V
119 5 95 116 118 fvmptd2 φ FinSum A B = ι s | m 0 f f : 1 m 1-1 onto I s = seq 1 + A n B f n I
120 4 119 eqtrid φ A FinSum B = ι s | m 0 f f : 1 m 1-1 onto I s = seq 1 + A n B f n I