nevanlinna/Nevanlinna/logpos.lean
2024-12-20 15:27:06 +01:00

40 lines
875 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Mathlib.Analysis.SpecialFunctions.Log.Basic
open Real
noncomputable def logpos : := fun r ↦ max 0 (log r)
notation "log⁺" => logpos
theorem loglogpos {r : } : log r = log⁺ r - log⁺ r⁻¹ := by
unfold logpos
rw [log_inv]
by_cases h : 0 ≤ log r
· simp [h]
· simp at h
have : 0 ≤ -log r := Left.nonneg_neg_iff.2 (le_of_lt h)
simp [h, this]
exact neg_nonneg.mp this
theorem logpos_norm {r : } : log⁺ r = 2⁻¹ * (log r + ‖log r‖) := by
by_cases hr : 0 ≤ log r
· rw [norm_of_nonneg hr]
have : logpos r = log r := by
unfold logpos
simp [hr]
rw [this]
ring
· rw [norm_of_nonpos (le_of_not_ge hr)]
have : logpos r = 0 := by
unfold logpos
simp
exact le_of_not_ge hr
rw [this]
ring
-- WANT: logpos is even and continuous
-- WANT: Inequalities