induction ls; intuition; simpl in *.
case_eq (eqbPair eqda eqdb (a0, b1) (a, b0)); intuition.
exfalso.
unfold eqbPair in *.
simpl in *.
apply andb_true_iff in H0.
intuition.
rewrite eqb_leibniz in H1.
subst.
eapply H.
left.
reflexivity.
trivial.
eauto.
Qed.

Theorem arrayLookup_pair_flatten_none :
forall (A B C : Set)(eqda : EqDec A)(eqdb : EqDec B) keys (ls : list (list (A * B * C))) a b,
list_pred (fun a b => forall x, In x b -> fst (fst x) = a) keys ls ->
(~ In a keys) ->
arrayLookup (pair_EqDec eqda eqdb) (flatten ls) (a, b) = None.