\documentclass{homework}
\course{Math 5522H}
\author{Jim Fowler}
\input{preamble}

\begin{document}
\maketitle

\begin{inspiration}
  Luck is the residue of design
    \byline{Branch Rickey}
    \end{inspiration}

    \section{Terminology}

    \begin{problem}
      Define the \textbf{residue} of $f$ at the point $z$, which we write $\Res(f,z)$.
      \end{problem}
      \begin{solution}
      The residue of $f:U\mapsto \R$ is
      \[
      \lim_{\epsilon\to 0^+} \frac{1}{2\pi i}\int_{\gamma_\epsilon} \frac{f(w)}{w-z} dz
      \]
      Where $\gamma_\epsilon:[0, 2\pi ] \to \C$ is defined as $\gamma(t) = \epsilon e^{it}$.

      Equivalently, it is the coefficient of the $\frac{1}{w-z}$ term in the Laurent expansion of $f$ at $z$.
      \end{solution}
      \section{Numericals}

      \begin{problem}
        Evaluate $\Res(f,z)$ for the function $f(z) = \displaystyle\frac{e^z}{z^2-1}$.
        \end{problem}
        \begin{solution}
        If $z_0\neq \pm 1$, then the function is analytic divided by analytic nonzero, so $\Res(f,z_0)=0$. We can directly compute the other two cases by multiplying by $z-z_0$ and evaluating at $z_0$:
        \begin{gather*}
        \Res(f,1) = f(z)(z-1)|_{z=1} = \frac{e^z}{z+1}|_{z=1} = \frac{e}{2}\\
        \Res(f,-1) = f(z)(z+1)|_{z=-1} = \frac{e^z}{z-1}|_{z=-1} = -\frac{1}{2e}
        \end{gather*}
        \end{solution}
        \begin{problem}\label{residues-all-one}
        Evaluate $\Res(f,z)$ for the
          function $f(z) = \pi \cot (\pi z)$.
          \end{problem}
          \begin{solution}
          The only points where the residue might be nonzero are where the denominator is zero, that is, where
          \[
              0=\sin \pi z = \frac{e^{i\pi z}+e^{-i\pi z}}{2},
              \]
              so points where $z = k$ for $k\in \N$.

              Now we can compute the residue at the point $k$ using L'Hopitals rule:
              \[
              \lim_{z\to k} \pi\frac{(z-k\pi)\cos \pi z}{\sin \pi z}\big|_{z=k} = \lim_{z\to k}\pi \frac{\cos (\pi z) -  (z-k\pi)\pi \sin \pi z}{\pi\cos \pi z}\big|_{z=k} = \frac{\pi(-1)^k}{\pi (-1)^k} = 1
              \]
              \end{solution}
              \begin{problem}\label{residue-coth}Compute $\Res(f,\pm bi)$ for the
                function
                  \[
                      f(z) = \frac{\pi \cot(\pi z)}{z^2 + b^2}.
                        \]
                        \end{problem}
                        \begin{solution}
                        For any value of $b$ except for when $bi\in \Z$, a simple formula gives the answer:
                        \[
                        Res(f, \pm bi) = \lim_{z\to \pm bi}\frac{\pi \cot(\pi z)}{z \pm bi} =\frac{\pi \cot(\pm \pi bi)}{\pm2bi}
                        \]
                        Otherwise, let $k\in \Z = bi$.
                        we will write out each term as a power series at $k$ and nab the $\frac{1}{z\mp bi}$ term.

                        Using a few steps of polynomial long division, we first compute the power series for $\frac{1}{\sin z}$ at $\pm k$ as
                        \[\frac{1}{(z\mp k)} + \frac{(z\mp k)}{6} + O((z\mp k)^3).\]
                        (This formula can be verified by multiplication with the power series for $\sin (z\mp k) = (z\mp k) - \frac{(z\mp n)^3}{6} + O(z^5)$, I don't want to latex out polynomial long division.)

                        Next we can compute the power series of $\frac{1}{z\pm k}$ at $z\pm k$. Let $w=z\mp k$
                        \[
                        \frac{1}{z\pm k} = \frac{1}{w\pm 2k} = \frac{\mp\frac{1}{2k}}{1-\frac{w}{\pm 2k}}= \mp \frac{1}{2k}\sum_{n=0}^\infty \frac{w^n}{(\pm 2k)^n} = \mp \frac{1}{2k}\sum_{n=0}^\infty \frac{(z\mp k)^n}{(\pm 2k)^n}
                        \]

                        Unless $k=0$, in which case the power series of $\frac{1}{z}$ is $\frac{1}{z}$.

                        Knowing the series for $\cos z$, we can write $f$ as a product of power series,

                        \begin{align*}
                        \frac{\pi\cot(\pi (z\mp k))}{z^2 + b^2} &= \pi\cos(\pi (z\mp k))\frac{1}{\sin(\pi (z\mp k))}\frac{1}{z\pm k}\frac{1}{z\mp k} \\
                        &= \pi\left(1 + O((z\mp k)^2\right)\left(\frac{1}{\pi(z\mp k)} - \frac{\pi(z\mp k)}{6} + O((z\mp k)^3)\right)\\&\times \left(\mp\frac{1}{2k}\sum_{n=0}^\infty \frac{(z\mp k)^{n-1}}{(\pm 2k)^{n}}\right) \\
                        &= \pi(1)\left(\frac{1}{\pi(z\mp k)}\right)\left(\frac{\mp 1}{2k(z\mp k)} - \frac{1}{4k^2}\right) + O(1)\\
                        &= \frac{1}{\pm 2k (z\mp k)^2} - \frac{1}{4k^2(z\mp k)}+ O(1)
                        \end{align*}
                        The residue is the coefficient of $\frac{1}{z\mp k}$. Since $bi=k$, it is  $-\frac{1}{4(bi)^2}=\frac{1}{4b^2}$.

                        If $k=0$, then we can replace the last term in the big product above with $\frac{1}{z}$ to get a laurant series of $\frac{1}{z^2} + O(1)$, and so the residue is 0.
                        \end{solution}

                        \begin{problem}
                          Evaluate the integrals
                            \[
                                \int_{-\infty}^\infty \frac{\sin x}{1+x^2} \, dx \mbox{ and }
                                    \int_{-\infty}^\infty \frac{\cos x}{1+x^2} \, dx.
                                      \]
                                      \end{problem}
                                      \begin{solution}
                                      Since $e^{ix} = \cos x  + i \sin x$, we can just integrate
                                      \[
                                      \int_\infty^\infty \frac{e^{iz}}{1+z^2} dz
                                      \]
                                      and the real part will be the cos integral, the imaginary the sin integral. We can integrate over the following curve:

                                      \begin{tikzpicture}
                                      \draw [<->] (-4, 0) -- (4, 0);
                                      \draw [<->] (0, -4) -- (0, 4);
                                      \node [below] at (3, 0) {$R$};
                                      \node [below] at (1, 0) {$\gamma_1$};
                                      \node [right] at (2, 2.5) {$\gamma_2$};
                                      \draw (0,1) circle[radius=2pt];
                                      \node [right] at (0, 1) {$\Res(\frac{e^{iz}}{1+z^2}, i)$};
                                      \begin{scope}[very thick,decoration={
                                          markings,
                                              mark=at position 0.5 with {\arrow{>}}}
                                                  ]
                                                  \draw[postaction={decorate}] (-3,0) -- (3,0);
                                                  \draw[postaction={decorate}] (3, 0) arc [radius=3, start angle=0, end angle=180];
                                                  \end{scope}
                                                  \end{tikzpicture}

                                                  We can compute the integral over the curve $\gamma_2$.
                                                  \begin{align*}
                                                  \int_{\gamma_2} \frac{e^{iz}}{1+z^2}dz  = \int_0^\pi \frac{e^{iRcos(\theta) - Rsin(\theta)d\theta}iRe^{i\theta}}{1+R^2e^{2i\theta}}d\theta\\
                                                  \end{align*}
                                                  Note that the $e^{iRcos(\theta) - Rsin(\theta)}$ term is never more than $1$ in magnitude, so
                                                  \begin{align*}
                                                  \abs{\lim_{R\to\infty} \int_{\gamma_2} \frac{e^{iz}}{1+z^2}dz} \leq \lim_{R\to\infty} \int_0^\pi \frac{R}{R^2+1}d\theta \leq \lim_{R\to\infty} \frac{\pi}{R} = 0
                                                  \end{align*}

                                                  By the residue thoerem, the value of the integral around the contour is equal to the value of the residue at $i$, so the value of the integral on the real line is equal to the residue at $i$ times $2\pi i$.

                                                  \begin{align*}
                                                  \int_\infty^\infty \frac{e^{iz}}{1+z^2} dz &= 2\pi i \Res(\frac{e^{iz}}{1+z^2}, i)\\
                                                  &= 2\pi i\lim_{z\to i} \frac{e^{iz}(z-i)}{1+z^2} \\
                                                  &= 2\pi i\lim_{z\to i} \frac{e^{iz}}{z+i} = \frac{\pi}{e}
                                                  \end{align*}

                                                  Therefore,
                                                    \[
                                                        \int_{-\infty}^\infty \frac{\sin x}{1+x^2} \, dx = 0 \mbox{ and }
                                                            \int_{-\infty}^\infty \frac{\cos x}{1+x^2} \, dx =  \frac{\pi}{e}
                                                              \]
                                                              \end{solution}
                                                              \begin{problem}
                                                                For a real number $\lambda \in (0,1)$, evaluate
                                                                  \[
                                                                      \int_{-\infty}^\infty \frac{e^{\lambda x}}{1 + e^x} \, dx.
                                                                        \]
                                                                        \end{problem}
                                                                        \begin{solution}
                                                                        We shall evaluate the integral on the following contour:\\
                                                                        \scalebox{1.5}{
                                                                        \begin{tikzpicture}
                                                                        \draw [<->] (-4, 0) -- (4, 0);
                                                                        \draw [<->] (0, -1) -- (0, 4);
                                                                        \node [below] at (-4, 0) {$-R$};
                                                                        \node [below] at (4, 0) {$R$};
                                                                        \node [below] at (1, 0) {$\gamma_1$};
                                                                        \node [above] at (-1, 3) {$\gamma_2$};
                                                                        \node [above] at (0, 3) {$2\pi i$};
                                                                        \node [right] at (4, 1.5) {$\gamma_3$};
                                                                        \node [right] at (-4, 1.5) {$\gamma_4$};
                                                                        \draw (0,1.5) circle[radius=2pt];
                                                                        \node [right] at (0, 1.5) {$\Res( \frac{e^{\lambda x}}{1 + e^x}, \pi)$};
                                                                        \begin{scope}[very thick,decoration={
                                                                            markings,
                                                                                mark=at position 0.5 with {\arrow{>}}}
                                                                                ]
                                                                                \draw[postaction={decorate}] (-4,0) -- (4,0);
                                                                                \draw[postaction={decorate}] (4,0) -- (4,3);
                                                                                \draw[postaction={decorate}] (4,3) -- (-4,3);
                                                                                \draw[postaction={decorate}] (-4,3) -- (-4,0);
                                                                                \end{scope}
                                                                                \end{tikzpicture}
                                                                                }
                                                                                \begin{align*}
                                                                                \int_{\gamma_1}dz +\int_{\gamma_2}dz &= \int_{\gamma_1}dz -\int_{-\gamma_2}dz\\
                                                                                &= \int_{-R}^R \frac{e^{\lambda x}}{1+e^x} - \frac{e^{\lambda (x+2\pi i)}}{1+e^{x+2\pi i}} dx\\
                                                                                &= \int_{-R}^R \frac{e^{\lambda x} - e^{\lambda x +\lambda2\pi i}}{1+e^x}dx\\
                                                                                &= (1 -e^{\lambda2\pi i})\int_{-R}^R \frac{e^{\lambda x}}{1+e^x}dx\\
                                                                                &= (1 -e^{\lambda2\pi i})\int_{\gamma_1}dz
                                                                                \end{align*}
                                                                                \begin{align*}
                                                                                \abs{\int_{\gamma_3}dz} &= \abs{\int_0^{2\pi i} \frac{ie^{\lambda R + \lambda ti}dt}{1 + e^{R+ti}}}\\
                                                                                &= \abs{\int_0^{2\pi} \frac{e^{\lambda R + \lambda ti} dt}{1 + e^{R+ti}}}\\
                                                                                &\leq \abs{\int_0^{2\pi} \frac{e^{\lambda R} dt}{e^{R}}} = 2\pi e^{R(\lambda - 1)} \underset{R\to\infty}{\to} 0
                                                                                \end{align*}
                                                                                \begin{align*}
                                                                                \abs{\int_{\gamma_4}dz} &= \abs{\int_0^{2\pi} \frac{-ie^{-\lambda R + \lambda ti}dt}{1 + e^{-R+ti}}}\\
                                                                                &\leq 2\pi \sup \abs{\frac{e^{\lambda R+\lambda ti}}{1 + e^{R+ti}}}\\
                                                                                &\leq 2\pi \abs{\frac{e^{\lambda R}}{1 + e^{R}}} \underset{R\to -\infty}{\to} \frac{0}{1} = 0
                                                                                \end{align*}
                                                                                Now by the residue theorem,
                                                                                \[
                                                                                (1-e^{\lambda 2\pi i})\int_{\gamma_1}dz= \int_{\gamma_1+\gamma_2+\gamma_3+\gamma_4} dz  =  2\pi i \Res(\frac{e^{\lambda x}}{1+e^x}, i\pi)
                                                                                \]

                                                                                We can compute the residue at the simple pole
                                                                                \[
                                                                                \Res(\frac{e^{\lambda x}}{1+e^x}, i\pi) = \lim_{x\to i\pi} \frac{e^{\lambda x}(x-i\pi)}{1-e^x}\big|_{x=i\pi} = \frac{\lambda e^{\lambda x}(x-i\pi) + e^{\lambda x}}{-e^x}|_{x=i\pi} = e^{i\pi\lambda}
                                                                                \]

                                                                                And now we can use the last two formulas to solve for the desired integral:
                                                                                \[
                                                                                \int_{\gamma_1}dz = \frac{2\pi i e^{i\pi \lambda}}{1 - e^{2\pi i \lambda}}
                                                                                \]
                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                Evaluate the integral $\displaystyle\int_{0}^{2\pi} \frac{1}{3 + \sin^2 x} \, dx$.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                Rewrite $\sin x$ as follows:
                                                                                \[
                                                                                \sin x = \frac{e^{ix} - \frac{1}{e^{ix}}}{2i}
                                                                                \]

                                                                                Now let $\gamma=e^{ix}$ be the positively oriented unit circle.
                                                                                \begin{align*}
                                                                                \int_{0}^{2\pi} \frac{dx}{3 + \sin^2 x} \, dx &=
                                                                                \int_{0}^{2\pi} \frac{dx}{3 + \left(\frac{e^{ix} - \frac{1}{e^{ix}}}{2i}\right)^2}\\
                                                                                &= \int_{0}^{2\pi} \frac{ie^{ix}dx}{ie^{ix}\left(3 - \left(\frac{e^{ix} - \frac{1}{e^{ix}}}{2}\right)^2\right)}\\
                                                                                &= \int_\gamma \frac{dz}{iz\left(3 - \left(\frac{z - \frac{1}{z}}{2}\right)^2\right)}
                                                                                \end{align*}

                                                                                We can now try to apply the residue theorem. We need to find poles of the function
                                                                                $f(z) = \frac{-i}{z(3 - (\frac{z - \frac{1}{z}}{2})^2)}$ in the unit circle.
                                                                                $z=0$ is a removable discontinuity since the second factor grows as fast as $\frac{1}{z^2}$ there, so the only poles are roots of the second factor. We can solve it with the quadratic formula and expand
                                                                                \begin{align*}
                                                                                3 - (\frac{z - \frac{1}{z}}{2})^2 &=
                                                                                \frac{4}{z^2}\left(3z^2 - (\frac{z^2 - 1}{2})^2\right)\\
                                                                                &= \frac{4}{z^2}\left(  (z-(2-\sqrt{3}))(z-(2+\sqrt{3}))(z-(-2-\sqrt{3}))(z-(-2+\sqrt{3}))\right)
                                                                                \end{align*}

                                                                                The roots in the unit circle can be found with the quadratic formula as $\pm (2-\sqrt{3})$.
                                                                                \begin{align*}
                                                                                \Res(f, 2-\sqrt{3}) &=
                                                                                \frac{-4iz}{(z-(-2+\sqrt{3}))(z-(2+\sqrt{3}))(z-(-2-\sqrt{3}))}\big|_{z=2-\sqrt{3}}\\
                                                                                &= \frac{-4iz}{2z\cdot 4\cdot 2\sqrt{3}} = \frac{-i}{4\sqrt{3}}
                                                                                \end{align*}
                                                                                \begin{align*}
                                                                                \Res(f, 2+\sqrt{3}) &=
                                                                                \frac{-4iz}{(z-(2-\sqrt{3}))(z-(2+\sqrt{3}))(z-(-2-\sqrt{3}))}\big|_{z=-2+\sqrt{3}}\\
                                                                                &= \frac{-4iz}{2z\cdot 4\cdot 2\sqrt{3}} = \frac{-i}{4\sqrt{3}}
                                                                                \end{align*}
                                                                                Now we can finally apply the residue formula to obtain the value of the desired integral:
                                                                                \begin{align*}
                                                                                2\pi i
                                                                                \left(\frac{-i}{4\sqrt{3}}+ \frac{-i}{4\sqrt{3}}\right) = \frac{\pi}{\sqrt{3}}
                                                                                \end{align*}

                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                Evaluate the integral $\displaystyle \int_0^\pi \log \sin x \, dx$.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                \begin{align*}
                                                                                \int_0^\pi \log \sin x dx &= \int_0^\pi \log \abs{\frac{e^{ix} - e^{-ix}}{2i}} dx\\
                                                                                &= \int_0^\pi \log \abs{\frac{(e^{ix})(e^{ix} - e^{-ix})}{i}} dx - \int_0^\pi \log 2 dx \\
                                                                                &= \int_0^\pi \log \abs{1 - e^{2ix}} dx - \pi \log 2
                                                                                \int_0^\pi \log \sin x dx &= \frac{1}{2}\lim_{r^- \to 1}\int_0^{2\pi} \log \abs{1 - re^{ix}} dx - \pi \log 2\\
                                                                                \end{align*}
                                                                                Now we use the fact that for functions $f$ holomorphic on a disk of radius $r$ about the point $z_0$,
                                                                                \[
                                                                                f(z_0) = \frac{1}{2\pi}\int_0^{2\pi} f(z_0+re^{i\theta})d\theta
                                                                                \]
                                                                                Applying this to $z_0=1, f=\log$:
                                                                                \begin{align*}
                                                                                \lim_{r^- \to 1}\int_0^{2\pi} \log (1 - e^{ix}) dx &= \lim_{r^-\to 1} \log 1 = 0
                                                                                \end{align*}
                                                                                And we conclude that
                                                                                \[
                                                                                \int_0^\pi \log \sin x \, dx = -\pi\log 2
                                                                                \]
                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                Evaluate the integral $\displaystyle\int_{-\infty}^{\infty} \frac{1-x}{1-x^7} \, dx$.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                Let $f = \frac{1-x}{1-x^7} = \frac{1}{1+x+x^2+x^3+x^4+x^5+x^6}$ and $\zeta$ be the 7th root of unity with the smallest counterclockwise nonzero angle to the positive x axis.
                                                                                We will compute the integral on the half circle contour as $R\to\infty$.

                                                                                \begin{tikzpicture}
                                                                                \draw [<->] (-4, 0) -- (4, 0);
                                                                                \draw [<->] (0, -.2) -- (0, 4);
                                                                                \node [below] at (3, 0) {$R$};
                                                                                \node [below] at (1, 0) {$\gamma_1$};
                                                                                \node [right] at (2, 2.5) {$\gamma_2$};
                                                                                \draw (1.247, 1.564) circle[radius=2pt];
                                                                                \draw (-.445, 1.95) circle[radius=2pt];
                                                                                \draw (-1.802, 0.868) circle[radius=2pt];
                                                                                \node [below] at (1.247, 1.564) {$\Res(f, \zeta)$};
                                                                                \node [right] at (-.445, 1.95) {$\Res(f, \zeta^2)$};
                                                                                \node [above] at (-1.802, 0.868) {$\Res(f, \zeta^3)$};
                                                                                \begin{scope}[very thick,decoration={
                                                                                markings,
                                                                                mark=at position 0.5 with {\arrow{>}}}
                                                                                ]
                                                                                \draw[postaction={decorate}] (-3,0) -- (3,0);
                                                                                \draw[postaction={decorate}] (3, 0) arc [radius=3, start angle=0, end angle=180];
                                                                                \end{scope}
                                                                                \end{tikzpicture}

                                                                                The value of the integral on the outer curve $\gamma_2$ is 0:
                                                                                \[
                                                                                \int_{\gamma_2} \frac{1-z}{1-z^7} \leq \pi R \sup_{|z|=R} \frac{\abs{1-z}}{\abs{1-z^7}} \in O(R^{-6})
                                                                                \]
                                                                                Using the residue theorem, we can get the value of the integral by multiplying the residues by $2\pi i$. Unfortunately the residues are nasty to compute, so we will have a nasty expression.

                                                                                \begin{align*}
                                                                                \Res(f, \zeta^p) = \lim_{z\to \zeta^p} \frac{z-\zeta^p}{\prod_{k=1}^6 (z-\zeta^k)} = \frac{1}{\prod_{1\leq k \leq 6, k\neq p}^5 (\zeta^p-\zeta^k)}
                                                                                \end{align*}
                                                                                It's easy enough to numerically compute that none of these terms are 0, and consequentally that the computation is indeed valid.
                                                                                \begin{code}
                                                                                import cmath # using python
                                                                                zeta = complex(0.6234898018587336, 0.7818314824680298)
                                                                                res = [1/reduce(operator.mul, [pow(zeta, p) - pow(zeta,k) for k in range(1, 7) if k != p], 1) for p in range(1, 4)]
                                                                                >> [(-0.12085867654500679+0.02758520424482756j), (-0.09692113342087182-0.2012588073284831j), (0.21777980996587906-0.173673603083655j)]
                                                                                \end{code}
                                                                                And then we can get the answer by summing the residues and multiplying.
                                                                                \[
                                                                                \lim_{R\to \infty} \int_{\gamma_1} fdz = \int_{-\infty}^{\infty} f dz = 2\pi i \sum_{p=1}^3{\Res(f, \zeta^p)}
                                                                                \]
                                                                                \begin{code}
                                                                                sum(res)*2*cmath.pi * complex(0, 1)
                                                                                >> (2.182446862280324+2.964688223307337e-15j)
                                                                                \end{code}
                                                                                It's about 2.18.
                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                Show that $f(z) = z^5 + 15z - 1$ has five zeros in $B_2(0)$, and one zero in $B_{1/15}(0)$.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                First we will show that on $B_2(0)$, $\abs{z^5} > \abs{15z-1}$. By the triangle inequality, $\abs{15z-1} \leq \abs{15z} + \abs{1} = 31$, and $\abs{z^5} = 2^5 = 32$.

                                                                                Now we can apply Rouch\'e's theorem to say that $z^5$ and $z^5+15z-1$ have the same number of zeros in the ball of radius 2 counted with multiplicity, so $f(z)$ must have $5$ zeros in the ball.

                                                                                Next consider the ball of radius $\frac{1}{15}$. The function $15z-(1-10^{-9})$ has exactly one zero in this ball; we hope to apply Rouch\'e's theorem again by showing that
                                                                                \[
                                                                                \abs{15z-1+10^{-9}} \geq \abs{z^5 - 10^{-9}}
                                                                                \]
                                                                                We can just apply the triangle inequality again:
                                                                                \[
                                                                                \abs{15z-1+10^{-9}} \geq 14 + 10^{-9} \geq \frac{1}{15}^5 - 10^{-9} \geq \abs{z^5 - 10^{-9}}
                                                                                \]
                                                                                Then we can confirm that there is one zero in the ball of radius $\frac{1}{15}$.

                                                                                \end{solution}
                                                                                \begin{problem}\label{form-at-infinity}
                                                                                Set $w = 1/z$ and compute $f(w) \, dw$ in terms of $f(z) \, dz$.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                If $w=\frac{1}{z}$, differentiating both sides we get that $dw = \frac{-dz}{z^2}$. Thus $f(w) dw = -f(\frac{1}{z})\frac{dz}{z^2}$

                                                                                \end{solution}
                                                                                \section{Exploration}

                                                                                \begin{problem}
                                                                                Fix $w \in \R$ with $w>0$.  By the intermediate value theorem, the
                                                                                polynomial $f(z) = z^4 + 4w^3 z - 1$ has a real root in the interval
                                                                                $(-\infty,0)$ and another in $(0,1)$, along with two complex roots
                                                                                $a \pm bi$.  Use Gauss-Lucas (\ref{gauss-lucas}) and Rouch\'e's
                                                                                (\ref{rouches-theorem}) theorem to describe a subset of $\C$
                                                                                containing $a\pm bi$.
                                                                                \end{problem}
                                                                                \begin{solution}

                                                                                We can use Rouch\'e's theorem to show that the roots lie in the ball of radius $\max(2w, \sqrt{2})$. Under these conditions we can prove the inequality $|z^4|>|4w^3z - 1|$, and since $z^4$ has 4 zeros in the ball, so must $f$.

                                                                                To prove the inequality: Suppose that $w>\sqrt[4]{1/8}$. Then
                                                                                \begin{align*}
                                                                                &8w^4 > 1 \\
                                                                                \implies &16w^4 > 8w^3 + 1\\
                                                                                \implies &\abs{z^4} > \abs{4zw^3 - 1} \quad \text{ if } \abs{z} = 2w
                                                                                \end{align*}
                                                                                Otherwise, we must have that
                                                                                \[w<\sqrt[4]{1/8}< \sqrt[3]{\frac{3}{4\sqrt{2}}}\]
                                                                                which implies that
                                                                                \begin{align*}
                                                                                3 > 4\sqrt{2}w^3\\
                                                                                &\implies 4 > 4\sqrt{2}w^3 - 1\\
                                                                                &\implies \abs{z^4} > \abs{4zw^3 - 1} \quad \text{ if } \abs{z} = \sqrt{2}
                                                                                \end{align*}
                                                                                In either case, the inequality is satisfied.

                                                                                By Gauss-Lucas, the roots of $f$ contain the convex hull of the roots of $f'(z) = 4z^3+4w^3$, which are cubic roots of $w$. WLOG let $b\geq 0$. This implies that $b > \frac{\sqrt{3}w}{2}$. Combining this with the fact that $a+bi$ is contained in the ball of radius $\max(2w, \sqrt{2})$, we get a somewhat restricted set of locations for the roots.

                                                                                We can restrict it a bit more if needed by considering the convex hull further: Let $\zeta_1 = w(\frac{\sqrt{3}}{2}+\frac{i}{2})$. Since the real roots are all on the line from $-\max(2w, \sqrt{2})$ to $1$, $a+bi$ is above the line from 1 to $\zeta_1$ and the line from $-\max(2w, \sqrt{2})$ to $\zeta_1$. And if $w>1$, then the real part of the roots is greater than $w.$
                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                What is the correct definition of $\Res(f,\infty)$?  Generally, we
                                                                                would shift the viewport by replacing $f$ with the function
                                                                                $g(z) = f(1/z)$ and then we study $g$ near $z = 0$ in order to
                                                                                investigate ``$f$ near $\infty$.''  Does \ref{form-at-infinity} help
                                                                                here?
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                Le $\gamma_R$ be the circle of radius $R$ centered at 0.
                                                                                The residue of $f$ at $\infty$ is kinda given by the formula
                                                                                \[
                                                                                \lim_{R \to \infty k} \int_{\gamma_R} \frac{f(w)dw}{w}
                                                                                \]
                                                                                Except that the part of the circle that is inside is backwards.

                                                                                We fix this by inverting everything using the subsitution $w=\frac{1}{z}$ investigated in $\ref{form-at-infinity}$ to get the formula
                                                                                \[
                                                                                \lim_{R^+\to 0} \int_{\gamma_R} -zg(z)\frac{dz}{z^2} = \lim_{R^+\to 0} \int_{\gamma_R} -g(z)\frac{dz}{z}
                                                                                \]
                                                                                Except that since we inverted everything, we are now travelling on $\gamma$ in the clockwise direction. To fix this we get rid of the negative sign, and see that we are looking for the coefficent of $\frac{1}{z}$ in the taylor series of $g(z)$, which is nothing but the coefficient of $z$ in the taylor series of $f(z)$.
                                                                                \end{solution}
                                                                                \begin{problem}\label{rouches-theorem}Suppose $U$ is an open set containing the closed disk $D_r(z_0)$ and
                                                                                $f, g : U \to \C$ are holomorphic functions satisfying
                                                                                \[
                                                                                \abs{f(z)} > \abs{g(z)}
                                                                                \]
                                                                                for $z \in \partial D_r(z_0)$.  Prove \textbf{Rouch\'e's theorem}
                                                                                that $f$ and $f+g$ have the same number of zeros, counted with
                                                                                multiplicity, in $B_r(z_0)$.  (This is sometimes called the dog
                                                                                leash theorem---can you see why?)
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                The argument principal tells us that for any holomorphic function $f$, the number of roots of $f$ inside of a positively oriented jordan curve $\gamma$ is given by
                                                                                $\frac{1}{2\pi i}\int_\gamma \frac{f'}{f} dz.$

                                                                                In particular, the number of zeros of $f+g = f(1 + \frac{g}{f})$ is
                                                                                \begin{align*}
                                                                                \frac{1}{2\pi i}\int_\gamma \frac{(f(1 + \frac{g}{f}))'}{f(1 + \frac{g}{f})}dx &=
                                                                                \frac{1}{2\pi i}\int_\gamma \frac{f'}{f} + \frac{(1+\frac{g}{f})'}{1 + \frac{g}{f}}dx
                                                                                \end{align*}
                                                                                Thus it suffices to show that the term
                                                                                \(
                                                                                \int_\gamma \frac{(1+\frac{g}{f})'}{1 + \frac{g}{f}}dx
                                                                                \)
                                                                                vanishes. Since $1+\frac{g}{f}>0$ on the boundary of $D_r(z_0)$, the function is analytic on the boundary, and since $\abs{f}>\abs{g}$, the function $1+\frac{g}{f}$ is analytic and always positive, so it has no zeros. By the argument principal, the term must evaluate to 0.
                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                Use \ref{rouches-theorem} to give another proof of the Fundamental Theorem of Algebra.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                Let $p(x) = \sum_{k=1}^d a_kx^k$ be a degree $d$ polynomial with $a_d\neq 0$. Then we can choose a circle $B_r(0)$ of sufficently big radius so that the leading term dominates on $\partial B_r(0)$:
                                                                                \[
                                                                                \abs{a_dx^d} \geq \abs{\sum_{k=1}^d a_kx^k}
                                                                                \]
                                                                                We should also ensure that $r > \sqrt[d]{a_d}$, to observe that $a_dx^d$ has exactly $d$ roots in the circle corresponding to the scaled $d$th roots of unity. By Rouch\'e's theorem, this means that $p(x)$ also has exactly $d$ roots in this big circle. And, in fact, in any circle of even larger size, so we can even say that $p(x)$ has exactly $d$ roots in $\C$.
                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                It is important to recognize patterns in how residues equip us to evaluate integrals, so that, when presented with a fresh integration problem, we have some ideas about the best tool for the task.  Develop a tool for evaluating
                                                                                \[
                                                                                \int_0^{2\pi} f(\cos \theta,\sin \theta) \, d\theta
                                                                                \]
                                                                                via residues.  Here $f$ is a rational function, explain how to make
                                                                                the substitution $z = e^{i\theta}$ to rewrite
                                                                                $f(\cos \theta,\sin \theta)$ in terms of $z$, and
                                                                                similarly rewrite $d\theta$ in terms of
                                                                                $dz$ to reduce the given integral to a certain contour integral.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                Let $z=e^{i\theta}$ so that $dz = ie^{i\theta} d\theta$. Then $d\theta = \frac{dz}{iz}$ and
                                                                                \begin{gather*}
                                                                                \cos\theta = \frac{e^{i\theta} + e^{-i\theta}}{2} = \frac{z+z^{-1}}{2}\\
                                                                                \sin\theta = \frac{e^{i\theta} - e^{-i\theta}}{2i} = \frac{z-z^{-1}}{2i}
                                                                                \end{gather*}
                                                                                So the integral becomes
                                                                                \[
                                                                                \int_\gamma f(\frac{z+z^{-1}}{2},\frac{z-z^{-1}}{2i})\frac{dz}{iz}
                                                                                \]
                                                                                Where $\gamma$ is the image of $e^{i\theta}$ for $0\leq \theta \leq 2\pi$, that is, the positively oriented unit circle
                                                                                \[\gamma:[0, 2\pi] \to \C\qquad \gamma(\theta)= e^{i\theta}.\]

                                                                                Since $f$ is a rational function, we have a rational function in $z$ so it is meromorphic with finitely many poles $\{z_k\}_{k=1}^n$ in the unit circle and the residue theorem can be used to evaluate the integrals:
                                                                                \[
                                                                                \int_0^{2\pi} f(\cos \theta, \sin\theta) d\theta =  2\pi i \sum_{k=1}^n \Res(f(\frac{z+z^{-1}}{2},\frac{z-z^{-1}}{2i}\frac{1}{iz} ), z_k)
                                                                                \]
                                                                                \end{solution}
                                                                                \begin{problem}\label{summation-theorem}Sometimes the residue calculus
                                                                                permits us to sum series.

                                                                                Suppose $f$ is meromorphic with poles $z_1,\ldots,z_N$ with $z_j \not\in \Z$.  Our goal is a formula
                                                                                \[
                                                                                \sum_{n=-\infty}^{\infty} f(n) = - \sum_{j=1}^N \Res(g, z_j)
                                                                                \]
                                                                                where $g(z) = \pi \cot(\pi z) f(z)$.  \textit{Hint:} Consider a square contour $R$ centered at the origin with side-length $2N+1$.  You may assume that $\pi \cot(\pi z)$ is bounded on $R$ independent of $N$.  You will then need to impose some bound on $f$ on the contour $R$.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                Let's compute the contour integral $I=\int_R g(z)dz$ in two different ways. First, using the residue theorem, we have that
                                                                                \begin{equation}\label{Residue_eq_q}
                                                                                \frac{I}{2\pi i} = \sum_{j=1}^N \Res(g,z_i) + \sum_{k=-\infty} ^\infty \Res(g, k).
                                                                                \end{equation}
                                                                                We can compute the residue of $g$ at $k$
                                                                                \[
                                                                                \Res(\pi\cot(\pi z)f(z), k) = \lim_{z\to k} \pi\cos(\pi z)f(z)\frac{(z-k)}{\sin(\pi z)} = \lim_{z\to k} \pi\cos(\pi z)f(z)\frac{(z-k)}{\sin(\pi z)}
                                                                                \]

                                                                                Thus if we can show that $I=0$, we get the desired equality  from \eqref{Residue_eq_q}.
                                                                                \[
                                                                                0 = \sum_{j=1}^N \Res(g,z_i) + \sum_{k=-\infty} ^\infty f(k).
                                                                                \]

                                                                                Second, let's compute $\int_R g(z)dz$ directly, aiming for it to be 0.
                                                                                \[
                                                                                \lim_{N\to\infty} \int_R g(z) dz \leq (4(2N+1))\sup_{z\in R}(g(z))
                                                                                \]
                                                                                Since $\pi\cot(\pi z)$ is bounded, it suffices for the growth rate of $f(z)$ to be asymptotically slowed than that of $8N+4$: $f(|z|) \in \omega(|z|)$.

                                                                                If so, we can conclude that $I=0$, proving the claim.
                                                                                \end{solution}
                                                                                \begin{problem}
                                                                                Apply \ref{residue-coth} and \ref{summation-theorem} to evaluate
                                                                                \[
                                                                                \sum_{n=-\infty}^\infty \frac{1}{n^2 + b^2}.
                                                                                \]
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                Let $f(n) = \frac{1}{n^2+b^2}$. We assume $bi \not \in \Z$ so that the sum is finite. Then in the previous problem, $g(n) = \frac{\pi\cot(\pi z)}{z^2 + b^2}$. By \ref{residue-coth}, the residue at $\pm bi$ is $\frac{\pi\cot(\pm \pi bi)}{\pm 2bi}$, so the sum of the residues is $-\frac{\pi \coth{\pi b}}{b}$ and thus the sum is $\frac{\pi \coth{\pi b}}{b}$.
                                                                                \end{solution}
                                                                                \section{Prove or Disprove and Salvage if Possible}

                                                                                \begin{problem}\label{zero-residue-not-enough}Suppose $f : D_r(z_0) \to \C$ is holomorphic.  The residue
                                                                                $\Res(f,z_0)$ vanishes if and only if the singularity $z_0$ is
                                                                                removable.
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                This is true for stupid reasons: if $f$ is holomorphic on a disk surrounding $z_0$, then $f$ has no singularity at $z_0$, so if a singularity exists, it is surely removable. If it is merely meromorphic, a counterexample like $\frac{1}{z^2}$ suffices, since it has residue $0$ but no removable singularity at $0$.

                                                                                However, if the singularity is removable, the residue will vanish, since after removing the singularity, $f$ is holomorphic on a small ball containing $z_0$, so the residue must vanish.

                                                                                \end{solution}
                                                                                \begin{problem}\label{open-mapping-theorem}If $U \subset \C$ is open
                                                                                and $f : U \to \C$ is holomorphic, then $f(U)$ is
                                                                                open. % missing nonconstant, can be proved from rouche
                                                                                \end{problem}
                                                                                \begin{solution}
                                                                                No, consider $f(z)=0$. If we don't allow $f$ to be a constant, then it is true.

                                                                                Choose some arbitrary point $z_0\in U$ with $f(z_0)=w_0$. Now consider a series of open balls $\{B_{1/n}(z_0)\}_{n\in\N}$. We can surely find an $n$ where the $n$th ball is contained in $U$ since $U$ is open. Furthermore, by the identity theorem, there is an $n$ where the $n$th ball does not contain any point $z_1$ with $f(z_1)=w_0$ - otherwise, we would have an infinite series of points $\{z_i\}$ containing their limit point where $f(z_i)=w$, implying by the identity theorem that $\forall z\in U, f(z) = w$. Call the first $n$ satsifying both conditions $N$.

                                                                                Let $\delta = (\inf_{z\in B_{1/N}(z_0)}\abs{f(z)-w_0})/2$, so that for all $z$ in this ball,
                                                                                \[
                                                                                \abs{f(z) - w_0 } \geq 2\delta.
                                                                                \]
                                                                                Choose some $w_1\in \partial D_\delta (f(z_0))$, so that
                                                                                \[\delta \geq \abs{w_0-w_1}.
                                                                                \]

                                                                                To show that $f(U)$ is open, it suffices to show that any such $w_1$ is in the image of $f$, or equivalently that $f(z) - w_1$ has a zero. We know from the last paragraph that $f(z)-w_0$ has exactly one zero in $B_{1/N}(z_0)$, and that
                                                                                \[
                                                                                \abs{f(z) - w_0} \geq \abs{w_0 - w_1}
                                                                                \]
                                                                                so by Rouche's theorem, $f(z)-w_0 +w_0-w_1 = f(z) - w_1$ has a zero in $B_{1/N}$. Thus $f(U)$ is open.
                                                                                \end{solution}

                                                                                \end{document}


\section{CP Violation and Mixing}
\label{sect:cpviolation}
\index{CP violation}

This section discusses how CP violation and mixing work
in the generator. These two topics are closely related, since
a large fraction of CP violating decays occurs via mixing. Exactly what is
the best way of introducing these two effects into EvtGen is still not clear;
there are different ways of generating CP violating decays depending on what
one is interested in.  For example, one might want to generate a sample of events with
$B\rightarrow a_1^+ \pi^-$, and the $B$'s which tag the flavor of this $B$
(e.g., via semileptonic decays) are all $B^0$'s.  On the
other hand, one might want to generate a sample that has the
correct mixture of $B^0$ and $\bar B^0$ tags, as determined by the decay
dynamics.  From the point of view of implementation these two situations are
fairly different, and at the moment we are still working on choosing
a consistent way of dealing with them.

This section starts out describing how mixing works, and
then proceeds to describe how CP violation is introduced.  Examples
will be provided. CP violating decays are
among the most complicated things this generator does, and
various ways in which one might get the generation of CP
violating decays wrong will be pointed out.

\subsection{Mixing in the $B^0\bar B^0$ System.}

As is well know, when $\Upsilon(4S)$ decays into the $B^0\bar B^0$ system,
the $B$'s are produced in a coherent state.  This implies that
when one of the $B$'s decays, and its flavor is determined, the other
$B$ is known to be in a pure state of the opposite flavor.
This state then evolves (oscillates) independently, with the oscillation frequency
given by $\Delta m /2$, ($\Delta m$ being $m_{2} - m_{1}$, the mass difference between the two $B$ mass
eigenstates).  Assuming $|B_{0}^{\rm phys}(t = 0)\rangle = |B^{0}\rangle$, its time evolution is given by:
\begin{equation}
|B_{\rm phys}^{0}(t)\rangle = e^{-\Gamma t/2}e^{i\overline{m} t}\,\left[ |B^0\rangle\,\cos\left(\frac{\Delta m t}{2}\right) + i\frac{q}{p}|\bar B^0\rangle\,\sin\left(\frac{\Delta m t}{2}\right)\right],
\end{equation}
where $\overline{m} \equiv (m_{1} + m_{2})/2$, $q = e^{i\phi_{M}}/\sqrt{2}$, and $p = e^{-i\phi_{M}}/\sqrt{2}$ ($\phi_{M}$ is the mixing angle).  Time $t$ in this formula is the time between the two $B$ decays.

By projecting $|B_{0}^{\rm phys}(t)\rangle$ into a pure $B^0$
or $\bar B^0$ state, one can obtain the amplitudes for the $B$ to decay with
a given flavor.  In turn, squaring them gives the probabilities:
\begin{eqnarray}
P(B_{\rm phys}^{0}\rightarrow B^0) & = & \frac{1}{2} e^{-\Gamma t} (1+\cos(\Delta m t))\\
P(B_{\rm phys}^{0}\rightarrow \bar B^0) & = & \frac{1}{2} e^{-\Gamma t} (1-\cos(\Delta m t))\\
\end{eqnarray}

Integrating these over all times, one obtains the total rates:
\begin{eqnarray}
P(B_{\rm phys}^{0}\rightarrow B^0)  & = & \frac{x_{d}^2}{2\,(1 + x_{d}^{2})}\\
P(B_{\rm phys}^{0}\rightarrow \bar B^0)  & = & \frac{2 + x_{d}^2}{2\,(1 + x_{d}^{2})}\\
\end{eqnarray}
where $x_d \equiv \frac{\Delta m}{\Gamma}$.

Considering in a similar way the time evolution of the coherently produced state ($\Psi(t = 0) = \frac{1}{\sqrt{2}}\,\left [ |B^{0} \overline{B}^{0} \rangle - |\overline{B}^{0} B^{0} \rangle \right ]$ ), one can obtain the ratio:
\begin{equation}
{ N(\Upsilon(4S)\rightarrow B^0B^0)+N(\Upsilon(4S)\rightarrow\bar B^0\bar B^0)
  \over N(\Upsilon(4S)\rightarrow B^0\bar B^0)}= \frac{x_{d}^{2}}{2 + \,x_{d}^{2}}.
\end{equation}

Currently, mixing is implemented in two decay models:
$\tt VSS\_MIX$ and $\tt VSS\_BMIX$.  These models both take the mass
difference to be a parameter and use the width assigned in the particle
properties table, i.e., from the evt.pdl file in the BaBar environment.
These models differ in the number of parameters that
the user must supply. The $\tt VSS\_MIX$ model requires that the branching
fractions into mixed and unmixed final states be set by hand, and does not
require that they be consistent with the mass difference and lifetime.
The $\tt VSS_BMIX$ model calculates the branching fractions automatically
and is therefore safer and easier to use. One can use this model as follows:
\begin{verbatim}
Decay Upsilon(4S)
0.5  B+       B-        VSS;
0.5  B0       anti-B0   VSS_BMIX;
Enddecay
\end{verbatim}
Both models give identical results when the $\tt VSS\_MIX$ branching
fractions are set correctly.

\subsection{Mixing and Non-zero Lifetime Differences.}

{\it This section should probably be merged with the previous but
is currently written separately, mostly due to historical reasons, as
this is only needed for $B_s$ mixing, which was added later.}

In this section $B^0$ and $\bar B^0$ will generically denote any
neutral meson flavor eigenstate. These states are not eigenstates
of the full hamiltonian and hence do not have a definite mass or
lifetime. The states that are eigenstates of the hamiltonian are
\begin{eqnarray}
|B_L\rangle & = & p|B^0\rangle +q|\bar B^0\rangle, \\
|B_H\rangle & = & p|B^0\rangle -q|\bar B^0\rangle.
\end{eqnarray}
The states $B_L$ and $B_H$ have masses, $m_L$ and $m_H$, and widths, $\Gamma_L$
and $\Gamma_H$, respectively such that
\begin{equation}
|B_{L,H}(t)\rangle=e^{-(\Gamma_{L,T}/2+im_{L,T})t}|B_{L,H}\rangle
\end{equation}
where $B_{L,H}(t)$ is the state after evolving the state $B_{L,H}$ for
a time $t$.

This allows us to evaluate several matrix elements that are useful for
calculating the mixing rates
\begin{eqnarray}
\langle B^0|B^0(t)\rangle & = & {1\over 2p}(\langle B^0|B_L(t)\rangle
                                           +\langle B^0|B_H(t)\rangle)\nonumber\\
                          & = & {1\over 2}(e^{-(\Gamma_L/2+im_L)t}
                                          +e^{-(\Gamma_H/2+im_H)t}),\\
\langle \bar B^0|B^0(t)\rangle & = & {1\over 2p}(\langle \bar B^0|B_L(t)\rangle
                                           +\langle \bar B^0|B_H(t)\rangle)\nonumber\\
                          & = & {q\over 2p}(e^{-(\Gamma_L/2+im_L)t}
                                          -e^{-(\Gamma_H/2+im_H)t}),\\
\langle B^0|\bar B^0(t)\rangle & = & {1\over 2q}(\langle B^0|B_L(t)\rangle
                                           -\langle B^0|B_H(t)\rangle)\nonumber\\
                          & = & {p\over 2q}(e^{-(\Gamma_L/2+im_L)t}
                                          -e^{-(\Gamma_H/2+im_H)t}),\\
\langle \bar B^0|\bar B^0(t)\rangle & = & {1\over 2q}(\langle \bar B^0|B_L(t)\rangle
                                           +\langle \bar B^0|B_H(t)\rangle)\nonumber\\
                          & = & {1\over 2}(e^{-(\Gamma_L/2+im_L)t}
                                          +e^{-(\Gamma_H/2+im_H)t}).
\end{eqnarray}

Now it is straight forward to calculate the mixing rate. Let $\chi$
define the probability that a meson produced, at $t=0$, as a $B^0$ will
decay as a $\bar B^0$. It is now easy to see that
\begin{eqnarray}
\chi & = &{\int_0^\infty |\langle \bar B^0|B^0(t)\rangle|^2dt \over
\int_0^\infty |\langle \bar B^0|B^0(t)\rangle|^2dt +
\int_0^\infty |\langle B^0| B^0(t)\rangle|^2dt }\nonumber\\
  & = & { x^2+y^2 \over x^2+y^2+\vert {p\over q} \vert^2(2+x^2-y^2)}
\end{eqnarray}
where
\begin{equation}
x\equiv {\Delta m \over \Gamma},\qquad y\equiv {\Delta\Gamma\over \Gamma}
\end{equation}
and
\begin{equation}
\Gamma\equiv {\Gamma_L+\Gamma_H \over 2},\qquad
\Delta\Gamma \equiv \Gamma_H-\Gamma_L,\qquad
\Delta m \equiv m_H-m_L.
\end{equation}
Similarly the probability that that a meson produced, at $t=0$
as a $\bar B^0$ will decay as a $B^0$ is given by
\begin{eqnarray}
\bar \chi & = &{\int_0^\infty |\langle B^0|\bar B^0(t)\rangle|^2dt \over
\int_0^\infty |\langle B^0|\bar B^0(t)\rangle|^2dt +
\int_0^\infty |\langle \bar B^0| \bar B^0(t)\rangle|^2dt }\nonumber\\
  & = & { x^2+y^2 \over x^2+y^2+\vert {q\over p} \vert^2(2+x^2-y^2)}.
\end{eqnarray}
In the limit of $|p/q|=1$ and $y=0$ we have
\begin{equation}
P_{\pm}(t)=\chi =\bar\chi={x^2\over 2(1+x^2)}
\end{equation}
as expected.
The time distribution, arbitrary normalization, is given by
\begin{equation}
e^{-\Gamma_L t}(1+e^{\Delta\Gamma t}\pm 2e^{\Delta\Gamma t/2}\cos\Delta m t)
\end{equation}
The minus sign corresponds to the case of mixing, and the plus sign
to the case of no mixing.

\subsection{CP-violation.}

The ``first generation'' of models which were implemented in EvtGen
to deal with CP violation did not solve all the problems that are
involved in simulating the physics of the $B\bar B$ system. To illustrate how
these models work, let us consider the following example (the decay
$B\rightarrow \pi^+\pi^-$):
\begin{verbatim}
Alias MYB B0
#
Decay Upsilon(4S)
0.70   MYB B0      VSS;
0.30   MYB B0B     VSS;
Enddecay
#
Decay MYB
1.0   pi+ pi-     SSS_CP alpha dm CP |A| arg(A) |Abar| arg(Abar);
Enddecay
End
\end{verbatim}

The model used in this example is {\tt SSS\_CP}.  Its first argument is {\tt alpha}, is the
relevant CKM angle (in this case it is $\alpha$); the second argument {\tt dm} is
the mass difference of the two $B$ mass eigenstates; the third
argument, {\tt CP}, specifies the CP of the final state, and is either $+1$ or $-1$.
The latter argument could in principle be determined from the particle properties, but at
the moment EvtGen does not include the C and P quantum numbers in its particle properties
list (this should be fixed). The last 4 arguments are the (complex) amplitudes for
$B^0$ and $\bar B^0$ to produce the final state.

In this example the $\Upsilon(4S)$ decays with unequal
probabilities to ``MYB'' and $B^0$  and to ``MYB'' and  $\bar B^0$. The
$B^0$ and $\bar B^0$ simply decay as a $B^0$ and a $\bar B^0$,
respectively, according to the generic decay table.  The interesting
thing is how ``MYB'' decays.  In the {\tt SSS\_CP} model, ``MYB'' will produce a
$\pi^+ \pi^-$ final state, while the other $B$ will provide
a tag of the flavor that is listed in the decay of the $\Upsilon(4S)$ ($B^0$ in 70\%
of the cases, and $\bar B^0$ in 30\% of the cases).  Therefore, in this example there will
be some number of $B^0$ tags and some number of $\bar B^0$ tags.

If one would like to get a sample of events with only $B^0$ tags,
one could do it in the following way:
\begin{verbatim}
Alias MYB B0
#
Decay Upsilon(4S)
1.00  MYB B0      VSS;
Enddecay
#
Decay MYB
1.0   pi+ pi-     SSS_CP dm alpha CP |A| arg(A) |Abar| arg(Abar);
Enddecay
End
\end{verbatim}

Here, the only available tag (as specified by the $\Upsilon(4S)$ branching fraction) is $B^{0}$.

When the $\Upsilon(4S)$ is decayed and the two $B$'s are produced,
they are assigned lifetimes which are sampled from a pure exponential
distribution, with a mean of the average lifetime specified
in the particle properties list. (If the decay model is one that
includes the effects of mixing, the time distribution is no longer
a pure exponential; see the previous section.  However, as will be
evident below, it doesn't matter what time distribution is used in
the decay of the $\Upsilon(4S)$.)  Since the lifetime distributions
of both the $B$ that decays to the CP channel and the tag $B$ are
no longer exponential, the {\tt SSS\_CP} model has to regenerate
lifetimes of {\it both} $B$'s. However, the model does not change what
tag one of the $B$ provides. This is important, because it means that this model
cannot enforce the right fraction of $B^0$ and $\bar B^0$ tags.  {\bf The only way to control this is through the decay table}.

The {\tt SSS\_CP} model handles decays to a pair of scalar particles.
Of these, the most important one is probably $B \rightarrow \pi\pi$, but the model also
works for any other decay with two scalars in the final state, e.g., $K_s\eta'$.
Other models which are implemented in a similar way are {\tt SVS\_CP} and {\tt STS\_CP},
which handle the decays to a scalar and a vector and to a scalar and a
tensor, respectively. There is also a model for two vectors
in the final state: it is called {\tt SVV\_CP}. One complication with this
model is that there are three partial waves that contribute to the
rate with different CP.

All of these models have one feature in common: they generate the $B$ tags with the relative
fractions specified in the decay table. It seems logical that the next step in expanding
the functionality of the generator should be implementing some way to generate the right
fraction of $B^0$ and $\bar B^0$ tags according to the amplitudes that are specified for a
particular decay channel.  Indeed, this would be a very natural thing to do, because given
the amplitudes, the relative fraction of $B^0$ and $\bar B^0$ tags can be determined.  A new class of models which have been recently put into EvtGen does have this feature.  These new models are particularly important for decays into final states that are not
CP eigenstates, for example $B\rightarrow a_1^+\pi^-$, or decays with direct CP violation (e.g., due to the presence of penguins).

Let us consider in more detail what the problem is.  The time-dependent CP-asymmetry for
the decay $B \rightarrow f$, where $f$ is a CP eigenstate, is defined as:
\begin{equation}
A_f(t) = \frac{\Gamma(B^{0}(t) \rightarrow f) - \Gamma(\overline{B}^{0}(t) \rightarrow f)}{\Gamma(B^{0}(t) \rightarrow f) + \Gamma(\overline{B}^{0}(t) \rightarrow f)}
\end{equation}
If $|A(B^{0} \rightarrow f)|$ = $|A(\overline{B}^{0} \rightarrow f)|$, then the integrated
asymmetry $\int_{-\infty}^{+\infty}A_f(t)dt = 0$, and the relative fraction of $B^{0}$ ($\bar B^0$) tags is known (1/2).  However, if $|A(B^{0} \rightarrow f)| \neq |A(\overline{B}^{0} \rightarrow f)|$ (which can happen, e.g., because of penguin pollution), $\int_{-\infty}^{+\infty}A_f(t)dt \neq 0$, so the fraction of tags must be somehow determined.

One way to get the correct fraction of tags is to use integrated rates.  For example, for decays into a CP-eigenstate it can be defined as:
\begin{equation}
fr \equiv \frac{\int_{-\infty}^{\infty}\Gamma(\overline{B}(t)^{0} \rightarrow f)dt}{\int_{-\infty}^{\infty}\left[\Gamma(B^{0}(t) \rightarrow f) + \Gamma(\overline{B}^{0}(t) \rightarrow f)\right]dt}
\end{equation}
so that
\begin{equation}
fr = \frac{|\overline{A}_{f}|^2 \left(1 + |\overline{r}_{f}|^2 + \frac{(1 - |\overline{r}_{f}|^2)}{1+x_{d}^2} \right)}{|\overline{A}_{f}|^2 \left(1 + |\overline{r}_{f}|^2 + \frac{(1 - |\overline{r}_{f}|^2)}{1+x_{d}^2} \right) + |{A}_{f}|^2 \left(1 + |r_{f}|^2 + \frac{(1 - |r_{f}|^2)}{1+x_{d}^2} \right)},
\end{equation}
where $x_{d} \equiv \frac{\Delta m}{\Gamma}$, $r_{f} = e^{2i\,\phi_{M}}\,\frac{\overline{A}}{A}$, and $\overline{r}_{f} = \frac{1}{r_{f}}$.

Two functions in the new version of EvtOtherB return this fraction (fractB0CP for decays into a CP eigenstate and fractB0nonCP for decays into non-CP eigenstates).  However, analytical calculations of the integrals can be done only in the simplest cases.  For example, for the $B \rightarrow \rho \pi$ decay one would have to integrate over the Dalitz plot as well as over time to get the total rates, which is very hard to do!  A better solution is to use the so-called acceptance-rejection method, which is effectively equivalent to numerical integration.  This method has been used in the ``second generation'' models which introduce direct CP-violation into EvtGen.

  The new models that are available are: {\tt SSS\_CP\_PNG} for the $B \rightarrow \pi^{+} \pi^{-}$ decay with penguin contributions; {\tt BTO2PI\_CP\_ISO} for the three isospin-related $B\rightarrow \pi \pi$ modes; {\tt BTOKPI\_CP\_ISO} for the four isospin-related $B \rightarrow K \pi$ modes; and {\tt SVS\_CP\_ISO} for the five isospin-related generic $scalar \rightarrow (pseudo)scalar + vector$ modes.  There is another decay model for the latter case, which also returns the correct fraction of $B^0$ ($\bar B^0$) tags.  It is called {\tt SVS\_NONCPEIGEN}.  Here is an example of how this model can be used for the $B \rightarrow a_1 \pi$ decay:
\begin{verbatim}
Alias MYB B0
Decay Upsilon(4S)
1.000 MYB anti-B0                         VSS;
Enddecay
Decay MYB
1.000 a_1-  pi+          SVS_NONCPEIGEN 1.22 0.51e12 0.0
                                                       1.0 0.0 3.0 0.1
                                                       3.0 0.1 1.0 0.0;
Enddecay
End
\end{verbatim}

The first parameter of this model is the corresponding CKM angle (in this case, it is $\alpha$); the second parameter is $\Delta m$; the third parameter is the ``flip'' which determines the fraction of ``MYB'' $\rightarrow f$ to ``MYB'' $\rightarrow \overline{f}$ decays, where the state specified in the decay table is considered the ``$f$'' state.  If the flip is set to 0, ``MYB'' always decays into the $f$ state.  The next four parameters are the absolute values and phases for the amplitudes $B^{0} \rightarrow f$ and $\bar B^{0} \rightarrow f$, respectively, and the last four parameters are those for the amplitudes $B^{0} \rightarrow \overline{f}$ and $\overline{B}^{0} \rightarrow \overline{f}$.

It is important not to confuse the ``flip'' parameter with the number of tags.  For example, one would like to generate 10,000 $B\overline{B}$ events with the flip parameter set to 0.5.  This means that one would get 5,000 ``MYB'' $\rightarrow f$ decays and 5,000 ``MYB'' $\rightarrow \overline{f}$ decays, but within each 5,000 event sample the number of $B^{0}$ and $\bar B^{0}$ tags is determined by the amplitudes specified in the decay file!

As before, ``MYB'' in this example decays into a CP-mode, while the other B provides a tag.  However, the model itself generates the correct fraction of $B^{0}$ ($\bar B^{0}$) tags, which is determined from the last eight parameters (the amplitudes), and is independent of the $\Upsilon(4S)$ branching fractions.

\subsection{Special CP models}

 The models described above are meant to be generic models that can
be applied to different decays with appropriate arguments. All of the
above models are two body decays. There is, however, many other decays
that are not two body decays and these can not be treated quite as
simply since there will in general be interference between various
resonances. As an example consider the decay $B\rightarrow \pi^+\pi^-\pi^0$
which is dominated by the $\rho(770)$ resonances.

 To handle the $B\rightarrow 3\pi$ and the $B\rightarrow 4\pi$
decays two special models have been written. These models are
called {\tt BTO3PI\_CP} and {\tt BTO4PI\_CP}. The second
of model {\tt BTO4PI\_CP} needs more work interms of understanding the
conventions of the phases between the resonances that contributes.

\newpage

\subsection{Unified implementation of CP-violating and mixing}

This section describes a {\it proposal} for how to unify and
simplify the simulation of CP-violating decays and mixing in EvtGen, this
should allow writing models that works independently of
how the neutral $B$ meson is produced, i.e. in a coherent pair in an
$\Upsilon(4S)$ decay or incoherently e.g. in a $p\bar p$ collision.

\subsubsection{CP violation}

The decays that we are considering here are
common final states to a neutral $B$ meson and its antiparticle,
e.g. $B\to J/\psi K_S$
or $B\to J/\psi K^*$. At the $\Upsilon(4S)$ in the absence of
direct CP violation these decays can be simplified as we can make the
assumption that you have an equal number of $B^0$ and $\bar B^0$
tags, or equivalent that there is no time integrated asymmetry.
However, we want to write the code such that no assumptions are
made about the numbers of $B^0$ and $\bar B^0$ tags.
For $B$ mesons that are produced incoherently we always have to
consider the asymmetries in the rates for an initial $B^0$ or
$\bar B^0$.

To allow generating these asymmetries correctly these models
will be allowed to modify the flavor of the $B$ meson that is decayed.
For the $\Upsilon(4S)$ this means changing the the flavor of 'the
other' $B$ meson in the $\Upsilon(4S)$ decay, the tag $B$.
For incoherent produced $B$
mesons this means that if a specific flavor is given to
EvtGen it can return a decay of the opposite flavor. If
e.g. EvtGen is given a $B^{**}+$ to decay and it decays it to
$B^0\pi^+$ the decay of the $B^0$ might decide to flip the
flavor of the decay chain to allow generating the right
time integrated asymmetry. This means that after EvtGen is
done the code that called EvtGen will get back a $B^{**}-$
and needs to be prepared to handle this, e.g. by applying CP
to the decay chain that produced the $B^{**}+$. Also note the
meaning of branching fractions in the decay table, for modes
that are common to a $B$ and its anti-particle, the $\bar B$
the above implies that the branching fraction listed for the
$B$ and the $\bar B$ are the average branching fractions.

Practically, this is implemented in the {\tt EvtCPUtil}
class, which will handle the cases of coherent and incoherently
produced $B$ mesons.

How is this different from the current implementation, V00-09-38?
Not very much, there are already some models, e.g. the
{\tt SVS\_NONCPEIGEN}
that has the full functionality that allows for direct CP violation
and will generate the right mixture of $B$ and $\bar B$ tags.
All CP models should convert to this more general model. For
applying this to $B$ mesons that are produced incoherent, i.e.
with a definite flavor, we need to modify the {\tt EvtCPUtil::otherB()}
method to allow the change of the flavor.

\subsubsection{Mixing}

In the $\Upsilon(4S)$ system mixing is handled by the decay of the
$\Upsilon(4S)$ meson via models such as {\tt VSS\_BMIX}. This
implementation seems sufficient at this point. Note that we
are not considering the case of the $\Upsilon(5S)$ at this point.

For incoherently produced neutral $B$ mesons, $B^0$ or $B_s$, we assume that
the flavor is tagged and mixing will be generated by adding a
decay like $B^0\to \bar B^0$ where the mixed particle have
zero lifetime. Models that simulate CP violation, or in general
models that handle decays common to the $B$ and the $\bar B$
decay will remove any mixing, this is done in {\tt EvtCPUtil}.
(Models that do not make any assumption about
the flavor of the $B$ should probably be using a 'neutral $B$' particle
instead of a specific flavor, but at BABAR we have not implemented
this as it would be very confusing at this point to a lot of
analysis code that uses Monte Carlo truth.)

This means that models that simulates CP-violating decays should not
need to turn of mixing, it will practically be ignored.

The mixing of incoherently produced  $B$ mesons is not done in a
model, this causes some problems as it is hard to control the
mixing, e.g., turning it of or modifying the parameters. We need to
invent a way to control this.


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[margin=2.5cm]{geometry}

\begin{document}
	\section{Geometry}
	\begin{itemize}
	\item
	The sum of opposite angles in cyclic quadrilateral is $180^\circ$.
	\item
	Inscribed angles which subtend to same arc are equal to half of the central angle.
	\item
	Limiting case of the above is alternate segment theorem. The angle between tangent and chord is equal to inscribed angle subtending to the same chord.
	\end{itemize}

	\begin{enumerate}
		\item
		Find mistake in the "proof that all triangles are isosceles".

		\item %% LPV 2000 11
		$PQRS$ is a cyclic quadrilateral in which $\angle PSR = 90^\circ$. Points $H$ and $K$ are projections of point $Q$ to lines $PR$ and $PS$ respectively. Prove that line $HK$ intersects segment $SQ$ at its midpoint.

		\item %% LPV 2002
		Point $P$ is chosen on the circumcircle of triangle $ABC$. Points $K$, $L$ and $M$ are projections of $P$ to lines $AB$, $BC$ and $AC$ respectively. Prove that $K$, $L$ and $M$ lie on the same line.

		\item %% problem solving strategies
		One of the cross sections in a rectangular box is a regular hexagon. Prove that the rectangular box is a cube.

	\end{enumerate}
	\section{Trigonometry}
		\begin{itemize}
			\item
			Sine law:
			$$\frac{a}{\sin \alpha}=\frac{b}{\sin \beta}=\frac{c}{\sin \gamma}=2R $$
			\item
			Cosine law:
			$$ c^2=a^2+b^2-2ab\cos\gamma $$
			\item
			Trigonometric functions of sums:
			$$ \sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta $$
			$$ \cos(\alpha+\beta)=\cos\alpha\cos\beta-\sin\alpha\sin\beta $$
		\end{itemize}
		\begin{enumerate}
			\item %% Prasolov 1.19
			A straight line passing through vertex $A$ of square $ABCD$ intersects side $CD$ at $E$ and line $BC$ at $F$. Prove that $\frac{1}{|AE|^2}+\frac{1}{|AF|^2} =
			\frac{1}{|AB|^2}$.
			\item
			An equilateral triangle is inscribed in a circle. An arbitrary point $P$ is chosen on arc $BC$. Prove that $|MA|=|MB|+|MC|$
			\item %% Prasolov 1.25
			Angles $\alpha$ and $\beta$ of $\triangle ABC$ are related as $3\alpha+2\beta=180^\circ$. Prove that $a^2+bc=c^2$.
			\item %% Prasolov 12.49
			Prove that for non right angle triangle with circumcircle radius $R$ and area $S$ the following holds
			$$ \tan\alpha+\tan\beta+\tan\gamma=\tan\alpha\tan\beta\tan\gamma=\frac{4S}{a^2+b^2+c^2-8R^2}$$
		\end{enumerate}

	\newpage

	\section{Functional equations}
		\begin{enumerate}
			\item %% LVS 2016
			Find all functions defined on all real numbers which satisfy for  all $(x,y)$
			$$f(x+y)f(xy)=f(x^2-y^2-1) $$
			\item %% LVS 2015
			Find all functions defined on all real numbers which satisfy for all $(x,y)$
			$$f(f(x)+f(y))=f(x)+y $$
			\item %% LVT 2014
			Find all functions defined on all real numbers which satisfy for all $(x,y)$
			$$f(x^2)+f(xy)=f(f(x+y)) $$
			\item %%  problemsolvingstrategies p277
			Find all polynomial functions that satisfy $P(x+1)=P(x)+2x+1$
			\item%%  problemsolvingstrategies p277
			Find all solutions to functional equation $f(x+y) + f(x-y) = 2f(x)\cos y$

		\end{enumerate}

	\section{Algebra}
		Mean inequalities:
		$$\min (a,b,c) \leq \frac{3}{\frac{1}{a}+\frac{1}{b}+\frac{1}{c}} \leq \sqrt[3]{abc} \leq \frac{a+b+c}{3} \leq \sqrt{\frac{a^2+b^2+c^2}{3}} \leq \max (a,b,c)$$
		\\
		Cauchy-Schwarz inequality
		$$(a_1b_1+...+a_nb_n)^2 \leq (a_1^2+...+a_n^2)(b_1^2+...+b_n^2) $$
		Geometric series
		$$ 1+a+a^2+...a^{n-1}=\frac{a^n-1}{a-1} $$

		\begin{enumerate}
		\item
		Prove that
		$$\frac{x^2+2}{\sqrt{x^2+1}} \geq 2 $$
		\item
		Prove that
		$$ a^2+b^2+c^2 \geq ab+bc+ac $$
		\item
		Find sum
		$$ \frac{1}{1 \times 2} + \frac{1}{2 \times 3} +...+ \frac{1}{(n-1)\times n} $$
		\item
		Prove that
		$$ 1+2^2+3^2+...+n^2 = \frac{n(n+1)(2n+1)}{6} $$
		\item
		Let $n \geq 3$ be an integer, and let $a_2$, $a_3$, ..., $a_n$ be positive real numbers such that $a_2a_3...a_n = 1$. Prove that
		$$(1 + a_2)^2(1 + a_3)^3...(1 + a_n)^n > n^n$$
		\end{enumerate}

	\newpage

	\section{Number Theory}
	Fermat's Little theorem for prime number $p$ and integer $a$
	$$ a^p \equiv a  \pmod p$$
	Euclidian algorithm
	$$ \gcd(a,b)=\gcd(a-b,b)$$
	\begin{enumerate}
		\item
		Prove that $a^4+4b^4$ is not a prime given $a,b$ are positive integers.
		\item
		Find integer solutions $(x,y)$ in terms of prime $p$ for equation
		$$ \frac{1}{x}+\frac{1}{y}=\frac{1}{p} $$
		\item
		Find all solutions $(x,y,z)$ in integers for
		$$ x^2 + y^2 + z^2 = 2xyz $$
		\item
		Find all prime numbers that are the factors of any number in form of
		$\underbrace{111...111}_{n}$ for positive integers $n$.
		\item
		Positive integers $a,b$ satisfy
		$$ a-b = 5b^2-4a^2 > 0$$
		Show that $a-b$ is a square of an integer.
	\end{enumerate}

	\section{Combinatorics}
	\begin{enumerate}
		\item
		There are 6 people in the room. Each pair of people either knows one another or they do not. Prove that there either 3 people among whom nobody knows another or 3 people among whom all people know one another.
		\item
		Is it possible to cover 2018x2018 board with L-shaped pieces (length 3, width 2) without overlapping?
		\item
		Is it possible to find 5 prime numbers, so that sum of each three of those is also a prime?

		\item
		On the table there are 13 blue chips, 15 red chips and 17 green chips. In each move two chips of different colour are taken from the table and replaced with two chips of the third colour. Is it possible that after some moves there are equal amount of chips of each colour?

		\item
		Each face of a cube is coloured with a different colour. How many distinct colourings are there?

	\end{enumerate}

\end{document}


\section{Trust Flow}
  We can now define indirect trust from $A$ to $B$.
  \subimport{common/definitions/}{indirecttrust.tex}
  \noindent Note that $Tr_{A \rightarrow B} \geq DTr_{A \rightarrow B}$. The next result shows $Tr_{A \rightarrow B}$ is
  finite.
  \subimport{fc17/theorems/}{convergencetheorem.tex}
  \subimport{common/proofsketches/}{convergenceproofsketch.tex}
  Proofs of all theorems can be found in Appendix A\ifdefined\proceedings \ of the full version \cite{trustisrisk}\fi.

  In the setting of \texttt{TransitiveGame(}$\mathcal{G}$\texttt{,}$A$\texttt{,}$B$\texttt{)} and $j$ being a turn in which
  the game has converged, we use the notation $Loss_A = Loss_{A, j}$. $Loss_A$ is not the same for repeated executions of this
  kind of game, since the order in which players are chosen may differ between executions and conservative players can choose
  which incoming direct trusts they will steal and how much from each.

  Let $G$ be a weighted directed graph. We investigate the maximum flow on it. For an introduction to maximum
  flows see Introduction to Algorithms, p. 708 \cite{clrs}. Considering each edge's capacity as its weight, a flow
  assignment $X = [x_{vw}]_{\mathcal{V} \times \mathcal{V}}$ with source $A$ and sink $B$ is valid when:
  \begin{equation}
  \label{flow1}
    \forall (v, w) \in \mathcal{E}, x_{vw} \leq c_{vw} \mbox{ and}
  \end{equation}
  \begin{equation}
  \label{flow2}
    \forall v \in \mathcal{V} \setminus \{A,B\}, \sum\limits_{w \in N^{+}(v)}x_{wv} = \sum\limits_{w \in N^{-}(v)}x_{vw}
    \enspace.
  \end{equation}
  The flow value is $\sum\limits_{v \in N^{+}\left(A\right)}x_{Av} = \sum\limits_{v \in N^{-}\left(B\right)}x_{vB}$. We do not
  suppose skew symmetry in $X$. There exists an algorithm $MaxFlow\left(A, B\right)$ that returns the maximum possible flow
  from $A$ to $B$.  This algorithm needs full knowledge of the graph and runs in $O\left(|\mathcal{V}||\mathcal{E}|\right)$
  time \cite{maxflownm}. We refer to the flow value of $MaxFlow\left(A, B\right)$ as $maxFlow\left(A, B\right)$.

  We will now introduce two lemmas that will be used to prove one of the central results of this work, the Trust Flow
  theorem.
  \subimport{fc17/lemmas/}{flowgamelemma.tex}
  \subimport{common/proofsketches/}{flowgameproofsketch.tex}
  \subimport{fc17/lemmas/}{gameflowlemma.tex}
  \subimport{common/proofsketches/}{gameflowproofsketch.tex}
  \subimport{common/theorems/}{trustflowtheorem.tex}
  \subimport{common/proofs/}{trustflowproof.tex}

  \noindent Note that the maxFlow is the same in the following two cases: If a player chooses the evil strategy and if that
  player chooses a variation of the evil strategy where she does not nullify her outgoing direct trust.

  Further justification of trust transitivity through the use of $MaxFlow$ can be found in the sociological work by Karlan et
  al. \cite{kmrs} where a direct correspondence of maximum flows and empirical trust is experimentally validated.

  Here we see another important theorem that gives the basis for risk-invariant transactions between different, possibly
  unknown, parties.
  \subimport{common/theorems/}{riskinvtheorem.tex}
  \subimport{common/proofs/}{riskinvproof.tex}
  \noindent $A$ can reduce her outgoing direct trust in a manner that achieves (\ref{primetrust}), since
  $maxFlow\left(A, B\right)$ is continuous with respect to $A$'s outgoing direct trusts.


\section{Excision, and the Eilenberg-Steenrod axioms}
We have homotopy invariance and the lexseq of a pair. We claimed that $ H_\ast(X,A)$ ``depends only on $X-A$''. You have to be careful about this.
\begin{definition}
A triple $(X,A,U)$ where $U\subseteq A\subseteq X$ is \emph{excisive} if $\overline{U}\subseteq\mathrm{Int}(A)$. This is a point-set definition. From an excisive triple you can get a pair $(X-U,A-U)\subseteq (X,A)$, and this is called an excision.
\end{definition}
\begin{theorem}
An excision induces an isomorphism in homology, i.e., $ H_\ast(X-U,A-U)\cong H_\ast(X,A)$. We might prove this on Wednesday.
\end{theorem}
What are some consequences? We'll compute $ H_\ast(S^n)$ and $ H^\ast(D^n,S^{n-1})$. Here's the result. We'll use the homeomorphisms $D^n\simeq \Delta^n$ and $S^{n-1}\simeq\partial\Delta^n$. Let's write $S^0=\{0,1\}$, and $\iota_n:\Delta^n\to\Delta^n$.
\begin{theorem}
	\begin{enumerate}
	\item \begin{equation*}
	 H_q(S^n)=\begin{cases}\Z = \langle[c^0_\ast]\rangle & q=0,n>0\\ \Z\oplus\Z = \langle[c^0_1],[\partial\iota_1]\rangle & q=n=0 \\ \Z = \langle[\partial\iota_{n+1}]\rangle & q=n>0 \\ 0 & \text{else} \end{cases}
	\end{equation*}

	\item \begin{equation*}
	 H_q(D^n,S^{n-1}) = \begin{cases}
	\Z=\langle [\iota_n]\rangle & q=n\\
	0 & \text{else}
	\end{cases}
	\end{equation*}
	\end{enumerate}
\end{theorem}
If $n=0$, then we say that $S^{-1}=\emptyset$. What are the generators of these groups?
\begin{proof}
We'll use the lexseq, homotopy invariance, and excision. We have the lexseq:
\begin{equation*}
\xymatrix{ & & \ar[dll]^\partial\\
 H_q(S^{n-1})\ar[r] & H_q(D^n)\ar[r] & H_q(D^n,S^{n-1})\ar[dll]^\partial\\
 H_{1-1}(S^{n-1})\ar[r] & H_{q-1}(D^n)\ar[r] & H_{q-1}(D^n,S^{n-1})\ar[dll]^\partial\\
 & & &}
\end{equation*}
But we know that $D^n$ is contractible, so $ H_q(D^n)=\begin{cases}\Z & q=n\\ 0 & \text{else}\end{cases}$. This means that $\partial: H_q(D^n,S^{n-1})\cong H_{q-1}(S^{n-1})$ for $q>1$, but when $q=1$, we get $0\to H_1(D^n,S^{n-1})\xrightarrow{\partial} H_0(S^{n-1})\to H_0(D^n) \to H_0(D^n,S^{n-1})\to 0$.

Let's think about the case $n>1$. Then $ H_0(S^{n-1})=\mathbf{Z}=\langle[c^0_\ast]\rangle$, and $ H_0(D^n)=\Z=\langle[c^0_\ast]\rangle$, so you have an isomorphism, which means that $ H_0(D^n,S^{n-1})=0$ and $ H_1(D^n,S^{n-1})=0$. Now, let's go to the case $n=1$. Then $ H_0(S^0)=\Z\oplus\Z=\langle [c^0_\ast],[\partial\iota_1]\rangle$ and $ H_0(D^0)=\Z$. But $[\partial\iota_1]$ goes to zero, and $[c^0_\ast]$ goes to the generator of $\Z= H_0(D^0)$. This means that $ H_1(D^1,S^0)$ is generated by $\langle[\iota_1]\rangle\cong\Z$ because the map $ H_1(D^n,S^{n-1})\to H_0(S^{n-1})$ is the boundary map, so $[\iota_1]\mapsto [\partial\iota_1]$.

Excision will come into play through the following statement.
\begin{prop}
If $n>1,q>1$, then $ H_q(D^n,S^{n-1})\to H_q(D^n/S^{n-1},\ast)\cong H_q(S^n,\ast)\cong H_q(S^n)$, because $D^n/S^{n-1}\simeq S^n$. The claim is that this collapse map is an isomorphism.
\end{prop}
This provides the inductive step. Let's assume we've proved the proposition. Then $ H_q(D^n,S^{n-1})\cong H_{q-1}(S^{n-1})$. The proposition says that $ H_q(S^n)\cong H_{q-1}(S^{n-1})$. But we also have the boundary map $\partial: H_{q+1}(D^n,S^{n-1})\cong H_q(S^n)$, i.e., $ H_{q+1}(D^n,S^{n-1})\cong H_q(D^n,S^{n-1})$.

Now I want to prove the proposition.
\begin{proof}[Proof of proposition]
We want to compare $ H_q(D^n,S^{n-1})$ and $ H_q(D^n/S^{n-1},\ast)$. We'll use excision to do this. We have $D^n=\{ x\in\mathbf{R}^{n+1} | |x|\leq 1 \}$. Let $A=\{ x|1/3\leq |x|\leq 1 \}$ and $U=\{ x|2/3<|x|\leq 1 \}$, and $\{ x||x|=1 \} =S^{n-1}\subseteq U$. We need a preliminary step. $ H_q(D^n,S^{n-1})\to H_q(D^n,A)$. We claim that this an isomorphism, but this is true because of the lexseq and the 5-lemma. By excision, $ H_q(D^n,A)\cong H_q(D^n-U,A-U)$. We can collapse the $(n-1)$-sphere, and $(D^n/S^{n-1}-U/S^{n-1},A/S^{n-1}-U/S^{n-1})=(D^n-U,A-U)$ because you're collapsing something from something that's already been collapsed! Now, we claim that $ H_q(D^n/S^{n-1}-U/S^{n-1},A/S^{n-1}-U/S^{n-1})\cong H_q(D^n/S^{n-1},A/S^{n-1})$, which is true by excision. THE FOLLOWING PART IS MOST DEFINITELY NOT RIGHT\footnote{My own comment: this proof can be finished by noticing that $A\simeq S^{n-1}$ via $\mathbf{v}\mapsto\frac{\mathbf{v}}{||\mathbf{v}||}$, and that $D^n/S^{n-1}\simeq S^n$.}. But also, $ H_q(D^n/S^{n-1},\text{disk})= H_q(D^n/S^{n-1},A/S^{n-1})$. Because the disk is contractible, using the lexseq and the 5-lemma completes the proof of the proposition.
\end{proof}
\end{proof}
``This really turns me on, because I love homology.'' Why should you care about homology?
\begin{corollary}
If $m\neq n$, then $S^m\not\simeq S^n$ because they have different homology groups.
\end{corollary}
\begin{corollary}
If $m\neq n$, then $\mathbf{R}^m\not\cong \mathbf{R}^n$, because they're not homeomorphic.
\end{corollary}
\begin{proof}
Let $m,n>0$. Assume we have a homeomorphism $f:\mathbf{R}^m\to \mathbf{R}^n$. This restricts to $\mathbf{R}^m-\{0\}\to \mathbf{R}^n-\{0\}$, but each of these are homotopy equivalent to spheres, but we can't get a homotopy equivalence between two spheres of different dimension by the above corollary.
\end{proof}
\subsection{Eilenberg-Steenrod axioms}
\begin{definition}
A homology theory (on $\mathbf{Top}$) is:
\begin{itemize}
\item a functor $h_n:\mathbf{Top}_2\to\mathbf{Ab}$ for all $n$. We'll write $h_n(X)=h_n(X,\emptyset)$
\item natural transformations $\partial:h_n(X,A)\to h_{n-1}(A)$.
\end{itemize}
such that:
\begin{itemize}
\item if $f_0,f_1:(X,A)\to (Y,B)$ are homotopic, then $f{0,\ast}\simeq f_{1,\ast}:h_n(X,A)\to h_n(Y,B)$.
\item an excision induces isomorphisms.
\item a lexseq:
\begin{equation*}
\cdots\to h_{q+1}(X,A)\xrightarrow{\partial}h_q(A)\to h_q(X)\to h_q(X,A)\xrightarrow{\partial}\cdots
\end{equation*}
\item (the dimension axiom): $h_n(\ast)$ is nonzero only in dimension zero. This is like the parallel postulate.
\end{itemize}
\end{definition}
\begin{example}
Ordinary singular homology satisfies these.
\end{example}
\begin{theorem}[Brouwer fixed-point theorem]
If $f:D^n\to D^n$, then there is some point $x\in D^n$ such that $f(x)=x$.
\end{theorem}
\begin{proof}
Suppose not. Then you can draw a ray from $x$ to $f(x)$ to the boundary $S^{n-1}$, intersecting at a point $g(x)$. Left to you to check that $g$ is continuous. If $x$ was on the boundary, then $x=g(x)$. This is inconsistent by our computation because otherwise the identity on $ H_{n-1}(S^{n-1})$ would be zero, contradiction!
\end{proof}