Section assoc.
Fixpoint assoc {A B : Type}(eq : A -> A -> bool)(x : A)(l : list (A * B)) : option B :=
match l with
| nil => None
| (x', y) :: l' => if eq x x' then Some y else assoc eq x l'
end.
Definition assoc_default {A B : Type}
(eqA : A -> A -> bool) (d : B) (l : list (A * B)) (x : A) : B :=
match assoc eqA x l with
| None => d
| Some b => b
end.
(* not an iff. There might be l' before l with (k, v') in it *)
End assoc.
Fixpoint andl (l : list Prop) : Prop :=
match l with
| nil => True
| P :: l' => P /\ andl l'
end.
Fixpoint orl (l : list Prop) : Prop :=
match l with
| nil => False
| P :: l' => P \/ orl l'
end.

Lemma orl_map (A : Type) (P : A -> Prop) l : orl (map P l) <-> exists x, In x l /\ P x.