Step * 1 1 1 1 1 1 of Lemma bag-summation-append


1. Type
2. add R ⟶ R ⟶ R
3. zero R
4. Assoc(R;add)
5. Ident(R;add;zero)
6. Comm(R;add)
7. Type
8. T ⟶ R
9. ∀[x,y,z:R].  ((x add (y add z)) ((x add y) add z) ∈ R)
10. v1 R
11. as List
12. bs List
13. permutation(T;as;bs)
⊢ accumulate (with value and list item x):
   add f[x] c
  over list:
    bs
  with starting value:
   v1)
(v1 add accumulate (with value and list item x): add f[x] cover list:  bswith starting value: zero))
∈ R
BY
(ThinVar `as' THEN MoveToConcl (-1) THEN InductionOnLast THEN Reduce 0) }

1
1. Type
2. add R ⟶ R ⟶ R
3. zero R
4. Assoc(R;add)
5. Ident(R;add;zero)
6. Comm(R;add)
7. Type
8. T ⟶ R
9. ∀[x,y,z:R].  ((x add (y add z)) ((x add y) add z) ∈ R)
10. v1 R
⊢ v1 (v1 add zero) ∈ R

2
1. Type
2. add R ⟶ R ⟶ R
3. zero R
4. Assoc(R;add)
5. Ident(R;add;zero)
6. Comm(R;add)
7. Type
8. T ⟶ R
9. ∀[x,y,z:R].  ((x add (y add z)) ((x add y) add z) ∈ R)
10. v1 R
11. bs List
12. ¬↑null(bs)
13. ||bs|| ≥ 
14. accumulate (with value and list item x):
     add f[x] c
    over list:
      firstn(||bs|| 1;bs)
    with starting value:
     v1)
(v1 
   add 
   accumulate (with value and list item x):
    add f[x] c
   over list:
     firstn(||bs|| 1;bs)
   with starting value:
    zero))
∈ R
⊢ accumulate (with value and list item x):
   add f[x] c
  over list:
    firstn(||bs|| 1;bs) [last(bs)]
  with starting value:
   v1)
(v1 
   add 
   accumulate (with value and list item x):
    add f[x] c
   over list:
     firstn(||bs|| 1;bs) [last(bs)]
   with starting value:
    zero))
∈ 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.  as  :  T  List
12.  bs  :  T  List
13.  permutation(T;as;bs)
\mvdash{}  accumulate  (with  value  c  and  list  item  x):
      add  f[x]  c
    over  list:
        bs
    with  starting  value:
      v1)
=  (v1 
      add 
      accumulate  (with  value  c  and  list  item  x):
        add  f[x]  c
      over  list:
          bs
      with  starting  value:
        zero))


By


Latex:
(ThinVar  `as'  THEN  MoveToConcl  (-1)  THEN  InductionOnLast  THEN  Reduce  0)




Home Index