(** ** Specific filters *)

(** Filters for pairs *)

Inductive filter_prod {T U : Type} (F G : _ -> Prop) (P : T * U -> Prop) : Prop :=
  Filter_prod (Q : T -> Prop) (R : U -> Prop) :
    F Q -> G R -> (forall x y, Q x -> R y -> P (x, y)) -> filter_prod F G P.(** ** Specific filters *)

(** Filters for pairs *)

Inductive filter_prod {T U : Type} (F G : _ -> Prop) (P : T * U -> Prop) : Prop :=
  Filter_prod (Q : T -> Prop) (R : U -> Prop) :
    F Q -> G R -> (forall x y, Q x -> R y -> P (x, y)) -> filter_prod F G P.Global Instance filter_prod_filter :
  forall T U (F : (T -> Prop) -> Prop) (G : (U -> Prop) -> Prop),
  Filter F -> Filter G -> Filter (filter_prod F G).Global Instance filter_prod_proper' {T1 T2 : Type}
  {F : (T1 -> Prop) -> Prop} {G : (T2 -> Prop) -> Prop}
  {FF : ProperFilter' F} {FG : ProperFilter' G} :
  ProperFilter' (filter_prod F G).Global Instance filter_prod_proper {T1 T2 : Type}
  {F : (T1 -> Prop) -> Prop} {G : (T2 -> Prop) -> Prop}
  {FF : ProperFilter F} {FG : ProperFilter G} :
  ProperFilter (filter_prod F G).

(* Specifications: *)
Lemma filterlim_fst : forall {T U F G} {FG : Filter G}, filterlim (@fst T U) (filter_prod F G) F.
Lemma filterlim_snd : forall {T U F G} {FF : Filter F}, filterlim (@snd T U) (filter_prod F G) G.
Lemma filterlim_pair : forall {T U V F G H} {FF : Filter F}, forall (f : T -> U) (g : T -> V), filterlim f F G -> filterlim g F H -> filterlim (fun x => (f x, g x)) F (filter_prod G H).
Lemma filterlim_comp_2 : forall {T U V W F G H I} {FF : Filter F}, forall (f : T -> U) (g : T -> V) (h : U -> V -> W), filterlim f F G -> filterlim g F H -> filterlim (fun x => h (fst x) (snd x)) (filter_prod G H) I -> filterlim (fun x => h (f x) (g x)) F I.
Lemma filterlimi_comp_2 : forall {T U V W F G H I} {FF : Filter F}, forall (f : T -> U) (g : T -> V) (h : U -> V -> W -> Prop), filterlim f F G -> filterlim g F H -> filterlimi (fun x => h (fst x) (snd x)) (filter_prod G H) I -> filterlimi (fun x => h (f x) (g x)) F I.