Section indexed_int.
Variable A : Setoid.
Variable I : Setoid.
Variable f : MAP I (part_set A). (* Picks A_i for i\in I *)
(** - so, given an index set $I$ and an indexing function $f$ mapping this set to the part_set (powerset) of X,  (ie. $f(i) = A_i\ (\in (part\_set A))$,) then (indexed_intersection f) will be $\bigcap_{i\in I} A_i$. *)
Definition indexed_intersection : part_set A.
simpl in |- *.
apply
(Build_Predicate (Pred_fun:=fun a : A => forall i : I, in_part a (f i))).
red in |- *.
intros.
apply in_part_comp_l with x.
apply H.
assumption.
Defined.
intro.
red in |- *.
intros.
unfold indexed_intersection in H.
simpl in H.
apply H.
Qed.
intros.
unfold indexed_intersection in H.
simpl in H.
apply H.
Qed.
intros.
unfold indexed_intersection in |- *.
simpl in |- *.
assumption.
Qed.
intros.
inversion H.
simpl in |- *.
intro.
apply H0.
apply H1.
Qed.
intros.
simpl in H.
apply (not_all_ex_not I (fun i : I => in_part a (f i))).
assumption.
Qed.

(* if one of the A_i is contained in some subset B, then so is the intersection *)
Lemma subset_included_then_indexed_intersection_included :
forall B : part_set A,
(exists i : I, included (f i) B) -> included indexed_intersection B.