We would like to prove that for all ns and m, foldl (+) m ns = m + sum ns. We shall proceed by induction on ns. In other words, we prove that the property holds for the empty list, and holds for n:ns whenever it holds for ns.
First, let's see the empty list, and let m be an arbitrary number. Our goal is to prove foldl (+) m [] = m + sum []. There are many ways to do this, but we will proceed by transforming the left side of the equation into the right side by equational reasoning.
foldl (+) m [] -- by definition of foldl
m -- by right identity of addition
m + 0 -- by the definition of sum
m + sum [] -- QED
Now for the (:) case. Let our list be n:ns. Suppose that the property holds for ns for any m (this is the induction hypothesis). Our goal is to prove foldl (+) m (n:ns) = m + sum (n:ns). Again, we use equational reasoning.
foldl (+) m (n:ns) -- by the definition of foldl
foldl (+) (m + n) ns -- by the induction hypothesis, applied to (m + n)
(m + n) + sum ns -- by associativity of addition
m + (n + sum ns) -- by the definition of sum
m + sum (n:ns) -- QED
And we're done.
A common issue among new students of proof writing is that they're not sure if what they're doing actually makes sense, and this makes them nervous. I recommend taking a look at proof assistants such as Agda or Coq. They are excellent for building proof-writing skill. As a small example of Agda, the above proof can be written very similarly there, with some syntactic differences:
-- imports omitted
prop : forall m ns → foldl (_+_) m ns ≡ m + sum ns
prop m [] = begin
foldl (_+_) m [] ≡⟨⟩
m ≡⟨ sym $ +-right-identity m ⟩
m + 0 ≡⟨⟩
m + sum [] ∎
prop m (x ∷ ns) = begin
foldl _+_ m (x ∷ ns) ≡⟨⟩
foldl _+_ (m + x) ns ≡⟨ prop (m + x) ns ⟩
(m + x) + sum ns ≡⟨ +-assoc m x (sum ns) ⟩
m + (x + sum ns) ≡⟨⟩
m + sum (x ∷ ns) ∎
my_prefix inconsistently. You should edit your question to remove them all, I guess. - chi