proposition: Lemma replace_ok : forall (l : list A) (i : nat) (x : A), i < length l -> elemlist A (replace l i x) i = x :: nil.
proof: Proof. simple induction l. simpl in |- *. intros. absurd (i < 0). apply lt_n_O. exact H. simple induction i. intros. simpl in |- *. unfold elemlist in |- *. rewrite strip_O. simpl in |- *. rewrite trunc_O; trivial with arith. intros. simpl in |- *. clear H0. unfold elemlist in |- *. rewrite strip_cons_S. rewrite elemlist_inv. apply H. apply lt_S_n. generalize H1. simpl in |- *. trivial with arith. Qed.
imports: Lists_field