Real logarithm #
In this file we define Real.log
to be the logarithm of a real number. As usual, we extend it from
its domain (0, +∞)
to a globally defined function. We choose to do it so that log 0 = 0
and
log (-x) = log x
.
We prove some basic properties of this function and show that it is continuous.
Tags #
logarithm, continuity
The real logarithm function, equal to the inverse of the exponential for x > 0
,
to log |x|
for x < 0
, and to 0
for 0
. We use this unconventional extension to
(-∞, 0]
as it gives the formula log (x * y) = log x + log y
for all nonzero x
and y
, and
the derivative of log
is 1/x
away from 0
.
Equations
- Real.log x = if hx : x = 0 then 0 else Real.expOrderIso.symm ⟨|x|, ⋯⟩
Instances For
Alias of Real.log_natCast_nonneg
.
Alias of Real.log_neg_natCast_nonneg
.
Alias of Real.log_intCast_nonneg
.
See Real.log_le_sub_one_of_pos
for the stronger version when x ≠ 0
.
See Real.one_sub_inv_le_log_of_pos
for the stronger version when x ≠ 0
.
The real logarithm function tends to +∞
at +∞
.
The real logarithm is continuous as a function from nonzero reals.
The real logarithm is continuous as a function from positive reals.
Extension for the positivity
tactic: Real.log
of a natural number is always nonnegative.
Instances For
Extension for the positivity
tactic: Real.log
of an integer is always nonnegative.
Instances For
Extension for the positivity
tactic: Real.log
of a numeric literal.