\chapter{Basic Definitions}
\section{Notation, commutator calculus, characteristic subgroups}
{\bf Definition 1:}
$Core_G(H)= \bigcap_{g \in G} H^g$ (Can use this to show $|G:Core_G(H)|\le |G:H|!$).
$O^{\cal A}(G)= \bigcap_{A \lhd G, G/A \in {\cal A}} A$.
$O_{\cal A}(G)= \prod_{A \lhd G, A \in {\cal A}} A$.\\
\\
{\bf Definition 2:} Let ${\cal M}_G= \{ M: M$ is a non-trivial minimal normal subgroup of $G\}$;
the \emph{socle of $G$}, denoted
$soc(G)$, is defined by
$soc(G)= \langle M \rangle_{M \in {\cal M}}$.
$O_{\pi}(G)=$ maximal normal $\pi-$subgroup of $G$.
$O^{\pi}(G)=$ smallest normal subgroup of $G$ such that $G/O^{\pi}(G)$ is a $\pi$-group.
$G$ is $p-$closed if $O_p(G) \in S_p(G)$.
\\
\\
{\bf Definition 3:}
A homomorphism $\varphi: G \rightarrow X$ is \emph {faithful} if it is injective.
\\
\\
{\bf Definition 4:}
${\cal SCN}(P)=$ set of self centralizing normal subgroups of $P$.
${\cal SCN}(p)= {\cal SCN}(P)$ where $P \in {\cal SCN}(P)$.
\\
\\
{\bf Definition 4.5:} If $\pi = \{ p_1, p_2, \ldots , p_k\}$ is a set of primes, we say
$G$ is a $\pi$ group if the only primes dividing $|G|$ are in $\pi$.  If $G$ is a finite
group and $H \leq G$, we say $H$ is an $S_{\pi}$ group if $H$ is a $\pi$ group and
$p \nmid |G:H|$  if $p \in \pi$.  $S_{\pi}(G)$  is the set of all $S_{\pi}$ subgroups of
$G$. For $\pi = \{ p \}$, we call an $S_{\pi}$ group and $S_p$ group and put $S_{\pi}(G) = S_p(G)$.
$S_p(G)$ is just the sylow subgroups of $G$.
\\
\\
{\bf Definition 5:}
${\cal N}_G(A, \pi)=$ set of all $A-$invariant $\pi$ subgroups of $G$.
${\cal N}_G^*(A, \pi)=$ maximal subgroups in ${\cal N}_G(A, \pi)$.  For a $p-$group, $P$,
$\Omega_n(P)=
\langle x \in P: x^{p^n}=1 \rangle $ and
$\mho_n(P)= \langle x^{p^n}: x \in P \rangle $.
\\
\\
{\bf Definition 6:} Let $H \subseteq G$ and let $S$ be an $H$-invariant subset of $G$;
$H$ is said to
control fusion in $S$ if for $s \in S$, $s^G \cap S = s^H$.
Let $X \le H \le G$.  $X$ is \emph{weakly closed} in $H$ with respect to $G$ if
$X^g \cap H = \{X\}$.\\
\\
{\bf Definition 7:}
$G$ is $p$\emph{-constrained} if
$P \in S_p ( O_{p',p} (G))$ implies $C_G(P) \subseteq O_{p',p} (G)$.
Equivalently, if $O_{p'}(G)=1$ then $C_G(O_p(G)) \subseteq O_p(G)$ and $F(G)= O_p(G)$..
\\
\\
{\bf Definition 8:}
$Z$ is \emph {weakly closed} in $P$ with respect to $G$ if $Z^g \subseteq P \rightarrow Z^G=Z$.
The \emph {weak closure} of $Z$ in $P$ with respect to $G$ is $wcl_G(Z, P)=
\langle Z^g, Z^g \subseteq P \rangle $.
\\
\\
{\bf Definition 9:}
$G$ is $p$\emph{-stable} if $p \ne 2$ and
if $A \in p(N(P))$ with $[P,A,A]= 1$ implies $A C(P)/C(P) \subseteq O_p (N(P)/C(P))$.
\\
\\
{\bf Definition 10:}
$m_p(P)$ is the rank of the largest elementary abelian $p$-group in $P$.
\\
\\
{\bf Definition 11:}
$O_{\infty}(G)=$ largest solvable normal subgroup of $G$.
\\
\\
{\bf Definition 12:} $F(G)$, the \emph{Fitting subgroup of $G$}
is the unique maximal, normal, nilpotent subgroup of $G$ and
$F(G)= \prod_p O_p(G)$.
\\
\\
{\bf Definition 13:} $A^{\pi}(G)$ is the unique smallest normal subgroup of $G$ such that
$G/A^{\pi}(G)$ is an abelian $\pi$-group.  If $P \subseteq H \subseteq G$ then
$ |G:A^p(G)| \le |H:A^p(H)|$ if equality holds we say $H$ \emph {controls $p$-transfer in $G$}.
\\
\\
{\bf Definition 14:}
$G$  is
$\pi$\emph{-solvable} if there is a normal series whose factors
consist of either $\pi'$-groups or a solvable
$\pi$-groups.
\\
\\
{\bf Definition 15:} $G$ is $\pi$\emph{-closed} if $G/O_{\pi}(G)$ is a $\pi'$ group and thus
$O_{\pi}(G)=O^{\pi'}(G)$.
\\
\\
{\bf Definition 16:}
$E_{p^n}$ denotes the elementary abelian $p-$group of rank $n$.
$m_{2,p}(G) = max \{ m_p (H) \}$, where $H$ is 2-local.
$e(G) = max \{ m_{2,p} (G), p \ne 2 \}$ ($e(G)$ is a good approximation of
the Lie rank.).
\\
\\
{\bf Definition 17:} The group $A/B$ is called a section of $G$ if $B \lhd A <G$.
\\
\\
{\bf Definition 18:} $G$ is $\pi$-separable if there are characteristic subgroups
$A_0, A_1, \ldots , A_n$: $1=A_0<A_1<\ldots<A_n=G$ such that $A_i/A_{i-1}$ is
either a $\pi$ group or a $\pi'$ group.
\\
\\
{\bf Definition 19:} $G$ is $p$-closed if $O_p(G)= O^{p'}(G)$.
\\
\\
{\bf Definition 20:}
$O^{\cal K}(G)= \bigcap_{A \lhd G, G/A \in {\cal K}} A$.
$O_{\cal K}(G)= \bigcap_{A \lhd G, A \in {\cal K}} A$.
\\
\\
{\bf Definition 21:}
$O_{p'}(G)$ is called the $p$\emph{-core} of $G$. $O_{2'}(G)$ is often called the
\emph{core} of $G$ and is sometimes denoted by $O(G)$.
\\
\\
{\bf Definition 22:}
$G$ is
\emph{metacyclic} if $\exists H \lhd G: G/H ,H$ are cyclic.
\\
\\
{\bf Notation:}  Let $G$ be a finite group, $x, y \in G$, $U, V \subseteq G$,
$A \subseteq Aut(G)$.
\begin{enumerate}
\item $ \langle U \rangle $ denotes the smallest subgroup of $G$ containing $U$.
\item $x^g= g^{-1}xg$.
\item $[x,g]= x^{-1} g^{-1} x g$.
\item $U^g= \{ u^g: u \in U \}$
\item ${\overline U} = U/N$.
\end{enumerate}
{\bf Theorem 1:}
$ [x, y^{-1}, z] [y, z^{-1}, x] [z, x^{-1}, y]=1$
(\emph{Jacobi Identity}).
$[ab,c]= [a,c]^b [b,c]$ and $[a,bc]=[a,c] [a,b]^c$.
\begin{quote}
\emph{Proof:} Straightforward calculations.
\end{quote}
{\bf Three Subgroups:} $A, B, C \subseteq G$ and
$N \lhd G$ with
$[A,B,C] \subseteq N$ and
$[B,C,A] \subseteq N$ then
$[C,A,B] \subseteq N$.
\\
\\
{\bf Dedekind's Lemma:}  If $G=HK$ and $H \subseteq G_0$ then $G_0 = H(G_0 \cap K)$.
\begin{quote}
\emph {Proof:}
$g_0=hk$ so $g_0 h^{-1} \in G_0 \cap K$ (since $h \in G_0$).
\end{quote}
{\bf Theorem 2:}  If $x,y \in G$ , $z=[x,y]$, $[z, x]=1=[z,y]$ then (1) $[x^n, y^m]=z^{mn}$ and
(2) $(yx)^n= z^{(n(n-1))/2}y^n x^n$.
\begin{quote}
\emph {Proof of 1:} Claim: Under the conditions of the theorem, $[x^n,y]= z^n$.  Proof by induction.
It is true for $n=1$.  $[x^{n+1},y]= x^{-(n+1)}y^{-1}x^{n+1}y= x^{-n}x^{-1} y^{-1} x x^n y$.
So $[x^{n+1},y]= x^{-1} x^{-n} y^{-1} x^n y y^{-1} x y= x^{-1} z^n y^{-1} x y= z^{n+1}$.
Proof of theorem is by induction on $m$.  It is true for $m=1$, by the claim.  Now,
$[x^n,y^{m+1}]= (x^{-n} y^{-1} x^n y) y^{-1} x^{-n} y^{-m} x^n y^m y= z^n y^{-1} (z^{mn}) y$;
so $[x^n,y^{m+1}]= z^n y^{-1} (z^{mn}) y = z^n z^{mn}= z^{n(m+1)}$ which proves the result.
\\
\\
\emph {Proof of 2:} Again, the proof is by induction on $n$; it is true for $n=1$.
$(yx)^{n+1}= (yx)^n (yx)=
z^{\frac {n(n-1)} {2}} y^n x^n y x= y^{n+1} x^n (x^{-n} y^{-1} x^n y) x
= z^{\frac {n(n-1)} {2}} y^{n+1} x^n z^n x= z^{\frac {n(n+1)} 2} y^{n+1} x^{n+1}$.
\end{quote}
{\bf Theorem 3:}
If  $H \; char \; K$ and $K \;  char \; G$ then $H \; char \; G$.
\\
\\
{\bf Theorem 4:}
If $H, K < G$, $[H,K] \lhd \langle H, K \rangle$.
If $H, K, L \lhd G$ then $[HK,L]= [H,L] [K, L]$.
$[xy,z]= [x,z] [x,z,y] [y,z]$.
$[x, yz]= [x,z] [x,y] [x,y,z]$.
\begin{quote}
\emph{Proof:}
Straightforward.
\end{quote}
{\bf Theorem 5:}
If $A$ is a cyclic group of maximal order in and abelian group $G$, then $A$ is a direct
factor of $G$.
\begin{quote}
\emph{Proof:}
By induction on $|G|$.
$G$ must possess a non-cyclic abelian $S_p$ group for some $p$.
$\exists H: pH=1, H \cap A = \{ 1 \}$, set ${\overline G}= G/H$.
If $|{\overline A}|= |A|$, the result follows by induction so
${\overline G} = {\overline A} {\overline B}$,
${\overline A} \cap {\overline B} = \{ 1 \}$.  Let $A$ and $B$ be the inverse images
under the homomorphism.  $A \cap B \subseteq H$ but by construction, $H \cap A= \{ 1 \}$
and the result follows.
\end{quote}
{\bf Theorem 6:}
If $H \lhd G$ and $(|G:H|, |H|)=1$ then $H \; char \; G$.
\begin{quote}
\emph{Proof:}
Let $\phi$ be an automorphism that does not fix $H$ and put $H'= \phi(H)$.
$H H'$ is a subgroup of $G$ and
$|H H'| > |H|$.  ${\frac {(H H')} {H}} \cong {\frac {H'} {H \cap H'}}$.
Put $k= |H H'|, m= |G:H|, n= |H|, d= | H \cap H' |$,  then
$ 1 < k'= {\frac {k} {n}} =  {\frac n d}$ and $k' \mid n$.  So $dk'= n$ and $(k', d)=1$,
thus $d=1, H = H'$ and the result follows.
\end{quote}
{\bf Theorem 7:}
Let $H$ be an elementary abelian $p$-group of $G$ and $x \in N_G(H)$ and let $\phi_x$
be the linear transformation induced by $x$ on $H$ then the minimal polynomial of
$\phi_x$ is $(x-1)^r$, where $[h,x, \ldots, x]= 1$ and $x$ appears $r$ times.
\begin{quote}
\emph{Proof:}
Straightforward calculation.
\end{quote}
{\bf Theorem 8:}  If $G$ has no non-trivial characteristic subgroups then
$G= \bigoplus_{i=1}^n H_i$, where $H_1 \cong H_i, \forall i$, and $H_i$ is
simple.
\begin{quote}
\emph{Proof:} Let $H_1$ be a minimal normal sugroup of $G$.  If $H_1 = G$, we're done.
Now let $H \le G$ be maximal subject to (a) $H=H_1 H_2 \ldots H_n$, (b) $H_1 \cong H_i$,
(c) $H_i \lhd G$ and (d)
$H=H_1 H_2 \ldots H_{i-1} H_{i+1} \ldots H_n \cap H_i = 1$.  Claim:  $H=G$.  Observe
$1 \ne H \; char \; G$; if $\phi \in Aut(G)$,
$H_i^{\phi} \lhd G$.
So $H_i^{\phi} \cap H \lhd G$.
If $H_i^{\phi} \cap H =1$, $H$ is not maximal and if
$H_i^{\phi} \cap H 1\ge $, $H_1$ is not minimal.
Thus $H^{\phi} = H$, $H \; char \; G$, so $G=H$.
\end{quote}
{\bf Corrollary:} If $G$ is solvable and $H \le G$ is characteristically simple, $H$
is an elementary abelian $p$-group.
\\
\\
{\bf Definition 23:} A group, $A$ acts on a set, $\Omega$, if $\forall x \in \Omega$ and $\forall a \in A$,
$x^a \in \Omega$, $x^e = x$, $x^{(a_1 a_2)} = (x^{a_1})^{a_2}$. If, in addition, $\Omega = G$ is a group and
$g_1 , g_2 \in G$, then $(g_1 g_2)^a = g_1^a g_2^a$.


% Part: first-order-logic
% Chapter: sequent-calculus
% Section: structural-rules

\documentclass[../../../include/open-logic-section]{subfiles}

\begin{document}

\iftag{FOL}
      {\olfileid{fol}{seq}{srl}}
      {\olfileid{pl}{seq}{srl}}

\olsection{Structural Rules}

We also need a few rules that allow us to rearrange !!{sentence}s in
the left and right side of a sequent.  Since the logical rules require
that the !!{sentence}s in the premise which the rule acts upon stand
either to the far left or to the far right, we need an ``exchange''
rule that allows us to move !!{sentence}s to the right position.  It's
also important sometimes to be able to combine two identical
!!{sentence}s into one, and to add !!a{sentence} on either side.

\subsection{Weakening}

\begin{defish}
\Axiom$ \Gamma \fCenter \Delta $
\RightLabel{\LeftR{\Weakening}}
\UnaryInf$ !A, \Gamma \fCenter \Delta$
\DisplayProof
\hfill
\Axiom$ \Gamma \fCenter \Delta$
\RightLabel{\RightR{\Weakening}}
\UnaryInf$ \Gamma \fCenter \Delta, !A$
\DisplayProof
\end{defish}

\subsection{Contraction}

\begin{defish}
\Axiom$ !A, !A, \Gamma \fCenter \Delta $
\RightLabel{\LeftR{\Contraction}}
\UnaryInf$ !A, \Gamma \fCenter \Delta$
\DisplayProof
\hfill
\Axiom$ \Gamma \fCenter \Delta, !A, !A$
\RightLabel{\RightR{\Contraction}}
\UnaryInf$ \Gamma \fCenter \Delta, !A$
\DisplayProof
\end{defish}

\subsection{Exchange}

\begin{defish}
\Axiom$ \Gamma, !A, !B, \Pi \fCenter \Delta $
\RightLabel{\LeftR{\Exchange}}
\UnaryInf$ \Gamma, !B, !A, \Pi \fCenter \Delta$
\DisplayProof
\hfill
\Axiom$ \Gamma \fCenter \Delta, !A, !B, \Lambda$
\RightLabel{\RightR{\Exchange}}
\UnaryInf$ \Gamma \fCenter \Delta, !B, !A, \Lambda$
\DisplayProof
\end{defish}

A series of weakening, contraction, and exchange inferences will often
be indicated by double inference lines.

The following rule, called ``cut,'' is not strictly speaking
necessary, but makes it a lot easier to reuse and combine derivations.
\begin{defish}
\[
\Axiom$ \Gamma \fCenter \Delta, !A$
\Axiom$ !A, \Pi \fCenter \Lambda $
\RightLabel{\Cut}
\BinaryInf$ \Gamma, \Pi \fCenter \Delta, \Lambda$
\DisplayProof
\]
\end{defish}

\end{document}


% Created 2020-04-22 mié 12:21
% Intended LaTeX compiler: pdflatex
\documentclass[presentation,aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{khpreamble}
\usetheme{default}
\author{Kjartan Halvorsen}
\date{\today}
\title{Feedback on reports for PI-control of a pneumatic tank}
\hypersetup{
 pdfauthor={Kjartan Halvorsen},
 pdftitle={Feedback on reports for PI-control of a pneumatic tank},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.3.6)},
 pdflang={English}}
\begin{document}

\maketitle

\section{Feedback}
\label{sec:org5d43272}

\begin{frame}[label={sec:org0aee4a0}]{Estimating the parameter of the model}
The model is \[\underbrace{\frac{dp}{dt}}_{y} = a\underbrace{(u_v-5)\sqrt{p_s-p}}_{x}, \]
fit \(a\) in \(y=ax\).
\begin{center}
  \begin{tikzpicture}
    \pgfmathsetmacro{\pps}{5}
    \pgfmathsetmacro{\aa}{1.1}
    \pgfmathsetmacro{\uv}{6}
    \pgfmathsetmacro{\AA}{\aa*(\uv-5)}
    \pgfmathsetmacro{\tmax}{2*sqrt(\pps)/\AA}
    \pgfmathsetmacro{\tone}{0.1}
    \pgfmathsetmacro{\pone}{\pps - pow(sqrt(\pps)-0.5*\AA*\tone,2)}
    \pgfmathsetmacro{\pdotone}{\AA*sqrt(\pps - \pone)}
    \pgfmathsetmacro{\ttwo}{0.8}
    \pgfmathsetmacro{\ptwo}{\pps - pow(sqrt(\pps)-0.5*\AA*\ttwo,2)}
    \pgfmathsetmacro{\pdottwo}{\AA*sqrt(\pps - \ptwo)}
    \pgfmathsetmacro{\tthree}{2}
    \pgfmathsetmacro{\pthree}{\pps - pow(sqrt(\pps)-0.5*\AA*\tthree,2)}
    \pgfmathsetmacro{\pdotthree}{\AA*sqrt(\pps - \pthree)}

    \pgfmathsetmacro{\xone}{(\uv-5)*sqrt(\pps-\pone)}
    \pgfmathsetmacro{\xtwo}{(\uv-5)*sqrt(\pps-\ptwo)}
    \pgfmathsetmacro{\xthree}{(\uv-5)*sqrt(\pps-\pthree)}

    \begin{axis}[
      clip=false,
      width = 6cm,
      height = 5cm,
      xlabel = {$t$},
      ylabel = {$p$},
      grid=both,
      major grid style = {dotted},
      ]
      \addplot[blue!80!black, no marks, domain=0:\tmax, samples=200,] {\pps - pow(sqrt(\pps)-0.5*\aa*x,2) + 0.1*rand};
      \addplot[orange!80!black, no marks, thick, domain=-0.3:0.3, samples=10] ({\tone+x}, {\pone + \pdotone*x}) node[coordinate, pos=0.5,pin=0:{$\frac{dp}{dt}=\pgfmathprintnumberto[precision=1]{\pdotone}{\myresult}\myresult$, $p=\pgfmathprintnumberto[precision=1]{\pone}{\myresult}\myresult$},] {};
      \addplot[red!80!black, no marks, thick, domain=-0.3:0.3, samples=10] ({\ttwo+x}, {\ptwo + \pdottwo*x}) node[coordinate, pos=0.5,pin=0:{$\frac{dp}{dt}=\pgfmathprintnumberto[precision=1]{\pdottwo}{\myresult}\myresult$, $p=\pgfmathprintnumberto[precision=1]{\ptwo}{\myresult}\myresult$},] {};
      \addplot[purple!80!black, no marks, thick, domain=-0.3:0.3, samples=10] ({\tthree+x}, {\pthree + \pdotthree*x}) node[coordinate, pos=0.5,pin=0:{$\frac{dp}{dt}=\pgfmathprintnumberto[precision=1]{\pdotthree}{\myresult}\myresult$, $p=\pgfmathprintnumberto[precision=1]{\pthree}{\myresult}\myresult$},] {};
    \end{axis}
    \begin{axis}[
      xshift=7cm,
      clip=false,
      width = 6cm,
      height = 5cm,
      xlabel = {$(u_v-5)\sqrt{p_s - p}$},
      ylabel = {$\frac{dp}{dt}$},
      yticklabel style={/pgf/number format/fixed,
                  /pgf/number format/precision=1},
      xtick = {0,\xthree, \xtwo, \xone},
      ytick = {0,\pdotthree,\pdottwo,\pdotone},
      grid=both,
      xmin=0,
      ymin=0,
      major grid style = {dotted},
      ]
      \addplot[orange!80!black, mark=o, ] coordinates {( \xone, \pdotone)};
      \addplot[red!80!black, mark=o, ] coordinates {( \xtwo, \pdottwo)};
      \addplot[purple!80!black, mark=o, ] coordinates {( \xthree, \pdotthree)};
      \addplot[black, no marks, domain=0:2.2, samples=20] { \aa*x } node[pos=0.3, coordinate, pin=0:{$y=ax=\aa \cdot x$},] {};
      \end{axis}

  \end{tikzpicture}
\end{center}
\end{frame}

\begin{frame}[label={sec:orgbfc8aab}]{The linearized model paramater \(b\) dependence on the operating pressure}
We obtained the following linearized models
\begin{align}
\frac{d}{dt}y(t) &= b_{in}u(t), \quad b_{in} = a\sqrt{p_s-p_0}, \quad \text{for air in}\\
\frac{d}{dt}y(t) &= b_{out}u(t), \quad b_{out} = a\sqrt{p_0}, \quad \text{for air out}
\end{align}

\begin{center}
  \begin{tikzpicture}
    \pgfmathsetmacro{\pps}{5}
    \pgfmathsetmacro{\aa}{1.1}
    \begin{axis}[
    clip=false,
    width=10cm,
    height=6cm,
    xlabel={$p_0$},
      ]
      \addplot[blue!80!black, no marks, domain=0:5, samples=100,] {\aa*sqrt(\pps-x)} node[pos=0.8,coordinate, pin=0:{$b_{in}$}] {};
      \addplot[orange!80!black, no marks, domain=0:5, samples=100,] {\aa*sqrt(x)} node[pos=0.2,coordinate, pin=0:{$b_{out}$}] {};
      \end{axis}
  \end{tikzpicture}
\end{center}
\end{frame}

\begin{frame}[label={sec:orgdd6eaa8}]{PI-controller design}
Using the controller \(F(s) = K\Big(1 + \frac{1}{sT_i}\Big) = K \frac{s T_i + 1}{sT_i}\)
 with \(T_i = 0.35\)
\begin{center}
\includegraphics[width=0.7\linewidth]{../../figures/rlocus_PI_tank.pdf}
\end{center}
\end{frame}

\begin{frame}[label={sec:org242b71c}]{PI-controller design, contd}
The (linear) closed-loop system becomes
\[ G_c(s) = \frac{4.43s + 12.7}{s^2 + 4.43s + 12.7}\]

\begin{center}
\includegraphics[width=0.6\linewidth]{../../figures/pzmap_PI_tank.pdf}
\end{center}
\end{frame}

\begin{frame}[label={sec:orgdca5f99}]{Simulations, P-controller}
\begin{center}
\includegraphics[width=1.0\linewidth]{../../figures/sim-P-control-tank.png}
\end{center}
\end{frame}
\begin{frame}[label={sec:org4949533}]{Simulations, PI-controller}
\begin{center}
\includegraphics[width=1.0\linewidth]{../../figures/sim-PI-control-tank.png}
\end{center}
\end{frame}
\end{document}


%%%% 13.10.2016

\minisec{Recall:}

We have a bounded value problem with
\[
	\begin{cases}
		Lu &\equiv u^{(n)}+ c_{n-1}(x) u^{(n-1)} + \dots + c_1(x) u' + c_0(x)u= f \in C([0,1]) \\
		R_ju &= \sum_{k=0}^{n-1}\left( \alpha_{kj} u^{(k)}(0) + \beta_{kj}u^{(k)}(1) \right) = 0, \qquad j = 1,2,\dots,n
	\end{cases}
\]
with $\alpha_{kj}, \beta_{kj} \in \mathbb{C}$ for $k=0, \dots,n-1$ and $j =1,\dots,n$. \\
We have
\[
	\mathcal{N}(L) = \set[u \in C^n((0,1))]{Lu =0}.
\]
Set $u_1,u_2, \dots,u_n$ as a basis for $\mathcal{N}(L)$ and set
\[
	L_0 = L  \big|_{C_R^n([0,1])}^{}
\]
where
\[
	C_R^n([0,1]) = \set[u \in C^n((0,1))]{R_ju=0,\,j=1, \dots,n}.
\]
Then $L_0 u \in C([0,1])$ for $u \in C_R^n([0,1])$. Remember Theorem 4.3 and Theorem 4.4:
\begin{theorem*}
	Assume
	\[
		\det(R_ju_k) \neq 0.
	\]
	Then
	\begin{enumerate}
		\item $L_0: C_R^n([0,1]) \to  C([0,1])$ is a bijection.
		\item Set $G = L_0^{-1}$. Then there exists a continuous function $g(x,y)$ in $[0,1] \times [0,1]$ such that
		\[
			G(f) = \int_{0}^{1}g(x,y)f(y) \,\mathrm{d}y, \qquad x \in [0,1].
		\]
		with $f \in C([0,1])$ and $g$ is called the Green's function for $L$ and the boundary conditions $R_j$, $j =1, \dots,n$ can be given by
		\[
			g(x,y) = e(x,y) \theta(x-y) + \sum_{k=1}^{n}b_k(y) u_k(x)
		\]
		where
		\[
			e(x,y) = \sum_{k=1}^{n}a_k(y)u_k(x)
		\]
		with $a_k$ and $b_k$ are defined through
		\[
			\begin{cases}
				\left( \diff{}{x} \right)^l e(x,y)  \big|_{x=y}^{} &= 0, \qquad l=0,1,\dots,n-2. \\
				\left( \diff{}{x} \right)^{n-1} e(x,y)  \big|_{x=y}^{} &= 1
			\end{cases}
		\]
		and \[
			R_j(g(.,y))= 0, \qquad 0<y<1, \qquad j=1,2,\dots,n.
		\]
 	\end{enumerate}
\end{theorem*}
\begin{bemerkung}
	Consider the problem
	\[
		\begin{cases}
			Lu &= f(x,u), \qquad x \in [0,1] \\
			R_ju &= c_j, \qquad j=1,2,\dots,n
		\end{cases}.
	\]
	Pick any $\tilde u \in C^n([0,1])$ such that
	\[
		R_j \tilde u = c_j, \qquad j=1, \dots,n.
	\]
	Set $U =  \tilde u + v$. Note that
	\[
		R_jv= R_j(u- \tilde u) = R_ju - R_j \tilde u = 0, \qquad j =1,2,\dots,n
	\]
	and
	\[
		L( \tilde u + v) = f(x, \tilde u + v)
	\]
	gives \[
		Lv = f(x, \tilde u + v) - L \tilde u = \hat f(x,v).
	\]
	Solve
	\[
		\begin{cases}
			Lv &= \hat f (x,v) \\
			R_jv &=0, \qquad j=1, \dots,n
		\end{cases}
	\]
	Moreover set \[
		T(v)(x) = \int_{0}^{1}g(x,y) \hat f(y, v(y)) \,\mathrm{d}y, \qquad x \in [0,1].
	\]
	Apply a fixed point theorem. \\ \underline{Warning:} don't take for example the space $C^2([0,1])$ because in this case we need another norm to use the fixed point theorem (no Banach space). Take
	\[
		T : C([0,1]) \to  C([0,1])
	\] instead where $(C([0,1]), \norm{.})$ is a Banach space. \\
If $u \in C([0,1])$ is a fixed point then
\[
	u(x) = \int_{0}^{1}g(x,y) f(y,u(y)) \,\mathrm{d}y, \qquad  x \in [0,1].
\]
WE ACTUALLY have $u \in C_R^n([0,1])$!!
\end{bemerkung}
\begin{definition*}
	Call $L_0$ \underline{symmetric} if
	\[
		\skal{L_0u}{v}_{L^2} = \skal{u}{L_0v}_{L^2}, \qquad \forall\, u,v \in C_R^n([0,1])
	\]
	where
	\[
		\skal{f}{h}_{L^2} = \int_{0}^{1}f(x) \overline{h(x)} \,\mathrm{d}x
	\]
\end{definition*}
\begin{theorem}
	Assume that $L_0: C_R^n([0,1]) \to C([0,1])$ is a bijection. The following statements are equivalent:
	\begin{enumerate}
		\item $L_0$ is symmetric.
		\item $\tilde G$ self-adjoint.
		\item $g(x,y) = \overline{g(y,x)}$ for all $(x,y) \in [0,1] \times [0,1]$.
	\end{enumerate}
	Here \begin{align*}
				G(f) &= \int_{0}^{1}g(x,y)f(y) \,\mathrm{d}y, \qquad  f \in C([0,1]) \\
				\tilde G(f) &= \int_{0}^{1}g(x,y)f(y) \,\mathrm{d}y, \qquad f \in L^2([0,1])
	\end{align*}
	$\tilde G \in \mathcal{B}(L^2([0,1]),L^2([0,1]))$ and $\overline{C([0,1])}^{L^2([0,1])} = L^2([0,1])$. \\
\end{theorem}

\begin{beweis}

	\begin{description}
		\item[(1) $\Rightarrow$ (2):] Assume that $L_0$ is symmetric. Then we have \[
			\skal{L_0(G(f))}{G(h)}_{L^2} = \skal{G(f)}{L_0(G(h))}_{L^2}
		\] for all $f,h \in C([0,1])$. Hence
		\[
			\skal{f}{G(h)}_{L^2} = \skal{G(f)}{h}_{L^2}, \qquad \forall\, f,h \in C([0,1]).
		\]
		Change
		\[
			\skal{f}{ \tilde G(h)}_{L^2} = \skal{ \tilde G(f)}{h}_{L^2}, \qquad \forall\, f,h \in L^2([0,1]) \qquad (*)
		\]
		Hence $\tilde G$ is self-adjoint in $\mathcal{B}(L^2([0,1]),L^2([0,1]))$.
		This yields (2).
		\item[(2) $\Rightarrow$ (3):]  Given (2). From $(*)$ we get
		\begin{align*}
			\int_{0}^{1}f(x)\int_{0}^{1}g(x,y)h(y) \,\mathrm{d}y \,\mathrm{d}x &= \int_{0}^{1} \int_{0}^{1}g(x,y)f(y) \,\mathrm{d}y \overline{h(x)} \,\mathrm{d}x \\
			&= \int_{0}^{1}f(y) \int_{0}^{1}g(x,y) \overline{h(x)} \,\mathrm{d}x \,\mathrm{d}y \\
			&= \int_{0}^{1}f(x) \overline{\int_{0}^{1} \overline{g(y,x)}h(y) \,\mathrm{d}y} \,\mathrm{d}x \\
		\end{align*}
		We get
		\[
			\int_{0}^{1}f(x) \overline{\int_{0}^{1}(g(x,y)-\overline{g(y,x)})h(y) \,\mathrm{d}y} \,\mathrm{d}x = 0, \qquad f,g,h \text{cont.}
		\]
		This implies that
		\[
			\int_{0}^{1}(g(x,y)- \overline{g(y,x)}) h(y) \,\mathrm{d}y = 0, \qquad  \forall\, x \in [0,1].
		\]
		This implies
		\[
			g(x,y) = \overline{g(y,x)}, \qquad \forall\, x,y \in [0,1]
		\]
	\end{description}
\end{beweis}
\begin{theorem}
	Assume $L_0$ symmetric and bijection. Then
	\begin{enumerate}
		\item \begin{itemize}
			\item $0$ is not an eigenvalue of $L_0$.
			\item $0$ is not an eigenvalue of $\tilde G$.
		\end{itemize}
		\item $f$ is an eigenfunction for $L_0$ with the eigenvalue $\mu$ if and only if $f$ is an eigenfunction for $\tilde G$ with the eigenvalue $\frac{1}{\mu}$.
	\end{enumerate}
\end{theorem}
\begin{beweis}
	\begin{enumerate}
		\item $\mathcal{N}(L_0)= \set{0}$. So $0$ is not an eigenvalue of $L_0$. IF $f$ is an eigenfunction for $\tilde G$ with eigenvalue $0$ then for $u \in C_R^n([0,1])$ we have
		\begin{align*}
			\skal{f}{u} &= \skal{f}{G \underset{\in  C([0,1])}{\underbrace{L_0(u)}}} \\ & = \skal{f}{\tilde G(L_0u)}  \\ &= \skal{\tilde G(f)}{L_0u} \\
			&= \skal{0}{L_0u}  \\ &=0
 		\end{align*}
		So we have
		\[
			\skal{f}{u}= 0, \qquad \forall\, u \in C_R^n([0,1]).
		\]
		\textbf{Claim:} \text{    }$C_R^n([0,1])$ is dense in $L^2([0,1])$. \\
		If so, we get
		\[
			f \equiv 0.
		\]
		\item Assume
		\[
			L_0(f) = \mu f, \qquad f \in C_R^n([0,1]) \setminus \set{0}.
		\]
		We have
		\[
			0 \neq f = G(L_0(f)) = G( \mu f) = \tilde G( \mu f) = \mu \tilde G(f)
		\]
		So $\tilde G(f) = \frac{1}{\mu}f$. \\
		Assume $\tilde G(f) = \frac{1}{\mu} f$ for $f \in L^2([0,1]) \setminus \set{0}$. \\
		We have
		\[
			\tilde G(f)(x) = \frac{1}{\mu}f(x), \qquad \text{ for all }x \in  [0,1] \text{ except for $x$ in a zero set.}
		\]
		Consider
		\[
			\underset{\in C([0,1])}{\underbrace{\mu \underset{\substack{\text{continuous} \\ \text{function}}}{\underbrace{\tilde G(f)(x)}}}}.
		\]
		Set
		\[
			h(x):= \mu \tilde G(f)(x), \qquad  x \in  [0,1].
		\]
		We get
		\[
			h(x) = \mu \tilde G(h)(x) = \mu \underset{\in C^n_R([0,1])}{\underbrace{G(h)}}(x).
		\]
		and
		\[
			L_0h= L_0( \mu G(h)) = \mu L_0G(h) = \mu h.
		\]
		So
		\[
			L_0(h) = \mu h.
		\]
	\end{enumerate}
\end{beweis}
\begin{theorem}
	Assume $L_0$ to be symmetric and a bijection. Let $(\mu_n)_{n=1}^{\infty}$ be the eigenvalues of $L_0$ counted with multiplicity and $(e_n)_{n=1}^{\infty}$ corresponding ON-sequence of eigenfunctions. Then
	\begin{enumerate}
		\item $(e_n)_{n=1}^{\infty}$ is an ON-basis for $L^2([0,1])$.
		\item The solution $u$ of
		\[
			\begin{cases}
				Lu &= f \in C([0,1]) \\
				R_ju &=0, \qquad j= 1,2,\dots,n
			\end{cases}
		\]
		is given by
		\[
			u = \sum_{n=1}^{\infty} \frac{1}{\mu_n} \skal{f}{e_n}e_n
		\]
		in $L^2([0,1])$. \\
		Note $Le_n = \mu e_n$.
	\end{enumerate}
\end{theorem}

\subsection{Method of continuity}
\label{sub:method_of_continuity}
\begin{theorem}
	Assume $(E,\norm{.})$ Banach space. $A_t \in \mathcal{B}(E,E)$ for $t \in [0,1]$. Assume that there exists $c>0$ such that
	\begin{enumerate}
		\item $\norm{x} \leq c \norm{A_t(x)}$ for all $x \in E$ and $t \in [0,1]$.
		\item $\norm{A_t(x)-A_s(x)} \leq C \abs{t-s} \norm{x}$ for all $x \in E$ and $s,t \in [0,1]$.
		\item $A_0$ is invertible.
	\end{enumerate}

	Then $A_1$ is invertible.
\end{theorem}

\begin{beweis}
	Assume $A_t$ is invertible.
	\[
		A_s = \underset{\text{invertible}}{\underbrace{A_t}} \underset{\substack{\text{invertible if}} \\ \norm{A^{-1}_t (A_s - A_t)}< 1 \\ \text{by 'Neumann series} \\ \text{lemma}}{\underbrace{\left( I + A_t^{-1} ( A_s - A_t) \right)}}
	\]
	But \[
		\norm{A^{-1}_t (A_s- A_t)} \leq \underset{\leq c}{\underbrace{\norm{A_t^{-1}}}} \cdot \underset{\leq C \abs{t-s}}{\underbrace{ \norm{A_s-A_t}}}
	\]
	So if $\abs{t-s} < \frac{1}{c^2}$ then $A_s$ is invertible. Pick a sequence $t_k$ for $k=1,\dots,N$ such that
	\[
		\max_{k =1,\dots,N-1} \abs{t_{k+1}-t_k} < \frac{1}{c^2}
	\]
	where $0 = t_1 < t_2 < \dots < t_N=1$. Finally we get if $A_0$ is invertible that $A_{t_1}$ is invertible. \\
	$\Rightarrow $ $A_{t_2}$ is invertible. $\Rightarrow $ $\dots$ $\Rightarrow $ $A_1$ is invertible.
\end{beweis}

\subsection{Orthogonal projections}
\label{sub:orthogonal_projections}
\underline{Attention:} We should have done this earlier. \\
$(E, \skal{.}{.})$ Hilbert space and $S$ closed subspace. We know that
\[
	E = S \oplus S^{\perp}
\]
For every $x \in E$ there are unique $y \in S$, $z \in S^{\perp}$ such that
\[
	x = y + z
\]
Define $P_S: E \to E$ with
\[
	P_s(x)= y, \qquad \forall\, x \in E.
\]
We note:
\begin{itemize}
	\item $P_S$ is linear: \\
	For $y_1,y_2 \in S$ we find $z_1,z_2 \in S^{\perp}$
	\begin{align*}
		x_1 &= y_1 + z_1 \\
		x_2 &= y_2 + z_2
	\end{align*}
	For scalars $\alpha_1,\alpha_2$ we have
	\[
		\alpha_1 x_1 + \alpha_2 x_2 = \underset{\in S}{\underbrace{\alpha_1 y_1 + \alpha_2 y_2}} + \underset{\in S^{\perp}}{\underbrace{\alpha_1 z_1 + \alpha_2 z_2}}
	\]
	Then we have
	\[
		P_S(\alpha_1 x_1 + \alpha_2 x_2) = \alpha_1 y_1 + \alpha_2 y_2 = \alpha_1 P_S(x_1) + \alpha_2 P_S(x_2)
	\]
	and
	\[
		P_S(x_1) =y_1, \qquad P_S(x_2)=y_2
	\]
	\item $P_S$ is bounded: \\
	\begin{align*}
		\norm{P_S(x)}^2 & \stackrel{\hphantom{y \perp z}}{=} \norm{y}^2 \\
		& \stackrel{y \perp z}{\leq } \norm{y}^2 + \norm{z}^2 \\
		& \stackrel{\hphantom{y \perp z}}{=} \norm{x}^2
	\end{align*}
	So $\norm{P_S} \leq 1$. But
	\[
		\norm{P_S(y)} = \norm{y}, \qquad y \in S.
	\]
	So $\norm{P_S}=1$.
	\item $P_s$ is self-adjoint: \\
	\begin{align*}
		\skal{P_S(x_1)}{x_2} &= \skal{y_1}{x_2} \\
		&= \skal{y_1}{y_2} \\
		&= \skal{x_1}{y_2} \\
		&= \skal{x_1}{P_S(x_2)}, \qquad \forall\, x_1,x_2 \in E.
	\end{align*}
	\item $P_S^2=P_S$:
	\begin{align*}
		P_S^2(x) &= P_S(P_S(x)) \\
		&= P_S(y) \\
		&= y \\
		&= P_S(x)
	\end{align*}
\end{itemize}

\begin{proposition}
	Assume $P \in \mathcal{B}(E,E)$. With $P^2=P$ and $P$ self-adjoint. Then there exists a closed subspace $S$ in $E$ such that $P=P_S$
\end{proposition}
\begin{beweis}
	What is $S$? Set
	\[
		S= \set[x \in E]{P(x)=x}
	\]
	\textbf{Claim:} \text{    }$S$ is a closed subspace in $E$.  \\
	This is obvious. \\
	\textbf{Claim:} \text{    }$S$ is closed. \\
	Assume $x_n \in S$ with $x_n \to x$ in $E$.
	\[
		P(x_n) \to P(x) \qquad \text{ in }E \text{ since $P$ continuous.}
	\]
	So $x \in S$. By the Orthogonal Decomposition Theorem we have
	\[
		E = S \oplus S^{\perp}.
	\]
	It remains to show $P = P_S$. Fix $x \in E$.
	\[
		x = P(x) + x- P(x)
	\]
	show that $P(x) \in S$ and $x-P(x) \in S^{\perp}$.
	\begin{enumerate}
		\item $P(x) \in S$ since
		\[
			P(P(x)) = P^2(x) = P(x), \qquad \text{by assumption}
		\]
		\item $x-P(x) \in S^{\perp}$ since for $y \in S$ we have
		\begin{align*}
			\skal{y}{x-P(x)} &= \skal{P(y)}{x-P(x)} \\
			&= \skal{y}{P^*(x- P(x))} \\
			&= \skal{y}{P(x)-P(x)} \\
			&= 0
		\end{align*}
	\end{enumerate}
\end{beweis}

\begin{example}[last example]
	Set $(E,\skal{.}{.})$ Hilbert space. $(e_n)_{n=1}^{\infty}$ ON-basis, $(f_n)_{n=1}^{\infty}$ ON-sequence. \\
	Assume
	\[
		\sum_{n=1}^{\infty}\norm{e_n-f_n}^2 < \infty
	\]
	Then
	\[
		\Rightarrow \qquad (f_n)_{n=1}^{\infty} \text{ is an ON-basis.}
	\]
\end{example}
\begin{beweis}
	\begin{description}
		\item[Step 1:] Assume
		\[
			\sum_{n=1}^{\infty}\norm{e_n - f_n}^2 < 1.
		\]
		Assume that $(f_n)_{n=1}^{\infty}$ is not an ON-basis. Then there exists $0 \neq x \in E$ such that
		\[
			\skal{x}{f_k} = 0, \qquad  k =1,2,\dots.
		\]
		But $(e_n)_{n=1}^{\infty}$ is an ON-basis.
		\[
			x= \sum_{n=1}^{\infty} \skal{x}{e_n}e_n
		\]
		Parseval's formula gives
		\begin{align*}
				0 &< \norm{x}^2 \\ &= \sum_{n=1}^{\infty}\abs{\skal{x}{e_n}}^2 \\& = \sum_{n=1}^{\infty}\abs{\skal{x}{e_n-f_n}}^2 \\
				&\leq  \sum_{n=1}^{\infty}\norm{x}^2 \norm{e_n-f_n}^2 \\
				&= \norm{x}^2 \underset{< 1}{\underbrace{\sum_{n=1}^{\infty}\norm{e_n -f_n }^2}} \\
				&< \norm{x}^2
		\end{align*}
		which is a contradiction. \\
		Conslusion: $(f_n)_{n=1}^{\infty}$ is an ON-basis.
		\item[Step 2:] Assume
		\[
			\sum_{n=1}^{\infty}\norm{e_n-f_n}^2 < \infty.
		\]
		Assume once more that $(f_n)_{n=1}^{\infty}$ is not an ON-basis. \\
		There exists $0 \neq x \in E$ such that
		\[
			\skal{x}{f_k} = 0, \qquad k=1,2,\dots.
		\]
		Since \[
			\sum_{n=1}^{\infty} \norm{e_n-f_n}^2 < \infty
		\]
		there exists a positive interger $N \in \mathbb{N}$ such that
		\[
			\sum_{n=N+1}^{\infty} \norm{e_n-f_n}^2 < 1.
		\]
		Note that $\spn \set{x,f_1,f_2,\dots,f_n}$ has the dimension $N+1$. \\
		\textbf{Claim:} \text{    }There exists a non-trivial solution to
		\[
			\alpha_0 x + \alpha_1 f_1 + \alpha_2 f_2 + \dots + \alpha_N f_N \perp e_k, \qquad k=1,2,\dots,N.
		\]
		$N$ equations, $N+1$ unknowns and it is a homogenous linear system. There exists
		\[
			y = \alpha_0 x + \alpha_1 f_1 + \dots + \alpha_N f_N
		\]
		where not all $\alpha_k$'s are $0$ such that
		\[
			y \perp e_k, \qquad \text{ for }k =1,2,\dots,N.
		\]
		Note that $y \neq 0$. \\
		$(e_n)_{n=1}^{\infty}$ is an ON-basis for $E$. So
		\begin{align*}
		y &= \sum_{n=1}^{\infty} \skal{y }{e_n}e_n  \\
		&= \sum_{n=N+1}^{\infty} \skal{y}{e_n}e_n
		\end{align*}
		Parseval's formular gives
		\begin{align*}
			0	&< \norm{y}^2 \\ &= \sum_{n=N+1}^{\infty}\abs{\skal{y}{e_n}}^2 \\
			&= \sum_{n=1=N+1}^{\infty}\abs{\skal{y}{e_n-f_n}}^2 \\
			&\leq \norm{y}^2 \cdot \sum_{n=N+1}^{\infty} \norm{e_n-f_n}^2 < \norm{y}^2
		\end{align*}
		This is a contradiction and we are done.
	\end{description}
\end{beweis}


This chapter studies the syntactic transformation of an \oz{} class into an \picalc{} process. The resulting process is intuitively defined as follows:
\[P_{OZ\_PI} = \sum_{v\_st\in Init}^{} \tau. Q(v\_st,v\_self)\]
\begin{equation*}
\begin{aligned}
Q(v\_st,v\_self) ={} & (\sum_{c\in \text{In}}^{} c(v\_in_{c}) \ +\ \sum_{c\in \text{Out}}^{} \tau.\out{c}{v\_out_{c}})\ . \\
      &  \sum_{v\_st'}^{} \tau.Q(v\_st',v\_self)
\end{aligned}
\end{equation*}
Where:
\begin{itemize}
\item $\inA$ the set of all input actions, defined as $\inA\define\set[x\in\names]{\inp{x}{\vec{y}}}$.
\item $\outA$ is the set of all output actions, defined as $\outA\define\set[x\in\names]{\out{x}{\vec{y}}}$.
\item $c$ refers to an operation.
\item $v\_st$ refers to the variables of the current state.
\item $v\_st'$ refers to the variables of the successor state.
\item $v\_self$ refers to the instance reference.
\item $c.v\_in_{c}$ refers to the occurrence of the operation $c$, where $v\_in_{c}$ represents the values of the input parameters of $c$.
\item $c.v\_out_{c}$ refers to the occurrence of the operation $c$, where $v\_out_{c}$ represents the values of the output parameters of $c$.
\end{itemize}

What is the benefit of transforming an \oz{} class into a \picalc{} process? The main advantage is that it can be combined using the parallel operator with a second explicit \picalc{} process that represents the desired sequencing of the operations of the OZ class. This will enable us to study the behavior of an entity as will be shown later in the next chapter.

To transform an \oz{} class into a \picalc{} process we need to remember that the \picalc{} has only names and processes, and nothing else. A $name$ in \picalc{} can be seen as a \findex{channel} or a \textit{memory location}. Thus, in this work when we use the word \findex{channel} we refer to a \picalc{} \textit{name}. We need to use the names and processes to represent: value, state variable, state schema, initial state schema and operation schema in \picalc{}.

\section{Mapping values}
\findex[process!value]{}
\label{sec_tra_mapping_values}
\input{chapters/mainpart/transformational_semantics_oz/sections/mapping_values/mapping_values}

\section{Mapping state variables}
\findex[process!state variables]{}
\label{sec_tra_mapping_state_variables}
\input{chapters/mainpart/transformational_semantics_oz/sections/mapping_state_variables/mapping_state_variables}

\section{Mapping operations}
\findex[process!operations]{}
\label{sec_tra_mapping_operation}
\input{chapters/mainpart/transformational_semantics_oz/sections/mapping_operation/mapping_operation}

\section{Mapping data Types}
\findex[process!data Types]{}
\label{sec_tra_mapping_data_types}
\input{chapters/mainpart/transformational_semantics_oz/sections/mapping_data_types/mapping_data_types}

\section{Mapping mathematical operators}
\findex[process!mathematical operators]{}
\label{sec_tra_mapping_mathematical_operations}
\input{chapters/mainpart/transformational_semantics_oz/sections/mapping_mathematical_operations/mapping_mathematical_operations}

\section{Mapping OZ class}
\findex[process!OZ class]{}
\label{sec_tra_mapping_class}
\input{chapters/mainpart/transformational_semantics_oz/sections/mapping_class/mapping_class}

\section{Mapping transferable operation's variable}
\findex[process!transferable operation's variable]{}
\label{sec_tra_mapping_transferable_operation}
\input{chapters/mainpart/transformational_semantics_oz/sections/mapping_transferable_operation/mapping_transferable_operation}


\documentclass{article}

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{enumitem}

\title{CEM3350 Analysis}
\author{Guy John \\ \texttt{guy@rumblesan.com}}

\begin{document}

\maketitle

\section{Introduction}
A verbose but hopefully useful and correct analysis of the CEM3350 and AS3350 VCF IC\@. An input can be sent to multiple places within the circuit to obtain different responses and gains. Either a LowPass/BandPass response or a BandPass/HighPass response can be created. The input can also be sent to a fixed or variable gain input or some mix of the two. This will control the level of the output as the Q increases.

\begin{figure}[h]
  \includegraphics[width=\linewidth]{lpbp.png}
  \caption{LowPass/BandPass configuration}
\end{figure}

\newpage

\subsection{Notations}

\begin{description}
\item[F] is the the frequency control variable
\item[Q] is the the Q control variable
\item[a] is the variable gain input scaling factor
\item[b] is the fixed gain input scaling factor
\end{description}

\section{LowPass/BandPass Configuration}

\begin{equation}
  iq = Q(aV_{in} - V_{bp})
\end{equation}

\begin{equation}
  i1 = F(bV_{in} - V_{lp})
\end{equation}

\begin{equation}
  i2 = FV_{bp}
\end{equation}

\begin{equation}
  \hat{V}_{bp} = \frac{\hat{I}_1 + \hat{I}_q}{sC}
\end{equation}

\begin{equation}
  \hat{V}_{lp} = \frac{\hat{I}_2}{sC}
\end{equation}

Simplify Vbp into terms of Vlp and Vin.

\begin{equation*}
\begin{split}
  \hat{V}_{bp} & = \frac{\hat{I}_1 + \hat{I}_q}{sC} \\
  sC\hat{V}_{bp} & = \hat{I}_1 + \hat{I}_q \\
  sC\hat{V}_{bp} & = Fb\hat{V}_{in} - F\hat{V}_{lp} + Qa\hat{V}_{in} - Q\hat{V}_{bp} \\
  sC\hat{V}_{bp} + Q\hat{V}_{bp} & = Fb\hat{V}_{in} - F\hat{V}_{lp} + Qa\hat{V}_{in}\\
  \hat{V}_{bp}(sC + Q) & = \hat{V}_{in}(Fb + Qa) - F\hat{V}_{lp} \\
\end{split}
\end{equation*}

\begin{equation}
  \hat{V}_{bp} = \frac{\hat{V}_{in}(Fb + Qa) - F\hat{V}_{lp}}{sC + Q}
\end{equation}

Get Vlp in terms of Vin and calculate Low Pass transfer function.

\begin{equation*}
\begin{split}
  \hat{V}_{lp} & = \frac{\hat{I}_2}{sC} \\
  \hat{V}_{lp} & = \frac{F\hat{V}_{bp}}{sC} \\
  sC\hat{V}_{lp} & = F\hat{V}_{bp} \\
  sC\hat{V}_{lp} & = \frac{\hat{V}_{in}(F^2b + FQa) - F^2\hat{V}_{lp}}{sC + Q} \\
  \hat{V}_{lp}(s^2C^2 + sCQ) & = \hat{V}_{in}(F^2b + FQa) - F^2\hat{V}_{lp} \\
  \hat{V}_{lp}(s^2C^2 + sCQ) + F^2\hat{V}_{lp} & = \hat{V}_{in}(F^2b + FQa) \\
  \hat{V}_{lp}(s^2C^2 + sCQ + F^2) & = \hat{V}_{in}(F^2b + FQa) \\
  \frac{\hat{V}_{lp}}{\hat{V}_{in}} & = \frac{F^2b + FQa}{s^2C^2 + sCQ + F^2} \\
  & = \frac{b + a\frac{Q}{F}}{s^2{(\frac{C}{F})}^2 + s\frac{C}{F}\frac{Q}{F} + 1} \\
\end{split}
\end{equation*}

\begin{equation}
  H(s) = \frac{b + a\frac{Q}{F}}{\frac{s^2}{{(\frac{F}{C})}^2} + 2\frac{s}{\frac{F}{C}}\frac{Q}{2F} + 1}
\end{equation}

Calculate Band Pass transfer function.

\begin{equation*}
\begin{split}
  \hat{V}_{bp} & = \frac{\hat{V}_{in}(Fb + Qa) - F\hat{V}_{lp}}{sC + Q} \\
  \hat{V}_{bp}(sC + Q) & = \hat{V}_{in}(Fb + Qa) - F\hat{V}_{lp} \\
  \hat{V}_{bp}(sC + Q) & = \hat{V}_{in}(Fb + Qa) - \frac{F^2\hat{V}_{bp}}{sC} \\
  \hat{V}_{bp}(s^2C^2 + sCQ) & = sC\hat{V}_{in}(Fb + Qa) - F^2\hat{V}_{bp} \\
  \hat{V}_{bp}(s^2C^2 + sCQ) + F^2\hat{V}_{bp} & = sC\hat{V}_{in}(Fb + Qa) \\
  \hat{V}_{bp}(s^2C^2 + sCQ + F^2) & = sC\hat{V}_{in}(Fb + Qa) \\
  \frac{\hat{V}_{bp}}{\hat{V}_{in}} & = \frac{sC(Fb + Qa)}{s^2C^2 + sCQ + F^2} \\
  & = \frac{s\frac{C}{F^2}(Fb + Qa)}{s^2\frac{C^2}{F^2} + s\frac{CQ}{F^2} + 1} \\
  & = \frac{s\frac{C}{F}{(b + \frac{Q}{F}a)}}{s^2{(\frac{C}{F})}^2 + s\frac{Q}{F}\frac{C}{F} + 1} \\
\end{split}
\end{equation*}

\begin{equation}
  H(s) = \frac{s\frac{C}{F}{(b + \frac{Q}{F}a)}}{\frac{s^2}{{(\frac{F}{C})}^2} + 2\frac{s}{\frac{F}{C}}\frac{Q}{2F} + 1} \\
\end{equation}

\section{With Q Enhancement}

The Q enhancement is just feeding a specific amount of the BandPass output back into the input.

\subsection{Notations}

\begin{description}
\item[F] is the the frequency control variable
\item[Q] is the the Q control variable
\item[x] is the the Q enhancement feedback gain
\item[a] is the variable gain input scaling factor
\item[b] is the fixed gain input scaling factor
\end{description}

\begin{equation}
  iq = Q(aV_{in} - V_{bp})
\end{equation}

\begin{equation}
  i1 = F(bV_{in} + xV_{bp} - V_{lp})
\end{equation}

\begin{equation}
  i2 = FV_{bp}
\end{equation}

\begin{equation}
  \hat{V}_{bp} = \frac{\hat{I}_1 + \hat{I}_q}{sC}
\end{equation}

\begin{equation}
  \hat{V}_{lp} = \frac{\hat{I}_2}{sC}
\end{equation}

Simplify Vbp into terms of Vlp and Vin.

\begin{equation*}
\begin{split}
  \hat{V}_{bp} & = \frac{\hat{I}_1 + \hat{I}_q}{sC} \\
  sC\hat{V}_{bp} & = \hat{I}_1 + \hat{I}_q \\
  sC\hat{V}_{bp} & = Fb\hat{V}_{in} + Fx\hat{V}_{bp} - F\hat{V}_{lp} + Qa\hat{V}_{in} - Q\hat{V}_{bp} \\
  sC\hat{V}_{bp} + Q\hat{V}_{bp} - Fx\hat{V}_{bp} & = Fb\hat{V}_{in} - F\hat{V}_{lp} + Qa\hat{V}_{in}\\
  \hat{V}_{bp}(sC + Q - Fx) & = \hat{V}_{in}(Fb + Qa) - F\hat{V}_{lp} \\
\end{split}
\end{equation*}

\begin{equation}
  \hat{V}_{bp} = \frac{\hat{V}_{in}(Fb + Qa) - F\hat{V}_{lp}}{sC + Q - Fx}
\end{equation}

Get Vlp in terms of Vin and calculate Low Pass transfer function.

\begin{equation*}
\begin{split}
  \hat{V}_{lp} & = \frac{\hat{I}_2}{sC} \\
  \hat{V}_{lp} & = \frac{F\hat{V}_{bp}}{sC} \\
  sC\hat{V}_{lp} & = F\hat{V}_{bp} \\
  sC\hat{V}_{lp} & = \frac{\hat{V}_{in}(F^2b + FQa) - F^2\hat{V}_{lp}}{sC + Q - Fx} \\
  \hat{V}_{lp}(s^2C^2 + sCQ - sCFx) & = \hat{V}_{in}(F^2b + FQa) - F^2\hat{V}_{lp} \\
  \hat{V}_{lp}(s^2C^2 + sCQ - sCFx) + F^2\hat{V}_{lp} & = \hat{V}_{in}(F^2b + FQa) \\
  \hat{V}_{lp}(s^2C^2 + sCQ -sCFx + F^2) & = \hat{V}_{in}(F^2b + FQa) \\
  \frac{\hat{V}_{lp}}{\hat{V}_{in}} & = \frac{F^2b + FQa}{s^2C^2 + sCQ - sCFx + F^2} \\
  & = \frac{F^2b + FQa}{s^2C^2 + sC(Q - Fx) + F^2} \\
  & = \frac{b + a\frac{Q}{F}}{s^2{(\frac{C}{F})}^2 + s\frac{C}{F}\frac{Q - xF}{F} + 1} \\
\end{split}
\end{equation*}

\begin{equation}
  H(s) = \frac{b + a\frac{Q}{F}}{\frac{s^2}{{(\frac{F}{C})}^2} + 2\frac{s}{\frac{F}{C}}\frac{(\frac{Q}{F} - x)}{2} + 1}
\end{equation}

\end{document}


\documentclass[10pt]{article}
\usepackage{amsfonts}
\usepackage{amssymb, amsmath}
\usepackage{eucal}
\usepackage{amscd}
\usepackage{url}
\usepackage{listings}
\usepackage{algorithmic}
\usepackage{enumerate}
\urlstyle{sf}
\pagestyle{plain}

\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\I}{\mathbb{I}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\Pee}{\mathbb{P}}
\newcommand{\Op}{\mathcal{O}}
\newcommand{\Qbar}{\Opverline{\mathbb{Q}}}
\newcommand{\code}{\lstinline}
\newcommand{\qed}{\square}
\newcommand{\im}{\mbox{im}}
\newcommand{\id}{\mbox{id}}

\newcommand{\ljk}[2]{\left(\frac{#1}{#2}\right)}
\newcommand{\modulo}[1]{\;\left(\mbox{mod}\;#1\right)}
\newcommand{\fr}{\mathfrak}

\def\notdivides{\mathrel{\kern-3pt\not\!\kern4.5pt\bigm|}}
\def\nmid{\notdivides}
\def\nsubseteq{\mathrel{\kern-3pt\not\!\kern2.5pt\subseteq}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}

\newenvironment{proof}[1][Proof]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{example}[1][Example]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{remark}[1][Remark]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

\parindent=0pt
\parskip 4pt plus 2pt minus 2pt

\title{Foundations : numbers}

\author{
William B. Hart
}

\begin{document}

\maketitle

\tableofcontents

\section{Introduction}

Numbers are fundamental to all of mathematics and science. However pure mathematicians don't just care about counting and arithmetic, but about the properties of systems of numbers and how they can be formalised and generalised.

In this set of notes we will look beyond the arithmetic of the counting numbers, fractions and decimals and look at how mathematicians describe the properties of the natural numbers, rationals, real numbers and complex numbers in a rigorous, axiomatic way.

\section{Natural numbers}

The \emph{natural numbers} are the counting numbers starting from $1$. We denote the set of natural numbers
$$\N = \{1, 2, 3, \ldots\}.$$

\subsection{Peano axioms}

It was Guiseppe Peano (1858--1932) who first developed a set of axioms that describe the natural numbers. These axioms are called the Peano axioms.

The Peano axioms formalise the idea that there is a first natural number $1$, that any natural number is followed by precisely one more natural number, and that nothing else is a natural number.

\begin{definition}
Given a natural number $n$, we call the natural number that follows it the \emph{successor} of $n$, denoted $S(n)$.
\end{definition}

\begin{example}
We have that $S(1) = 2$, $S(2) = 3$, $S(3) = 4$, etc. $\qed$
\end{example}

Here is Peano's list of axioms.

\begin{definition} (Peano axioms)
The set of natural numbers $\N$ is a set with a successor function $S$ that obeys the following rules
\begin{itemize}
\item $1 \in \N$
\item If $n \in \N$ then $S(n) \in \N$
\item There is no $n \in \N$ such that $S(n) = 1$
\item If $m, n \in \N$ then $m = n$ iff $S(m) = S(n)$
\item If $T$ is any set for which (i) $1 \in T$, and (ii) $S(n) \in T$ whenever $n \in T$; then $\N \subseteq T$
\end{itemize}
\end{definition}

The fifth Peano axiom is called the axiom of \emph{induction}. It's purpose is to exclude numbers that can't be reached from $1$ by repeated application of the successor function.

For example, consider a set containing the standard natural numbers plus three additional elements $a$, $b$ and $c$ such that $S(a) = b$, $S(b) = c$ and $S(c) = a$. Or it could contain additional nonstandard numbers $\ldots, -2^*, -1^*, 0^*, 1^*, 2^*, \ldots$. Such sets obey the first four Peano axioms, just as the set of standard natural numbers does.

But the axiom of induction says that $\N$ must be a subset of all the other sets, and the only one of these sets contained in all the others is the set of standard natural numbers. Thus we conclude that it alone can be $\N$.

\subsection{Addition of natural numbers}

The two most important operations are addition and multiplication. Addition is defined recursively using the successor function.

\begin{definition}
For $n \in \N$ we define
\begin{itemize}
\item $n + 1 = S(n)$
\item $n + S(m) = S(n + m)$ for all $m \in \N$
\end{itemize}
\end{definition}

Note the second part turns the sum of $n$ and the successor of $m$ into the sum of $n$ and $m$. Each application of the rule makes the required computation smaller.

\begin{example}
We have $1 + 2 = 1 + S(1) = S(1 + 1) = S(S(1)) = S(2) = 3$. $\qed$
\end{example}

The recursive definition allows us to add any natural number $m'$ to $n$. If $m'$ is $1$ the first case applies. Otherwise the following theorem shows that the second case applies.

\begin{theorem}
If $m' \in \N$ and $m' \neq 1$ then $m' = S(m)$ for some $m \in \N$.
\end{theorem}

\begin{proof}
We give a proof by contradiction. Suppose $m' \in \N$ with $m' \neq 1$ but that there is no $m \in \N$ with $m' = S(m)$.

Let $T$ be the set of natural numbers excluding $m'$. We see that $1 \in T$ since $m' \neq 1$. Also if $m \in T$ then $m \in \N$, thus $S(m) \in \N$. However $S(m) \neq m'$ by assumption, thus $S(m) \in T$. Thus $T$ obeys the conditions of the axiom of induction.

But then $\N \subseteq T$, which is a contradiction since $m' \in \N$ but $m' \notin T$.

Thus our assumption was false and the theorem is proved. $\qed$
\end{proof}

\subsection{The principle of mathematical induction}

The axiom of induction is often used to show that a given result holds for all natural numbers $n$. To this end it is given the following form.

\begin{theorem} (Principle of mathematical induction)
Let $P(n)$ be a mathematical proposition which holds for some natural numbers $n$. Suppose that
\begin{itemize}
\item $P(1)$ holds
\item $P(n + 1)$ holds whenever $P(n)$ holds
\end{itemize}
then $P(n)$ holds for all $n \in \N$.
\end{theorem}

\begin{proof}
Let $T$ be the set of all natural numbers $n$ such that $P(n)$ holds.

By assumption, $P(1)$ holds. Thus $1 \in T$. Also by assumption $P(n + 1)$ holds whenever $P(n)$ holds. Thus $n + 1 \in T$ whenever $n \in T$.

The axiom of induction then says that $\N \subseteq T$ as required. $\qed$
\end{proof}

A proof using the principle of mathematical induction to show some proposition $P(n)$ holds for all $n \in \N$ is called a \emph{proof by induction}.

Let us see an example of proof by induction.

\begin{theorem} (Associative Law for Addition)
If $a, b, c \in \N$ then $(a + b) + c = a + (b + c)$.
\end{theorem}

\begin{proof}
Fix $a$ and $b$. Let $P(c)$ be the statement that $(a + b) + c = a + (b + c)$.

We have that $(a + b) + 1 = S(a + b) = a + S(b) = a + (b + 1)$. Thus $P(1)$ holds.

If $P(n)$ holds then $(a + b) + n = a + (b + n)$. Thus by the fourth Peano axiom $S((a + b) + n) = S(a + (b + n))$.

Hence by the definition of addition, $(a + b) + S(n) = a + S(b + n)$. Again by the definition of addition, $(a + b) + (n + 1) = a + (b + S(n))$. Thus $(a + b) + (n + 1) = a + (b + (n + 1))$, i.e. $P(n + 1)$ holds.

Therefore by the principle of mathematical induction $P(n)$ holds for all $n \in \N$. $\qed$
\end{proof}

The associative law says that we don't require parentheses when doing additions of natural numbers.

Here is another simple induction proof.

\begin{theorem}
If $n \in \N$ then $1 + n = n + 1$.
\end{theorem}

\begin{proof}
Let $P(n)$ be the proposition that $1 + n = n + 1$.

$P(1)$ says that $1 + 1 = 1 + 1$, which obviously holds.

If $P(n)$ holds then $n + 1 = 1 + n$. By the fourth Peano axiom $(n + 1) + 1 = (1 + n) + 1$. By the associative law this becomes $(n + 1) + 1 = 1 + (n + 1)$. Thus $P(n + 1)$ holds.

Therefore by induction $P(n)$ holds for all $n \in \N$. $\qed$
\end{proof}

The following important addition laws can also be proved by induction. We leave the proofs as exercises.

\begin{theorem} (Commutative law for addition)
If $m, n \in \N$ then $m + n = n + m$.
\end{theorem}

\begin{theorem} (Additive cancellation law)
If $a + n = b + n$ for $a, b, n \in \N$ then $a = b$. The converse also holds.
\end{theorem}

\subsection{Multiplication of natural numbers}

We define multiplication recursively as we did for addition.

\begin{definition}
For $m, n \in \N$ we define
\begin{itemize}
\item $n\times 1 = n$
\item $n\times S(m) = n\times m + n$
\end{itemize}
\end{definition}

\begin{example}
We have $2\times 2 = 2\times S(1) = 2\times 1 + 2 = 2 + 2 = 4$. $\qed$
\end{example}

A number of identities hold for multiplication. Again their proofs by induction are left as exercises.

\begin{theorem} (Distributive law)
For all $a, b, n \in \N$ we have $(a + b)n = an + bn$.
\end{theorem}

\begin{theorem}
For all $n \in \N$ we have $1\times n = n$.
\end{theorem}

\begin{theorem} (Commutative law of multiplication)
For all $a, b \in \N$ we have that $ab = ba$.
\end{theorem}

\begin{corollary}
For all $a, b, n \in \N$ we have $n(a + b) = na + nb$.
\end{corollary}

\begin{proof}
Follows immediately from the distributive law and the commutative law for multiplication. $\qed$
\end{proof}

\begin{theorem} (Associative law of multiplication)
For all $a, b, n \in \N$ we have $(ab)n = a(bn)$.
\end{theorem}

\subsection{Comparison of natural numbers}

We define what it means for a natural number to be less than another using addition.

\begin{definition}
For $m, n \in \N$ we say that $m$ is \emph{less than} $n$, denoted $m < n$ if there exists $k \in \N$ such that $n = m + k$.
\end{definition}

\begin{example}
We have that $3 < 5$ since $5 = 3 + 2$.
\end{example}

We can defined $\leq$, $>$ and $\geq$ in terms of $<$ and equality.

The less-than relation has many useful properties. We prove some here.

\begin{theorem} (Transitivity)
If $a, b, c \in \N$ with $a < b$ and $b < c$ then $a < c$.
\end{theorem}

\begin{proof}
If $a < b$ then $b = a + x$ for some $x \in \N$. Similarly if $b < c$ then $c = b + y$ for some $y \in \N$.

Thus $c = b + y = a + x + y = a + (x + y)$. Thus $a < c$ by definition. $\qed$
\end{proof}

\begin{theorem}
If $a, b, x \in \N$ and $a < b$ then $a + x < b + x$.
\end{theorem}

\begin{proof}
Fix $a$ and $b$ and prove by induction on $x$.

If $a < b$ then $b = a + y$ for some $y \in \N$. Then $b + 1 = a + y + 1 = (a + 1) + y$. Thus $a + 1 < b + 1$. Thus the result holds for $x = 1$.

Suppose $a < b$ implies $a + x < b + x$ for some $x \in \N$. Then $b + x = a + x + y$ for some $y \in \N$.

Thus $b + (x + 1) = a + x + y + 1 = a + (x + 1) + y$. Thus we have that $a + (x + 1) < b + (x + 1)$. Thus the result holds for $x + 1$.

By induction the result holds for all $x \in \N$. $\qed$
\end{proof}

We can relate $<$ and $\leq$ as follows.

\begin{theorem} (Creeping lemma)
If $a < b$ for $a, b \in \N$ then $a + 1 \leq b$.
\end{theorem}

\begin{proof}
We begin by fixing $b$.

If $a < b$ then $b = a + n$ for some $n \in \N$.

But we previously showed that $1 \leq n$ for all $n \in \N$. We examine two cases: $1 = n$ or $1 < n$.

If $1 = n$ then $a + 1 = b$, so certainly $a + 1 \leq b$.

If $1 < n$ then $n = 1 + x$ for some $x \in \N$ and $b = a + 1 + x$. Thus $a + 1 < b$. So in this case we also have $a + 1 \leq b$.

Thus in either case the result holds. $\qed$
\end{proof}

We can now prove the following fact.

\begin{theorem}
If $a, b \in \N$ then $a < b$, $a = b$ or $a > b$.
\end{theorem}

\begin{proof}
We fix $b$ and prove the result by induction on $a$.

If $a = 1$, then as $1 \leq b$ we have $a \leq b$. Thus either $a = b$ or $a < b$ by definition. So the result holds for $a = 1$.

Suppose the result holds for some $a \in \N$, i.e. either $a < b$, $a = b$ or $a > b$. We examine each case separately.

If $a < b$ then by the creeping lemma $a + 1 \leq b$. Thus either $a + 1 = b$ or $a + 1 < b$.

If $a = b$ then $a + 1 = b + 1$ and $b < a + 1$. Thus $a + 1 > b$ by definition.

If $a > b$ then $a = b + x$ for some $x \in \N$ and so $a + 1 = b + 1 + x$. Thus $b < a + 1$ and so $a + 1 > b$.

Thus in all cases the result is true for $a + 1$. By induction it is true for all $a \in \N$. $\qed$
\end{proof}

A stronger version of the last theorem is the following.

\begin{theorem} (Strong trichotomy)
For all $a, b \in \N$ precisely one of $a < b$, $a = b$ or $a > b$ holds.
\end{theorem}

\begin{proof}
Suppose $a < b$ and $a = b$. Then $a > a$. Therefore $a = a + x$ for some $x \in \N$. But then $a + 1 = a + x + 1$. By the additive cancellation law we have that $1 = x + 1$. This is impossible since $1$ is not the successor of any number. Thus we cannot have both $a < b$ and $a = b$.

A similar argument shows that we cannot have both $a > b$ and $a = b$.

Finally suppose that $a < b$ and $a > b$. Then $b < a$ and by transitivity we have $a < a$. But we've already shown this to be impossible. Thus we cannot have both $a < b$ and $a > b$.

By the previous theorem at least one of the cases holds. But we've just showed that no two hold. Thus precisely one holds.$\qed$
\end{proof}

We prove a very useful result involving multiplication.

\begin{theorem}
If $a < b$ for $a, b \in \N$ then $na < nb$ for all $n \in \N$.
\end{theorem}

\begin{proof}
If $a < b$ then $b = a + x$ for some $x \in \N$. Thus $nb = n(a + x) = na + nx$ by the distributive law. Thus $na < nb$ by definition. $\qed$
\end{proof}

\begin{corollary} (Cancellation law for multiplication)
If $na = nb$ for $a, b, n \in \N$ then $a = b$.
\end{corollary}

\begin{proof}
If $a < b$ then $na < nb$. Similarly if $a > b$ then $b < a$ and $nb < na$, i.e $na > nb$.

Thus by strong trichotomy if $na = nb$ we must have $a = b$. $\qed$
\end{proof}

\subsection{Strong induction}

Induction is not always the easiest way to prove something holds for all $n \in \N$. The following stronger form is sometimes more useful.

\begin{theorem} (Strong induction)
Let $P(n)$ be a proposition which holds for some natural numbers $n$. If
\begin{itemize}
\item $P(1)$ holds
\item $P(k + 1)$ holds whenever $P(1), P(2), ..., P(k)$ all hold
\end{itemize}
then $P(n)$ holds for all $n \in \N$.
\end{theorem}

\begin{proof}
We will prove the result using standard induction.

Let $P'(n)$ be the proposition that $P(1), P(2), \ldots, P(n)$ all hold. We will prove by induction that if the conditions of the theorem hold then $P'(n)$ holds for all $n \in \N$.

But $P(n)$ holds if $P'(n)$ holds and so we will have shown that if the conditions of the theorem hold then $P(n)$ holds for all $n \in \N$.

The first condition of the theorem implies $P'(1)$ holds.

If $P'(n)$ holds then $P(1), P(2), \ldots, P(n)$ all hold. But then the second condition of the theorem says that $P(n + 1)$ holds, i.e. $P(1), P(2), \ldots, P(n + 1)$ all hold. Thus $P'(n + 1)$ holds.

Thus by standard induction, $P'(n)$ holds for all $n \in \N$. $\qed$
\end{proof}

\subsection{The well-ordering principle}

We will use strong induction to prove that every non-empty set $S$ of natural numbers has a \emph{least element}, i.e. an element $m$ such that $m \leq x$ for all $x \in S$.

\begin{theorem} (Well-ordering principle)
A non-empty set $S$ of natural numbers has a least element.
\end{theorem}

\begin{proof}
For $n \in \N$ let $P(n)$ be the proposition that the theorem is true if $n \in S$.

If $1 \in S$ then since $1 \leq n$ for all $n \in \N$ then $1 \leq n$ for all $n \in S$. In this case, $1$ is a least element of $S$. Thus $P(1)$ holds.

Suppose $P(k)$ holds for all $k < n + 1$. We will show that $P(n + 1)$ holds.

To this end, suppose that $S$ is a non-empty set of natural numbers containing $n + 1$.

If $n + 1$ is a least element of $S$ then we are done. Otherwise $n + 1$ is not a least element of $S$ and there must be some $m \in S$ with $m < n + 1$.

But as $m < n + 1$ and $m \in S$ we have by assumption that $S$ has a leat element. Thus we have shown that $P(n + 1)$ holds.

By strong induction, $P(n)$ holds for all $n \in \N$.

If $S$ is a non-empty set then it contains some $n \in \N$. But as $P(n)$ holds we have that $S$ contains a least element, proving the theorem. $\qed$
\end{proof}

The condition that the set be non-empty is essential, since an empty set contains no elements, and so certainly no least element.

\section{Integers}

We can define subtraction of natural numbers as follows.

\begin{definition}
We define $a - b = x$ for $a, b, x \in \N$ if $a + x = b$.
\end{definition}

But notice it is only defined when a suitable $x \in \N$ exists. The following characterises when this is the case.

\begin{theorem}
The difference $a - b$ is defined for $a, b \in \N$ iff $a > b$.
\end{theorem}

\begin{proof}
We have by definition that $a > b$ iff $a = b + x$ for some $x \in \N$. But this is precisely when $a - b$ is defined. $\qed$
\end{proof}

\begin{example}
We have that $5 - 3 = 2$ since $3 + 2 = 5$. $\qed$
\end{example}

As for addition and multiplication, we can prove many arithmetic identities involving subtraction of natural numbers. But a more interesting question is how we should define $a - b$ in the case that $a \leq b$.

This leads us to the concept of zero and negative numbers, which together with the natural numbers give the integers,
$$\Z = \{\ldots, -2, -1, 0, 1, 2, \ldots\}.$$

We'd like to capture the notion that an integer is the difference of a pair of natural numbers $(a, b)$. The natural numbers themselves correspond to pairs $(a, b)$ with $a > b$.

We observe that if $n \in \N$ and $a - b = n$ and $c - d = n$ then $a - b = c - d$ so that $a + d = b + c$. This leads us to the following definition.

\begin{definition}
An \emph{integer} is represented by a pair of natural numbers $(a, b)$ where two such representations $(a, b)$ and $(c, d)$ correspond to the same integer if $a + d = b + c$. In this case we write $(a, b) \sim (c, d)$.
\end{definition}

\begin{example}
The two pairs $(4, 5)$ and $(6, 7)$ represent the same integer (which we usually denote $-1$) since $4 + 7 = 5 + 6$.
\end{example}

However, our definition wouldn't make sense if for example $(a, b)$ represented the same integer as $(c, d)$ but the converse didn't hold. We need to check three things.

\begin{theorem}
Let $a, b, c, d, f, g \in \N$ then
\begin{itemize}
\item $(a, b) \sim (a, b)$
\item If $(a, b) \sim (c, d)$ then $(c, d) \sim (a, b)$
\item If $(a, b) \sim (c, d)$ and $(c, d) \sim (f, g)$ then $(a, b) \sim (f, g)$.
\end{itemize}
\end{theorem}

\begin{proof}
These follow easily from the definition. For example, if $(a, b) \sim (c, d)$ then $a + d = b + c$. Thus $c + b = d + a$ and so $(c, d) \sim (a, b)$, thus proving the second part of the theorem. We leave the other cases as exercises. $\qed$
\end{proof}

Of course we usually don't make use of the ordered pair notation for integers.

\begin{definition}
If $a > b$ for $a, b \in \N$ and $a - b = n$ then we denote the integer represented by $(b, a)$ by $-n$. For any $a \in \N$ we denote the integer represented by $(a, a)$ by $0$.
\end{definition}

In order to prove the elementary properties of the integers, however, we must stick with the ordered pair representation.

\subsection{Addition and multiplication of the integers}

Now we would like to define addition and multiplication of integers.

\begin{definition}
We define $(a, b) + (c, d) = (a + c, b + d)$ and $(a, b)\cdot (c, d) = (ac + bd, ad + bc)$.
\end{definition}

In order to show that these definitions make sense, we must show that replacing a pair in the definition with another pair representing the same integer doesn't change the result.

\begin{theorem}
The sum of integers is well-defined.
\end{theorem}

\begin{proof}
Suppose that $(a', b') \sim (a, b)$ and $(c, d) \sim (c', d')$. Then $a' + b = b' + a$ and $c + d' = d + c'$.

Thus $a' = b' + a - b$ and $d' = c' + d - c$.

Now $(a', b') + (c', d') = (a' + c', b' + d') = (b' + c' + a - b, b' + c' + d - c)$ after making the substitutions for $a'$ and $d'$.

But this is equivalent to $(b' + c' + a + c, b' + c' + d + b)$ as can be seen by adding $b + c$ to each side of the pair. And this is equivalent to $(a + c, d + b)$.

Thus $(a', b') + (c', d') \sim (a + c, d + b) = (a, b) + (c, d)$. $\qed$
\end{proof}

\begin{theorem}
The product of integers is well-defined.
\end{theorem}

\begin{proof}
Suppose that $(a', b') \sim (a, b)$ and $(c, d) \sim (c', d')$. Then $a' + b = b' + a$ and $c + d' = d + c'$.

Now $(a', b')\cdot (c', d') = (a'c' + b'd', a'd' + b'c')$.

This is equivalent to $(a'c' + b'd' + a'c + b'c, a'd' + b'c' + a'c + b'c)$.

Now substituting the expression for $d' + c$ on both sides we obtain $(a'c' + a'c + b'd + b'c', a'c' + a'd + b'c' + b'c)$ which is equivalent to $(a'c + b'd, a'd + b'c)$ and thus to $(a'c + b'd + ad + bc, a'd + b'c + ad + bc)$.

Now substituting the expressions for $a' + b$ and $a + b'$ on the left side of this, we obtain $(ac + b'c + a'd + bd, a'd + b'c + ad + bc)$ which is equivalent to $(ac + bd, ad + bd) = (a, b)\cdot (c, d)$.

Thus $(a', b')\cdot (c', d') \sim (a, b)\cdot (c, d)$.
$\qed$
\end{proof}

We must also show that this definition of sum and product agrees with the definition of the sum and product of natural numbers.

\begin{theorem}
If $m$ and $n$ are natural numbers then $m + n$ agrees with their sum as integers.
\end{theorem}

\begin{proof}
As integers, $m, n \in \N$ are represented as $(m + 1, 1)$ and $(n + 1, 1)$. Their sum is then $(m + n + 2, 2) \sim (m + n + 1, 1)$.

But this is a representative of the class of $m + n$ as an integer. $\qed$
\end{proof}

The same holds multiplication of natural numbers. The proof is an exercise.

\begin{theorem}
The product of natural numbers $m$ and $n$ agrees with their product as integers.
\end{theorem}

Finally, we can prove that many of the identities that held for natural numbers also hold for integers. Again we leave the proofs as exercises.

\begin{theorem}
For $a, b, c \in \Z$ we have
\begin{itemize}
\item (Associative law for addition) $a + (b + c) = (a + b) + c$
\item (Commutative law for addition) $a + b = b + a$
\item (Associative law for multiplication) $a(bc) = (ab)c$
\item (Commutative law for multiplication) $ab = ba$
\item (Distributive law) $a(b + c) = ab + ac$
\item (Additive cancellation) $a + c = b + c$ iff $a = b$
\item (Multiplicative cancellation) If $ac = bc$ and $c \neq 0$ then $a = b$ and conversely
\end{itemize}
\end{theorem}

There are also a number of new identities which hold for the integers.

\begin{theorem}
For $a, b \in \Z$ we have
\begin{itemize}
\item (Additive identity) $a + 0 = a = 0 + a$
\item (Multiplicative identity) $1.a = a = a.1$
\item $(-a)\times b = -(ab) = a\times (-b)$
\item $(-a)\times (-b) = ab$
\item $0.a = 0 = a.0$
\end{itemize}
\end{theorem}

\subsection{Ordering the integers}

We can also define the less-than relation for the integers.

\begin{definition}
For $a, b \in \Z$ we write $a < b$ if there exists $n \in \N$ such that $a + n = b$.
\end{definition}

Notice that $n$ is a natural number in the definition, not an integer.

We easily show that the relation is well-defined and $>$, $\leq$ and $\geq$ are defined in terms of $<$ as usual and that strong trichotomy holds for integers.

\begin{definition}
We say that $a \in \Z$ is \emph{positive} if $a > 0$, \emph{negative} if $a < 0$ and \emph{zero} otherwise.
\end{definition}

We can show numerous useful theorems involving the less-than relation.

\begin{theorem}
Let $x, y, z \in \Z$. We have $x < y$ iff $x + z < y + z$.
\end{theorem}

\begin{theorem}
Let $x, y, z \in \Z$ with $x < y$. If $z > 0$ then $xz < yz$ and if $z < 0$ then $xz > yz$.
\end{theorem}

All of these results can be proved using the ordered pair notation.

\section{Rational numbers}

As for subtraction, division is defined conditionally for natural numbers.

\begin{definition}
We define $a/b = x$ for $a, b, x \in \N$ if $a = bx$.
\end{definition}

We can extend this definition to the integers.

\begin{definition}
We define $a/b = x$ for $a, b, x \in \Z$ with $b \neq 0$ if $a = bx$.
\end{definition}

We have to exclude the case $b = 0$ from the definition because $0 = 0x$ for all $x \in \Z$, so the result of division by $0$ would not be well-defined.

As for addition, multiplication and subtraction, we can prove many identities involving division for either the natural numbers or the integers. But it is natural to ask how we should define $a/b$ for $b \neq 0$ when there is no integer $x$ such that $a = bx$.

This leads to fractions, or what mathematicians call \emph{rational} numbers. The set of rational numbers will be denoted $\Q$. The construction is similar to that of the integers.

\begin{definition}
A \emph{rational} number is represented by a pair of integers $(a, b)$ with $b \neq 0$. We often denote such a pair by $a/b$. We call such pairs \emph{fractions}.
\end{definition}

\begin{definition}
Two fractions $a/b$ and $c/d$ are defined to represent the same rational number if $ad = bc$.
\end{definition}

We can easily show that this definition is well-defined.

\begin{definition}
We identify each $x \in \Z$ with the fractions $a/b$ with $b \neq 0$ for which $a = bx$. Thus $\Z \subseteq \Q$.
\end{definition}

The definitions of addition and multiplication of rationals are as follows.

\begin{definition}
For $a, b, c, d \in \Z$ with $b, d \neq 0$ we define $a/b + c/d = (ad + bc)/(bd)$.
\end{definition}

\begin{definition}
For $a, b, c, d \in \Z$ with $b, d \neq 0$ we define $(a/b)\times (c/d) = (ac)/(bd)$.
\end{definition}

We easily check that these definitions are well-defined and that they agree with the usual addition of integers.

It's easy to see that the following result holds.

\begin{theorem}
If $a, b \in \Z$ with $b \neq 0$ then $a/b = (-a)/(-b)$.
\end{theorem}

This means that every rational number is represented by a fraction $a/b$ where $b > 0$. From now on we will assume all rationals are represented in this way.

We can now define the less-than operator conveniently for rationals.

\begin{definition}
If $a, c \in \Z$ and $b, d \in \N$ then we define $a/b < c/d$ if $ad < bc$.
\end{definition}

It is easy to check that the less-than operator is well-defined.

Once we have all these definitions, we can prove that all of the identities and theorems that held for the integers also hold for the rationals.

In addition to this, we can define division of any two rational numbers except for division by zero.

\begin{definition}
If $a, c \in \Z$ and $b, d \in \N$ with $c \neq 0$ we define $(a/b)/(c/d) = (a/b)(d/c)$.
\end{definition}

It is easy to check that the following theorem holds.

\begin{theorem}
If $s, t, x \in \Q$ with $s/t = x$ then $s = tx$.
\end{theorem}

\section{Real numbers}

\begin{definition}
We say that two numbers $x$ and $y$ are \emph{commensurable} if there exist $m, n \in \N$ such that $mx = ny$.
\end{definition}

\begin{theorem}
If $x = a/b$ and $y = c/d$ are rational numbers then $x$ and $y$ are commensurable.
\end{theorem}

\begin{proof}
Simply take $m = d$ and $n = b$ in the definition of commensurable. $\qed$
\end{proof}

It was the ancient Greeks that first realised that it was possible to conceive of quantities that were not commensurable.

They considered the hypotenuse of a right angled triangle with sides of length $1$. By Pythagoras' theorem if $x$ is the length of the hypotenuse then $x^2 = 1^2 + 1^2 = 2$. In our modern notation we write $x = \sqrt{2}$.

The Greeks showed that the side and hypotenuse of the triangle were not commensurable, i.e. that $1$ and $\sqrt{2}$ were not commensurable.

If they were commensurable then by definition $m.1 = n.\sqrt{2}$ for some $m, n \in \N$. Squaring both sides we would have $m^2 = 2n^2$.

But the Greeks showed the following.

\begin{theorem}
There are no natural numbers $m$ and $n$ such that $m = 2n$.
\end{theorem}

\begin{proof}
If $m$ and $n$ are both even, say $m = 2m'$ and $n = 2n'$ then we would have $4m'^2 = 8n'^2$. Dividing through by $4$ we'd have $m'^2 = 2n'^2$, where $n' < n$.

If $m'$ and $n'$ are both even then we can apply the same argument again to obtain even smaller values.

By the well-ordering principle this process must stop, and so there must be natural numbers $m$ and $n$ with $n$ odd such that $m^2 = 2n^2$.

But as the right hand side is even, the left hand side must be also. Thus $m$ is even, i.e. $m = 2m'$ say. But then $4m'^2 = 2n^2$.

Dividing by $2$ we have $2m'^2 = n^2$. By a similar argument to the above, $n$ is now even. But this is a contradiction since $n$ is odd. Thus there do not exist $m, n \in \N$ such that $m = 2n^2$. $\qed$
\end{proof}

\subsection{Dedekind cuts}

The notion of incommensurability shows that there ought to be numbers between rational numbers that are not themselves rational. Such numbers, along with the rationals will be called \emph{real} numbers.

There are a number of ways of defining the real numbers. We will look at a definition due to Richard Dedekind (1831--1916) known as Dedekind cuts.

The basic intuition is that a real number $\alpha$ is a cut of the rational numbers into two subsets, namely all the rational numbers that are less than $\alpha$ and all the rational numbers that are greater than or equal to $\alpha$.

Here is the formal definition.

\begin{definition} (Dedekind cut)
A subset $R$ of the rational numbers is said to be \emph{closed downwards} if for each $s \in R$ all rational numbers $r$ with $r < s$ are also in $R$. A \emph{Dedekind cut} is a subset $R$ of the rational numbers that is closed downwards and which has no greatest element.
\end{definition}

\begin{example}
Consider the set $R$ of all rational numbers less than the square root of $2$. What we mean by this is the set of all rational numbers $m/n$ such that $m^2 < 2n^2$.

If $m/n \in R$ then $m^2 < 2n^2$. Now suppose that $k/l$ is another rational number with $k/l < m/n$. Then $kn < lm$.

Multiplying $m^2 < 2n^2$ through by $l^2$ we have $l^2m^2 < 2l^2n^2$. But as $kn < lm$ we have $k^2n^2 < l^2m^2$ and so by transitivity we have $k^2n^2 < 2l^2n^2$.

Dividing through by $n^2$ we have $k^2 < 2l^2$. In other words $k/l \in R$.

Suppose contrary to the theorem that $R$ has a greatest element $m/n$.

However we find with some algebra that if $k = 8m^3n + 16mn^3$ and $l = m^4 + 12m^2n^2 + 4n^4$ then $2l^2 - m^2 = (2n^2 - m^2)^4 > 0$. This allows us to show that $k/l < \sqrt{2}$.

Similarly $kn - lm = m(m^2 - 2n^2)(m^2 + 6n^2) > 0$. Thus $m/n < k/l$.

Thus $k/l \in R$ and $m/n$ is not the greatest element of $R$ and so $R$ is a Dedekind cut. $\qed$
\end{example}

Note that the definition of a Dedekind cut doesn't refer to a real number, but only to subsets of the rational numbers. Thus we can think of a real number as being represented by a Dedekind cut. In the example above, $\sqrt{2}$ is represented by the Dedekind cut $R = \{m/n \in \Q \;|\; m < 2n^2\}$.

Of course whilst square roots of positive integers correspond to Dedekind cuts, there are many other Dedekind cuts. We think of any Dedekind cut as corresponding to a real number. We also define two Dedekind cuts to be equal precisely if they are the same as subsets of the rational numbers.

We can define addition, multiplication and the less-than relation for any two Dedekind cuts as follows.

\begin{definition}
If $A$ and $B$ are Dedekind cuts then we define $A + B = \{a + b \;|\; a \in A, b \in B\}$.
\end{definition}

\begin{definition}
If $A$ and $B$ are Dedekind cuts then we define $B < A$ if there is a Dedekind cut $X$ such that $A = B + X$.
\end{definition}

\begin{definition}
We define the set of \emph{real} numbers to be the set of Dedekind cuts. The rational number $m/n$ can be identified with the Dedekind cut $R_{m/n} = \{r/s \;|\; r/s < m/n\}$ so that $\Q \subseteq \R$.
\end{definition}

We sometimes think of real numbers as decimal numbers with possibly infinitely many digits beyond the decimal point.

\begin{definition}
If $A$ is a Dedekind cut, we define $-A$ to be the Dedekind cut $\{a \in \Q \;|\; a < -p \;\;\mbox{for some}\;\; p \notin A\}$.
\end{definition}

The definition of $-A$ is quite convoluted. We'd have liked to define $-A$ as the set of all rationals in $R = \{-a \;|\; a \in A\}$. But this is closed upwards not closed downwards.

We can't even define it as $R'$ the set of rationals \emph{not} in $R$ since $R'$ has a greatest element.

The definition above avoids this complication by only including the rational numbers that are less than an element of $R'$. This avoids the greatest element of $R'$.

\begin{definition}
If $A$ and $B$ are Dedekind cuts, we define $A\times B$ to be $0$ if either $A = 0$ or $B = 0$. If $A > 0$ we define $AB = \{ab \;|\; a \in A \;\;\mbox{and}\;\; a > 0, b \in B\}$ and if $B > 0$ we define $AB = \{ab \;|\; a \in A, b \in B \;\;\mbox{and}\;\; b > 0\}$. If both $A < 0$ and $B < 0$ we define $AB = (-A)\times (-B)$.
\end{definition}

After quite some work we can prove that this definition is well-defined and that all the identities that hold for the rational numbers also hold for the real numbers.

\subsection{Reciprocals}

A most important property of the real numbers is the following.

\begin{theorem}
If $r \in R$ with $r \neq 0$ then there exists a unique $r' \in \R$ such that $rr' = 1$.
\end{theorem}

\begin{definition}
We call $r'$ of the previous theorem the \emph{reciprocal} of $r$ and denote it $r^{-1}$ or $1/r$.
\end{definition}

Like the rationals, this allows us to define division of any two real numbers except for division by zero.

\begin{definition}
If $a, b \in \R$ with $b \neq 0$ we define $a/b = a\times b^{-1}$.
\end{definition}

To prove the theorem above, the following is the definition that works.

\begin{definition}
If $R$ is a nonzero Dedekind cut then we define the \emph{reciprocal} of $R$, denoted $R^{-1}$ to be the Dedekind cut
$$R^{-1} = \begin{cases}\{a \in \Q \;|\; a < 1/p \;\;\mbox{for some}\;\; p \in Q, p \notin R\}, & \;\;\mbox{if}\;\; R > 0\\\{a \in \Q \;\; a < 1/p \;\;\mbox{for some}\;\; p \in Q, p \notin R \;\;\mbox{with}\;\; p < 0\}, & \;\;\mbox{if}\;\; R < 0\end{cases}$$
\end{definition}

\subsection{Suprema}

\begin{definition}
Given a subset $S$ of the real numbers, we say that $S$ has an \emph{upper bound} in $\R$ if there is a real number $\alpha$ such that $x < \alpha$ for all $x \in S$.
\end{definition}

\begin{definition}
A \emph{supremum} of a set $S \subseteq \R$ is a least upper bound of $S$, i.e. an upper bound $s$ for $S$ such that every other upper bound of is greater than $s$.
\end{definition}

Perhaps the most important property of the real numbers which the rational numbers do not have is the following.

\begin{theorem} (Supremum property)
If a non-empty subset $S$ of the real numbers has an upper bound in $\R$ then it has a supremum in $\R$.
\end{theorem}

\begin{proof}
We will show that $T = \bigcup_{A \in S} A$, i.e. the union of the Dedekind cuts representing the real numbers in $S$, is the supremum of $S$.

Let $B$ be the Dedekind cut representing an upper bound for $S$.

We must show that $T$ is a Dedekind cut.

Suppose $p \in T$. Then $p \in A_0$ for some $A_0 \in S$. Then if $q < p$ then $q \in A_0$ and so $q \in T$. Thus $T$ is closed below.

Since $A_0$ has no greatest element, there is an $r \in A_0$ with $r > p$. But $r \in A_0$ and so $r \in T$. Therefore $p$ is not a greatest element of $T$. As $p \in T$ was arbitrary, this shows that $T$ has no greatest element.

Since $T$ is non-empty, there is at least one $A \in S$. As $A$ is non-empty, it contains at least one element $p$, and $p \in T$. Thus $T$ is non-empty.

Finally, since $B$ is an upper bound for $S$, and $B$ is a Dedekind cut, there exists a $q \in \Q$ with $b < q$ for all $b \in B$. Furthermore, since $B$ is an upper bound for $S$, $A < B$ for all $A \in S$. Thus $A \subseteq B$ for all $A \in S$. Thus $p < q$ for all $p \in A$ since $p \in B$.

But this shows that $p < q$ for all $p \in T$. Thus $q \notin T$, and so $T$ is a proper subset of $\Q$.

Thus $T$ is a Dedekind cut.

Now $A \subseteq T$ for all $A \in S$. Thus $A \leq T$ for all $T \in S$ and so $T$ is an upper bound for $S$.

Now if $A < T$ for some Dedekind cut $A$ then there exists a $p \in \Q$ such that $p \in T$ but $p \notin A$. But $p \in A_0$ for some $A_0 \in S$. Thus $A$ is not greater than $A_0$ and therefore $A$ is not an upper bound for $S$.

Therefore $T$ is the least upper bound for $S$. $\qed$
\end{proof}

Intuitively the supremum property says that there are no holes in the real number line. If we applied the Dedekind cut construcion to the real numbers instead of the rationals, we wouldn't get any new numbers. The supremum of any Dedekind cut of real numbers would just be another real number.

\section{Complex numbers}

Linear equations of the form $ax + b = 0$ for $a, b \in \R$ with $a \neq 0$ can be solved straightforwardly in the reals. The given equation clearly has solution $x = -b/a$.

Quadratic equations are already more involved.

If we have a quadratic equation $a'x^2 + b'x + c' = 0$ with $a, b, c \in \R$ and $a \neq 0$ we can divide through by $a'$ and obtain an equation of the form $x^2 + bx + c = 0$.

Let us write $p = b/2$ so that the equation becomes $x^2 + 2px + c = 0$. We can rewrite this as $(x + p)^2 = p^2 - c$.

Clearly if $c < p^2$ the right hand side is positive and the equation has two real solutions $x = -p \pm \sqrt{p^2 - c}$.

But things are more interesting if $c \geq p^2$. This corresponds to the case where $c = p^2 + q^2$ for some $q \in \R$. In other words, we are solving the equation $x^2 + 2px + p^2 + q^2 = 0$.

If $q = 0$ this has just one real solution and if $q \neq 0$ it has no real solutions.

We observe that changing the sign of $q$ doesn't change the equation.

Informally complex numbers are solutions of such equations.

\begin{definition}
We represent the two complex number solutions of the equation $x^2 + 2px + p^2 + q^2 = 0$, by the pairs $(p, q)$ and $(p, -q)$. Two such pairs $(a, b)$ and $(c, d)$ are declared to represent the same complex number precisely when $a = c$ and $b = d$. The set of complex numbers is denoted $\C$.
\end{definition}

\begin{definition}
We identify a real number $p$ with the pair $(p, 0)$. Thus $\R \subseteq \C$.
\end{definition}

We see that $(0, 1)$ is a root of the equation $x^2 + 1 = 0$. The complex number represented by $(0, 1)$ is often denoted $i$. By definition $i^2 = -1$.

We can define addition and multiplication of complex numbers.

\begin{definition}
If $A = (a, b)$ and $B = (c, d)$ with $a, b, c, d \in \R$, we define $A + B = (a + c, b + d)$.
\end{definition}

\begin{definition}
If $A = (a, b)$ and $B = (c, d)$ with $a, b, c, d \in \R$, we define $AB = (ac - bd, ad + bc)$.
\end{definition}

Note that in the special case where $A = (a, 0)$ is a real number we have $AB = (ac, ad)$. Because of this, for all $a, b \in \R$ we have $(a, b) = a(1, 0) + b(0, 1) = a + bi$.

After quite a lot of work we can verify that the complex numbers obey all the same identities as the real numbers involving addition and multiplication.

However, there is no way to define a less-than operator for arbitrary complex numbers. Unlike the reals, the complex numbers are not ordered.

\subsection{Complex conjugates}

\begin{definition}
Given a complex number $\alpha = a + bi$ the \emph{complex conjugate} of $\alpha$ is the complex number $a - bi$. We denote it $\bar{\alpha}$.
\end{definition}

The following result is obvious from the definition.

\begin{theorem}
A complex number $\alpha$ is equal to its complex conjugate iff $\alpha \in \R$.
\end{theorem}

The complex conjugate allows us to define the reciprocal of a nonzero complex number. This depends on the following theorem.

\begin{theorem}
If $\alpha = a + bi$ for $a, b \in \R$ is a complex number, then $\alpha\bar{\alpha}$ is a non-negative real number. It is zero iff $a = b = 0$.
\end{theorem}

\begin{proof}
By definition $\alpha\bar{\alpha} = (a + bi)(a - bi) = a^2 - b^2i^2$. However $i^2 = -1$, so the product is $a^2 + b^2$ which is real.

As it is the sum of two squares it is non-negative. It is zero iff $a = b = 0$. $\qed$
\end{proof}

We are now able to prove the following.

\begin{theorem}
Let $\alpha = a + bi$ be a nonzero complex number. Define $\alpha' = (a/r) - (b/r)i$ where $r$ is the real number $\alpha\bar{\alpha}$. Then $\alpha\alpha' = 1$.
\end{theorem}

\begin{proof}
Clearly $\alpha' = (1/r)\bar{\alpha}$. The result follows by simplifying the expression $\alpha\alpha'$. $\qed$
\end{proof}

\begin{definition}
We denote the reciprocal of a nonzero complex number $\alpha$ by $\alpha^{-1}$ or $1/\alpha$.
\end{definition}

Because we can define the reciprocal of any nonzero complex number, we can divide any two complex numbers except for division by zero.

\begin{definition}
For complex numbers $\alpha$ and $\beta$ with $\beta \neq 0$ we define $\alpha/\beta = \alpha\times \beta^{-1}$.
\end{definition}

It is easy to check that if $\alpha/\beta = \gamma$ for $\alpha, \beta, \gamma \in \C$ then $\alpha = \beta\gamma$.

\subsection{Roots of polynomials}

Complex numbers don't just provide solutions to quadratic polynomial equations. A very famous theorem is the following.

\begin{theorem} (Fundamental theorem of algebra)
If $f(x) = x^n + a_{n-1}x^{n-1} + \ldots a_1x + a_0$ for $a_i \in \R$ then $f(x)$ can be written $(x - \alpha_1)(x - \alpha_2)\ldots(x - \alpha_n)$ for some $\alpha_i \in \C$. Moreover the $\alpha_i$ are either real or come in complex conjugate pairs.
\end{theorem}

We see that the complex values $\alpha_i$ of the theorem satisfy the polynomial equation $f(x) = 0$. We call the $\alpha_i$ the complex \emph{roots} of $f(x)$.

A proof of this theorem is not easy and makes use of results from analysis. It was first proved by Carl Friedrich Gauss (1777--1855).

\end{document}


% Created 2021-06-29 Tue 10:19
% Intended LaTeX compiler: pdflatex
\documentclass[presentation,aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{khpreamble}
\DeclareMathOperator{\atantwo}{atan2}
\usetheme{default}
\author{Kjartan Halvorsen}
\date{2021-06-29}
\title{Frequency response}
\hypersetup{
 pdfauthor={Kjartan Halvorsen},
 pdftitle={Frequency response},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.4.6)},
 pdflang={English}}
\begin{document}

\maketitle

\section{Bode diagram}
\label{sec:org11cd25a}

\begin{frame}[label={sec:org73f82b9}]{Response of LTI systems to sinusoids}
\begin{center}
  \begin{tikzpicture}[scale = 0.8, node distance=20mm, block/.style={rectangle, draw, minimum width=15mm}, sumnode/.style={circle, draw, inner sep=2pt}]

  \node[coordinate] (refinput) {};
  \node[block, right of=refinput] (motor) {$G(s)$};
  \node[coordinate, right of=motor, node distance=20mm] (output) {};

  \draw[->] (refinput) -- node[above, pos=0.3] (voltsignal) {$u$} (motor);
  \draw[->] (motor) -- node[above, pos=0.5] (velsignal) {$y$} (output);
  \end{tikzpicture}
\end{center}

Let \(u(t) = \sin\omega_1 t\). Then, after transients have died out,
\[ y(t) = |G(i\omega_1)| \sin \big( \omega_1 t + \arg G(i\omega_1)\big). \]
\end{frame}

\begin{frame}[label={sec:orgbe017dd}]{The Bode diagram}
\[ y(t) = \underbrace{|G(i\omega_1)|}_{\text{amplification}} \sin \big( \omega_1 t + \underbrace{\arg G(i\omega_1)}_{\text{phase shift}} \big) \]

The Bode diagram shows the magnitude and phase of the transfer function evaluated on the positive imaginary axis. It thus contains all information about the steady-state response of the system to input signals of different frequency.
\end{frame}

\begin{frame}[label={sec:orgb9e4790}]{Specifications on the frequency properties of the closed-loop system}
\begin{center}
\includegraphics[width=0.899\linewidth]{../../figures/spec-bode-closed-loop-new}
\end{center}
\end{frame}

\begin{frame}[label={sec:orgdf7a519}]{Exercise: Reading the Bode diagram}
\begin{center}
\includegraphics[width=\linewidth]{../../figures/alias-example-bode-GC}
\end{center}
which of the below frequency responses \alert{is not} compatible with the Bode diagram?

\begin{center}
\includegraphics[width=\linewidth]{../../figures/alias-example-bode-timeseries}
\end{center}
\end{frame}

\begin{frame}[label={sec:org56bfd92}]{From loop gain to closed-loop gain}
 \begin{center}
 \begin{tikzpicture}
\tikzset{node distance=2cm,
    block/.style={rectangle, draw, minimum height=12mm, minimum width=14mm},
    sumnode/.style={circle, draw, inner sep=2pt}
}

  \node[coordinate] (input) {};
  \node[sumnode, right of=input, node distance=20mm] (sum) {\tiny $\sum$};
  \node[block,right of=sum, node distance=30mm] (fb) {$F(s)$};
  \node[block,right of=fb, node distance=30mm] (plant) {$G(s)$};
  \node[coordinate, right of=plant, node distance=30mm] (output) {};
  \node[coordinate, right of=plant, node distance=22mm] (measure) {};
  \draw[->] (input) -- node[above, pos=0.2] {$y_{ref}(t)$} (sum);
  \draw[->] (sum) -- node[above] {$e(t)$} (fb);
  \draw[->] (fb) -- node[above] {$u(t)$} (plant);
  \draw[->] (plant) -- node[at end, above] {$y(t)$} (output);
  \draw[->] (measure) -- ++(0, -18mm) -| (sum) node[left, pos=0.96] {$-$};
  \draw[red] (3.8, -1) rectangle (9.4, 1.7);
  \node[red] at (8, 1.4) {$G_o(s)$};
  \end{tikzpicture}
\end{center}

\[ G_c(i\omega) = \frac{G(i\omega)F(i\omega)}{1 + G(i\omega)F(i\omega)} = \frac{G_o(i\omega)}{1 + G_o(i\omega)} \]
\[ |G_c(i\omega)| = \frac{|G_o(i\omega)|}{|1 + G_o(i\omega)|} = \frac{|G_o(i\omega)|}{|G_o(i\omega) - (-1)|} \]

\alert{Keep the loop gain \(G_o(i\omega)\) away from -1!}
\end{frame}
\end{document}