Section BasicLemmas.
Variable X Y: Type.
Implicit Type f: X -> Y.
Implicit Type p: X -> bool.
Implicit Type A B C : list X.
Implicit Type a b c : X.
Global Instance proper_in_incl: Proper (eq ++> incl ==> Basics.impl) (@In X).
Global Instance in_seteq_proper: Proper (eq ++> seteq ++> iff) (@In X).
(* ⊆ *)
Global Instance subrel_incl_seteq: subrelation seteq (@incl X).
End WellFoundedStrictInclusion.
(* app *)
Global Instance proper_app_incl: Proper (incl ++> incl ++> incl) (@app X).
Global Instance proper_app_seteq: Proper (seteq ++> seteq ++> seteq) (@app X).
Hint Rewrite app_nil_l app_nil_r : listdb.
Hint Rewrite <- app_comm_cons : listdb.
Hint Rewrite -> in_app_iff : listdb.
Global Instance proper_incl_seteq: Proper (@seteq X ++> @seteq X ++> iff) incl.
Global Instance proper_rev_incl: Proper (incl ++> incl) (@rev X).
Global Instance proper_rev_seteq: Proper (seteq ++> seteq) (@rev X).
Hint Rewrite rev_seteq rev_involutive rev_length rev_app_distr : listdb.
Global Instance map_incl_proper : Proper (eq ++> incl ++> incl) (@map Y X).
Global Instance map_seteq_proper : Proper (eq ++> seteq ++> seteq) (@map Y X).
Hint Rewrite map_id map_rev map_nil map_cons map_app map_length : listdb.
Hint Resolve in_map : listdb.
(* length *)
Hint Rewrite app_length map_length rev_length : listdb.

(* filter *)
Lemma filter_length p A: length (filter p A) <= length A.