pply comp_spec_eq_refl.

  Qed.


  Fixpoint findCollision_1 (A B : Set)(eqda : EqDec A)(eqdb : EqDec B)(ls : list (A * B))(a : A)(b : B) :=
    match ls with
      | nil => None
      | (a', b') :: ls' => if(eqb b b' && (negb (eqb a a')))
        then (Some a') else (findCollision_1 _ _ ls' a b)
    end.Definition collidesWith (A B : Set)(eqda : EqDec A)(eqdb : EqDec B)(ls : list (A * B))(a : A) b :=
    if (findCollision_1 _ _ ls a b) then true else false.

  Fixpoint findCollision(A B : Set)(eqda : EqDec A)(eqdb : EqDec B)(ls : list (A * B)) : option (A * A * B) :=
    match ls with
      | nil => None
      | (a, b) :: ls' => let a' := (findCollision_1 _ _ ls' a b) in
        match a' with
          | None =>  (findCollision _ _ ls')| Some p' => Some (a, p', b)
        end
    end.

(* Specifications: *)
ret (b, funcCollision _ _ (fst (split f))). Theorem arrayLookup_noCollision_eq : forall (A B C : Set)(eqda : EqDec A)(eqdb : EqDec B)(x1 : list ((A * B) * C)) a b0 b, arrayLookup _ x1 (a, b) = Some
Qed. Theorem in_impl_collidesWith : forall (A B : Set)(eqda : EqDec A)(eqdb : EqDec B)(ls : list (A * B))(a a': A) (b : B), In (a, b) ls ->
Qed. Theorem funcCollision_false_impl_collidesWith_false : forall (A B : Set)(eqda : EqDec A)(eqdb : EqDec B) ls (a : A) (b : B), funcCollision _ _ ls = false ->
Theorem arrayLookup_Some_In_split:
Qed. Theorem arrayLookup_noCollision_eq_f : forall (A B C : Set)(eqda : EqDec A)(eqdb : EqDec B)(x1 : list ((A * B) * C)) (a : A) (b : B) c, arrayLookup_f _ x1 b = Some c ->
Qed. Theorem funcCollision_true_cons : forall (A B : Set)(eqda : EqDec A)(eq
Qed. Theorem F_randomFunc_preserves_coll : forall c0 x d a b0, funcCollision _ _ (fst (split c0)) = true
Qed. Theorem randomFunc_mem_preserves_coll : forall (D1 D2 R : Set)(eqdd : EqDec D1)(eqdd2 : EqDec D2)(eqdr : EqDec R) (RndR : Comp R) (c0 : list ((D1 * D2) * R)) d a b0, funcCollision _ _ (fst (split c0)) = true
Qed. Theorem F_randomFunc_wf :
Qed. Theorem randomFunc_mem_wf : forall (A B : Set) x y z (w : list (A * B)) v,
destruct p. simpl in *. Theorem findCollision_1_correct : forall (A B : Set) eqd1 eqd2 (ls : list (A * B)) (x1 x2 : A) y, findCollision_1
Qed. Theorem findCollision_correct : forall (A B : Set) eqd1 eqd2 (ls : list (A * B)) (x1 x2 : A) y, findCollision eqd1 eqd2 ls = Some (x1, x2,
ret (b, funcCollision _ _ (fst (split f))). Theorem arrayLookup_noCollision_eq : forall (A B C : Set)(eqda : EqDec A)(eqdb : EqDec B)(x1 : list ((A * B) * C)) a b0 b, arrayLookup _ x1 (a, b) = Some
Qed. Theorem in_impl_collidesWith : forall (A B : Set)(eqda : EqDec A)(eqdb : EqDec B)(ls : list (A * B))(a a': A) (b : B), In (a, b) ls ->
Qed. Theorem funcCollision_false_impl_collidesWith_false : forall (A B : Set)(eqda : EqDec A)(eqdb : EqDec B) ls (a : A) (b : B), funcCollision _ _ ls = false ->
Theorem arrayLookup_Some_In_split:
Qed. Theorem arrayLookup_noCollision_eq_f : forall (A B C : Set)(eqda : EqDec A)(eqdb : EqDec B)(x1 : list ((A * B) * C)) (a : A) (b : B) c, arrayLookup_f _ x1 b = Some c ->
Qed. Theorem funcCollision_true_cons : forall (A B : Set)(eqda : EqDec A)(eq
Qed. Theorem F_randomFunc_preserves_coll : forall c0 x d a b0, funcCollision _ _ (fst (split c0)) = true
Qed. Theorem randomFunc_mem_preserves_coll : forall (D1 D2 R : Set)(eqdd : EqDec D1)(eqdd2 : EqDec D2)(eqdr : EqDec R) (RndR : Comp R) (c0 : list ((D1 * D2) * R)) d a b0, funcCollision _ _ (fst (split c0)) = true
Qed. Theorem F_randomFunc_wf :
Qed. Theorem randomFunc_mem_wf : forall (A B : Set) x y z (w : list (A * B)) v,
Qed. Theorem findCollision_1_correct : forall (A B : Set) eqd1 eqd2 (ls : list (A * B)) (x1 x2 : A) y, findCollision_1
Qed. Theorem findCollision_correct : forall (A B : Set) eqd1 eqd2 (ls : list (A * B)) (x1 x2 : A) y, findCollision eqd1 eqd2 ls = Some (x1, x2,