The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V15. Real analysis in one variable

Mathlib.Analysis.SpecialFunctions.Log.PosLog

33 declarations. Mathlib docs · Source

The Positive Part of the Logarithm

This file defines the function Real.posLog = r ↦ max 0 (log r) and introduces the notation log⁺. For a finite length-n sequence f i of reals, it establishes the following standard estimates.

  • theorem posLog_prod : log⁺ (∏ i, f i) ≤ ∑ i, log⁺ (f i)

  • theorem posLog_sum : log⁺ (∑ i, f i) ≤ log n + ∑ i, log⁺ (f i)

See Mathlib/Analysis/SpecialFunctions/Integrals/PosLogEqCircleAverage.lean for the presentation of log⁺ as a Circle Average.

Definition, Notation and Reformulations

Elementary Properties

Trivial Estimates

Estimates for Products

Estimates for Sums

def Real.posLog E1 #

ℝ → ℝ

Definition: the positive part of the logarithm.

def Real.«termLog⁺» E1 #

Lean.ParserDescr

Notation log⁺ for the positive part of the logarithm.

theorem Real.posLog_apply E0 #

∀ {x : ℝ}, x.posLog = max 0 (Real.log x)

Definition of the positive part of the logarithm, formulated as a theorem.

theorem Real.posLog_def E0 #

Real.posLog = 0 ⊔ fun x ↦ Real.log x

Definition of the positive part of the logarithm, formulated as a theorem.

theorem Real.posLog_sub_posLog_inv E1 #

∀ {x : ℝ}, x.posLog - x⁻¹.posLog = Real.log x

Presentation of log in terms of its positive part.

theorem Real.half_mul_log_add_log_abs E1 #

∀ {x : ℝ}, 2⁻¹ * (Real.log x + |Real.log x|) = x.posLog

Presentation of log⁺ in terms of log.

theorem Real.posLog_zero E0 #

Real.posLog 0 = 0

theorem Real.posLog_one E0 #

Real.posLog 1 = 0

theorem Real.posLog_nonneg E1 #

∀ {x : ℝ}, 0 ≤ x.posLog

The positive part of log is never negative.

theorem Real.posLog_neg E0 #

∀ (x : ℝ), (-x).posLog = x.posLog

The function log⁺ is even.

theorem Real.posLog_abs E0 #

∀ (x : ℝ), |x|.posLog = x.posLog

The function log⁺ is even.

theorem Real.posLog_eq_zero_iff E0 #

∀ (x : ℝ), x.posLog = 0 ↔ |x| ≤ 1

The function log⁺ is zero in the interval [-1,1].

theorem Real.posLog_eq_log E1 #

∀ {x : ℝ}, 1 ≤ |x| → x.posLog = Real.log x

The function log⁺ equals log outside of the interval (-1,1).

theorem Real.monotoneOn_posLog E1 #

MonotoneOn Real.posLog (Set.Ici (-1))

The function log⁺ is monotone on the interval [-1,∞).

theorem Real.antitoneOn_posLog E1 #

AntitoneOn Real.posLog (Set.Iic 1)

The function log⁺ is antitone on the interval (-∞,1].

theorem Real.log_of_nat_eq_posLog E1 #

∀ {n : ℕ}, (↑n).posLog = Real.log ↑n

The function log⁺ equals log for all natural numbers.

theorem Real.abs_log_eq_posLog_add_posLog_inv E1 #

∀ (x : ℝ), |Real.log x| = x.posLog + x⁻¹.posLog

Presentation of |log| in terms of the positive part of the logarithm.

theorem Real.posLog_eq_log_max_one E1 #

∀ {x : ℝ}, 0 ≤ x → x.posLog = Real.log (max 1 x)

The function log⁺ equals log (max 1 _) for non-negative real numbers.

theorem Real.posLog_le_posLog E1 #

∀ {x y : ℝ}, -1 ≤ x → x ≤ y → x.posLog ≤ y.posLog

theorem Real.posLog_pow E0 #

∀ (n : ℕ) (x : ℝ), (x ^ n).posLog = ↑n * x.posLog

The function log⁺ commutes with taking powers.

theorem Real.posLog_rpow E0 #

∀ {x α : ℝ}, -1 ≤ x → 0 ≤ α → (x ^ α).posLog = α * x.posLog

The function log⁺ commutes with real powers with nonnegative base and exponent.

theorem Real.continuous_posLog E1 #

Continuous Real.posLog

The function log⁺ is continuous.

theorem Real.posLog_le_log_one_add E1 #

∀ {x : ℝ}, 0 ≤ x → x.posLog ≤ Real.log (1 + x)

For nonnegative x, the positive part of the logarithm is bounded by log (1 + x).

theorem Real.log_one_add_le_posLog E1 #

∀ {x : ℝ}, Real.log (1 + x) ≤ x.posLog + Real.log 2

Converse to posLog_le_log_one_add up to the additive constant log 2.

theorem Real.posLog_le_abs E1 #

∀ (x : ℝ), x.posLog ≤ |x|

The positive part of the logarithm is bounded by the absolute value: log⁺ x ≤ |x|.

theorem Real.posLog_mul E1 #

∀ {x y : ℝ}, (x * y).posLog ≤ x.posLog + y.posLog

Estimate for log⁺ of a product. See Real.posLog_prod for a variant involving multiple factors.

theorem Real.posLog_nat_mul E1 #

∀ {x : ℝ} {n : ℕ}, (↑n * x).posLog ≤ Real.log ↑n + x.posLog

Estimate for log⁺ of a product. Special case of Real.posLog_mul where one of the factors is a natural number.

theorem Real.posLog_prod E1 #

∀ {α : Type u_1} (s : Finset α) (f : α → ℝ), (∏ t ∈ s, f t).posLog ≤ ∑ t ∈ s, (f t).posLog

Estimate for log⁺ of a product. See Real.posLog_mul for a variant with only two factors.

theorem Real.posLog_sum E1 #

∀ {α : Type u_1} (s : Finset α) (f : α → ℝ), (∑ t ∈ s, f t).posLog ≤ Real.log ↑s.card + ∑ t ∈ s, (f t).posLog

Estimate for log⁺ of a sum. See Real.posLog_add for a variant involving just two summands.

theorem Real.posLog_norm_sum_le E1 #

∀ {E : Type u_1} [inst : SeminormedAddCommGroup E] {α : Type u_2} (s : Finset α) (f : α → E),
  ‖∑ t ∈ s, f t‖.posLog ≤ Real.log ↑s.card + ∑ t ∈ s, ‖f t‖.posLog

Variant of posLog_sum for norms of elements in normed additive commutative groups, using monotonicity of log⁺ and the triangle inequality.

theorem Real.posLog_add E1 #

∀ {x y : ℝ}, (x + y).posLog ≤ Real.log 2 + x.posLog + y.posLog

Estimate for log⁺ of a sum. See Real.posLog_sum for a variant involving multiple summands.

theorem Real.posLog_norm_add_le E1 #

∀ {E : Type u_1} [inst : SeminormedAddCommGroup E] (a b : E), ‖a + b‖.posLog ≤ ‖a‖.posLog + ‖b‖.posLog + Real.log 2

Variant of posLog_add for norms of elements in normed additive commutative groups, using monotonicity of log⁺ and the triangle inequality.

theorem Real.abs_posLog_mul_sub_posLog_le_posLog_add_posLog E1 #

∀ {x y : ℝ}, x ≠ 0 → |(x * y).posLog - y.posLog| ≤ x.posLog + x⁻¹.posLog

Multiplying the argument of log⁺ by a nonzero factor x changes its value by at most log⁺ x + log⁺ x⁻¹, which equals |log x| by Real.abs_log_eq_posLog_add_posLog_inv.