\documentclass{article}

\usepackage[english]{babel}
\usepackage[margin=1in]{geometry}

\usepackage{amsmath}
% for symbols such as /implies
\usepackage{amssymb}
% for symbols such as /subsetneq
\usepackage{amsthm}
% for commands such as \newtheorem

\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\newtheorem{axiom}{Axiom}

\begin{document}

\section{Inequalities}

\begin{theorem}
  If $x\in\mathbb{R}$, then $x^2 \geq 0$.
  Equality occurs if and only if $x=0$.
\end{theorem}

\begin{theorem}[Bernoulli Inequality]
  If $x\in\mathbb{R}$ and $n\in\mathbb{N}$ with $x > -1$, then
  $$
    (1+x)^n \geq 1+nx.
  $$
  \begin{proof}
    Let $x\in\mathbb{R}$ with $x > -1$.
    Let $A = \{n\in\mathbb{N} : (1+x)^n \geq 1+nx\}$. 
    Since $(1+x)^0 = 1 = 1+0x$, we have $0\in A$.
    Suppose $k\in A$. 
    Then $(1+x)^k \geq 1+kx$.
    Since $x > -1$, we have $1+x > 0$.
    Then
    $$
      (1+x)^{k+1} = (1+x)^k (1+x) \geq (1+kx)(1+x) = 1 + (k+1)x + kx^2 \geq 1 + (k+1)x
    $$
    and it follows that $k+1\in A$. By induction, $A=\mathbb{N}$, completing the proof.
  \end{proof}
\end{theorem}

\begin{lemma}
  If $x,y\in\mathbb{R}$, then 
  $$
    |xy|\leq \frac{x^2+y^2}{2}.
  $$
  \begin{proof}
    We have
    $$
      0\leq (x+y)^2 = x^2 + 2xy + y^2
    $$
    and 
    $$
      0\leq (x-y)^2 = x^2 - 2xy + y^2.
    $$
    Then
    $$
      \frac{-x^2-y^2}{2} \leq xy \leq \frac{x^2 + y^2}{2}
    $$
    and the result follows.
  \end{proof}
\end{lemma}

\begin{theorem}[Cauchy-Schwarz Inequality]
  If $(a_1,\dots,a_n), (b_1,\dots,b_n)\in\mathbb{R}^n$ then
  $$
    \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left(\sum_{k=1}^n a_k^2\right) \cdot \left(\sum_{k=1}^n b_k^2\right).
  $$
  Equality occurs if and only if there is $c\in\mathbb{R}$ such that $b_k = c a_k$ for each $k=1,\dots,n$.
  \begin{proof}
    Let $(a_1,\dots,a_n), (b_1,\dots,b_n)\in\mathbb{R}^n$. Let
    $$
      A = \sqrt{\sum_{k=1}^n a_k^2}, \quad B = \sqrt{\sum_{k=1}^n b_k^2}, \quad\text{and}\quad C = \sum_{k=1}^n a_k b_k
    $$
    so that the inequality to be proven is equivalent to $C^2\leq A^2B^2$. We consider three cases.

    \textbf{Case 1:} Suppose $A=0$. Then $a_k=0$ for each $k=1,\dots,n$. Hence $C=0$ and $C^2=A^2B^2=0$.

    \textbf{Case 2:} Suppose $B=0$. Then $b_k=0$ for each $k=1,\dots,n$. Hence $C=0$ and $C^2=A^2B^2=0$.

    \textbf{Case 3:} Suppose $A>0$ and $B>0$. Then
    $$
      \left|\frac{C}{AB}\right|
      = \left|\sum_{k=1}^n \frac{a_k b_k}{AB} \right|
      \leq \sum_{k=1}^n \left| \frac{a_k}{A} \cdot \frac{b_k}{B} \right|
      \leq \sum_{k=1}^n \frac{1}{2} \left( \frac{a_k^2}{A^2} + \frac{b_k^2}{B^2} \right)
      = \frac{1}{2} \left( \frac{\sum_{k=1}^n a_k^2}{A^2} + \frac{\sum_{k=1}^n b_k^2}{B^2} \right)
      = 1
    $$
    so that $|C| \leq |AB|$. Then $C^2\leq A^2B^2$.

    If there is $c\in\mathbb{R}$ such that $b_k = ca_k$ for each $k=1,\dots,n$, then
    $$
      C^2 = \left( \sum_{k=1}^n a_k b_k \right)^2 
      = \left( \sum_{k=1}^n c a_k^2 \right)^2
      = \left( \sum_{k=1}^n a_k^2 \right) \cdot \left( \sum_{k=1}^n c^2 a_k^2 \right)
      = \left(\sum_{k=1}^n a_k^2\right) \cdot \left(\sum_{k=1}^n b_k^2\right) = A^2B^2.
    $$
    Suppose $C^2=A^2B^2$. Let $c = B/A$. WIP
  \end{proof}
\end{theorem}
    
\end{document}