Require Coq.Classes.EquivDec.
Require ExtLib.Data.Nat.
Set Implicit Arguments.
Set Strict Implicit.
Section type.
Variable T : Type.
Context {type_T : type T}.
Inductive list_eq : list T -> list T -> Prop :=
| nil_eq : list_eq nil nil
| cons_eq : forall x xs y ys, equal x y -> list_eq xs ys -> list_eq (x :: xs) (y :: ys).
Instance type_list : type (list T) :=
{ equal := list_eq
; proper := Forall proper
}.
Context {typeOk_T : typeOk type_T}.
Instance typeOk_list : typeOk type_list.
End type.
Section EqDec.
Variable T : Type.
Variable EqDec_T : EquivDec.EqDec _ (@eq T).
Global Instance EqDec_list : EquivDec.EqDec _ (@eq (list T)).
End EqDec.

(* Specialized induction rules *)
Lemma list_ind_singleton
: forall {T : Type} (P : list T -> Prop)
(Hnil : P nil)
(Hsingle : forall t, P (t :: nil))
(Hcons : forall t u us, P (u :: us) -> P (t :: u :: us)),
forall ls, P ls.