Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue creating simple topological space #32

Open
siraben opened this issue Jul 31, 2021 · 6 comments
Open

Issue creating simple topological space #32

siraben opened this issue Jul 31, 2021 · 6 comments

Comments

@siraben
Copy link
Member

siraben commented Jul 31, 2021

I want to create a very simple topological space on X={a,b,c} with the open sets T={{b},{b,c},{a,b},X,∅}, but I'm having great difficulty in doing so (code below). In particular, I'm stuck on this goal (see the location of admit in the code):

1 subgoal (ID 70)
  
  F : Family X
  HF : forall S : Ensemble X, In F S -> T S
  ============================
  T (FamilyUnion F)

also, is there a way to perform reflection on Ensembles to discharge the easy proof about being closed under finite intersections?

From Topology Require Import TopologicalSpaces.
Require Import Ensembles.

Section TopSpaceEx1.

Inductive X : Type := a | b | c.
From ZornsLemma Require Export EnsemblesImplicit.

Definition T (x : Ensemble X) : Prop := Same_set x (Singleton b)
                                  \/ Same_set x (Couple b c)
                                  \/ Same_set x (Couple a b)
                                  \/ Same_set x Full_set.
Ltac destruct_ensembles_in :=
 match goal with
   | [H : Ensembles.In _ _ |- _] => destruct H
 end.

Ltac destruct_ensembles :=
  split; red; intros;
    repeat destruct_ensembles_in.

Ltac inversion_ensembles_in :=
 match goal with
   | [H : Ensembles.In _ _ |- _] => inversion H; clear H
 end.

Ltac ensembles_inv :=
  let x := fresh "x" in
  let H := fresh "H" in
  split; red; intros x H; destruct x;
    repeat inversion_ensembles_in.

Lemma T_is_topology : TopologicalSpace.
Proof with auto with sets.
refine (Build_TopologicalSpace X T _ _ ltac:(firstorder)).
- intros F HF.
  admit.
- intros.
  destruct H as [? | [? | [? | ?]]];
  destruct H0 as [? | [? | [? | ?]]];
  apply Extensionality_Ensembles in H;
  apply Extensionality_Ensembles in H0; subst; unfold T.
  + left...
  + left; repeat destruct_ensembles; constructor.
  + left; repeat destruct_ensembles; constructor.
  + left; repeat destruct_ensembles; constructor.
  + left; repeat destruct_ensembles; constructor.
  + right; left; repeat destruct_ensembles; constructor.
  + left; ensembles_inv...
  + right; left; repeat destruct_ensembles; constructor.
  + left; repeat destruct_ensembles; constructor.
  + left; ensembles_inv...
  + right; right; left...
  + right; right; left; repeat destruct_ensembles; constructor.
  + left; red; repeat destruct_ensembles; constructor.
  + right; left; repeat destruct_ensembles; constructor.
  + right; right; left; repeat destruct_ensembles; constructor.
  + right; right; right...
Admitted.

End TopSpaceEx1.
@stop-cran
Copy link
Collaborator

According to the definition the reduced goal is:

Same_set (FamilyUnion F) (Singleton b) \/
Same_set (FamilyUnion F) (Couple b c) \/ Same_set (FamilyUnion F) (Couple a b) \/ Same_set (FamilyUnion F) Full_set

So we just need a classical choice on whether a, b, and c are in the set:

destruct (classic (In (FamilyUnion F) a)), (classic (In (FamilyUnion F) b)), (classic (In (FamilyUnion F) c)).

Thus you gain 8 subgoals, each of them is pretty straightforward.

@siraben
Copy link
Member Author

siraben commented Aug 2, 2021

Thanks, that helps but I have the following goal which seems impossible:

  F : Family X
  HF : forall S : Ensemble X, In F S -> T S
  H : In (FamilyUnion F) a
  H0 : ~ In (FamilyUnion F) b
  H1 : In (FamilyUnion F) c
  ============================
  Same_set (FamilyUnion F) (Singleton b) \/
  Same_set (FamilyUnion F) (Couple b c) \/
  Same_set (FamilyUnion F) (Couple a b) \/
  Same_set (FamilyUnion F) Full_set

@stop-cran
Copy link
Collaborator

stop-cran commented Aug 3, 2021

As any topology, T should include Empty_set. Adding it solves the problem:

From Coq Require Import Ensembles.
From ZornsLemma Require Import EnsemblesTactics.
From Topology Require Import TopologicalSpaces.

Section TopSpaceEx1.

Inductive X : Type := a | b | c.

Definition T (x : Ensemble X) : Prop := Same_set x Empty_set
                                     \/ Same_set x (Singleton b)
                                     \/ Same_set x (Couple b c)
                                     \/ Same_set x (Couple a b)
                                     \/ Same_set x Full_set.

Ltac split_destruct_x :=
split; red; intros x ?; destruct x.

Ltac destruct_or :=
repeat match goal with
   | [H: _ \/ _ |- _] => destruct H as [H | H]
   | [H: Same_set _ _ |- _] => apply Extensionality_Ensembles in H
end; subst.

Ltac firstorder_or tac :=
match goal with
   | [ |- _ \/ _] => try (left; firstorder_or tac); try (right; firstorder_or tac)
   | _ => tac; fail
end. 

Lemma T_is_topology : TopologicalSpace.
Proof.
refine (Build_TopologicalSpace X T _ _ ltac:(firstorder));
  intros; unfold T in *.
- destruct (classic (In (FamilyUnion F) a)),
           (classic (In (FamilyUnion F) b)),
           (classic (In (FamilyUnion F) c));
    firstorder_or ltac:(split_destruct_x; easy + constructor);
    match goal with
       | [HH: In _ _ |- _] => inversion HH
    end;
    pose proof (H _ H3);
    destruct_or;
    easy + contradict H1;
    repeat (econstructor + eassumption).
- destruct_or;
    firstorder_or ltac:(now repeat (split_destruct_x; inversion_ensembles_in) + constructor).
Qed.

End TopSpaceEx1.

@siraben
Copy link
Member Author

siraben commented Aug 4, 2021

Ah, interesting. I assumed that adding the empty set would be redundant because this was already proven in TopologicalSpaces.v

Lemma open_empty: forall X:TopologicalSpace, open (@Empty_set X).

@stop-cran
Copy link
Collaborator

open_empty implies T is topology, which implies that it contains Empty_set.
However, one don't need an empty set in a base. For the topology above there exists a base consisting of Singleton b, Couple a b and Couple b c. By the way, building the same topology from base looks easier:

From Coq Require Import Ensembles.
From ZornsLemma Require Import EnsemblesTactics.
From Topology Require Import TopologicalSpaces OpenBases.

Section TopSpaceEx1.

Inductive X : Type := a | b | c.

Ltac destruct_or :=
repeat match goal with
   | [H: _ \/ _ |- _] => destruct H as [H | H]
   | [H: Same_set _ _ |- _] => apply Extensionality_Ensembles in H
end; subst.

Definition B (x : Ensemble X) : Prop := Same_set x (Singleton b)
                                     \/ Same_set x (Couple b c)
                                     \/ Same_set x (Couple a b).

Lemma B_couple_a : forall W, In W a -> In B W -> W = (Couple a b).
Proof.
intros.
extensionality_ensembles_inv;
  destruct_or;
  try apply Extensionality_Ensembles in H2;
  subst;
  try destruct H1;
  easy + right.
Qed.

Lemma B_couple_c : forall W, In W c -> In B W -> W = (Couple b c).
Proof.
intros.
extensionality_ensembles_inv;
  destruct_or;
  try apply Extensionality_Ensembles in H2;
  subst;
  try destruct H1;
  easy + left.
Qed.

Lemma B_is_basis : TopologicalSpace.
Proof.
refine (Build_TopologicalSpace_from_open_basis B _ _);
  red; intros;
  try destruct H1;
  destruct x.
- rewrite (B_couple_a _ H1 H), (B_couple_a _ H2 H0).
  exists (Couple a b).
  repeat split; trivial + (do 3 constructor);
  now red; intros.
- exists (Singleton b).
  repeat split;
    try now destruct H3.
  left.
  now split; red; intros.
- rewrite (B_couple_c _ H1 H), (B_couple_c _ H2 H0).
  exists (Couple b c).
  repeat split; trivial + (do 3 constructor);
  now red; intros.
- exists (Couple a b).
  now repeat (right + constructor).
- exists (Singleton b).
  now repeat constructor.
- exists (Couple b c).
  now repeat (right + constructor).
Qed.

End TopSpaceEx1.

@Columbus240
Copy link
Collaborator

Constructing the topological space from a subbasis should be even easier, because subbases don't have to satisfy any conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants