Corollary sum_0: forall n, sum (repeat 0 n) = 0.Corollary sum_1: forall n, sum (repeat 1 n) = Z.of_nat n.

Lemma upd_Znth_sum: forall l i n, 0 <= i < Zlength l -> sum (upd_Znth i l n) = sum l + n - Znth i l.