Residue Theorem

lean4-proofcomplex-analysisvisualization
γf(z)dz=2πikRes(f,ak)\oint_\gamma f(z)\,dz = 2\pi i \sum_{k} \operatorname{Res}(f, a_k)

Statement

Let ff be meromorphic inside and on a simple closed contour γ\gamma (traversed counterclockwise), with isolated poles a1,,ana_1, \ldots, a_n inside γ\gamma. Then:

γf(z)dz=2πik=1nRes(f,ak)\oint_\gamma f(z)\,dz = 2\pi i \sum_{k=1}^n \operatorname{Res}(f, a_k)

For a simple pole at aa, the residue is Res(f,a)=limza(za)f(z)\operatorname{Res}(f, a) = \lim_{z \to a}(z - a)f(z).

Visualization

Example 1: f(z)=1/zf(z) = 1/z, contour z=1|z| = 1.

Res(1/z,  0)=limz0z1z=1\operatorname{Res}(1/z,\; 0) = \lim_{z \to 0} z \cdot \frac{1}{z} = 1
z=1dzz=2πi1=2πi\oint_{|z|=1} \frac{dz}{z} = 2\pi i \cdot 1 = 2\pi i

Example 2: f(z)=1/(z2+1)f(z) = 1/(z^2 + 1), contour z=2|z| = 2.

Poles at z=iz = i and z=iz = -i, both inside z=2|z| = 2.

Pole aa(za)f(z)(z - a) \cdot f(z)Residue
ii<span class="math-inline" data-latex="\frac{1}{z+i}\big_{z=i} = \frac{1}{2i}">
i-i<span class="math-inline" data-latex="\frac{1}{z-i}\big_{z=-i} = \frac{1}{-2i}">

Sum of residues =12i12i=0= \frac{1}{2i} - \frac{1}{2i} = 0, so:

z=2dzz2+1=2πi0=0\oint_{|z|=2}\frac{dz}{z^2 + 1} = 2\pi i \cdot 0 = 0

Example 3: f(z)=ez/z2f(z) = e^z/z^2, contour z=1|z| = 1.

Pole at z=0z = 0 of order 2. Residue =ddz[ez]z=0=1= \frac{d}{dz}[e^z]\big|_{z=0} = 1, so the integral =2πi= 2\pi i.

Proof Sketch

  1. Isolate each pole aka_k with a small disk DkD_k of radius ε\varepsilon; deform γ\gamma to avoid them.
  2. On the deformed region, ff is holomorphic, so the integral is unchanged and equals the sum of integrals over small circles zak=ε|z - a_k| = \varepsilon.
  3. For a simple pole, Laurent expand: f(z)=c1zak+g(z)f(z) = \frac{c_{-1}}{z - a_k} + g(z) where gg is holomorphic. The circle integral of gg vanishes; the integral of c1/(zak)c_{-1}/(z - a_k) is 2πic1=2πiRes(f,ak)2\pi i \cdot c_{-1} = 2\pi i \cdot \operatorname{Res}(f, a_k).
  4. Sum over all poles.

Connections

The Residue Theorem is the Cauchy Integral Formula applied iteratively — it extends Cauchy Integral FormulaCauchy Integral Formulaf(w)=12πizc=Rf(z)zwdzf(w) = \frac{1}{2\pi i}\oint_{|z-c|=R} \frac{f(z)}{z - w}\,dzA holomorphic function's value at any interior point is determined by its values on the boundary circle.Read more → to meromorphic functions. It connects to Liouville's TheoremLiouville's Theoremf:CC entire,  fC    fconstf : \mathbb{C} \to \mathbb{C} \text{ entire},\; |f| \leq C \implies f \equiv \text{const}A bounded entire function on ℂ must be constant — complex differentiability is far more rigid than real differentiabilityRead more →: an entire function with a "residue at infinity" forces non-constancy.

Lean4 Proof

import Mathlib.Analysis.Complex.CauchyIntegral

open Complex MeasureTheory

/-- **Residue formula for a simple pole**: the circle integral of f(z)/(z - a)
    equals 2πi · f(a) when f is holomorphic on the closed disk.
    This is the Residue Theorem for a single simple pole, derived directly
    from the Cauchy Integral Formula in Mathlib. -/
theorem residue_simple_pole {R : } {c a : } {f :   }
    (hf : DiffContOnCl  f (Metric.ball c R))
    (ha : a  Metric.ball c R) :
    ∮ z in C(c, R), (z - a)⁻¹ • f z = (2 * π * Complex.I) • f a :=
  hf.circleIntegral_sub_inv_smul ha