Section BuildFromOpenBasis.
Variable X : Type.
Variable B : Family X.
Definition open_basis_cond :=
forall U V:Ensemble X, In B U -> In B V ->
forall x:X, In (Intersection U V) x ->
exists W:Ensemble X, In B W /\ In W x /\
Included W (Intersection U V).
Definition open_basis_cover_cond :=
forall x:X, exists U:Ensemble X, In B U /\ In U x.
Hypothesis Hbasis : open_basis_cond.
Hypothesis Hbasis_cover: open_basis_cover_cond.
Inductive B_open : Ensemble X -> Prop :=
| B_open_intro: forall F:Family X, Included F B ->
B_open (FamilyUnion F).
Definition Build_TopologicalSpace_from_open_basis : TopologicalSpace.
refine (Build_TopologicalSpace X B_open _ _ _).
- intros.
pose proof (choice (fun (x:{S:Ensemble X | In F S}) (F:Family X) =>
Included F B /\ proj1_sig x = FamilyUnion F)).
unshelve refine (let H1:=(H0 _) in _); [ | clearbody H1 ].
+ intros.
destruct x.
pose proof (H x i).
destruct H1.
exists F0.
now split.
+ clear H0.
destruct H1.
replace (FamilyUnion F) with (FamilyUnion (IndexedUnion x)).
* constructor.
red. intros.
destruct H1.
pose proof (H0 a).
destruct H2.
auto with sets.
* extensionality_ensembles.
** destruct (H0 a), a.
simpl in H4.
exists x2; trivial.
rewrite H4.
now exists x1.
** destruct (H0 (exist _ _ H1)).
simpl in H4.
rewrite H4 in H2.
destruct H2.
constructor 1 with S0; trivial.
now exists (exist _ _ H1).
- intros.
replace (Intersection U V) with (FamilyUnion
[ S:Ensemble X | In B S /\ Included S (Intersection U V) ]).
+ constructor.
red. intros.
destruct H1.
destruct H1.
auto.
+ extensionality_ensembles.
* destruct H1.
auto.
* destruct H.
destruct H0.
destruct H1.
destruct H2.
pose proof (H _ H1).
pose proof (H0 _ H2).
pose proof (Hbasis _ _ H5 H6).
assert (In (Intersection S S0) x) by
now constructor.
apply H7 in H8.
clear H7.
destruct H8, H7 as [? [? ?]].
exists x0; trivial.
constructor.
split; trivial.
red. intros.
constructor.
** exists S; trivial.
now destruct (H9 x1 H10).
** destruct (H9 x1 H10).
econstructor; eassumption.
- replace Full_set with (FamilyUnion B).
+ constructor.
auto with sets.
+ extensionality_ensembles.
* constructor.
* destruct (Hbasis_cover x), H.
now exists x0.
Defined.

Lemma Build_TopologicalSpace_from_open_basis_point_set:
point_set Build_TopologicalSpace_from_open_basis = X.