A Formal Proof of Cauchy`s Residue Theorem

A Formal Proof of Cauchy’s Residue Theorem
Wenda Li and Lawrence C. Paulson
University of Cambridge
{wl302,lp15}@cam.ac.uk
August 21, 2016
1 / 20
a1
an
γ
a2
s
Informally, suppose f is holomorphic (i.e. complex differentiable)
on an open set s except for a finite number of points {a1 , a2 , ..., an }
and γ is some closed path, Cauchy’s residue theorem states
I
f = 2πi
γ
n
X
n(γ, ak )Res(f , ak )
k=1
where
I
n(γ, ak ) is the winding number of γ about ak
I
Res(f , ak ) is the residue of f at ak
2 / 20
Overview
1. Background: the multivariate analysis library in Isabelle/HOL
2. Main proof of the residue theorem
3. Application to improper integrals
4. Corollaries: the argument principle and Rouché’s theorem
5. Related work
6. Conclusion
3 / 20
Background: the multivariate analysis library
The multivariate analysis library in Isabelle/HOL
I
I
about 70000 LOC (for now) on topology, analysis and linear
algebra
originates from John Harrison’s work in HOL Light
I
I
Rn vs. type classes
scripted proofs vs. structured proofs
4 / 20
Background: contour integration
Contour integration is mathematically defined as
I
Z 1
f =
f (γ(t))γ 0 (t)dt.
γ
0
In Isabelle/HOL, we have
definition has contour integral ::
"(complex ⇒ complex) ⇒ complex ⇒ (real ⇒ complex)
⇒ bool"
where "(f has contour integral i) γ ≡
((λx. f(γ x) * vector derivative γ (at x within {0..1}))
has integral i) {0..1}"
and also contour integral of type
(complex ⇒ complex) ⇒ (real ⇒ complex) ⇒ complex
5 / 20
Background: valid paths
A valid path is a piecewise continuously differentiable function on
[0..1].
lemma valid_path_def:
fixes γ::"real ⇒ ’a::real_normed_vector"
shows "valid_path γ ←→ continuous_on {0..1} γ ∧
(∃ s. finite s ∧ γ C1_differentiable_on ({0..1} - s))"
6 / 20
Background: winding numbers
The winding number n(γ, z) is the number of times the path γ
travels counterclockwise around the point z:
I
dw
1
n(γ, z) =
2πi γ w − z
A lemma to illustrate this definition is as follows:
lemma winding number valid path:
fixes γ::"real ⇒ complex" and z::complex
assumes "valid path γ" and "z ∈
/ path image γ"
shows "winding number γ z
= 1/(2*pi*i) * contour integral γ (λw. 1/(w - z))"
7 / 20
Background: Cauchy’s integral theorem
Cauchy’s integral theorem states: given f is a holomorphic
function on an open set s, which contains a closed path γ and its
interior, then
I
f =0
γ
theorem Cauchy_theorem_global:
fixes s::"complex set" and f::"complex ⇒ complex"
and γ::"real ⇒ complex"
assumes "open s" and "f holomorphic_on s"
and "valid_path γ" and "pathfinish γ = pathstart γ"
and "path_image
γ ⊆ s"
V
and " w. w ∈
/ s =⇒ winding_number γ w = 0"
shows "(f has_contour_integral 0) γ"
8 / 20
Main proof: singularities
Cauchy’s integral theorem does not apply when there are
singularities.
For example, consider f (w ) = w1 so that f has a pole at w = 0,
and γ is the circular path γ(t) = e 2πit :
I
Z 1
Z 1
1
d 2πit
dw
=
e
dt =
2πidt = 2πi 6= 0
2πit
dt
0
0 e
γ w
9 / 20
Main proof: residue
The residue of f at z can be defined as
I
1
f
Res(f , z) =
2πi circ(z)
where circ(z) is a small counterclockwise circular path around z.
z
definition residue
::"(complex ⇒ complex) ⇒ complex ⇒ complex"
where "residue f z = (SOME int. ∃ δ>0. ∀ ε>0. ε<δ −→
(f has_contour_integral 2*pi*i*int) (circlepath z ε))"
10 / 20
Main proof: Cauchy’s residue theorem
lemma Residue_theorem:
fixes s pts::"complex set" and f::"complex ⇒ complex"
and γ::"real ⇒ complex"
assumes "open s" and "connected s"
and "finite pts" and "f holomorphic_on s-pts"
and "valid_path γ" and "pathfinish γ = pathstart γ"
and "path_image γ ⊆ s-pts"
and "∀ z. (z ∈
/ s) −→ winding_number γ z = 0"
shows "contour_integral
γ f
P
= 2*pi*i*( p∈pts. winding_number γ p * residue f p)"
11 / 20
Main proof: remarks
I
the core idea to induct on
the number of singularity
points
I
gap in informal proofs
s
γ
12 / 20
Application to improper integrals
The residue theorem can be
used to solve improper integrals:
Z ∞
dx
=π
2+1
x
−∞
CR
i
γR
−R
R
−i
Proof: let
f (z) =
since limR→∞
H
CR
z2
1
+ 1.
f = 0 we have
Z
∞
−∞
dx
= lim
x 2 + 1 R→∞
I
f
γR +CR
13 / 20
Z
∞
−∞
dx
=π
+1
x2
I
⇔ lim
f =π
R→∞ γR
I
I
⇔ lim (
f +
f)=π
R→∞ γR
CR
I
⇔ lim
f
R→∞ γR +CR
= 2πiRes(γR + CR , i) = π
def f≡"λx::real. 1/(x^2+1)"
def f’≡"λx::complex. 1/(x^2+1)"
have "((λR. integral {- R..R} f) −→ pi) at_top
= ((λR. contour_integral (γ R R) f’)
−→ pi) at_top"
also have "... = ((λR. contour_integral (CR R) f’
+ contour_integral (γ R R) f’) −→ pi) at_top"
also have "... = ((λR. contour_integral
(CR R +++ γ R R) f’) −→ pi) at_top"
also have "..."
proof have "contour_integral (CR R +++ γ R R) f’ = pi"
when "R>1" for R
then show ?thesis
qed
finally have "((λR. integral {- R..R}
(λx. 1 / (x2 + 1))) −→ pi) at_top"
14 / 20
Application to improper integrals (3)
CR
i
−R
γR
R
−i
lemma improper_Ex:
"Lim at_top (λR. integral {- R..R} (λx. 1/(x2 +1))) = pi"
Remarks
I
about 300 LOC
I
the main difficulty is to show n(γR + CR , i) = 1 and
n(γR + CR , −i) = 0
15 / 20
Corollaries: the argument principle
The argument principle states: suppose f is holomorphic on a
connected open set s except for a finite number of poles and γ is a
valid closed path, then


I 0
X
X
f
= 2πi 
n(γ, z)zorder (f , z) −
n(γ, z)porder (f , z)
γ f
z∈zeros
z∈poles
where
I
f 0 is the first derivative of f ;
I
zorder (f , z) and porder (f , z) are the order of a zero and a
pole respectively;
I
zeros and poles are the zeros and poles respectively of f .
16 / 20
Corollaries: Rouché’s theorem
Given two functions f and g holomorphic on a connected open set
containing a valid path γ, if
|f (w )| > |g (w )|
then Rouché’s Theorem states
X
n(γ, z)zorder (f , z) =
z∈zeros(f )
∀w ∈ image of γ
X
n(γ, z)zorder (f + g , z)
zeros(f +g )
17 / 20
Big picture
Cauchy’s residue theorem
Rouché’s theorem
Roots of a polynomial depend
continuously on its coefficients
in progress
Decision procedure to solve
first-order real formulas
18 / 20
Related work
To the best of our knowledge, our formalization of Cauchy’s
residue theorem is novel among major proof assistants.
I
HOL Light: comprehensive library for complex analysis, to
which it should be not hard to port our result;
I
Coq: Coquelicot and C-Corn, but they are mainly about real
analysis and some fundamental theorems (e.g. Cauchy’s
integral theorem) are not yet available.
19 / 20
Conclusion
To conclude, I have mainly covered
I
the multivariate analysis library in Isabelle/HOL
I
the residue theorem
I
application to improper integrals
I
corollaries: the argument principle and Rouché’s theorem
Thank you for your attention!
20 / 20