Documentation

Atlas.ComplexVariables.code.Lecture16

Lecture 16: Harmonic Functions #

This file formalizes Definition 1, Theorem 1, Corollary 1, and Theorem 2 (Schwarz's Theorem) from Lecture 16.

Main definitions #

Main results #

Implementation notes #

We define IsHarmonic as an abbreviation for Mathlib's InnerProductSpace.HarmonicOnNhd, specialized to ℂ → ℝ. Since is a real finite-dimensional inner product space, the Laplacian Δ u is exactly ∂²u/∂x² + ∂²u/∂y² (the sum of second directional derivatives along the standard orthonormal basis {1, i} of ℂ ≃ ℝ²).

The Poisson integral uses Mathlib's poissonKernel (centered at the origin) and Real.circleAverage. The key identity used in the proof is that the Poisson kernel equals the real part of the Herglotz–Riesz kernel: P(a, e^{iφ}) = Re((e^{iφ} + a) / (e^{iφ} - a)) which is Mathlib's poissonKernel_eq_re_herglotzRieszKernel.

The proof of Schwarz's theorem uses two standard results from complex analysis that are not proved in the textbook:

  1. The integral of a holomorphic parameter family is holomorphic (Morera + Fubini).
  2. The real part of a holomorphic function is harmonic (Cauchy–Riemann equations). The first is proved as herglotzIntegral_differentiableOn and the second is proved as harmonicOnNhd_re_of_differentiableOn.
@[reducible, inline]
abbrev IsHarmonic (u : ) (Ω : Set ) :

Definition 1, Lecture 16. A real-valued function u : ℂ → ℝ is harmonic on a set Ω ⊆ ℂ if it is C² and its Laplacian ∂²u/∂x² + ∂²u/∂y² vanishes on Ω.

This is defined as InnerProductSpace.HarmonicOnNhd u Ω, which requires that at every point z ∈ Ω, the function u is ContDiffAt ℝ 2 and the Laplacian Δ u vanishes in a neighborhood of z.

Instances For
    theorem IsHarmonic.contDiffOn {u : } {Ω : Set } (hu : IsHarmonic u Ω) :

    A harmonic function is C² on its domain.

    theorem IsHarmonic.harmonicAt {u : } {Ω : Set } (hu : IsHarmonic u Ω) {z : } (hz : z Ω) :

    A harmonic function is harmonic at every point of its domain.

    theorem IsHarmonic.mono {u : } {Ω₁ Ω₂ : Set } (hu : IsHarmonic u Ω₁) (h : Ω₂ Ω₁) :
    IsHarmonic u Ω₂

    Restriction of harmonicity to a subset.

    theorem isHarmonic_const (c : ) (Ω : Set ) :
    IsHarmonic (fun (x : ) => c) Ω

    Constant functions are harmonic.

    theorem IsHarmonic.add {u v : } {Ω : Set } (hu : IsHarmonic u Ω) (hv : IsHarmonic v Ω) :
    IsHarmonic (u + v) Ω

    Sum of harmonic functions is harmonic.

    Poisson Kernel and Poisson Integral #

    Definitions #

    noncomputable def poissonKernelDisk (a z : ) :

    The Poisson kernel for the unit disk, as presented in the textbook: P(a, z) = (1 - |a|²) / |a - z|² for |a| < 1 and z on the unit circle.

    On the unit circle |z| = 1, this equals Mathlib's poissonKernel 0 a z.

    Instances For
      noncomputable def poissonIntegral (U : ) (a : ) :

      Poisson Integral (Theorem 2, Lecture 16). Given a function U on the unit circle, the Poisson integral is defined by P_U(a) = (2π)⁻¹ ∫₀²π P(a, e^{iφ}) U(e^{iφ}) dφ for |a| < 1, using Mathlib's Real.circleAverage with poissonKernel 0 a.

      Instances For
        noncomputable def herglotzIntegral (U : ) (a : ) :

        The complex-valued Herglotz integral whose real part is the Poisson integral. This is (2π)⁻¹ ∫₀²π ((e^{iφ} + a)/(e^{iφ} - a)) U(e^{iφ}) dφ, which is holomorphic in a on the open unit disk.

        Instances For

          Basic Properties #

          The Poisson kernel for the unit disk agrees with Mathlib's poissonKernel 0 a z on the unit circle ‖z‖ = 1. The textbook writes (1 - |a|²)/|a - e^{iφ}|²; Mathlib's kernel is (‖z‖² - ‖a‖²)/‖z - a‖², which equals the same when ‖z‖ = 1.

          theorem poissonIntegral_def (U : ) (a : ) :

          The Poisson integral unfolds to the textbook formula.

          The Poisson kernel equals the real part of the Herglotz–Riesz kernel: P(a, e^{iφ}) = Re((e^{iφ} + a)/(e^{iφ} - a)). This identity is the key step in the proof of Schwarz's theorem, showing that the Poisson integral is the real part of a holomorphic function.

          Standard results used in the proof of Schwarz's Theorem #

          The proof of Theorem 2 (Schwarz's Theorem) in Lecture 16 says: "Therefore u is the real part of a holomorphic function, hence harmonic."

          This implicitly invokes three standard results from complex analysis that are not proved in the textbook:

          1. The Poisson integral P_U(a) = Re(H_U(a)) where H_U is the Herglotz integral. This follows from poissonKernel = Re ∘ herglotzRieszKernel and the fact that Re (a continuous linear map) commutes with integration. Now proved as poissonIntegral_eq_re_herglotzIntegral.

          2. The Herglotz integral is ℂ-differentiable (holomorphic) on the open disk. This is a consequence of differentiation under the integral sign (Morera's theorem + Fubini's theorem). Now proved as herglotzIntegral_differentiableOn.

          3. The real part of a holomorphic function is harmonic. This follows from the Cauchy–Riemann equations: if f is holomorphic, then Δ(Re f) = 0. Axiomatized as harmonicOnNhd_re_of_differentiableOn.

          For the boundary behavior (part b), the book's proof uses the Möbius transform S_a(z) = (z + a)/(āz + 1) to rewrite the Poisson integral as a plain circle average of U ∘ S_a, then applies dominated convergence. This is decomposed into:

          1. The Möbius change of variables: P_U(a) = circleAverage(U ∘ S_a). Now proved as poissonIntegral_eq_circleAverage_mobiusTransform using axiomatized properties of the inverse Möbius angle reparametrization.
          2. The dominated convergence step: circleAverage(U ∘ S_a) → U(z₀) as a → z₀. Now proved as circleAverage_mobiusTransform_tendsto via the Lebesgue DCT, using three sub-axioms: pointwise Möbius convergence on the circle (mobiusTransform_tendsto_on_circle), measurability of U ∘ S_a (circleAverage_mobiusTransform_aestronglyMeasurable), and an integrable dominating bound (circleAverage_mobiusTransform_bound).

          The Poisson integral equals the real part of the Herglotz integral on the open disk. This follows from poissonKernel_eq_re_herglotzRieszKernel and the fact that Complex.reCLM commutes with integration. Not proved in the textbook.

          The Herglotz integral is ℂ-differentiable (holomorphic) on the open unit disk. This follows from differentiation under the integral sign: for fixed θ, the integrand a ↦ ((e^{iθ} + a)/(e^{iθ} - a)) U(e^{iθ}) is holomorphic in a, and the resulting integral is holomorphic by Morera's theorem and Fubini's theorem. Not proved in the textbook.

          theorem harmonicOnNhd_re_of_differentiableOn {f : } {s : Set } (hs : IsOpen s) (hf : DifferentiableOn f s) :
          InnerProductSpace.HarmonicOnNhd (fun (z : ) => (f z).re) s

          The real part of a ℂ-differentiable function on an open set is harmonic. This follows from the Cauchy–Riemann equations: holomorphic functions satisfy ∂²(Re f)/∂x² + ∂²(Re f)/∂y² = 0. Not proved in the textbook.

          noncomputable def mobiusTransform (a z : ) :

          The Möbius transform for the unit disk: S_a(z) = (z + a)/(ā·z + 1). When ‖a‖ < 1, this is a biholomorphism of the open unit disk that maps the unit circle to itself. It satisfies S_a(0) = a. The Poisson kernel P(a, e^{iθ}) equals the Jacobian dφ/dθ of the induced reparametrization e^{iφ} = S_a(e^{iθ}) of the circle (textbook formula (2)).

          Instances For

            Inverse Möbius angle reparametrization #

            The Möbius transform S_a maps the unit circle to itself. On the circle, it induces a smooth reparametrization e^{iφ} = S_a(e^{iθ}) where φ = ψ(θ). The inverse reparametrization ψ satisfies:

            1. S_a(e^{i·ψ(θ)}) = e^{iθ} (correct parametrization),
            2. ψ'(θ) = P(a, e^{iθ}) (the Poisson kernel is the Jacobian — textbook formula (2)),
            3. ψ(θ + 2π) = ψ(θ) + 2π (one full period maps to one full period).

            We define ψ via the integral formula ψ(θ) = arg((1-a)/(1-ā)) + ∫₀^θ P(a, e^{it}) dt and prove properties 2 and 3 from the definition. Property 1 (the ODE uniqueness step) is axiomatized as invMobiusAngle_mobiusTransform_axiom since it requires proving that two solutions of the same ODE with the same initial condition must agree.

            theorem continuous_poissonKernel_circleMap (a : ) (ha : a Metric.ball 0 1) :
            Continuous fun (t : ) => poissonKernel 0 a (circleMap 0 1 t)

            The Poisson kernel composed with circleMap 0 1 is continuous.

            noncomputable def invMobiusAngle (a : ) (_ha : a Metric.ball 0 1) :

            The inverse Möbius angle reparametrization: given a in the open unit disk, invMobiusAngle a ha is the smooth function ψ : ℝ → ℝ defined by ψ(θ) = arg((1-a)/(1-ā)) + ∫₀^θ P(a, e^{it}) dt, which satisfies S_a(e^{i·ψ(θ)}) = e^{iθ} for all θ.

            Instances For

              The initial value condition: at θ = 0, the Möbius transform of the inverse angle maps to 1 (= circleMap 0 1 0). This is a helper for the full statement invMobiusAngle_mobiusTransform_axiom.

              theorem eq_zero_of_hasDerivAt_mul {y c : } (hc_cont : Continuous c) (hy_deriv : ∀ (θ : ), HasDerivAt y (c θ * y θ) θ) (hy0 : y 0 = 0) (θ : ) :
              y θ = 0

              ODE uniqueness via integrating factor: if y' = c(θ)·y and y(0) = 0, then y ≡ 0.

              theorem deriv_inv_mobius_eq_poisson_mul' (a z : ) (hz : z = 1) (hd : 1 - (starRingEnd ) a * z 0) (hza : z - a 0) :
              (1 - (starRingEnd ) a * a) / (1 - (starRingEnd ) a * z) ^ 2 * (z * Complex.I) = (poissonKernel 0 a z) * ((z - a) / (1 - (starRingEnd ) a * z) * Complex.I)

              Key algebraic identity: the derivative of the inverse Möbius transform composed with circleMap equals the Poisson kernel times the value times I. For z on the unit circle: ((1-ā·a)/(1-ā·z)²)·z·I = P(0,a,z)·((z-a)/(1-ā·z)·I).

              theorem one_sub_conj_mul_circleMap_ne_zero (a : ) (ha : a Metric.ball 0 1) (θ : ) :
              1 - (starRingEnd ) a * circleMap 0 1 θ 0

              1 - conj(a) * z ≠ 0 when z is on the unit circle and ‖a‖ < 1.

              The ODE uniqueness step: the integral definition of ψ, combined with the derivative property ψ'(θ) = P(a, e^{iψ(θ)}), implies that S_a(e^{iψ(θ)}) = e^{iθ}. The proof uses ODE uniqueness via an integrating factor argument: both circleMap 0 1 ∘ ψ and T_a ∘ circleMap 0 1 satisfy the same linear ODE with the same initial condition, so they agree. Then composing with S_a gives the result since S_a ∘ T_a = id.

              theorem invMobiusAngle_mobiusTransform (a : ) (ha : a Metric.ball 0 1) (θ : ) :

              The inverse Möbius angle correctly parametrizes: S_a(e^{i·ψ(θ)}) = e^{iθ}.

              Chain-rule computation: the derivative of θ ↦ S_a(e^{i·ψ(θ)}) is I times itself. Since S_a(e^{i·ψ(θ)}) = e^{iθ} (by invMobiusAngle_mobiusTransform), this reduces to the derivative of circleMap 0 1.

              theorem hasDerivAt_invMobiusAngle (a : ) (ha : a Metric.ball 0 1) (θ : ) :

              The derivative of the inverse Möbius angle is the Poisson kernel (textbook formula (2)): ψ'(θ) = (1 - |a|²) / |e^{iθ} - a|² = P(a, e^{iθ}).

              theorem invMobiusAngle_add_two_pi (a : ) (ha : a Metric.ball 0 1) (θ : ) :

              The inverse Möbius angle is -additive: ψ(θ + 2π) = ψ(θ) + 2π. One full traversal of the circle maps to one full traversal.

              theorem norm_circleMap_zero_one (θ : ) :

              The norm of circleMap 0 1 θ is 1.

              theorem poissonKernel_nonneg_circleMap (a : ) (ha : a Metric.ball 0 1) (θ : ) :
              0 poissonKernel 0 a (circleMap 0 1 θ)

              The Poisson kernel is nonneg on the unit circle when ‖a‖ < 1.

              The Möbius change of variables identity: the Poisson integral of U at a equals the circle average of U ∘ S_a. This is the textbook identity u(S(0)) = (1/2π) ∫₀²π U(S(e^{iφ})) dφ (after formula (2)), which follows from the fact that the Poisson kernel P(a, e^{iθ}) is exactly the Jacobian dφ/dθ of the Möbius reparametrization of the circle.

              Proof: By change of variables using the inverse Möbius angle ψ:

              1. Rewrite the LHS integrand P(a,e^{iθ}) · U(e^{iθ}) as ψ'(θ) · (g ∘ ψ)(θ) where g(φ) = U(S_a(e^{iφ})), using S_a(e^{i·ψ(θ)}) = e^{iθ} and ψ' = P.
              2. Apply integral_deriv_smul_comp_of_deriv_nonneg (Poisson kernel ≥ 0) to get ∫ u in ψ(0)..ψ(2π), g(u).
              3. Use ψ(2π) = ψ(0) + 2π and -periodicity of g to shift to ∫ u in 0..2π, g(u).
              theorem mobiusTransform_tendsto_on_circle (z₀ : ) (hz₀ : z₀ Metric.sphere 0 1) :
              ∀ᵐ (θ : ), θ Set.uIoc 0 (2 * Real.pi)Filter.Tendsto (fun (a : ) => mobiusTransform a (circleMap 0 1 θ)) (nhdsWithin z₀ (Metric.ball 0 1)) (nhds z₀)

              Pointwise convergence of the Möbius transform on the unit circle. For z₀ ∈ sphere 0 1, as a → z₀ from inside the disk, the Möbius transform S_a(z) = (z + a)/(conj(a)·z + 1) converges to z₀ for almost every z on the unit circle (all z ≠ -z₀). In terms of the circle parametrization, for a.e. θ, mobiusTransform a (circleMap 0 1 θ) → z₀.

              The proof is an algebraic computation: when |z₀| = 1, (e^{iθ} + z₀)/(conj(z₀)·e^{iθ} + 1) = (e^{iθ} + z₀)/(conj(z₀)·(e^{iθ} + z₀)) = z₀, using conj(z₀)·z₀ = |z₀|² = 1. The convergence fails only at the single point e^{iθ} = -z₀ where the denominator vanishes, which has measure zero. The textbook states this implicitly (lines 1978–1980) for the special case z₀ = 1.

              Measurability of U ∘ S_a on the circle. For a ∈ ball 0 1, the composition θ ↦ U(S_a(circleMap 0 1 θ)) is AE strongly measurable on [0, 2π]. This follows from the measurability of the Möbius transform (a rational function) composed with circleMap (a smooth function) and then U (a circle-integrable function). The textbook uses this implicitly.

              theorem circleAverage_mobiusTransform_bound (U : ) (hU : CircleIntegrable U 0 1) (hUbd : ∃ (M : ), ∀ (z : ), U z M) (z₀ : ) (hz₀ : z₀ Metric.sphere 0 1) :
              ∃ (bound : ), IntervalIntegrable bound MeasureTheory.volume 0 (2 * Real.pi) ∀ᶠ (a : ) in nhdsWithin z₀ (Metric.ball 0 1), ∀ᵐ (θ : ), θ Set.uIoc 0 (2 * Real.pi)U (mobiusTransform a (circleMap 0 1 θ)) bound θ

              Dominating bound for U ∘ S_a on the circle. For a near z₀ in the open disk, |U(S_a(circleMap 0 1 θ))| ≤ bound(θ) for some interval-integrable bound on [0, 2π]. Since the Möbius transform S_a maps the unit circle to itself, the values of U ∘ S_a on the circle are values of U on the circle. The textbook obtains this from the assumption that U is piecewise continuous (hence bounded) on the compact unit circle. The hypothesis hUbd provides a global bound M on U, modeling the textbook's assumption that piecewise continuous functions on a compact set are bounded.

              theorem circleAverage_mobiusTransform_tendsto (U : ) (hU : CircleIntegrable U 0 1) (hUbd : ∃ (M : ), ∀ (z : ), U z M) (z₀ : ) (hz₀ : z₀ Metric.sphere 0 1) (hcont : ContinuousAt U z₀) :
              Filter.Tendsto (fun (a : ) => Real.circleAverage (U mobiusTransform a) 0 1) (nhdsWithin z₀ (Metric.ball 0 1)) (nhds (U z₀))

              The dominated convergence step in the boundary convergence proof (textbook lines 1975–1981). As a → z₀ from inside the disk, S_a(e^{iφ}) → z₀ for a.e. φ (because the Möbius transform concentrates at the boundary point), and by the dominated convergence theorem the circle average of U ∘ S_a converges to U(z₀).

              The proof uses three sub-facts:

              1. mobiusTransform_tendsto_on_circle: pointwise a.e. convergence of S_a(e^{iθ}) → z₀
              2. circleAverage_mobiusTransform_aestronglyMeasurable: measurability of the integrand
              3. circleAverage_mobiusTransform_bound: integrable dominating bound These are combined via the Lebesgue dominated convergence theorem (intervalIntegral.tendsto_integral_filter_of_dominated_convergence) to show that the interval integral converges, and then the constant limit integral evaluates to U(z₀).
              theorem poissonIntegral_tendsto_boundary (U : ) (hU : CircleIntegrable U 0 1) (hUbd : ∃ (M : ), ∀ (z : ), U z M) (z₀ : ) (hz₀ : z₀ Metric.sphere 0 1) (hcont : ContinuousAt U z₀) :

              At a continuity point of U on the unit circle, the Poisson integral converges to U as the argument approaches the boundary from inside the disk. The proof uses the Möbius transform S_a(z) = (z + a)/(āz + 1) to rewrite the Poisson integral as a plain circle average of U ∘ S_a (poissonIntegral_eq_circleAverage_mobiusTransform), then applies the dominated convergence theorem to conclude (circleAverage_mobiusTransform_tendsto).

              Schwarz's Theorem (Theorem 2, Lecture 16) #

              Helper lemma: harmonicity transfers under pointwise equality on an open set. Since HarmonicOnNhd is a local property (it unfolds to HarmonicAt at each point), if two functions agree on an open neighborhood they have the same harmonicity status.

              Part (a) of Schwarz's Theorem. The Poisson integral of a circle-integrable function is harmonic on the open unit disk.

              Proof (from the textbook): By poissonKernel_eq_re_herglotzRieszKernel, the Poisson kernel P(a, e^{iφ}) = Re((e^{iφ} + a)/(e^{iφ} - a)). Therefore the Poisson integral P_U(a) = Re(H_U(a)) where H_U(a) = (2π)⁻¹ ∫₀²π ((e^{iφ}+a)/(e^{iφ}-a)) U(e^{iφ}) dφ is holomorphic in a (by differentiation under the integral sign). Since P_U is the real part of a holomorphic function, it is harmonic.

              theorem schwarz_poisson_boundary (U : ) (hU : CircleIntegrable U 0 1) (hUbd : ∃ (M : ), ∀ (z : ), U z M) (z₀ : ) (hz₀ : z₀ Metric.sphere 0 1) (hcont : ContinuousAt U z₀) :

              Part (b) of Schwarz's Theorem. At a continuity point e^{iφ₀} of U on the unit circle, lim_{z → e^{iφ₀}} P_U(z) = U(e^{iφ₀}).

              Proof (from the textbook): Using the Möbius transform S(z) = (z + a)/(az + 1) which maps the disk to itself, the Poisson integral becomes P_U(S(0)) = (2π)⁻¹ ∫₀²π U(S(e^{iφ})) dφ. Taking a = tanh t and letting t → ∞, so that a → 1, we get S(e^{iφ}) → 1 for each φ, and by the dominated convergence theorem the integral converges to U(1). By rotational symmetry, the same holds at any continuity point.

              theorem schwarz_poisson (U : ) (hU : CircleIntegrable U 0 1) (hUbd : ∃ (M : ), ∀ (z : ), U z M) :

              Theorem 2, Lecture 16 (Schwarz's Theorem). Let U be a real piecewise continuous function on the unit circle |z| = 1 and define the Poisson integral u(a) = P_U(a) = (2π)⁻¹ ∫₀²π ((1-|a|²)/|a-e^{iφ}|²) U(e^{iφ}) dφ for |a| < 1.

              Then: (a) u is harmonic on the open unit disk |z| < 1; (b) lim_{z → e^{iφ₀}} u(z) = U(e^{iφ₀}) at each continuity point e^{iφ₀} of U.

              The proof uses the identity P(a, e^{iφ}) = Re((e^{iφ}+a)/(e^{iφ}-a)) (Mathlib's poissonKernel_eq_re_herglotzRieszKernel) to express u as the real part of a holomorphic function, which is then harmonic. The boundary behavior is established via Möbius transforms and the dominated convergence theorem.

              Theorem 1: Harmonic functions as real parts of holomorphic functions #

              theorem eq_of_hasDerivAt_eq_on_connected {F₁ F₂ f : } {U : Set } (hU_open : IsOpen U) (hU_conn : IsPreconnected U) (hU_ne : U.Nonempty) (hF₁ : zU, HasDerivAt F₁ (f z) z) (hF₂ : zU, HasDerivAt F₂ (f z) z) {z₀ : } (hz₀ : z₀ U) (heq : F₁ z₀ = F₂ z₀) (z : ) :
              z UF₁ z = F₂ z

              If two functions have the same derivative on an open connected set, they differ by a constant.

              axiom Complex.IsSimplyConnected.eq_of_hasDerivAt_eq_of_mem {f : } {Ω : Set } ( : IsSimplyConnected Ω) (hf : DifferentiableOn f Ω) {V₁ V₂ : Set } {G₁ G₂ : } (hV₁_open : IsOpen V₁) (hV₂_open : IsOpen V₂) (hV₁_conn : IsPreconnected V₁) (hV₂_conn : IsPreconnected V₂) (hV₁_sub : V₁ Ω) (hV₂_sub : V₂ Ω) (hG₁ : wV₁, HasDerivAt G₁ (f w) w) (hG₂ : wV₂, HasDerivAt G₂ (f w) w) {z₀ : } (hz₀₁ : z₀ V₁) (hz₀₂ : z₀ V₂) (heq_z₀ : G₁ z₀ = G₂ z₀) {z : } (hz₁ : z V₁) (hz₂ : z V₂) :
              G₁ z = G₂ z

              Morera's theorem for simply connected domains. On a simply connected domain, a continuous function whose rectangle integrals satisfy the antisymmetry condition (IsConservativeOn) has a primitive.

              This extends Complex.IsConservativeOn.isExactOn_ball (Morera's theorem for disks) to simply connected domains. The textbook establishes this as Corollary 2 (p. 142 / Lecture 13), noting it is "an immediate consequence of Cauchy's Theorem."

              The proof uses an open-closed argument:

              1. Derive holomorphicity from the conservative and continuity hypotheses.
              2. Define S = set of points reachable from a base point z₀ by a primitive.
              3. Show S is open (extend using local primitives on balls).
              4. Show Ω \ S is open (any neighbor of S can be absorbed).
              5. Conclude S = Ω by preconnectedness.
              6. Define F pointwise and verify HasDerivAt using the monodromy axiom for consistency.

              In a simply connected domain, every holomorphic function has a primitive (antiderivative).

              This is a consequence of the Cauchy theorem for simply connected regions: if g is holomorphic on Ω and Ω is simply connected, then the integral of g along any closed curve in Ω is zero, hence g admits a primitive F with F' = g on Ω.

              The return type Complex.IsExactOn g Ω is defined in Mathlib (Mathlib.Analysis.Complex.HasPrimitives) as ∃ F, ∀ z ∈ Ω, HasDerivAt F (g z) z. The method Complex.IsExactOn.with_val_at (also from Mathlib) allows choosing a primitive with a prescribed value at a given point.

              The proof combines two Mathlib results: • DifferentiableOn.isConservativeOn: holomorphic ⟹ conservative (rectangle integrals vanish), • DifferentiableOn.continuousOn: holomorphic ⟹ continuous, with Complex.IsConservativeOn.isExactOn_of_isSimplyConnected (the extension of Morera's theorem from disks to simply connected domains, which is Corollary 2 on p. 142).

              theorem IsHarmonic.exists_holomorphic_re_eq {u : } {Ω : Set } ( : Complex.IsSimplyConnected Ω) (hu : IsHarmonic u Ω) :
              ∃ (f : ), DifferentiableOn f Ω Set.EqOn (fun (z : ) => (f z).re) u Ω

              Theorem 1, Lecture 16. If Ω is simply connected and u is harmonic on Ω, then there exists a holomorphic function f : ℂ → ℂ such that u(z) = Re(f(z)) for all z ∈ Ω.

              The proof constructs the harmonic conjugate v via the "complex gradient" g(z) = ∂u/∂x - i·∂u/∂y, which is holomorphic by the Cauchy–Riemann equations. Simply connectedness of Ω ensures g has a primitive F on Ω, and Re(F) = u follows from the equality of their real derivatives on the connected open set Ω.

              Corollary 1: Mean Value Property for Harmonic Functions #

              theorem IsHarmonic.mean_value_property {u : } {Ω : Set } {z₀ : } {r : } (hu : IsHarmonic u Ω) (hr : 0 r) (hdisk : Metric.closedBall z₀ r Ω) :
              u z₀ = Real.circleAverage u z₀ r

              Corollary 1, Lecture 16 (Mean Value Property for Harmonic Functions). If u is harmonic in Ω and the closed disk |z - z₀| ≤ r lies in Ω, then u(z₀) = (1/2π) ∫₀²π u(z₀ + r·e^{iθ}) dθ.

              In Mathlib notation, Real.circleAverage u z₀ r = (2π)⁻¹ • ∫ θ in 0..2π, u(circleMap z₀ r θ), where circleMap z₀ r θ = z₀ + r * exp(i * θ), so the equality reads u z₀ = circleAverage u z₀ r.

              Proof. By Theorem 1 (Lecture 16), u = Re(f) for some holomorphic f (locally, on the disk). By Cauchy's integral formula, f(z₀) = (2πi)⁻¹ ∮ f(ζ)/(ζ - z₀) dζ. Taking real parts gives the mean value property for u.

              Theorem 20: Mean Value of Harmonic Functions on Annuli #

              If u is harmonic in Ω and the closed annulus {z : r₁ ≤ |z - z₀| ≤ r₂} ⊆ Ω, then the circle average V(r) = (1/2π) ∫₀²π u(z₀ + r·e^{iθ}) dθ satisfies V(r) = α·log(r) + β for some constants α, β and all r ∈ [r₁, r₂].

              The book's proof proceeds by expressing the Laplacian in polar coordinates as Δ = ∂²/∂r² + (1/r)∂/∂r + (1/r²)∂²/∂θ², integrating Δu = 0 over θ ∈ [0, 2π] (the ∂²/∂θ² term vanishes by periodicity), yielding the ODE V''(r) + (1/r)V'(r) = 0, i.e., (d/dr)(r·V'(r)) = 0. Integrating gives r·V'(r) = α, hence V'(r) = α/r, and finally V(r) = α·log(r) + β.

              theorem circleMap_mem_of_annulus {Ω : Set } {z₀ : } {r₁ r₂ r θ : } (hr₁ : 0 < r₁) (hr : r₁ r) (hr2 : r r₂) (hannulus : ∀ (z : ), r₁ z - z₀z - z₀ r₂z Ω) :
              circleMap z₀ r θ Ω

              Helper: circleMap z₀ r θ lies in Ω when r ∈ [r₁, r₂] and the annulus is in Ω.

              theorem circleAverage_hasDerivAt_first {u : } {Ω : Set } {z₀ : } {r₁ r₂ r₀ : } (hu : IsHarmonic u Ω) ( : IsOpen Ω) (hr₁ : 0 < r₁) (hr₁₂ : r₁ r₂) (hr0 : r₁ r₀) (hr0' : r₀ r₂) (hannulus : ∀ (z : ), r₁ z - z₀z - z₀ r₂z Ω) :
              HasDerivAt (fun (s : ) => Real.circleAverage u z₀ s) ((2 * Real.pi)⁻¹ (θ : ) in 0..2 * Real.pi, (fderiv u (circleMap z₀ r₀ θ)) (Complex.exp (θ * Complex.I))) r₀

              Leibniz rule, first application. Differentiation under the integral sign for the circle average of a harmonic function, passing the first radial derivative through the integral. Since u is analytic (hence C^∞) on the open set Ω containing the annulus, the map (r, θ) ↦ u(circleMap z₀ r θ) is C^∞, and all hypotheses of the dominated convergence / Leibniz rule are satisfied on a neighborhood of each r₀ ∈ [r₁, r₂].

              This is a standard analysis fact used without explicit proof in the textbook ("writing the Laplacian in polar coordinates"). The Leibniz rule for parametric integrals and the chain rule for differentiation through circleMap are silently assumed.

              theorem circleAverage_hasDerivAt_second {u : } {Ω : Set } {z₀ : } {r₁ r₂ r₀ : } (hu : IsHarmonic u Ω) ( : IsOpen Ω) (hr₁ : 0 < r₁) (hr₁₂ : r₁ r₂) (hr0 : r₁ r₀) (hr0' : r₀ r₂) (hannulus : ∀ (z : ), r₁ z - z₀z - z₀ r₂z Ω) :
              have V' := fun (r : ) => (2 * Real.pi)⁻¹ (θ : ) in 0..2 * Real.pi, (fderiv u (circleMap z₀ r θ)) (Complex.exp (θ * Complex.I)); HasDerivAt V' ((2 * Real.pi)⁻¹ (θ : ) in 0..2 * Real.pi, (fderiv (fun (z : ) => (fderiv u z) (Complex.exp (θ * Complex.I))) (circleMap z₀ r₀ θ)) (Complex.exp (θ * Complex.I))) r₀

              Leibniz rule, second application. Passing the second radial derivative through the integral. The derivative function r ↦ (2π)⁻¹ ∫₀²π (fderiv ℝ u (circleMap z₀ r θ))(e^{iθ}) dθ is itself differentiable with derivative given by applying the chain rule a second time.

              As with the first application, this uses the Leibniz rule for parametric integrals, which is silently assumed in the textbook's proof of Theorem 20.

              theorem bilinear_trace_rotation (B : →L[] →L[] ) (z : ) :
              (B z) z + (B (Complex.I * z)) (Complex.I * z) = (z.re ^ 2 + z.im ^ 2) * ((B 1) 1 + (B Complex.I) Complex.I)

              For an ℝ-bilinear form B on ℂ, the trace identity B(z,z) + B(Iz,Iz) = (z.re² + z.im²) · (B(1,1) + B(I,I)) holds by direct computation from bilinearity and I² = -1.

              If u is harmonic at z, the trace of the second derivative vanishes: D²u(z)(1,1) + D²u(z)(I,I) = 0. This is the Laplacian formula for the standard orthonormal basis {1, I} of over .

              theorem harmonic_second_deriv_neg {u : } {z e : } (h : InnerProductSpace.HarmonicAt u z) (he : e.re ^ 2 + e.im ^ 2 = 1) :
              ((fderiv (fderiv u) z) e) e = -((fderiv (fderiv u) z) (Complex.I * e)) (Complex.I * e)

              For harmonic u at z and unit-norm e, the second derivatives satisfy D²u(z)(e,e) + D²u(z)(Ie,Ie) = 0, hence D²u(z)(e,e) = -D²u(z)(Ie,Ie). This follows from bilinear_trace_rotation and harmonic_fderiv_trace_zero.

              theorem cexp_re_sq_add_im_sq (θ : ) :
              (Complex.exp (θ * Complex.I)).re ^ 2 + (Complex.exp (θ * Complex.I)).im ^ 2 = 1

              cexp(↑θ * I) has unit norm in the re² + im² = 1 sense.

              theorem hasDerivAt_u_circleMap {u : } {z₀ : } {r₀ θ : } (hu : DifferentiableAt u (circleMap z₀ r₀ θ)) :
              HasDerivAt (fun (θ' : ) => u (circleMap z₀ r₀ θ')) ((fderiv u (circleMap z₀ r₀ θ)) (r₀ * Complex.I * Complex.exp (θ * Complex.I))) θ

              The derivative of θ ↦ u(circleMap z₀ r₀ θ) is Du(z_θ)(r₀ · i · e^{iθ}).

              theorem hasDerivAt_g_of_C2 {u : } {z₀ : } {r₀ θ : } (hu_C2 : ContDiffAt 2 u (circleMap z₀ r₀ θ)) :
              HasDerivAt (fun (θ' : ) => (fderiv u (circleMap z₀ r₀ θ')) (r₀ * Complex.I * Complex.exp (θ' * Complex.I))) (r₀ ^ 2 * ((fderiv (fderiv u) (circleMap z₀ r₀ θ)) (Complex.I * Complex.exp (θ * Complex.I))) (Complex.I * Complex.exp (θ * Complex.I)) - r₀ * (fderiv u (circleMap z₀ r₀ θ)) (Complex.exp (θ * Complex.I))) θ

              The derivative of g(θ) = Du(z_θ)(r₀ · i · e^{iθ}) decomposes as g'(θ) = r₀² · D²u(z_θ)(ie^{iθ}, ie^{iθ}) - r₀ · Du(z_θ)(e^{iθ}).

              theorem periodicity_of_circle_derivative {u : } {z₀ : } {r₀ : } (hu_C2 : ∀ (θ : ), ContDiffAt 2 u (circleMap z₀ r₀ θ)) :
              r₀ * (θ : ) in 0..2 * Real.pi, ((fderiv (fderiv u) (circleMap z₀ r₀ θ)) (Complex.I * Complex.exp (θ * Complex.I))) (Complex.I * Complex.exp (θ * Complex.I)) = (θ : ) in 0..2 * Real.pi, (fderiv u (circleMap z₀ r₀ θ)) (Complex.exp (θ * Complex.I))

              Periodicity of the θ-derivative of Du(z_θ)(ie^{iθ}). The function g(θ) = Du(z₀ + r₀·e^{iθ})(i·e^{iθ}) is 2π-periodic, so by the FTC: ∫₀²π g'(θ) dθ = g(2π) - g(0) = 0. Expanding g'(θ) via chain rule and product rule gives: r₀ · D²u(z_θ)(ie^{iθ}, ie^{iθ}) - Du(z_θ)(e^{iθ}) = 0 after integration. Rearranging: r₀ · ∫ D²u(ie^{iθ}, ie^{iθ}) dθ = ∫ Du(e^{iθ}) dθ.

              The textbook (Theorem 20) uses this fact without proof when stating that the ∂²/∂θ² term in the polar Laplacian integrates to zero.

              theorem fderiv_eval_eq_fderiv2 {u : } {z₀ v w : } (hu : DifferentiableAt (fderiv u) z₀) :
              (fderiv (fun (z : ) => (fderiv u z) v) z₀) w = ((fderiv (fderiv u) z₀) w) v

              Chain rule for evaluating the second derivative: the derivative of z ↦ (fderiv ℝ u z) v at z₀ in direction w equals D²u(z₀)(w)(v).

              theorem euler_ode_from_laplacian {u : } {Ω : Set } {z₀ : } {r₁ r₂ r₀ : } (hu : IsHarmonic u Ω) ( : IsOpen Ω) (hr₁ : 0 < r₁) (hr₁₂ : r₁ r₂) (hr0 : r₁ r₀) (hr0' : r₀ r₂) (hannulus : ∀ (z : ), r₁ z - z₀z - z₀ r₂z Ω) :
              have V'₀ := (2 * Real.pi)⁻¹ (θ : ) in 0..2 * Real.pi, (fderiv u (circleMap z₀ r₀ θ)) (Complex.exp (θ * Complex.I)); have V''₀ := (2 * Real.pi)⁻¹ (θ : ) in 0..2 * Real.pi, (fderiv (fun (z : ) => (fderiv u z) (Complex.exp (θ * Complex.I))) (circleMap z₀ r₀ θ)) (Complex.exp (θ * Complex.I)); V''₀ + V'₀ / r₀ = 0

              Euler ODE from the Laplacian. The key mathematical step: combining Δu = 0 with periodicity (∫₀²π ∂²u/∂θ² dθ = 0) to derive V'' + V'/r = 0.

              The proof uses three ingredients:

              1. Chain rule (fderiv_eval_eq_fderiv2): The V'' integrand equals D²u(e^{iθ}, e^{iθ})
              2. Harmonicity (bilinear_trace_rotation + harmonic_fderiv_trace_zero): D²u(e^{iθ}, e^{iθ}) = -D²u(ie^{iθ}, ie^{iθ})
              3. Periodicity (periodicity_of_circle_derivative): r₀ · ∫ D²u(ie^{iθ}, ie^{iθ}) dθ = ∫ Du(e^{iθ}) dθ

              Combining: V''₀ = -(2π)⁻¹ ∫ D²u(ie,ie) = -(1/r₀)(2π)⁻¹ ∫ Du(e) = -V'₀/r₀, hence V''₀ + V'₀/r₀ = 0.

              theorem harmonic_circleAverage_euler_ode {u : } {Ω : Set } {z₀ : } {r₁ r₂ : } (hu : IsHarmonic u Ω) ( : IsOpen Ω) (hr₁ : 0 < r₁) (hr₁₂ : r₁ r₂) (hannulus : ∀ (z : ), r₁ z - z₀z - z₀ r₂z Ω) :
              ∃ (V' : ) (V'' : ), (∀ (r : ), r₁ rr r₂HasDerivAt (fun (s : ) => Real.circleAverage u z₀ s) (V' r) r) (∀ (r : ), r₁ rr r₂HasDerivAt V' (V'' r) r) ∀ (r : ), r₁ rr r₂V'' r + V' r / r = 0

              Euler ODE for circle average. The circle average V(r) = circleAverage u z₀ r of a harmonic function on an annulus is C² and satisfies the Euler ODE V''(r) + V'(r)/r = 0.

              The textbook's proof (Theorem 20) derives this by expressing the Laplacian in polar coordinates as Δ = ∂²/∂r² + (1/r)∂/∂r + (1/r²)∂²/∂θ², integrating Δu = 0 over θ ∈ [0, 2π], and using the periodicity ∫₀²π ∂²u/∂θ² dθ = 0.

              The proof is decomposed into three steps:

              1. circleAverage_hasDerivAt_first: Leibniz rule for V'
              2. circleAverage_hasDerivAt_second: Leibniz rule for V''
              3. euler_ode_from_laplacian: ODE from Δu = 0 + periodicity
              theorem euler_ode_solution (V V' V'' : ) (r₁ r₂ : ) (hr₁ : 0 < r₁) (hV : ∀ (r : ), r₁ rr r₂HasDerivAt V (V' r) r) (hV' : ∀ (r : ), r₁ rr r₂HasDerivAt V' (V'' r) r) (hode : ∀ (r : ), r₁ rr r₂V'' r + V' r / r = 0) :
              ∃ (α : ), ∀ (r : ), r₁ rr r₂HasDerivAt V (α / r) r

              Solving the Euler ODE: if a function V is C² and satisfies V''(r) + V'(r)/r = 0 on [r₁, r₂] with 0 < r₁, then V'(r) = α/r for some constant α.

              The proof rewrites the ODE as (d/dr)(r·V'(r)) = 0, so W(r) = r·V'(r) is constant.

              theorem harmonic_circleAverage_ode {u : } {Ω : Set } {z₀ : } {r₁ r₂ : } (hu : IsHarmonic u Ω) ( : IsOpen Ω) (hr₁ : 0 < r₁) (hr₁₂ : r₁ r₂) (hannulus : ∀ (z : ), r₁ z - z₀z - z₀ r₂z Ω) :
              ∃ (α : ), ∀ (r : ), r₁ rr r₂HasDerivAt (fun (s : ) => Real.circleAverage u z₀ s) (α / r) r

              ODE for circle average. The circle average of a harmonic function on an annulus satisfies V'(r) = α/r for some constant α.

              The textbook's proof (Theorem 20) derives this from the polar-coordinates Laplacian. The intermediate step — the Euler ODE V'' + V'/r = 0 — is proved in harmonic_circleAverage_euler_ode (using axiomatized Leibniz rule and polar Laplacian facts, which are silently assumed in the textbook). The present theorem solves this ODE to obtain V' = α/r.

              theorem harmonic_annulus_mean_value {u : } {Ω : Set } {z₀ : } {r₁ r₂ : } (hu : IsHarmonic u Ω) ( : IsOpen Ω) (hr₁ : 0 < r₁) (hr₁₂ : r₁ r₂) (hannulus : ∀ (z : ), r₁ z - z₀z - z₀ r₂z Ω) :
              ∃ (α : ) (β : ), ∀ (r : ), r₁ rr r₂Real.circleAverage u z₀ r = α * Real.log r + β

              Theorem 20 (Lecture 16). If u is harmonic in Ω and the closed annulus {z : r₁ ≤ |z - z₀| ≤ r₂} ⊆ Ω, then the circle average of u on the circle of radius r around z₀ is of the form α · log r + β for constants α, β.

              The proof uses the ODE V'(r) = α/r (proved in harmonic_circleAverage_ode) and integrates to obtain V(r) = α · log r + β via the mean value theorem for derivatives.

              Exercise 5, p. 171 (Ahlfors, Chapter 4 §6.2) #

              Prove that ∫_{-π}^{π} log|1 + e^{iθ}| dθ = 0.

              Proof (textbook). Since log|1+z| is harmonic in |z| < 1, the mean-value theorem gives (2π)⁻¹ ∫_{-π}^{π} log|1 + r·e^{iθ}| dθ = log|1 + 0| = log 1 = 0 for r < 1. Bounding |log|1 + r·e^{iθ}|| by an integrable function of θ and applying the dominated convergence theorem to let r → 1 gives the result.

              Formalization. In Mathlib, circleAverage_log_norm_add_const_eq_posLog gives circleAverage (log ‖· + a‖) 0 1 = log⁺ ‖a‖ for all a : ℂ. Taking a = 1 yields circleAverage (log ‖· + 1‖) 0 1 = log⁺ 1 = 0, which is the circle-average formulation. We convert to the [-π, π] integral by periodicity.

              Exercise 5, p. 171 (circle average form). (2π)⁻¹ ∫₀²π log|e^{iθ} + 1| dθ = 0. This is the circle average of log ‖· + 1‖ over the unit circle.

              Exercise 5, p. 171 (integral over [0, 2π]). ∫₀²π log|e^{iθ} + 1| dθ = 0.

              Exercise 5, p. 171 (textbook form). $\int_{-\pi}^{\pi} \log|1 + e^{i\theta}|\, d\theta = 0$.

              This is the form stated in the textbook. Since log|1 + z| is harmonic in |z| < 1, the mean-value property gives (2π)⁻¹ ∫ log|1 + re^{iθ}| dθ = 0 for r < 1. The dominated convergence theorem extends this to r = 1. In our formalization, we use circleAverage_log_norm_add_const_eq_posLog directly and convert by periodicity.