proposition: Theorem eq_list2 : forall (A : Type) (x : A) (l1 l2 : list A), l1 = l2 <=> length l1 = length l2 # (forall n : nat, n<length l1 -> nth n l1 x = nth n l2 x).
proof: Proof. intros. split ; introv H. eapply eq_list in H. repnd. split; auto. repnd. eapply eq_list; split; eauto. intros. assert (n < length l1 \/ length l1 <= n ) as Hdic by omega. destruct Hdic. apply H; auto. repeat (rewrite nth_overflow ); auto. rewrite <- H0; auto. Qed.
imports: UsefulTypes bin_rels Omega