Step * of Lemma sum-as-accum2

[n:ℕ]. ∀[f:ℕn ⟶ ℤ].
  (f[x] x < n) accumulate (with value and list item y):
                      f[y]
                     over list:
                       upto(n)
                     with starting value:
                      0))
BY
(InductionOnNat
   THEN Auto
   THEN ((RWO "sum-unroll" THENA Auto)
         THEN (Reduce THEN Auto)
         THEN (InstHyp [⌜f⌝(-2)⋅ THENA Auto)
         THEN (RWO "upto_decomp1" THENA Auto)
         THEN (RWW "map_append_sq list_accum_append" THENA Auto)
         THEN HypSubst (-1) 0
         THEN Reduce 0
         THEN Auto)⋅}


Latex:


Latex:
\mforall{}[n:\mBbbN{}].  \mforall{}[f:\mBbbN{}n  {}\mrightarrow{}  \mBbbZ{}].
    (\mSigma{}(f[x]  |  x  <  n)  \msim{}  accumulate  (with  value  x  and  list  item  y):
                                            x  +  f[y]
                                          over  list:
                                              upto(n)
                                          with  starting  value:
                                            0))


By


Latex:
(InductionOnNat
  THEN  Auto
  THEN  ((RWO  "sum-unroll"  0  THENA  Auto)
              THEN  (Reduce  0  THEN  Auto)
              THEN  (InstHyp  [\mkleeneopen{}f\mkleeneclose{}]  (-2)\mcdot{}  THENA  Auto)
              THEN  (RWO  "upto\_decomp1"  0  THENA  Auto)
              THEN  (RWW  "map\_append\_sq  list\_accum\_append"  0  THENA  Auto)
              THEN  HypSubst  (-1)  0
              THEN  Reduce  0
              THEN  Auto)\mcdot{})




Home Index