intuition.
unfold arrayUpdate.
simpl.
case_eq (eqb p2 p1); intuition.
rewrite eqb_leibniz in H0.
subst.
intuition.
Qed.
End ListArray.
(* Some notation for array lookups *)
Notation "f '#' i " := (arrayLookup _ f i) (at level 70) : array_scope.
Local Open Scope array_scope.
(* A special case for array lookup when the range is lists -- returns nil instead of None when not found.  This is useful for multidimensional arrays. *)
Definition arrayLookupList(A B : Set)(eqd : EqDec A)(ls : list (A * (list B)))(a : A) :=
match (arrayLookup _ ls a) with
| None => nil
| Some ls => ls
end.

Lemma arrayLookup_Some_In_unzip :
forall (A B : Set)(eqd : EqDec A)(arr : Array A B) a b,
(arr # a) = Some b ->
In a (fst (unzip arr)).