Arguments Build_Filter_from_basis {X}.
From ZornsLemma Require Export FiniteTypes.
From ZornsLemma Require Export IndexedFamilies.
Record filter_subbasis {X:Type} (F:Filter X) (B:Family X) : Prop := {
filter_subbasis_elements: Included B (filter_family F);
filter_subbasis_cond: forall S:Ensemble X,
In (filter_family F) S -> exists J:Type, FiniteT J /\
exists T:J->Ensemble X,
(forall j:J, In B (T j)) /\
Included (IndexedIntersection T) S
}.
Section filter_from_subbasis.
Variable X:Type.
Variable B:Family X.
Hypothesis B_subbasis_cond: forall (J:Type) (V:J->Ensemble X),
FiniteT J -> (forall j:J, In B (V j)) ->
Inhabited (IndexedIntersection V).
Definition Build_Filter_from_subbasis: Filter X.
refine (Build_Filter_from_basis (finite_intersections B) _ _ _).
exists Full_set.
constructor.
red; intro.
pose proof (finite_intersection_is_finite_indexed_intersection _ _ H).
destruct H0 as [J [? [V []]]].
assert (Inhabited (IndexedIntersection V)).
apply B_subbasis_cond; trivial.
rewrite <- H2 in H3.
destruct H3.
destruct H3.
intros.
exists (Intersection S1 S2); split; auto with sets.
constructor 3; trivial.
Defined.

(* Specifications: *)
Lemma filter_from_subbasis_subbasis:
filter_subbasis Build_Filter_from_subbasis B.