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.

Lemma list_in_decb_iff' (l : list X) : forall x, list_in_decb l x = false <-> not (x el l).