Zulip Chat Archive
Stream: Is there code for X?
Topic: nat.log is monotonically decreasing on its first argument
Joanna Choules (Oct 04 2021 at 09:12):
I've been able to write my own proof of
lemma log_le_log_of_left_ge {b c n : ℕ} (hc : c > 1) (hb : b ≥ c) : nat.log b n ≤ nat.log c n
since I couldn't find one in mathlib, but I wanted to check whether it is already there and I just missed it.
Kevin Buzzard (Oct 04 2021 at 09:14):
We may have (or be close to having) the word antitone
to mean this, so that's what to search for (if the PR hit)
Johan Commelin (Oct 04 2021 at 09:16):
It should be in this file https://github.com/leanprover-community/mathlib/blob/master/src/data/nat/log.lean if it is there.
Johan Commelin (Oct 04 2021 at 09:16):
Doesn't seem the case, so please PR it!
Kevin Buzzard (Oct 04 2021 at 09:16):
But to answer your question, we may well not have it. My instinct would be to prove the Galois connection if we don't already have it: b^t <= n iff t <= log_b n: for fixed b, b^ and log_b are a Galois connection
Johan Commelin (Oct 04 2021 at 09:17):
We do have that: docs#nat.pow_le_iff_le_log
Kevin Buzzard (Oct 04 2021 at 09:18):
Why "almost" in the docstring? Oh, because 0<y maybe? So it's a Galois connection on pnat :-/
Johan Commelin (Oct 04 2021 at 09:18):
I guess so
Joanna Choules (Oct 04 2021 at 09:19):
I did use the Galois connection in my proof, yeah.
Kevin Buzzard (Oct 04 2021 at 09:19):
Nice!
Kevin Buzzard (Oct 04 2021 at 09:20):
Are you happy to PR it? If so then the simplest way is for you to do it is to ask for PR access for non-master branches of mathlib, if you don't have it already.
Joanna Choules (Oct 04 2021 at 09:21):
I am happy to, yeah. I don't think I have such access yet as I've not previously submitted any PRs.
Johan Commelin (Oct 04 2021 at 09:22):
@Joanna Choules What is your github username?
Joanna Choules (Oct 04 2021 at 09:23):
It's jchoules
Johan Commelin (Oct 04 2021 at 09:23):
https://github.com/leanprover-community/mathlib/invitations
Joanna Choules (Oct 04 2021 at 09:23):
Thank you!
Kevin Buzzard (Oct 04 2021 at 09:27):
Cheat sheet: https://leanprover-community.github.io/contribute/index.html
Kevin Buzzard (Oct 04 2021 at 09:27):
Feel free to ask if you have any questions
Yaël Dillies (Oct 04 2021 at 09:48):
Yeah! I didn't prove that one, so feel free to PR it.
Joanna Choules (Oct 04 2021 at 10:20):
I need to do some tidying (and prove the analogous lemma for clog
while I'm at it - might as well), but I should be able to get it PR'd within the next day or so I think.
Yaël Dillies (Oct 04 2021 at 10:23):
Feel free to request a review from me then :wink:
Last updated: Dec 20 2023 at 11:08 UTC