Proof with auto.
split; intro H.
- split.
+ replace a1 with (fst (a1, b1)); replace a2 with (fst (a2, b2))...
rewrite H...
+ replace b1 with (snd (a1, b1)); replace b2 with (snd (a2, b2))...
rewrite H...
- destruct H; subst...
Qed.
Definition curry {A B C:Type} (f:A * B -> C)
(x:A) (y:B) : C := f (x,y).
Definition uncurry {A B C:Type} (f:A -> B -> C)
(p:A * B) : C := match p with (x, y) => f x y end.

Lemma rew_pair A (P Q : A->Type) x1 x2 (y1:P x1) (y2:Q x1) (H:x1=x2) :
(rew H in y1, rew H in y2) = rew [fun x => (P x * Q x)%type] H in (y1,y2).