Section Compatibility_of_indexed_intersections.
Variable A : Setoid.
Variable I : Setoid.
intros.
simpl in |- *.
unfold eq_part in |- *.
intros.
split.
intro.
simpl in |- *.
simpl in H0.
intro.
apply in_part_comp_r with (f i); auto.
intro.
simpl in |- *.
simpl in H0.
intro.
apply in_part_comp_r with (g i); auto.
apply Sym.
apply H.
Qed.
(** - in fact, even if only the images of the indexing functions are the same, so is their intersection (ie. the index sets $I,J$ may not be equal, but (indexing the subsets by $F$ and $G$) for all $F_i, i \in I$, there is some $G_j, j \in J$ equal to it and vice versa) *)
Variable J : Setoid.
intros.
simpl in |- *.
unfold eq_part in |- *.
intro a.
split.
simpl in |- *.
intros H0 j.
unfold image in H.
simpl in H.
unfold eq_part in H.
simpl in H.
generalize (H (g j)).
intros (H1, H2).
cut
(exists j' : J,
True /\
(forall a0 : A,
(in_part a0 (g j) -> in_part a0 (g j')) /\
(in_part a0 (g j') -> in_part a0 (g j)))).
intro.
generalize (H2 H3).
intro.
inversion_clear H4.
inversion_clear H5.
elim (H6 a).
auto.
exists j.
intuition.
simpl in |- *.
intros H0 i.
unfold image in H.
simpl in H.
unfold eq_part in H.
simpl in H.
generalize (H (f i)).
intros (H1, H2).
cut
(exists i' : I,
True /\
(forall x0 : A,
(in_part x0 (f i) -> in_part x0 (f i')) /\
(in_part x0 (f i') -> in_part x0 (f i)))).
intro.
generalize (H1 H3).
intro.
inversion_clear H4.
inversion_clear H5.
elim (H6 a).
auto.
exists i.
intuition.
Qed.
End Compatibility_of_indexed_intersections.
(** - If $I=\emptyset$ then $\bigcap_{i\in I} X_i = A$ *)

Lemma empty_indexed_intersection_gives_full_set :
forall (A : Setoid) (f : MAP (empty A) (part_set A)),
Equal (indexed_intersection f) (full A).