-
Notifications
You must be signed in to change notification settings - Fork 299
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
Conversation
src/topology/connected.lean
Outdated
|
||
/-- A set `s` is preconnected if and only if every | ||
map into `bool` that is continuous on `s` is constant on `s` -/ | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
Build failed: |
bors r- |
bors r+ |
bors r- |
Canceled. |
src/topology/connected.lean
Outdated
/-- A set `s` is preconnected if and only if every | ||
map into `bool` that is continuous on `s` is constant on `s` -/ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks!
s.bool_indicator ⁻¹' t = sᶜ ∨ s.bool_indicator ⁻¹' t = ∅ := | ||
begin | ||
simp only [preimage_bool_indicator_eq_union], | ||
split_ifs ; simp [s.union_compl_self] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 := |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
).
/-- `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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
bors merge |
…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>
Pull request successfully merged into master. Build succeeded: |
What about my comments? 😢 |
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.