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(analysis/convex/topology): Separating by convex sets #11458

Closed
wants to merge 17 commits into from

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Jan 14, 2022

When s is compact, t is closed and both are convex, we can find disjoint open convex sets containing s and t.


Open in Gitpod

@YaelDillies YaelDillies added the awaiting-review The author would like community review of the PR label Jan 14, 2022
@YaelDillies YaelDillies changed the title feat({analysis/convex/topology): Separating by convex sets and thickening lemmas feat(analysis/convex/topology): Separating by convex sets and thickening lemmas Jan 14, 2022
src/data/set/basic.lean Outdated Show resolved Hide resolved
src/topology/metric_space/hausdorff_distance.lean Outdated Show resolved Hide resolved
@PatrickMassot PatrickMassot added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Jan 16, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jan 19, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jan 19, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jan 24, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jan 24, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 12, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 16, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 26, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 27, 2022
@kkytola
Copy link
Collaborator

kkytola commented Apr 16, 2022

It is true that to use this for the proof of existence of disjoint thickenings, one hits the usual ennreal-hurdles. But it does imply that result, for example as follows. I'm not sure if others would consider this satisfactory as an approach. If it is acceptable in principle, then golfing and adding ennreal-lemmas may be worthwhile.

import topology.metric_space.hausdorff_distance

open nnreal ennreal set metric emetric filter

open_locale ennreal

variables {X : Type*} [pseudo_emetric_space X]

lemma suggested_lemma (K F : set X) (K_cpt : is_compact K) (K_nonempty : K.nonempty) :
  ∃ (x ∈ K), ∀ (x' ∈ K), inf_edist x F ≤ inf_edist x' F :=
K_cpt.exists_forall_le K_nonempty (@continuous_inf_edist _ _ F).continuous_on

lemma suggested_corollary {K F : set X} (K_cpt : is_compact K) (K_nonempty : K.nonempty) (F_closed : is_closed F) (disj : K ∩ F = ∅) :
 ∃ r > 0, ∀ (x ∈ K) (y ∈ F), r ≤ edist x y :=
begin
  rcases suggested_lemma K F K_cpt K_nonempty with ⟨x₀, ⟨x₀_in_K, h⟩⟩,
  set r := inf_edist x₀ F with def_r,
  refine ⟨r, _, _⟩,
  { by_contra r_vanish,
    rw [not_lt, nonpos_iff_eq_zero] at r_vanish,
    rw r_vanish at def_r,
    have x₀_also_mem := mem_closure_iff_inf_edist_zero.mpr def_r.symm,
    rw F_closed.closure_eq at x₀_also_mem,
    have oops : x₀ ∈ K ∩ F, from ⟨x₀_in_K, x₀_also_mem⟩,
    rw disj at oops,
    exact not_mem_empty x₀ oops, },
  { intros x x_in_K y y_in_F,
    exact le_inf_edist.mp (h x x_in_K) y y_in_F, },
end

lemma exists_disjoint_thickenings {K F : set X} (K_cpt : is_compact K)
  (F_closed : is_closed F) (disj : K ∩ F = ∅) :
  ∃ δ, 0 < δ ∧ disjoint (thickening δ K) (thickening δ F) :=
begin
  by_cases K_empty : K = ∅,
  { refine ⟨1, zero_lt_one, _⟩,
    rw [K_empty, thickening_empty],
    exact (thickening 1 F).empty_disjoint, },
  have K_nonempty : K.nonempty, from ne_empty_iff_nonempty.mp K_empty,
  rcases suggested_corollary K_cpt K_nonempty F_closed disj with ⟨r, r_pos, h⟩,
  set δ := (min 1 (r/2)).to_real with def_δ,
  have δ_pos : 0 < δ,
  { -- Given r_pos and def_δ, one would expect this to be a one-liner.
    apply (to_real_lt_to_real zero_ne_top 
           (lt_of_le_of_lt (min_le_left 1 (r/2)) one_lt_top).ne).mpr,
    apply lt_min ennreal.zero_lt_one _,
    rw div_eq_mul_inv,
    exact ennreal.mul_pos (ne_of_gt r_pos) (ennreal.inv_pos.mpr two_ne_top).ne.symm, },
  have two_δ : 2 * ennreal.of_real δ ≤ r, 
  { -- Given def_δ, one would expect this to be a one-liner at most!
    have obs := (@of_real_to_real_le (min 1 (r/2))).trans (min_le_right _ _),
    rw ←def_δ at obs,
    have got_it := ennreal.mul_le_mul (show (2 : ℝ≥0∞) ≤ 2, by simp only [le_refl]) obs,
    rwa ennreal.mul_div_cancel' two_ne_zero' two_ne_top at got_it, },
  refine ⟨δ, δ_pos, _⟩,
  by_contra overlap,
  rw not_disjoint_iff_nonempty_inter at overlap,
  rcases nonempty_def.mp overlap with ⟨z, ⟨z_near_K, z_near_F⟩⟩,
  rw mem_thickening_iff_exists_edist_lt at *,
  rcases z_near_K with ⟨x, ⟨x_in_K, z_near_x⟩⟩,
  rcases z_near_F with ⟨y, ⟨y_in_F, z_near_y⟩⟩,
  have tri := edist_triangle x z y,
  rw edist_comm x z at tri,
  have oops := lt_of_le_of_lt tri (ennreal.add_lt_add z_near_x z_near_y),
  rw [← mul_two, mul_comm] at oops,
  have oh_no := lt_of_lt_of_le oops two_δ,
  exact (lt_iff_not_ge _ _).mp oh_no (h x x_in_K y y_in_F),
end

@leanprover-community-bot-assistant leanprover-community-bot-assistant added merge-conflict Please `git merge origin/master` then a bot will remove this label. and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Apr 29, 2022
@leanprover-community-bot-assistant
Copy link
Collaborator

This PR/issue depends on:

@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Apr 29, 2022
@YaelDillies YaelDillies changed the title feat(analysis/convex/topology): Separating by convex sets and thickening lemmas feat(analysis/convex/topology): Separating by convex sets Apr 29, 2022
@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR and removed help-wanted The author needs attention to resolve issues awaiting-author A reviewer has asked the author a question or requested changes labels Apr 30, 2022
src/analysis/convex/topology.lean Outdated Show resolved Hide resolved
src/topology/metric_space/hausdorff_distance.lean Outdated Show resolved Hide resolved
src/topology/metric_space/hausdorff_distance.lean Outdated Show resolved Hide resolved
src/analysis/convex/topology.lean Outdated Show resolved Hide resolved
src/analysis/convex/topology.lean Outdated Show resolved Hide resolved
@sgouezel sgouezel added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels May 3, 2022
@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels May 4, 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 May 4, 2022
bors bot pushed a commit that referenced this pull request May 4, 2022
When `s` is compact, `t` is closed and both are convex, we can find disjoint open convex sets containing `s` and `t`.
@bors
Copy link

bors bot commented May 4, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request May 4, 2022
When `s` is compact, `t` is closed and both are convex, we can find disjoint open convex sets containing `s` and `t`.
bors bot pushed a commit that referenced this pull request May 4, 2022
When `s` is compact, `t` is closed and both are convex, we can find disjoint open convex sets containing `s` and `t`.
@bors
Copy link

bors bot commented May 4, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(analysis/convex/topology): Separating by convex sets [Merged by Bors] - feat(analysis/convex/topology): Separating by convex sets May 4, 2022
@bors bors bot closed this May 4, 2022
@bors bors bot deleted the disjoint_thickenings branch May 4, 2022 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants