Zulip Chat Archive

Stream: Is there code for X?

Topic: Bound on ln (natural log)


Colin McDonagh (Jun 22 2023 at 19:46):

Hi, newb here. Looking through mathlib I can't tell if there's code for the bound on the natural logarithm (ln, not a logarithm with a base number which is a natural number):
ln x < x - 1

Rémy Degenne (Jun 22 2023 at 19:48):

docs#Real.log_le_sub_one_of_pos

Colin McDonagh (Jun 22 2023 at 19:50):

Thank you!

Scott Morrison (Jun 23 2023 at 02:03):

@Colin McDonagh, a general strategy here is:

import Mathlib

example : Real.log x  x - 1 := by apply?

which prints as the third result:

Try this: refine Real.log_le_sub_one_of_pos ?hx
Remaining subgoals:
 0 < x

and if you change the example to

example (h : 0 < x) : Real.log x  x - 1 := by apply?

you just get a single result:

Try this: exact Real.log_le_sub_one_of_pos h

Colin McDonagh (Jun 25 2023 at 10:02):

Excellent, thanks for the lesson


Last updated: Dec 20 2023 at 11:08 UTC