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

[Merged by Bors] - feat(data/set/basic, topology/{subset_properties, connected}): A space is preconnected iff every continuous map to a discrete space is constant #17070

Closed
wants to merge 5 commits into from

Conversation

dagurtomas
Copy link
Collaborator

@dagurtomas dagurtomas commented Oct 19, 2022

This useful characterisation was missing from mathlib.

Co-authored-by: Patrick Massot patrick.massot@math.cnrs.fr


Closes #16974 by completely redoing it as suggested by Patrick Massot.

Open in Gitpod

@dagurtomas dagurtomas added awaiting-review The author would like community review of the PR t-topology Topological spaces, uniform spaces, metric spaces, filters labels Oct 19, 2022
@dagurtomas dagurtomas changed the title Characterisation of connectedness in terms of continuous maps into discrete spaces feat(data.set.basic, topology.{subset_properties, connected}): prove a space is preconnected iff every continuous map to a discrete space is constant Oct 19, 2022

/-- A set `s` is preconnected if and only if every
map into `bool` that is continuous on `s` is constant on `s` -/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line should be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also fixed the style errors that linter complained about.

@ADedecker ADedecker self-assigned this Oct 20, 2022
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🎉

bors merge

@leanprover-community-bot-assistant leanprover-community-bot-assistant added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Oct 21, 2022
bors bot pushed a commit that referenced this pull request Oct 21, 2022
… a space is preconnected iff every continuous map to a discrete space is constant (#17070)

This useful characterisation was missing from mathlib. 
Closes #16974 by completely redoing it as suggested by Patrick Massot. 

Co-authored-by: Patrick Massot <patrick.massot@math.cnrs.fr>
@bors
Copy link

bors bot commented Oct 21, 2022

Build failed:

@sgouezel
Copy link
Collaborator

bors r-

@sgouezel
Copy link
Collaborator

bors r+

@sgouezel
Copy link
Collaborator

bors r-

@bors
Copy link

bors bot commented Oct 21, 2022

Canceled.

Comment on lines 1551 to 1552
/-- A set `s` is preconnected if and only if every
map into `bool` that is continuous on `s` is constant on `s` -/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring does not correspond to the content of the lemma. Docstrings appear as documentation attached to one single lemma, so you should give a docstring for this lemma adapated to its content, and another docstring for the next lemma.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks!

@ADedecker ADedecker removed their assignment Oct 21, 2022
@YaelDillies YaelDillies changed the title feat(data.set.basic, topology.{subset_properties, connected}): prove a space is preconnected iff every continuous map to a discrete space is constant feat(data/set/basic, topology/{subset_properties, connected}): A space is preconnected iff every continuous map to a discrete space is constant Oct 23, 2022
s.bool_indicator ⁻¹' t = sᶜ ∨ s.bool_indicator ⁻¹' t = ∅ :=
begin
simp only [preimage_bool_indicator_eq_union],
split_ifs ; simp [s.union_compl_self]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
split_ifs ; simp [s.union_compl_self]
split_ifs; simp [s.union_compl_self]

/-- If every map to `bool` (a discrete two-element space), that is
continuous on a set `s`, is constant on s, then s is preconnected -/
lemma is_preconnected_of_forall_constant {s : set α}
(hs : ∀ f : α → bool, continuous_on f s → ∀ x ∈ s, ∀ y ∈ s, f x = f y) : is_preconnected s :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you state this for all nontrivial spaces with the discrete topology, rather than just bool?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can even be generalized to any space that is not preconnected. But bool is the simplest such space so it's nice to state the result using it. The general proof pretty much reduces to the bool case (pick one point in a clopen set and one point outside of it, then the subspace of these two points is homeomorphic to bool).

Comment on lines +2958 to +2960
/-- `bool_indicator` maps `x` to `tt` if `x ∈ s`, else to `ff` -/
noncomputable def bool_indicator (x : α) :=
@ite _ (x ∈ s) (classical.prop_decidable _) tt ff
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you generalise according to my previous comment, you won't need this anymore.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because bool is the simplest non-preconnected space, having an indicator function valued in bool is convenient. I thought about making a local has_zero bool instance and define bool_indicator in terms of set.indicator, or at least deduce lemmas from the set.indicator counterparts to reduces duplication, but it seems not many of them can be easily deduced, and the API for bool_indicator is sufficiently distinct from set.indicator to deserve a separate declaration. So I'm satisfied with the current situation.

@PatrickMassot
Copy link
Member

bors merge

bors bot pushed a commit that referenced this pull request Oct 23, 2022
…ce is preconnected iff every continuous map to a discrete space is constant (#17070)

This useful characterisation was missing from mathlib.

Co-authored-by: Patrick Massot <patrick.massot@math.cnrs.fr>
@bors
Copy link

bors bot commented Oct 24, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/set/basic, topology/{subset_properties, connected}): A space is preconnected iff every continuous map to a discrete space is constant [Merged by Bors] - feat(data/set/basic, topology/{subset_properties, connected}): A space is preconnected iff every continuous map to a discrete space is constant Oct 24, 2022
@bors bors bot closed this Oct 24, 2022
@bors bors bot deleted the connected-discrete branch October 24, 2022 01:07
@YaelDillies
Copy link
Collaborator

What about my comments? 😢

@eric-wieser eric-wieser added the hacktoberfest-accepted Without this label hacktoberfest is scared off by bors label Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Without this label hacktoberfest is scared off by bors ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-topology Topological spaces, uniform spaces, metric spaces, filters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants