Fixpoint zip {X} (f1 f2 : nat -> X) n :=
  match n with
  | O => f1 O
  | S O => f2 0
  | S (S n) => zip (fun n => f1 (S n)) (fun n => f2 (S n)) n
  end.

Lemma finite_union_intersection_nat {X} (A1 A2 : X -> Prop) (P : nat -> X -> Prop) : finite (fun n => exists x, A1 x /\ P n x) -> finite (fun n => exists x, A2 x /\ P n x) -> finite (fun n => exists x, (A1 x \/ A2 x) /\ P n x).