induction n. intros v Z. simpl. auto.
intros v Z.
apply Trans with (nsum(S n)(v(Build_finiteT(lt_O_Sn n));;Seqtl v)).
apply nsum_comp. apply conseq_hdtl. unfold nsum. fold nsum.
apply Trans with (head v+nsum n(Seqtl(v(Build_finiteT(lt_O_Sn n));;Seqtl v))).
apply pluscomp2. simpl. unfold head. auto.
apply Trans with (0+nsum n(Seqtl(v(Build_finiteT(lt_O_Sn n));;Seqtl v))).
apply pluscomp2. unfold head. apply Z. rewrite plus_0_l.
apply Trans with (nsum n(Seqtl v)). apply nsum_comp.
change (Seqtl(v(Build_finiteT(lt_O_Sn n));;Seqtl v) =' Seqtl v).
apply Seqtl_comp. apply Sym. apply conseq_hdtl.
apply IHn. destruct i.
apply Trans with (v(Build_finiteT(lt_n_S index n in_range_prf))).
apply (Seqtl_to_seq v). apply Z. Qed.

Lemma undo_modify:forall(c:Nat)(Q:seq c Nat)(i:fin c)(z:Nat),
modify_seq (modify_seq Q i z) i (Q i) =' Q.