Hint Unfold closed : topology.
Hint Resolve (@open_family_union) (@open_intersection2) open_full
open_empty (@open_union2) (@open_indexed_union)
(@open_finite_indexed_intersection) (@closed_complement_open)
(@closed_union2) (@closed_intersection2) (@closed_family_intersection)
(@closed_indexed_intersection) (@closed_finite_indexed_union)
: topology.
Section Build_from_closed_sets.
Variable X:Type.
Variable closedP : Ensemble X -> Prop.
Hypothesis closedP_empty: closedP Empty_set.
Hypothesis closedP_union2: forall F G:Ensemble X,
closedP F -> closedP G -> closedP (Union F G).
Hypothesis closedP_family_intersection: forall F:Family X,
(forall G:Ensemble X, In F G -> closedP G) ->
closedP (FamilyIntersection F).
Definition Build_TopologicalSpace_from_closed_sets : TopologicalSpace.
refine (Build_TopologicalSpace X
(fun U:Ensemble X => closedP (Ensembles.Complement U)) _ _ _).
intros.
replace (Ensembles.Complement (FamilyUnion F)) with
(FamilyIntersection [ G:Ensemble X | In F (Ensembles.Complement G) ]).
apply closedP_family_intersection.
destruct 1.
rewrite <- Complement_Complement.
apply H; trivial.
apply Extensionality_Ensembles; split; red; intros.
intro.
destruct H1.
destruct H0.
absurd (In (Ensembles.Complement S) x).
intro.
contradiction H3.
apply H0.
constructor.
rewrite Complement_Complement; trivial.
constructor.
destruct 1.
apply NNPP; intro.
contradiction H0.
exists (Ensembles.Complement S); trivial.
intros.
replace (Ensembles.Complement (Intersection U V)) with
(Union (Ensembles.Complement U) (Ensembles.Complement V)).
apply closedP_union2; trivial.
apply Extensionality_Ensembles; split; red; intros.
intro.
destruct H2.
destruct H1; contradiction H1.
apply NNPP; intro.
contradiction H1.
constructor; apply NNPP; intro; contradiction H2;
[ left | right ]; trivial.
apply eq_ind with (1 := closedP_empty).
apply Extensionality_Ensembles; split; auto with sets;
red; intros.
contradiction H.
constructor.
Defined.

Lemma Build_TopologicalSpace_from_closed_sets_closed:
forall (F:Ensemble (point_set Build_TopologicalSpace_from_closed_sets)),
closed F <-> closedP F.