Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 3.34 — a matrix has a logarithm iff det ≠ 0; real logarithms

Proved
TeschlODE.Linear.matrix_logarithm

by mikedeng1 · Sep 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

linear-algebramatrix-exponentialmatrix-logarithmp2o-batch-books5p2o-gran-per-chapterp2o-plan-bookp2o-v1

A logarithm of a square matrix AAA is a matrix BBB with exp⁡(B)=A\exp(B) = Aexp(B)=A (3.200). Lemma 3.34 makes three claims:

  1. A (complex) matrix A∈Cn×nA \in \mathbb{C}^{n\times n}A∈Cn×n has a logarithm if and only if det⁡A≠0\det A \neq 0detA=0.
  2. If A∈Rn×nA \in \mathbb{R}^{n\times n}A∈Rn×n and every real eigenvalue of AAA is positive, then AAA has a real logarithm B∈Rn×nB \in \mathbb{R}^{n\times n}B∈Rn×n.
  3. If A∈Rn×nA \in \mathbb{R}^{n\times n}A∈Rn×n (with det⁡A≠0\det A \ne 0detA=0), then A2A^2A2 has a real logarithm.
∃B: eB=A  ⟺  det⁡A≠0.\exists B:\ e^{B} = A \iff \det A \neq 0.∃B: eB=A⟺detA=0.

Claim 1 is what turns the monodromy matrix of a periodic system into exp⁡(TQ)\exp(TQ)exp(TQ) in Floquet's theorem; claims 2–3 give the real version, Corollary 3.16.

Formalization Note. exp⁡\expexp is Mathlib's NormedSpace.exp on Matrix (Fin n) (Fin n) 𝕂. "Real eigenvalue μ\muμ of AAA" is Module.End.HasEigenvalue (Matrix.toLin' A) μ for μ∈R\mu \in \mathbb{R}μ∈R, which for a real matrix is the same as μ\muμ being a real root of its characteristic polynomial. In claim 3 the hypothesis det⁡A≠0\det A \neq 0detA=0 is added: the book states claim 3 inside the paragraph that begins "Hence suppose that det⁡(A)≠0\det(A) \neq 0det(A)=0" (p. 108), and without it the claim is false (A=0A = 0A=0, where A2=0A^2 = 0A2=0 has no logarithm).

Preamble
import Mathlib
Formal statement
namespace TeschlODE.Linear

/-- Teschl, Lemma 3.34 (p. 108), all three claims. A logarithm of `A` is a matrix `B` with
`exp(B) = A` (3.200). (1) A complex matrix has a logarithm iff `det A ≠ 0`. (2) A real matrix
all of whose real eigenvalues are positive has a real logarithm. (3) For a real matrix `A`
(with `det A ≠ 0`, the standing assumption of the paragraph (3.200)–(3.202)), `A²` has a real
logarithm. -/
theorem matrix_logarithm (n : ℕ) :
    (∀ A : Matrix (Fin n) (Fin n) ℂ,
      (∃ B : Matrix (Fin n) (Fin n) ℂ, NormedSpace.exp B = A) ↔ A.det ≠ 0) ∧
    (∀ A : Matrix (Fin n) (Fin n) ℝ,
      (∀ μ : ℝ, Module.End.HasEigenvalue (Matrix.toLin' A) μ → 0 < μ) →
      ∃ B : Matrix (Fin n) (Fin n) ℝ, NormedSpace.exp B = A) ∧
    (∀ A : Matrix (Fin n) (Fin n) ℝ, A.det ≠ 0 →
      ∃ B : Matrix (Fin n) (Fin n) ℝ, NormedSpace.exp B = A * A) := by sorry

end TeschlODE.Linear
Source
Teschl, Ordinary Differential Equations and Dynamical Systems (author's preliminary version of AMS GSM 140, 2012), p. 108, Lemma 3.34
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Fix a natural number nnn. Throughout, exp⁡(B)\exp(B)exp(B) denotes the matrix exponential given by the power series

exp⁡(B)=∑k≥0Bkk!,\exp(B) = \sum_{k\ge 0} \frac{B^k}{k!},exp(B)=k≥0∑​k!Bk​,

taken in complex n×nn\times nn×n matrices or in real n×nn\times nn×n matrices, according to where BBB lives.

Claim. Three statements hold together.

(1) Complex matrices. For every complex n×nn\times nn×n matrix AAA:

(∃ B∈Cn×n with exp⁡(B)=A)  ⟺  det⁡A≠0.\bigl(\exists\, B \in \mathbb{C}^{n\times n} \text{ with } \exp(B) = A\bigr) \iff \det A \neq 0.(∃B∈Cn×n with exp(B)=A)⟺detA=0.

(2) Real matrices with positive real eigenvalues. Let AAA be a real n×nn\times nn×n matrix, and suppose every real number μ\muμ that is an eigenvalue of AAA satisfies μ>0\mu > 0μ>0. Here "eigenvalue" means that Av=μvAv = \mu vAv=μv for some nonzero v∈Rnv \in \mathbb{R}^nv∈Rn. Then there exists a real n×nn\times nn×n matrix BBB with exp⁡(B)=A\exp(B) = Aexp(B)=A.

  • The hypothesis constrains only real eigenvalues; non-real complex eigenvalues are unrestricted.
  • In particular, the hypothesis excludes 000 as an eigenvalue.
  • No other invertibility assumption is stated.

(3) Squares of invertible real matrices. For every real n×nn\times nn×n matrix AAA with det⁡A≠0\det A \neq 0detA=0, there exists a real n×nn\times nn×n matrix BBB with exp⁡(B)=A⋅A=A2\exp(B) = A\cdot A = A^2exp(B)=A⋅A=A2.

Degenerate cases.

  • n=0n = 0n=0: there is only one matrix, the empty one, whose determinant is 111. Its exponential is itself, so all three parts hold trivially.
  • n=1n = 1n=1:
    • Part (1) says that a complex number aaa equals ebe^beb for some complex bbb exactly when a≠0a \neq 0a=0.
    • Part (2) says that a real a>0a > 0a>0 equals ebe^beb for some real bbb. If a≤0a \le 0a≤0, then aaa itself is a real eigenvalue that is not positive, so the hypothesis fails and nothing is claimed.
    • Part (3) says that a2=eba^2 = e^ba2=eb for some real bbb whenever a≠0a \neq 0a=0.
Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 2, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me