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/special_functions): real.log is infinitely smooth away from zero #5116

Closed
wants to merge 21 commits into from

Conversation

urkud
Copy link
Member

@urkud urkud commented Nov 25, 2020

@urkud urkud added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Nov 25, 2020
@hrmacbeth
Copy link
Member

Since you're taking this opportunity to do a general refactor of log, I wanted to discuss what the cleanest way is to set up this and similar functions. You're deriving the main properties from strict_mono_incr_on.continuous_at, but it should also be possible to do it by analogy with the method for arctan (#4138), which uses homeomorph_of_strict_mono_continuous_Ioo.
I think the homeomorph_of_strict_mono_continuous_Ioo method slightly reduces code duplication, by eliminating the need for lemmas like tendsto_log_at_top (or rather, permitting them to be deduced from general theory for the inverses of monotone functions). Alternatively we could refactor arctan to follow the method you take here. What do you think?

@urkud
Copy link
Member Author

urkud commented Nov 27, 2020

I have a refactor of arcsin and arctan in https://github.com/leanprover-community/mathlib/blob/arcsin-redefine/src/analysis/special_functions/trigonometric.lean
I use an order_iso and the corresponding homeomorph to define the inverse function. Possibly I should redefine log in the same way: define exp_order_iso : \R ≃o Ioi 0, then take the inverse.

@hrmacbeth
Copy link
Member

I use an order_iso and the corresponding homeomorph to define the inverse function.

Ah, fantastic!

Possibly I should redefine log in the same way: define exp_order_iso : \R ≃o Ioi 0, then take the inverse.

In my opinion that is definitely the most elegant method. If you have the energy, that would be great! I guess it requires one of the other 9^2 variants of surj_on_Ioo_of_continuous_on, namely

lemma surj_on_Ioi_of_continuous_on' {f : α → β} {a : β}
  (hf : continuous f) (h_top : tendsto f at_top at_top)
  (h_bot : tendsto f at_bot (𝓝[Ioi a] a)) :
  surj_on f univ (Ioi a) :=

@hrmacbeth
Copy link
Member

If I understand correctly, that would allow you to slim down #5111, since order_iso.to_homeomorph would be the only theorem required for external purposes (no need for strict_mono_incr_on.continuous_at, which you're currently using for log). And I think that in such a slimmed-down version, there could be a very direct proof of order_iso.to_homeomorph, essentially by noting that an order isomorphism induces an isomorphism of the order topology.

On the other hand, maybe it's worth keeping the local results such as strict_mono_incr_on.continuous_at, even if they're not used elsewhere. What do you think?

@urkud
Copy link
Member Author

urkud commented Nov 27, 2020

I would prefer to keep local results. I have no particular applications in mind right now but I don't want to prove them once more when they will be needed. UPD: I already have a use case for a local lemma.

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 3, 2020
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 3, 2020
@urkud urkud removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Dec 3, 2020
@urkud urkud added the awaiting-review The author would like community review of the PR label Dec 4, 2020
Copy link
Member

@hrmacbeth hrmacbeth left a comment

Choose a reason for hiding this comment

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

Looks good to me. Since the redefinition of log is a moderately fundamental change (a big improvement in my opinion!), let's leave the PR open for a day or so, for greater visibility?

src/analysis/special_functions/exp_log.lean Show resolved Hide resolved
Comment on lines +497 to +498
@[simp] lemma differentiable_at_log_iff : differentiable_at ℝ log x ↔ x ≠ 0 :=
⟨λ h, continuous_at_log_iff.1 h.continuous_at, differentiable_at_log⟩
Copy link
Member

Choose a reason for hiding this comment

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

Last time I looked, we didn't have the analogue of this and the next lemma in other cases where they would be useful: x⁻¹, tan, etc. Note to self: add them!

src/analysis/special_functions/exp_log.lean Outdated Show resolved Hide resolved
@hrmacbeth hrmacbeth 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 Dec 5, 2020
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 5, 2020
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 6, 2020
@urkud urkud added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Dec 6, 2020
urkud and others added 2 commits December 6, 2020 00:16
Co-authored-by: hrmacbeth <25316162+hrmacbeth@users.noreply.github.com>
@urkud urkud 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 Dec 7, 2020
Copy link
Member

@hrmacbeth hrmacbeth left a comment

Choose a reason for hiding this comment

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

Thank you for adding the filter lemmas! These last two are basically aesthetic suggestions, up to you whether to implement them.

bors d+

src/analysis/special_functions/exp_log.lean Show resolved Hide resolved
Comment on lines 472 to 473
simpa [(∘)] using (tendsto_neg_at_top_at_bot.comp $ tendsto_log_at_top.comp
tendsto_inv_zero_at_top).comp this
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
simpa [(∘)] using (tendsto_neg_at_top_at_bot.comp $ tendsto_log_at_top.comp
tendsto_inv_zero_at_top).comp this
have h : tendsto log (𝓝[set.Ioi 0] 0) at_bot :=
tendsto_comp_exp_at_bot.1 (by simpa only [log_exp] using tendsto_id),
simpa [(∘)] using h.comp this,

I think you don't need this particular trick (inverting and re-inverting). My suggestion is still longer than yours with the trick, but maybe you can golf it ...

@bors
Copy link

bors bot commented Dec 8, 2020

✌️ urkud can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@urkud urkud removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Dec 8, 2020
@urkud
Copy link
Member Author

urkud commented Dec 9, 2020

bors merge

@github-actions github-actions bot 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 Dec 9, 2020
bors bot pushed a commit that referenced this pull request Dec 9, 2020
…y from zero (#5116)

Also redefine it using `order_iso.to_homeomorph` and prove more lemmas about limits of `exp`/`log`.
@bors
Copy link

bors bot commented Dec 9, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(analysis/special_functions): real.log is infinitely smooth away from zero [Merged by Bors] - feat(analysis/special_functions): real.log is infinitely smooth away from zero Dec 9, 2020
@bors bors bot closed this Dec 9, 2020
@bors bors bot deleted the log-tcd2 branch December 9, 2020 07:37
@urkud urkud restored the log-tcd2 branch October 29, 2023 14:57
@urkud urkud deleted the log-tcd2 branch October 29, 2023 14: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

2 participants