Step
*
1
1
1
1
1
1
2
1
1
of Lemma
bag-summation-append
1. R : Type
2. add : R ⟶ R ⟶ R
3. zero : R
4. Assoc(R;add)
5. Ident(R;add;zero)
6. Comm(R;add)
7. T : Type
8. f : T ⟶ R
9. ∀[x,y,z:R].  ((x add (y add z)) = ((x add y) add z) ∈ R)
10. v1 : R
11. bs : T List
12. ¬↑null(bs)
13. ||bs|| ≥ 1 
14. accumulate (with value c and list item x):
     add f[x] c
    over list:
      firstn(||bs|| - 1;bs)
    with starting value:
     v1)
= (v1 
   add 
   accumulate (with value c and list item x):
    add f[x] c
   over list:
     firstn(||bs|| - 1;bs)
   with starting value:
    zero))
∈ R
15. v : R
16. accumulate (with value c and list item x):
     add f[x] c
    over list:
      firstn(||bs|| - 1;bs)
    with starting value:
     zero)
= v
∈ R
⊢ (add f[last(bs)] (v1 add v)) = (v1 add (add f[last(bs)] v)) ∈ R
BY
{ (GenConcl ⌜f[last(bs)] = x ∈ R⌝⋅ THEN Auto) }
1
1. R : Type
2. add : R ⟶ R ⟶ R
3. zero : R
4. Assoc(R;add)
5. Ident(R;add;zero)
6. Comm(R;add)
7. T : Type
8. f : T ⟶ R
9. ∀[x,y,z:R].  ((x add (y add z)) = ((x add y) add z) ∈ R)
10. v1 : R
11. bs : T List
12. ¬↑null(bs)
13. ||bs|| ≥ 1 
14. accumulate (with value c and list item x):
     add f[x] c
    over list:
      firstn(||bs|| - 1;bs)
    with starting value:
     v1)
= (v1 
   add 
   accumulate (with value c and list item x):
    add f[x] c
   over list:
     firstn(||bs|| - 1;bs)
   with starting value:
    zero))
∈ R
15. v : R
16. accumulate (with value c and list item x):
     add f[x] c
    over list:
      firstn(||bs|| - 1;bs)
    with starting value:
     zero)
= v
∈ R
17. x : R
18. f[last(bs)] = x ∈ R
⊢ (add x (v1 add v)) = (v1 add (add x v)) ∈ R
Latex:
Latex:
1.  R  :  Type
2.  add  :  R  {}\mrightarrow{}  R  {}\mrightarrow{}  R
3.  zero  :  R
4.  Assoc(R;add)
5.  Ident(R;add;zero)
6.  Comm(R;add)
7.  T  :  Type
8.  f  :  T  {}\mrightarrow{}  R
9.  \mforall{}[x,y,z:R].    ((x  add  (y  add  z))  =  ((x  add  y)  add  z))
10.  v1  :  R
11.  bs  :  T  List
12.  \mneg{}\muparrow{}null(bs)
13.  ||bs||  \mgeq{}  1 
14.  accumulate  (with  value  c  and  list  item  x):
          add  f[x]  c
        over  list:
            firstn(||bs||  -  1;bs)
        with  starting  value:
          v1)
=  (v1 
      add 
      accumulate  (with  value  c  and  list  item  x):
        add  f[x]  c
      over  list:
          firstn(||bs||  -  1;bs)
      with  starting  value:
        zero))
15.  v  :  R
16.  accumulate  (with  value  c  and  list  item  x):
          add  f[x]  c
        over  list:
            firstn(||bs||  -  1;bs)
        with  starting  value:
          zero)
=  v
\mvdash{}  (add  f[last(bs)]  (v1  add  v))  =  (v1  add  (add  f[last(bs)]  v))
By
Latex:
(GenConcl  \mkleeneopen{}f[last(bs)]  =  x\mkleeneclose{}\mcdot{}  THEN  Auto)
Home
Index