Section list_in.
Variable (X : Type).
Variable (eqb : X -> X -> bool).
Variable eqb_correct : forall a b,  a = b <-> eqb a b = true.
Definition list_in_decb := fix rec (l : list X) (x : X) : bool :=
match l with [] => false
| (l :: ls) => eqb l x || rec ls x
end.
Proof using eqb_correct.
intros x. induction l.
- cbn. firstorder.
- split.
+ intros [H1 | H1]%orb_true_elim. left. now apply eqb_correct.
apply IHl in H1. now right.
+ intros [H | H].
cbn. apply orb_true_intro; left; now apply eqb_correct.
cbn. apply orb_true_intro; right; now apply IHl.
Qed.
Proof using eqb_correct.
intros x. split.
- intros H H'. apply list_in_decb_iff in H'. congruence.
- intros H'. destruct (list_in_decb l x) eqn:H.
+ now apply list_in_decb_iff in H.
+ reflexivity.
Qed.
Fixpoint list_incl_decb (a b : list X) :=
match a with
| [] => true
| (x::a) => list_in_decb b x && list_incl_decb a b
end.

Lemma list_incl_decb_iff (a b : list X) : a <<= b <-> list_incl_decb a b = true.