Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  Logarithm.lean   Sprache: Lean

 

/-
Copyright (c) 2026 Kevin Buzzard. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kevin Buzzard
-/

module

public import Mathlib.Analysis.Analytic.OfScalars

import Mathlib.Algebra.Algebra.TransferInstance

/-!
# The logarithm in a topological algebra

In this file we define `NormedSpace.log : �� → ��`, the logarithm
`log x = ∑ₙ ((-1) ^ (n + 1) / n) • (x - 1) ^ n` in a topological ring `��`, following the
development style of `NormedSpace.exp` (see `Mathlib/Analysis/Normed/Algebra/Exponential.lean`).
It is the value at `x - 1` of the `FormalMultilinearSeries` `NormedSpace.logSeries ℚ ��`, where the
`ℚ`-algebra structure on `��` is chosen using `Classical.choice`. It takes the junk value `0`
if the series does not converge or if `��` has no `ℚ`-algebra structure (equivalently,
if `1 / n` doesn't correspond to what a mathematician thinks).

This file only contains the definition and its immediate algebraic properties; convergence of
the series and the relation to `NormedSpace.exp` are left to later files.

## Main definitions

* `NormedSpace.logSeries �� ��`: the formal multilinear series whose `n`-th term is
  `(xᵢ) ↦ ((-1) ^ (n + 1) / n : ��) • ∏ xᵢ`; its sum at `x - 1` is `log x`.
* `NormedSpace.log`: the logarithm `�� → ��`.

## Main results

* `NormedSpace.log_eq_tsum`: `log` as a `tsum`.
* `NormedSpace.log_one`, `NormedSpace.log_op`, `NormedSpace.star_log`, `NormedSpace.log_mem`,
  `Commute.log`: immediate properties.

## TODO

* Ultrametric convergence: if `K` is a complete ultrametric normed field of characteristic zero
  then the series converges on the whole disc `‖x - 1‖ < 1` (no choice of prime is needed: the
  natural numbers of norm `< 1` form a prime ideal of `ℕ`, and if it is `pℕ` then
  `‖n‖ = ‖p‖ ^ padicValNat p n`).
* If moreover `‖(p : K)‖ < 1` for a prime `p`, Iwasawa's formula
  `log x = lim (x ^ p ^ k - 1) / p ^ k` gives `log (x * y) = log x + log y` on that disc, hence
  `log_inv`, `log_pow`, `log_zpow` etc.
* The formal identity `log ((1 + X) * (1 + Y)) = log (1 + X) + log (1 + Y)` in `ℚ⟦X, Y⟧`.
* Relation with `NormedSpace.exp`: `exp (log x) = x` and `log (exp x) = x` whenever both series
  converge.
* In the ultrametric case, the computation of where the series for exp and log converge
  (`‖x - 1‖ ^ (p - 1) < ‖(p : K)‖` for log).
* `‖log x‖ = ‖x - 1‖` when the series converges
* Analyticity: `HasFPowerSeriesOnBall log (logSeries �� ��) 1 (logSeries �� ��).radius` and its
  consequences, mirroring `NormedSpace.analyticAt_exp_of_mem_ball`.
* Over `ℝ` and `ℂ`, `NormedSpace.log` agrees with `Real.log` and `Complex.log` on `‖x - 1‖ < 1`.
* Analytic continuation of `log` in the ultrametric case (probably best to be opinionated
  and define `log p = 0` so we get a "canonical branch" analogous to how mathlib has
  chosen a branch of `Complex.log`).
-/


@[expose] public section

namespace NormedSpace

open FormalMultilinearSeries

section TopologicalAlgebra

/-- `logSeries �� ��` is the `FormalMultilinearSeries` whose `n`-th term is the map
`(xᵢ) : ��ⁿ ↦ ((-1) ^ (n + 1) / n : ��) • ∏ xᵢ`; its `0`-th term is `0` since `1 / 0 = 0`.
The corresponding sum evaluated at `x - 1` is the logarithm `NormedSpace.log x`. -/

def logSeries (�� �� : Type*) [Field ��] [Ring ��] [Algebra �� ��] [TopologicalSpace ��]
    [IsTopologicalRing ��] : FormalMultilinearSeries �� �� �� := fun n =>
  ((-1) ^ (n + 1) / n : ��) • ContinuousMultilinearMap.mkPiAlgebraFin �� n ��

variable (�� �� : Type*) [Field ��] [Ring ��] [Algebra �� ��] [TopologicalSpace ��] [IsTopologicalRing ��]

theorem logSeries_eq_ofScalars : logSeries �� �� = ofScalars �� fun n ↦ ((-1) ^ (n + 1) / n : ��) :=
  rfl

variable {�� ��}

open scoped Classical in
/-- `NormedSpace.log : �� → ��` is the logarithm `log x = ∑ₙ ((-1) ^ (n + 1) / n) • (x - 1) ^ n`.
It is defined as the sum of the `FormalMultilinearSeries` `logSeries ℚ ��` at `x - 1`, in the same
way as `NormedSpace.exp`, and takes the junk value `0` where the series does not converge.

If `��` can't be equipped with a `ℚ`-algebra structure, we use the junk value `0`.
-/

@[no_expose] noncomputable def log (x : ��) : �� :=
  if h : Nonempty (Algebra ℚ ��) then
    letI _ := h.some
    (NormedSpace.logSeries ℚ ��).sum (x - 1)
  else
    0

/-- The junk value when `��` can't be equipped with a `ℚ`-algebra structure. -/
@[simp]
theorem log_of_isEmpty_algebra_rat [IsEmpty (Algebra ℚ ��)] (x : ��) : log x = 0 := by
  rw [log, dite_eq_right (not_nonempty_iff.mpr ‹_›)]

theorem logSeries_apply_eq (x : ��) (n : ℕ) :
    (logSeries �� �� n fun _ => x) = ((-1) ^ (n + 1) / n : ��) • x ^ n := by simp [logSeries]

theorem logSeries_sum_eq (x : ��) :
    (logSeries �� ��).sum x = ∑' n : ℕ, ((-1) ^ (n + 1) / n : ��) • x ^ n :=
  tsum_congr fun n => logSeries_apply_eq x n

private lemma neg_one_pow_div_natCast_eq_inv_intCast (T : Type*) [DivisionRing T] (k n : ℕ) :
    ((-1) ^ k / n : T) = (((-1) ^ k * n : ℤ) : T)⁻¹ := by
  rcases Nat.even_or_odd k with hk | hk <;> simp [hk.neg_one_pow, div_eq_mul_inv, inv_neg]

/-- If `E` is a module over two division rings `R` and `S`, then scalar multiplication by the
coefficients `(-1) ^ k / n` of the logarithm series agree in `R` and `S`. -/

private lemma neg_one_pow_div_natCast_smul_eq {E : Type*} (R S : Type*) [AddCommGroup E]
    [DivisionRing R] [DivisionRing S] [Module R E] [Module S E] (k n : ℕ) (x : E) :
    ((-1) ^ k / n : R) • x = ((-1) ^ k / n : S) • x := by
  rw [neg_one_pow_div_natCast_eq_inv_intCast R, neg_one_pow_div_natCast_eq_inv_intCast S,
    inv_intCast_smul_eq R S]

theorem logSeries_sum_eq_rat [Algebra ℚ ��] : (logSeries �� ��).sum = (logSeries ℚ ��).sum := by
  ext; simp_rw [logSeries_sum_eq, neg_one_pow_div_natCast_smul_eq �� ℚ]

theorem logSeries_eq_logSeries_rat [Algebra ℚ ��] (n : ℕ) :
    (⇑(logSeries �� �� n) : (Fin n → ��) → ��) = logSeries ℚ �� n := by
  ext c
  simp [logSeries, neg_one_pow_div_natCast_smul_eq �� ℚ]

variable (��) in
theorem log_eq_logSeries_sum [CharZero ��] : log = fun x : �� ↦ (logSeries �� ��).sum (x - 1) := by
  ext x
  rw [log, dite_eq_left ⟨RestrictScalars.algebra ℚ �� ��⟩, ← @logSeries_sum_eq_rat (�� := ��)]

variable (��) in
theorem log_eq_tsum [CharZero ��] :
    log = fun x : �� ↦ ∑' n : ℕ, ((-1) ^ (n + 1) / n : ��) • (x - 1) ^ n := by
  simp_rw [log_eq_logSeries_sum ��, logSeries_sum_eq]

theorem logSeries_apply_zero (n : ℕ) : logSeries �� �� n (fun _ ↦ (0 : ��)) = 0 := by
  rw [logSeries_apply_eq]
  rcases n
  · simp
  · grind [smul_zero]

@[simp]
theorem log_one : log (1 : ��) = 0 := by
  simp [log, logSeries_sum_eq, ← logSeries_apply_eq, logSeries_apply_zero, tsum_zero]

@[simp]
theorem log_op [T2Space ��] (x : ��) : log (MulOpposite.op x) = MulOpposite.op (log x) := by
  obtain h | ⟨⟨_⟩⟩ := isEmpty_or_nonempty (Algebra ℚ ��)
  · have : IsEmpty (Algebra ℚ ��ᵐᵒᵖ) := ⟨fun _ => h.elim <| (RingEquiv.opOp ��).algebra ℚ⟩
    simp
  · rw [log_eq_tsum ℚ, log_eq_tsum ℚ]
    simp_rw [← MulOpposite.op_one, ← MulOpposite.op_sub, ← MulOpposite.op_pow,
      ← MulOpposite.op_smul, tsum_op]

theorem star_log [T2Space ��] [StarRing ��] [ContinuousStar ��] (x : ��) :
    star (log x) = log (star x) := by
  obtain _ | ⟨⟨_⟩⟩ := isEmpty_or_nonempty (Algebra ℚ ��)
  · simp
  · simp [log_eq_tsum ℚ, tsum_star]

/-- A subring of `��` that is closed topologically and under `ℚ`-scaling is closed under `log`. -/
theorem log_mem
    {R S : Type*} [Monoid R] [SMul ℚ R] [MulAction R ��] [Algebra ℚ ��] [IsScalarTower ℚ R ��]
    [SetLike S ��] [SubringClass S ��] [SMulMemClass S R ��] {s : S}
    (h_closed : IsClosed (s : Set ��)) {x : ��} (h : x ∈ s) :
    log x ∈ s := by
  have := SMulMemClass.ofIsScalarTower S ℚ R ��
  rw [log_eq_tsum ℚ]
  exact tsum_mem h_closed fun i => SMulMemClass.smul_mem _ <| pow_mem (sub_mem h (one_mem s)) _

end NormedSpace.TopologicalAlgebra

namespace Commute

open NormedSpace

variable {�� : Type*} [Ring ��] [TopologicalSpace ��] [IsTopologicalRing ��]

theorem log_right [T2Space ��] {x y : ��} (h : Commute x y) :
    Commute x (log y) := by
  obtain _ | ⟨⟨_⟩⟩ := isEmpty_or_nonempty (Algebra ℚ ��)
  · simp
  · rw [log_eq_tsum ℚ]
    exact Commute.tsum_right x fun n =>
      ((h.sub_right (Commute.one_right x)).pow_right n).smul_right _

theorem log_left [T2Space ��] {x y : ��} (h : Commute x y) :
    Commute (log x) y :=
  h.symm.log_right.symm

theorem log [T2Space ��] {x y : ��} (h : Commute x y) :
    Commute (log x) (log y) :=
  h.log_left.log_right

end Commute

Messung
CHZG
9210010097

¤ Dauer der Verarbeitung: 0.3 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,158
#Domains=932,834