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

refactor(calculus): simplify derivative extension #1826

Merged
merged 5 commits into from
Dec 27, 2019
Merged

Conversation

PatrickMassot
Copy link
Member

This is the PR promised in the #1794 discussion. Sébastien used sequences to prove a derivative extension lemma. The main point of the current PR us to make sure the library allows a sequence-free proof. Recall the main lemma replacing the use of sequences in topology is

lemma image_closure_subset_closure_image {f : α → β} {s : set α} (h : continuous f) :
  f '' closure s ⊆ closure (f '' s)

from here. Here we need a version with weaker assumptions. This PR introduces:

lemma continuous_within_at.image_closure {f : α → β} {s : set α}
  (hf : ∀ x ∈ closure s, continuous_within_at f s x) :
  f '' (closure s) ⊆ closure (f '' s)

which is a tiny repackaging of an existing lemma. I also added a lemma about ordered topologies with similar weak assumptions:

lemma continuous_within_at.closure_le  {f g : β → α} {s : set β}
 (hf : ∀ x ∈ closure s, continuous_within_at f s x) (hg : ∀ x ∈ closure s, continuous_within_at g s x)
 (h : ∀ x ∈ s, f x ≤ g x) : ∀ x ∈ closure s, f x ≤ g x

for which I couldn't find a good name.
Using those two lemmas indeed simplifies the derivative extension main lemma (at least if you like that kind of proof).

@@ -96,6 +96,22 @@ lemma closure_lt_subset_le [topological_space β] {f g : β → α} (hf : contin
closure {b | f b < g b} ⊆ {b | f b ≤ g b} :=
by { rw [←closure_le_eq hf hg], exact closure_mono (λ b, le_of_lt) }

lemma continuous_within_at.closure_le [topological_space β]
Copy link
Collaborator

Choose a reason for hiding this comment

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

To obtain f x ≤ g x at a given x in the closure of s, you only need the continuity of f and g at this specific x. So, I think a statement involving one fixed x and assumptions continuous_within_at f s x, continuous_within_at g s x and x ∈ closure s would be more natural.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I fixed that. But maybe I'm having too much fun with filters in the new proof...

change ψ x ∈ H,
suffices : ψ x ∈ closure H,
by rwa ← (closure_eq_iff_is_closed.2 (ordered_topology.is_closed_le' α) : closure H = H),
rw [closure_eq_nhds, mem_set_of_eq] at *,
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 you can take a shortcut by using continuous_within_at.mem_closure_image here. Possibly with the following version that could be worth adding just below continuous_within_at.mem_closure_image.

lemma continuous_within_at.mem_closure {f : α → β} {s : set α} {x : α} {A : set β}
  (h : continuous_within_at f s x) (hx : x ∈ closure s) (hA : s ⊆ f⁻¹' A) : f x ∈ closure A :=
closure_mono (image_subset_iff.2 hA) (h.mem_closure_image hx)

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice! I've done it.

@sgouezel sgouezel added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Dec 27, 2019

lemma continuous_within_at.image_closure {f : α → β} {s : set α}
(hf : ∀ x ∈ closure s, continuous_within_at f s x) :
f '' (closure s) ⊆ closure (f '' s) :=
Copy link
Member

Choose a reason for hiding this comment

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

Do we have continuous_on.image_closure assuming is_closed s and continuous_on f s?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so.

@mergify mergify bot merged commit 82ca731 into master Dec 27, 2019
@mergify mergify bot deleted the extend-deriv branch December 27, 2019 18:12
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…ty#1826)

* refactor(calculus): simplify derivative extension

* generalize continuous_within_at.closure_le

* Simplify proof following Sébastien

* Update src/analysis/calculus/extend_deriv.lean

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
…ty#1826)

* refactor(calculus): simplify derivative extension

* generalize continuous_within_at.closure_le

* Simplify proof following Sébastien

* Update src/analysis/calculus/extend_deriv.lean

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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

3 participants