\section{Complex Differentiability}
\label{section:complex-derivative}

\begin{lemma}
\label{lemma:complex-analytic}
    Let $E$ be a separated locally convex space over $\complex$, $U \subset \complex$, and $f: U \to E$, then the following are equivalent:
    \begin{enumerate}
        \item $f \in C^1(U; E)$. 
        \item Under the identification of $C = \real^2$, $\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \in C(U; E)$ and
        \[
        \frac{\partial f}{\partial x} = i\frac{\partial f}{\partial y}
        \]
    \end{enumerate}
\end{lemma}
\begin{proof}
    (1) $\Rightarrow$ (2): Let $x_0 \in U$, then
    \[
    \frac{\partial f}{\partial x} = \lim_{\substack{h \to 0 \\ h \in \real}}\frac{f(x_0 + h) - f(x_0)}{h} 
    = \lim_{h \to 0}\lim_{\substack{h \to 0 \\ h \in \real}}\frac{f(x_0 + ih) - f(x_0)}{ih} = \frac{1}{i} \frac{\partial f}{\partial y}
    \]

    (2) $\Rightarrow$ (1): Let $x_0 \in U$ and
    \[
    L: \complex \to E \quad a + bi \mapsto a \frac{\partial f}{\partial x}(x_0) + b \frac{\partial f}{\partial y}(x_0)
    \]

    by assumption and \autoref{proposition:polarisation-linear}, $L \in L(\complex; E)$. By \autoref{proposition:partial-total-derivative}, $f \in C^1(U \subset \real^2; E)$, where for any $(a, b) \in \real^2$, 
    \[
    Df(x_0)(a, b) = a \frac{\partial f}{\partial x}(x_0) + b \frac{\partial f}{\partial y}(x_0)
    \]

    so by definition of differentiability, $f$ is complex-differentiable at $x_0$ with derivative $L$. 
\end{proof}

\begin{theorem}[Cauchy]
\label{theorem:cauchy-homotopy}
    Let $E$ be a complete separated locally convex space over $\complex$, $U \subset \complex$ be open, $f \in C^1(U; E)$, and $\gamma, \mu \in C([a, b]; U)$ be closed rectifiable paths. If $\gamma$ and $\mu$ are homotopic, then
    \[
    \int_\gamma f = \int_\mu f
    \]
\end{theorem}
\begin{proof}[Proof of smooth case. ]
    Let $\Gamma \in C^\infty([0, 1] \times [a, b]; U)$ be a smooth homotopy of loops from $\gamma$ to $\mu$, and
    \[
    F: [0, 1] \to E \quad t \mapsto \int_{\Gamma (t, \cdot)}f = \int_a^b (f \circ \Gamma)(t, s) \Gamma(t, ds)
    \]

    then for any $t \in [0, 1]$, by the \hyperref[change of variables formula]{theorem:rs-change-of-variables}, 
    \begin{align*}
        F(t) &= \int_a^b (f \circ \Gamma)(t, s) \Gamma(t, ds) \\
        &= \int_a^b (f \circ \Gamma)(t, s) \frac{\partial \Gamma}{\partial s}(t, s) ds
    \end{align*}

    Now, by \autoref{proposition:difference-quotient-compact}, 
    \[
        \frac{dF}{dt}(t) = \int_a^b \frac{\partial}{\partial t}\braks{(f \circ \Gamma)(t, s) \frac{\partial \Gamma}{\partial s}(t, s)}ds
    \]

    Under the identification that $\complex = \real^2$, by the \hyperref[power rule]{theorem:power-rule} and the \hyperref[chain rule]{proposition:chain-rule-sets-conditions},
    \[
    \frac{\partial }{\partial t}\braks{(f \circ \Gamma) \frac{\partial \Gamma}{\partial s}} = (Df \circ \Gamma)\paren{\frac{\partial\Gamma}{\partial t}} \frac{\partial \Gamma}{\partial s} + (f \circ \Gamma) \frac{\partial^2\Gamma}{\partial t \partial s}
    \]
    
    Now, since $f \in C^1(U; E)$ satisfies the \hyperref[Cauchy-Riemann equations]{lemma:complex-analytic},
    \begin{align*}
    (Df \circ \Gamma)\paren{\frac{\partial\Gamma}{\partial t}} \frac{\partial \Gamma}{\partial s} &= 
    (Df \circ \Gamma)\frac{\partial\Gamma}{\partial t} \frac{\partial \Gamma}{\partial s} = (Df \circ \Gamma)\paren{\frac{\partial \Gamma}{\partial s}}\frac{\partial\Gamma}{\partial t} 
    \end{align*}

    so
    \begin{align*}
        \frac{\partial }{\partial t}\braks{(f \circ \Gamma) \frac{\partial \Gamma}{\partial s}} &= (Df \circ \Gamma)\paren{\frac{\partial\Gamma}{\partial s}} \frac{\partial \Gamma}{\partial t} + (f \circ \Gamma) \frac{\partial^2\Gamma}{\partial s \partial t} \\
        &= \frac{\partial }{\partial s}\braks{(f \circ \Gamma) \frac{\partial \Gamma}{\partial t}}
    \end{align*}

    Hence by the \hyperref[Fundamental Theorem of Calculus]{theorem:ftc-riemann}, 
    \begin{align*}
        \frac{dF}{dt}(t) &= \int_a^b \frac{\partial}{\partial s}\braks{(f \circ \Gamma)(t, s) \frac{\partial \Gamma}{\partial t}(t, s)}ds \\
        &= (f \circ \Gamma)(t, b)\frac{\partial \Gamma}{\partial t}(t, b) - (f \circ \Gamma)(t, a)\frac{\partial \Gamma}{\partial t}(t, a)
    \end{align*}

    Since $\Gamma(t, a) = \Gamma(t, b)$ for all $t \in [0, 1]$, the above expression evaluates to $0$, so
    \[
    \int_\gamma f = F(0) = F(1) = \int_\mu f
    \]

    by \autoref{proposition:zero-derivative-constant}. 
\end{proof}
\begin{proof}[Proof of general case. ]
    Let $\Gamma \in C([0, 1] \times [a, b]; \complex)$ be a homotopy of loops from $\gamma$ to $\mu$. By augmenting $\Gamma$ and using \autoref{lemma:rectifiable-piecewise-linear}, assume without loss of generality that:
    \begin{enumerate}[label=(\alph*)]
        \item $\mu$, $\gamma$ are piecewise linear. 
    \end{enumerate}
    
    Furthermore, by passing through a reparametrisation, assume without loss of generality that:
    \begin{enumerate}[label=(\alph*),start=1]
        \item For each $t \in [0, \eps)$, $\Gamma(t, \cdot) = \gamma$.
        \item For each $t \in (1 - \eps, 1]$, $\Gamma(t, \cdot) = \mu$.
        \item For each $t \in [0, 1]$, $\Gamma$ is constant on $\bracs{t} \times ([a, a + \eps] \cup [b - \eps, b])$.
    \end{enumerate}

    Extend $\Gamma$ to $[0, 1] \times \real$ by
    \[
    \Gamma_0: \real^2 \to \complex \quad (t, s) \mapsto \begin{cases}
        \Gamma(t, s) &t \in k(b-a) + [a, b], k \in \integer \\
    \end{cases}
    \]

    then extend $\Gamma_0$ to $\real^2$ by
    \[
    \ol \Gamma: \real^2 \to \complex \quad (t, s) \mapsto \begin{cases}
        \Gamma(t, s) &t \in [0, 1] \\
        \Gamma(1, s) &t \ge 1 \\
        \Gamma(0, s) &t \le 0
    \end{cases}
    \]

    Let $\varphi \in C_c^\infty(\real^2; \real)$ with $\int_{\real^2} \varphi = 1$. For each $\delta \ge 0$, let
    \[
    \Gamma_\delta: [0, 1] \times [a, b] \to \complex \quad (t, s) \mapsto \frac{1}{\delta^2}\int_{\real^2} \Gamma(y) \varphi\paren{\frac{(t, s) - y}{\delta}}dy
    \]

    Since for each $k \in \integer$ and $(t, s) \in \real^2$, $\Gamma(t, s + k(b - a)) = \Gamma(t, s)$, $\Gamma_\delta(t, a) = \Gamma_\delta(t, b)$ for all $t \in [0, 1]$. Therefore $\Gamma_\delta$ is a homotopy of loops. Since $\Gamma$ is continuous, $\Gamma([0, 1] \times [a, b])$ is compact, so $\Gamma_\delta$ lies in $U$ for sufficiently small 

    By assumptions (b) and (c), for sufficiently small $\delta$, there exists $\psi \in C_c^\infty(\real; \real)$ with $\int_{\real} \psi = 1$ such that
    \[
    \Gamma_\delta(0, s) = \frac{1}{\delta}\int_{\real^2} \Gamma(0, y) \psi\paren{\frac{s - y}{\delta}}dy
    \]

    and
    \[
    \Gamma_\delta(1, s) = \frac{1}{\delta}\int_{\real^2} \Gamma(1, y) \psi\paren{\frac{s - y}{\delta}}dy
    \]

    By assumption (a), (d), and \autoref{lemma:rectifiable-smooth}, 
    \[
    \int_\gamma f = \lim_{\delta \downto 0} \int_{\Gamma_\delta(0, \cdot)}f = \lim_{\delta \downto 0} \int_{\Gamma_\delta(1, \cdot)}f = \int_\mu f 
    \]
\end{proof}

\begin{definition}
\label{definition:winding-number-1}
    Let $U \subset \complex$, $z_0 \in U$, and $r > 0$ such that $\ol{B(z_0, r)} \subset U$, then the path
    \[
    \omega_{z_0, r}: [0, 2\pi] \to U \quad \theta \mapsto a + re^{i\theta}
    \]

    is the \textit{standard path of winding number $1$} at $a$ with radius $r$. 
\end{definition}


\begin{theorem}[Cauchy's Integral Formula]
\label{theorem:cauchy-formula}
    Let $E$ be a complete separated locally convex space over $\complex$, $U \subset \complex$ be open, $z_0 \in U$, $r > 0$ such that $\ol{B(z_0, r)} \subset U$, $\gamma \in C([a, b]; \complex)$ be a closed, rectifiable path homotopic to $\omega_{z_0, r}$ on $U \setminus \bracs{z_0}$, and $f \in C^1(U; E)$, then
    \begin{enumerate}
        \item $\int_\gamma f = 0$.
        \item $f(z) = \frac{1}{2\pi i}\int_\gamma \frac{f(z)}{z - z_0}dz$. 
    \end{enumerate}

    More over, for any $g \in C(U; E)$ that satisfies (2) for all $z_0 \in U$, $r > 0$ with $\ol{B(z_0, r)} \subset U$, closed rectifiable curve $\gamma \in C([a, b]; \complex)$ homotopic to $\omega_{z_0, r}$ on $U \setminus \bracs{z_0}$, 
    \begin{enumerate}[start=2]
        \item $g \in C^\infty(U; E)$, where for each $k \in \natz$, 
        \[
        D^kg(z_0) = \frac{k!}{2\pi i}\int_{\gamma} \frac{g(z)}{(z - z_0)^{k+1}}dz
        \]
    \end{enumerate}
\end{theorem}
\begin{proof}
    By \autoref{theorem:cauchy-homotopy} and the \hyperref[change of variables formula]{theorem:rs-change-of-variables}, for any $g \in C^1(U \setminus \bracs{z_0}; E)$, 
    \[
    \int_\gamma g = \lim_{s \downto 0} \int_{\omega_{z_0, s}} g = \int_0^{2\pi} 
    = \lim_{s \downto 0}\frac{s}{2\pi} \int_{0}^{2\pi} g \circ \omega_{z_0, s}(\theta) e^{i\theta} d\theta
    \]

    (1): Since $f \in C(U; E)$, $f$ is bounded on $\ol{B(z_0, r)}$, so for any $s \in (0, r)$,
    \[
    \frac{s}{2\pi} \int_{0}^{2\pi} f \circ \omega_{z_0, s}(\theta) e^{i\theta} d\theta \in s\ol{\text{Conv}}(f(\ol{B(z_0, r)}))
    \]

    As $E$ is locally convex, 
    \[
    \int_\gamma g = \lim_{s \downto 0} \int_{\omega_{z_0, s}} g = 0
    \]

    (2): Since $f \in C(U; E)$, 
    \begin{align*}
        \frac{1}{2\pi i}\int_{\gamma} \frac{f(z)}{z - z_0}dz &= \lim_{s \downto 0}\frac{s}{2\pi} \int_{0}^{2\pi} \frac{f \circ \omega_{z_0, s}(\theta)}{\omega_{z_0, s}(\theta) - z_0} e^{i\theta} d\theta \\
        &= \lim_{s \downto 0}\frac{1}{2\pi}\int_0^{2\pi} f \circ \omega_{z_0, s}(\theta) d\theta = f(z_0)
    \end{align*}

    (3): Suppose inductively that (3) holds for $k \in \natz$. For sufficiently small $h \in \complex$, 
    \[
    \frac{D^kg(z_0 + h) -D^kg(z_0)}{h} = \frac{k!}{2\pi ih} \int_\gamma \frac{g(z)}{(z - z_0-h)^{k+1}} - \frac{g(z)}{(z- z_0)^{k+1}}dz
    \]

    By \autoref{proposition:difference-quotient-compact}, 
    \[
    \lim_{h \to 0}\frac{D^kg(z_0 + h) -D^kg(z_0)}{h} = \frac{(k+1)!}{2\pi i} \int_\gamma \frac{g(z)}{(z - z_0)^{k+2}} dz
    \]

    Therefore $g \in C^{k+1}(U; E)$ with
    \[
    D^{k+1}g(z_0) = \frac{(k+1)!}{2\pi i} \int_\gamma \frac{g(z)}{(z - z_0)^{k+2}} dz
    \]    
\end{proof}

\begin{corollary}[Cauchy's Estimate]
\label{corollary:cauchy-estimate}
    Let $E$ be a complete separated locally convex space over $\complex$, $U \subset \complex$ be open, $z_0 \in U$, $r > 0$ such that $\ol{B(z_0, r)} \subset U$, then for any $k \in \natz$ and continuous seminorm $[\cdot]_E: E \to [0, \infty)$, 
    \[
    [D^kf(z_0)]_E \le \frac{k!}{r^k} \sup_{z \in \ol{B(z_0, r)}}[f(z)]_E
    \]
\end{corollary}
\begin{proof}
    By \autoref[Cauchy's Integral Formula]{theorem:cauchy-formula} and \autoref{proposition:rs-bound}, 
    \begin{align*}
        D^kf(z_0) &= \frac{k!}{2\pi i}\int_{\omega_{z_0, r}} \frac{f(z)}{(z - z_0)^{k+1}}dz \\
        [D^kf(z_0)]_E &\le \frac{k!}{2\pi i}\int_0^{2\pi}\frac{[f(z)]_E}{|z - z_0|^{k+1}}dz \\
        &= \frac{k!}{2\pi i}\int_0^{2\pi}\frac{[f(z)]_E}{r^{k+1}}dz \le \frac{k!}{r^k} \sup_{z \in \ol{B(z_0, r)}}[f(z)]_E
    \end{align*}
\end{proof}


\begin{definition}[Holomorphic]
\label{definition:complex-analytic}
    Let $E$ be a complete separated locally convex space over $\complex$, $U \subset \complex$ be open, and $f \in C(U; E)$, then the following are equivalent:
    \begin{enumerate}
        \item (\textbf{Complex Differentiability}) $f \in C^1(U; E)$. 
        \item (\textbf{Cauchy-Riemann Equations}) Under the identification of $C = \real^2$, $\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \in C(U; E)$ and
        \[
        \frac{\partial f}{\partial x} = i\frac{\partial f}{\partial y}
        \]
        \item (\textbf{Cauchy's Integral Formula}) For each $z_0 \in U$, $r > 0$ such that $\ol{B(z_0, r)} \subset U$, and closed rectifiable path $\gamma \in C([a, b]; U)$ homotopic to $\omega_{z_0, r}$ on $U \setminus \bracs{z_0}$, 
        \[
        f(z_0) = \frac{1}{2\pi i} \int_\gamma \frac{f(z)}{z - z_0}dz
        \]
        \item (\textbf{Analyticity}) For each $z_0 \in U$ and $r > 0$ with $\ol{B(0, r)} \subset U$, there exists $\seq{a_n} \subset E$ such that for each $z \in B(z_0, r/2)$, 
        \[
        f(z) = \sum_{n = 0}^\infty a_n(z - z_0)^n
        \]

        where the radius of convergence of the series is at least $r$. 
        \item (\textbf{Weak Holomorphy}) For each $\phi \in E^*$, $\phi \circ f$ satisfies the above. 
    \end{enumerate}

    If the above holds, then $f$ is \textbf{holomorphic/complex analytic} on $U$. 
\end{definition}
\begin{proof}
    (1) $\Leftrightarrow$ (2): \autoref{lemma:complex-analytic}. 

    (1) + (2) $\Rightarrow$ (3): See \hyperref[Cauchy's Integral Formula]{theorem:cauchy-formula}. 

    (3) $\Rightarrow$ (4): By \hyperref[Cauchy's Integral Formula]{theorem:cauchy-formula}, $f \in C^\infty(U; E)$ where for each $k \in \natz$, 
    \[
        D^kf(z_0) = \frac{k!}{2\pi i}\int_{\gamma} \frac{f(z)}{(z - z_0)^{k+1}}dz
    \]
    
    Let
    \[
    g(z) = \sum_{k = 0}^\infty \frac{1}{k!} D^kf(z_0)(z - z_0)^k
    \]

    then by \hyperref[Cauchy's Estimate]{corollary:cauchy-estimate}, for any $k \in \natz$ and continuous seminorm $[\cdot]_E: E \to [0, \infty)$, 
    \[
        [D^kf(z_0)]_E \le \frac{k!}{r^k} \sup_{z \in \ol{B(z_0, r)}}[f(z)]_E = \frac{Ck!}{r^k}
    \]

    Thus $[D^kf(z_0)/k!]_E \le C/r^k$ for all $k \in \natz$, and the radius of convergence of $g$ is at least $r$. 
    
    Let $z \in B(z_0, r/2)$, $s = |z - z_0|$, and $n \in \natp$, then by \hyperref[Taylor's Formula]{theorem:taylor-integral} and \hyperref[Cauchy's Estimate]{corollary:cauchy-estimate}, 
    \begin{align*}
        \braks{f(z) - \sum_{k = 0}^n \frac{1}{k!} D^kf(z_0)(z - z_0)^n}_E &\le s^{n+1} \cdot \sup_{z' \in \ol{B(z_0, s)}} [D^{n+1}f(z')]_E \\
        &\le \frac{Cs^{n+1}}{(r-s)^{n+1}}
    \end{align*}

    which tends to $0$ as $n \to \infty$. 

    (4) $\Rightarrow$ (1): By \autoref{theorem:termwise-differentiation}. 

    (5) $\Rightarrow$ (3): By the equivalence of the prior points, for any $\phi \in E^*$, $\phi \circ f$ satisfies (3). By the \hyperref[Hahn-Banach Theorem]{proposition:hahn-banach-utility}, $f$ also satisfies (3). 
\end{proof}



