Step * 1 1 1 1 1 1 2 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. 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
BY
(((RWO "list_accum_append" THEN Auto) THEN Reduce 0) THEN HypSubst (-1) THEN Auto) }

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
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
⊢ (add f[last(bs)] 
   (v1 
    add 
    accumulate (with value and list item x):
     add f[x] c
    over list:
      firstn(||bs|| 1;bs)
    with starting value:
     zero)))
(v1 
   add 
   (add f[last(bs)] 
    accumulate (with value and list item x):
     add f[x] c
    over list:
      firstn(||bs|| 1;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.  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))
\mvdash{}  accumulate  (with  value  c  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  c  and  list  item  x):
        add  f[x]  c
      over  list:
          firstn(||bs||  -  1;bs)  @  [last(bs)]
      with  starting  value:
        zero))


By


Latex:
(((RWO  "list\_accum\_append"  0  THEN  Auto)  THEN  Reduce  0)  THEN  HypSubst  (-1)  0  THEN  Auto)




Home Index