\documentclass[12pt,a4paper,final,titlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{hyperref}
\author{Jaiswal, Ankit Kumar}

\newtheorem{dfn}{Definition}
\newtheorem{thm}{Theorem}
\newtheorem{pf}{Proof}

\begin{document}
\title{Extension of Rational to Real using Dedekind's Cuts}
\date{May, 2013}
\maketitle

\begin{abstract}
This report contains the bare bones of Dedekind's cut, with an attempt to define real numbers out of rational numbers, with a view to elaborate the reason for choosing this approach. This is in accordance with the view of the consolidated project to grasp the formation of real in its entirety. We assume familiarity with Elementary Set Theory, Natural \& Rational number constructed via Peano's Axioms and the fact that set of rational is a field.
\end{abstract}

\section{Introduction}
We all have seen upto now, natural numbers ($\mathbb{N}$) being constructed from ``Naive Set Theory" and integers ($\mathbb{Z}$) and rational numbers ($\mathbb{Q}$) further being constructed from natural numbers with an interesting pattern, i.e.
\begin{equation}\label{eq1}
\mathbb{N}\:\subset \mathbb{Z}\:\subset \mathbb{Q}
\end{equation}
In a similar way, we will construct real numbers out of rational numbers which of course isn't obvious to see. But, all we need is a pattern among rational numbers which could be uniquely associated to every element in the set of real numbers ($\mathbb{R}$) (We do know what kinds of numbers to include; the numbers which we are using in the name of real numbers since childhood).
In 1872, a German mathematician ``Richard Dedekind" discovered one such pattern and popularly his approach is known as ``Dedekind's Cuts"; and we will proceed the same way as contained in the books referred ($-$ list of reference is mentioned in the last).

\textbf{NOTE:} The word ``number" would mean rational numbers unless otherwise specified.

\section{Cuts}
\begin{dfn}\label{def1}
A set $\xi$ of rational numbers is called as a \textbf{cut}, if
\begin{enumerate}
\item it contains at least one rational number, but not all of them;
\item every rational number of the set is smaller than every rational number not belonging to the set;
\item it does not contain a greatest rational number (i.e. a number which is greater than any other number of the set).
\end{enumerate}
A number contained in the Cut is termed as \textbf{lower number} for $\xi$ and for numbers not belonging to the cut, \textbf{upper number} is used.
\end{dfn}
Also,
\begin{dfn}\label{def2}
Let $\xi$ and $\eta$ be two cuts, then $\xi\:=\:\eta$ ;
if every lower number for $\xi$ is a lower number for $\eta$ and every lower number of $\eta$ is a lower number for $\xi$.
\end{dfn}

Now here comes a simple but important theorem;

\begin{thm}\label{thm1}
If X is an upper number for a cut $\xi$ and $X_1$ is some rational number such that $X_1 > X$ then, $X_1$ is also an upper number for $\xi$.
\end{thm}
\textbf{Proof:} Let's assume that $X_1$ is not an upper number for $\xi$, which from Definition \ref{def1} implies, $X_1 \in \xi$ and also $X_1 < X$ . But according to Theorem's conditions $X_1 > X$, which contradicts $X_1 \in \xi$. Hence, $X_1$ is an upper number.

\medskip

\begin{thm}\label{thm2}
If $X$  is a lower number for $\xi$ and $X_1$ is some Rational Number such that, $X_1 < X$ then,
$X_1$ is also a lower number for $\xi$.
\end{thm}
\textbf{Proof:} Let's assume that $X_1$ is not a lower number for $\xi$, which from Definition \ref{def1} implies, $X_1 \notin \xi$ and also $X_1 > X$ . But according to Theorem's conditions $X_1 < X$, which contradicts $X_1 \notin \xi$. Hence, $X_1$ is a lower number.

\bigskip
\bigskip

Now, if we wish to show that a given set of rational number is a cut, we need to show only the following:
\begin{enumerate}
 \item The set is not empty and there is a rational number not belonging to it.
 \item With every number it contains, the set also contains all numbers smaller than that number.
 \item with every number it contains, the set also contains a greater one.
\end{enumerate}

In order to substitute numbers (known till now) with ``cuts", we should be able to do all operations defined on numbers, over cuts. Some of them are ordering, addition, multiplication etc.
\bigskip

\subsection{Ordering}
\begin{dfn}\label{def3}
If $\xi$ and $\eta$ are cuts, then $\xi > \eta$; if there exist a lower number for $\xi$ which is an upper number for $\eta$.
\end{dfn}

\begin{dfn}\label{def4}
If $\xi$ and $\eta$ are cuts, then $\xi < \eta$; if there exist an upper number for $\xi$ which is a lower number for $\eta$.
\end{dfn}

With this, we can show that cuts too follow the rule of trichotomy under ordering, like numbers. And the same has been shown as a theorem.

\begin{thm}\label{thm3}
For any given $\xi$, $\eta$, exactly one of\quad $\xi$=$\eta$, $\xi > \eta$, $\xi < \eta$\quad is the case.
\end{thm}
\textbf{Proof:} Let's check whether can two of them be simultaneously true. The statements $\xi = \eta$ \& $\xi < \eta$ , simultaneously are incompatible by Definition \ref{def2} and \ref{def3}. Similarly, the statements $\xi = \eta$ \& $\xi < \eta$ simultaneously are incompatible. But if we had $\xi>\eta$ \& $\xi<\eta$ then for sure we can say that there exists a lower number $X$ and an upper number $Y$ for $\xi$ such that $X$ is an upper number for $\eta$ and $Y$ is a lower number for $\eta$. Now, this implies $X<Y$ and $X>Y$ simultaneously; which is not possible. Hence we can say that two of them can't be true at the same time. Similarly, all of them can't be true simultaneously as two at a time is not possible. Therefore we can have at most one of the three cases true.

If $\xi \neq \eta$ , then it's obvious that their lower numbers do not coincides, i.e. either some lower number for $\xi$ is an upper number for $\eta$, in which case, it follows that $\xi > \eta$ ; or some lower number for $\eta$ is an upper number for $\xi$, in which case, it follows that $\xi < \eta$. This implies, at least one of them is true. But among these three at most one can be true. Hence, one of them has to be true at a time.

\bigskip

\subsection{Addition}
Before defining addition of cuts, there is one theorem which is helpful in our approach towards defining it. From the axiomatic point of view of addition of numbers, it is necessary to obtain a unique number on addition of two numbers. Following theorem fulfils this condition.
\begin{thm}\label{thm4}
Let $\xi$ and $\eta$ be two cuts and also let X be a lower number for $\xi$ and Y a lower number for $\eta$.
\begin{enumerate}
\item Then the set $\zeta$ of all rational number which are representable in the form $X + Y$, is itself a cut.
\item No number of this set can be written as a sum of an upper number for $\xi$ and an upper number for $\eta$.
\end{enumerate}
\end{thm}
\textbf{Proof:} Consider any lower numbers $X_1$ \&\ $X_2$ for $\xi$ and any lower numbers $Y_1$ \&\ $Y_2$ for $\eta$. Also consider any upper number $X_3$ for $\xi$ and any upper number $Y_3$ for $\eta$; with following relation.
\begin{equation}
X_1<X_2<X_3\qquad \&\ \qquad Y_1<Y_2<Y_3 \nonumber
\end{equation}

We can always find such numbers because of the properties of cuts.

In order to prove $\zeta$ a cut, it is sufficient to show that it satisfies the three points of Definition \ref{def1}. \\
\begin{enumerate}
\item Since $\xi$ and $\eta$ are cuts, means both are non-empty. And by given condition, sum of their elements belongs to the set $\zeta$. Also $\exists$ a number $Z=X_3+Y_3$ which doesn't belong to $\zeta$ (according to given condition).
\item Now consider all numbers less than $X_1+Y_1$, i.e. $Z<X_1+Y_1$ or $\frac{Z}{X_1+Y_1} < 1$ . This statement can be used to draw the following :
\begin{equation}
X_1\dfrac{Z}{X_1+Y_1} < X_1\cdot1 \qquad \&\ \qquad Y_1\dfrac{Z}{X_1+Y_1} < Y_1\cdot1 \nonumber
\end{equation}
By Theorem \ref{thm2} and by given condition, the number
\begin{equation}
( X_1\dfrac{Z}{X_1+Y_1} + Y_1\dfrac{Z}{X_1+Y_1} ) \in \zeta \nonumber
\end{equation}
which implies that $Z\in \zeta$.
\item For every $X_1\in \xi$, $\exists$ a greater lower number $X_2$ and since it is a lower number for $\xi$, $(X_2+Y_1) \in \zeta$ even though $X_2+Y_1 > X_1+Y_1$.
\end{enumerate}
From 1, 2 and 3, we can conclude that the set $\zeta$ is a cut.\\ \medskip

Now consider lower numbers for $\zeta$, from the first part of this theorem it could be represented as the sum of the lower numbers of both $\xi$ and $\eta$ i.e. of the form $X_1+Y_1$. And any such number can't be represented by the form $X_3+Y_3$, i.e. $X_1+Y_1 \neq X_3+Y_3$ as $X_1+Y_1 < X_3+Y_3$ (from the given relation).
So, this proves the theorem.
\bigskip

\begin{dfn}\label{def5}
The cut constructed in Theorem \ref{thm4} is denoted by $\xi+\eta$ and is called the sum of $\xi$ and $\eta$.
\end{dfn}
\begin{thm} (Commutative Law of Addition):
$\xi+\eta = \eta+\xi$.
\end{thm}
\textbf{Proof:} Every X+Y is a Y+X, and vice versa; where X and Y are lower numbers for $\xi$ and $\eta$, respectively.

\begin{thm} (Associative Law of Addition):
$(\xi+\eta)+\zeta = \xi(\eta+\zeta)$
\end{thm}
\textbf{Proof:} Every (X+Y)+Z is a X+(Y+Z), and vice versa; where X and Y are lower numbers for $\xi$ and $\eta$, respectively.

There is yet another interesting property of property of cuts, which may be useful result to use.

\begin{thm}\label{thm7}
Given any positive Rational number A, and given a cut, then there exists a lower number X and an upper number U for the cut such that
\begin{equation}
U-X = A. \nonumber
\end{equation}
\end{thm}
\textbf{Proof:} Let $X_1$ be some lower number and $Y_1$ be some upper number, and consider all rational numbers of the form $X_1+nA$ (where n is an integer) such that $X_1+nA > Y_1$. By Theorem \ref{thm1}, this number is an upper number. Consider a set S=\{$n\in\mathbb{N}$ | $X_1+nA$ is an uper number for $\xi$\} and since it is a set of natural number then it must have a least natural number, say u. This implies $X_1 + (u-1)A$ is a lower number. Therefore letting\: $U=X_1+uA$ and $X=X_1+(u-1)A$\: proves this.

\medskip

\begin{thm}\label{thm8}
If \quad $\xi > \eta$ \quad then,\quad $\xi+\zeta > \eta+\zeta$.
\end{thm}
\textbf{Proof:} If $\xi>\eta$, then according to the definition \ref{def3} there exists a Rational number such that $Y\in\xi$ but $Y\notin\eta$. If $\xi$ is cut then, $\exists$ a rational number $X\in\xi$ such that, $X>Y$. By Theorem \ref{thm7} we can let $X-Y=U-Z$; where U \&\ Z are suitable upper and lower number for $\zeta$. The equation $X-Y=U-Z$ is equivalent to $X+Z=U+Y$ and $X+Z$ is a lower number for $(\xi+\zeta)$ and $U+Y$ is an upper number for $(\eta+\zeta)$ (by theorem \ref{thm4}). Hence, it is one such number which belongs to $(\xi+\zeta)$ but doesn't belong to $(\eta+\zeta)$. Therefore $\xi+\zeta > \eta+\zeta$.

\bigskip
\bigskip
\bigskip

\subsection{Multiplication}
Before defining multiplication of cuts, there is one theorem which is helpful in our approach towards defining it. From the axiomatic point of view of multiplication of numbers, it is necessary to obtain a unique number on multiplication of two numbers. Following theorem fulfils this condition.
\begin{thm}\label{thm9}
Let $\xi$ and $\eta$ be cuts and also X be a lower number for $\xi$, whereas Y be a lower number for $\eta$.
\begin{enumerate}
\item Then the set $\zeta$ of all rational number which are representable in the form $X\cdot Y$, is itself a cut.
\item No number of this set can be written as a product of an upper number for $\xi$ and an upper number for $\eta$.
\end{enumerate}
\end{thm}
\textbf{Proof:} Consider any lower numbers $X_1$ \&\ $X_2$ for $\xi$ and any lower numbers $Y_1$ \&\ $Y_2$ for $\eta$. Also consider any upper number $X_3$ for $\xi$ and any upper number $Y_3$ for $\eta$; with following relation.
\begin{equation}
X_1<X_2<X_3\qquad \&\ \qquad Y_1<Y_2<Y_3 \nonumber
\end{equation}
We can always find such numbers because of the properties of cuts.

In order to prove $\zeta$ a cut, it is sufficient to show that it satisfies the three points of Definition \ref{def1}. \\
\begin{enumerate}
\item Since $\xi$ and $\eta$ are cuts, means both are non-empty. And by given condition, product of their elements belongs to the set $\zeta$. Also $\exists$ a number $Z=X_3\cdot Y_3$ which doesn't belong to $\zeta$ (according to given condition).
\item Now consider all numbers less than $X_1\cdot Y_1$, i.e. $Z<X_1\cdot Y_1$ or $\frac{Z}{X_1} < Y_1$. This implies $\frac{Z}{X_1}$ is a lower number for $\eta$. Therefore its product with $X_1$ will belong to $\zeta$, which implies $Z\in \zeta$ (as $X_1\dfrac{Z}{X_1} = Z$ ).
\item For every $X_1\in \xi$, $\exists$ a greater lower number $X_2$ and since it is a lower number for $\xi$, $(X_2\cdot Y_1) \in \zeta$ even though $X_2\cdot Y_1 > X_1\cdot Y_1$.
\end{enumerate}
From 1, 2 and 3, we can conclude that the set $\zeta$ is a cut.\\

Now consider lower numbers for $\zeta$, from the first part of this theorem it could be represented as the product of the lower numbers of both $\xi$ and $\eta$ i.e. of the form $X_1\cdot Y_1$. And any such number can't be represented by the form $X_3\cdot Y_3$, i.e. $X_1\cdot Y_1 \neq X_3\cdot Y_3$ as $X_1\cdot Y_1 < X_3\cdot Y_3$ (from the given relation).
So, this proves the theorem.
\bigskip

\begin{dfn}\label{def6}
The cut constructed in Theorem \ref{thm9} is denoted by $\xi\cdot \eta$ (however the dot is usually omitted), and is called the product of $\xi$ and $\eta$.
\end{dfn}
\begin{thm} (Commutative Law of Multiplication):
$\xi\cdot \eta$ = $\eta\cdot \eta$
\end{thm}
\textbf{Proof:} Every XY is a YX, and vice versa; where X and Y are lower numbers for $\xi$ and $\eta$, respectively.

\begin{thm} (Associative Law of Multiplication):
$(\xi\cdot \eta)\cdot \zeta$ = $\xi\cdot (\eta\cdot \zeta)$
\end{thm}
\textbf{Proof:} Every (XY)Z is a X(YZ), and vice versa; where X,Y\&\ Z are lower numbers for $\xi$, $\eta$ and $\zeta$.

\begin{thm} (Distributive Law of Multiplication):
$\xi\cdot (\eta+\zeta)$ = $\xi\cdot \eta + \xi\cdot \zeta$
\end{thm}
\textbf{Proof:}Let X,Y\&\ Z be the lower numbers for $\xi$, $\eta$ and $\zeta$.\\
From Definition \ref{def5} and \ref{def6}, lower number for $\xi\cdot (\eta+\zeta)$ will be of the form $X(Y+Z)$ which is equal to $XY + XZ$ (as Distributive Law holds over Rational number) which is the lower number for $\xi\cdot \eta + \xi\cdot \zeta$ (by Definition \ref{def5} and \ref{def6}). this implies that every lower number for $(\xi\cdot(\eta+\zeta))$ is a lower number for $(\xi\cdot \eta + \xi\cdot \zeta)$. Hence, $(\xi\cdot (\eta+\zeta)) \subset (\xi\cdot \eta + \xi\cdot \zeta)$.

From Definition \ref{def5} and \ref{def6}, lower number for $(\xi\cdot \eta + \xi\cdot \zeta)$ will be of the form $XY+X_1Z$ (where $X_1\in \xi$ and may be different from $X$). Now if we let $X=min(X,X_1)$ then, $XY+XZ$ is also a lower number for $\xi$ which is equal to $X(Y+Z)$, where $X(Y+Z)$ is a lower number for $\xi\cdot(\eta+\zeta)$ (by Definition \ref{def5} and \ref{def6}). Hence, $(\xi\cdot \eta+\xi\cdot \zeta) \subset (\xi\cdot(\eta+\zeta))$

From above two paragraph we can conclude that $(\xi\cdot (\eta+\zeta)) = (\xi\cdot \eta + \xi\cdot \zeta)$.

\bigskip
\bigskip
\bigskip

\section{Rational and Integral cuts}
We are almost one step far from defining real Numbers. In the previous section we have seen how to construct a cut, which just ask for a set of Rational number to satisfy three axioms of Definition \ref{def1}; but the question is ``how to associate uniquely a cut to a rational and what sort of cut will be suitable?". May be following theorem would help.
\begin{thm} \label{thm10}
For any given rational number $R$, the set of all rational numbers $<R$ constitutes a cut.
\end{thm}
\textbf{Proof:} Let the set defined above be $S$.In order to prove $\zeta$ a cut, it is sufficient to show that it satisfies the three points of Definition \ref{def1}.
\begin{enumerate}
\item For every R, $\exists$ a $X<R$ \&\ $X_1>R$ (where $X,X_1$ $\in$ $\mathbb{Q}$) which makes $X$ to belong in $S$ and $X_1$ not to belong in $S$.
\item consider number less than any number $X\in S$; i.e. $Z<X$, but $X<R$, which implies $Z\in S$ for every $Z<X$.
\item since there exists infinite rational number between any two Rational numbers, i.e. for every $X<R$, $\exists$ a $X_2\in \mathbb{Q}$ such that $X<X_2<R$ and by given condition $X_2\in S$.
\end{enumerate}
From 1, 2 and 3 we can conclude that $S$ is a cut. \\
Also, it's clear that this cut $S$ uniquely identifies R and hence, it is denoted by \textbf{R*}.

\bigskip

\begin{dfn} \label{def7}
The cut constructed in Theorem \ref{thm10} is called as \textbf{rational cut} and is denoted by \textbf{R*}. And if R happens to be an integer then, the cut so constructed is called as \textbf{integral cut} and it is then denoted by \textbf{r*}. And if R is a natural number then the cut will be called as \textbf{natural cut}.
\end{dfn}

\subsection{Properties}
Here are some interesting properties of rational cuts which are among the motivations in choosing cuts for defining all sorts of numbers (means rational) and hence are stated as theorems.

\begin{thm} \label{thm11}
If

$
\begin{array}{lll}
X<Y \qquad or & X=Y \qquad or & X>Y \\
X\text{*}<Y\text{*} \quad or & X\text{*}=Y\text{*} \quad or & X\text{*}>Y\text{* ;}
\end{array}
$

 vice versa.
\end{thm}

\textbf{Proof:} If $X<Y$ then for sure $X\in Y$* and by Definition \ref{def7} $X\notin X$*. Hence, by Definition \ref{def3} $X$*$<$ $Y$*. Similarly, result for other two cases can also be proved.

\bigskip

\begin{thm} \label{thm12} The following holds

$
\begin{array}{rcl}
(X+Y)\text{*} & = & (X\text{*} + Y\text{*}) \\
(X\cdot Y)\text{*} & = & (X\text{*}\cdot Y\text{*})
\end{array}
$
\end{thm}
\textbf{Proof:} Let $X_1$ and $Y_1$ be arbitrary lowers number for $X$* and $Y$*, respectively.
\begin{enumerate}
\item From definition \ref{def5}, lower number for ($X$* + $Y$*) will be of the form $X_1+Y_1$, where $X_1<X$ \&\ $Y_1<Y$. Because of the property of rational number, $X_1+Y_1 < X+Y$. Also by Definition \ref{def5} $(X_1+Y_1)$ is a lower number for ($X+Y$)*. This implies $(X\text{*} + Y\text{*}) \subset (X+Y)\text{*}$.
\medskip
\item Let $Z$ be a arbitrary lower number for ($X+Y$)* for which $Z<(X+Y)$ or in other sense $\frac{Z}{X+Y}<1$. This statement can be used to draw the following :
\begin{equation}
X_1\dfrac{Z}{X_1+Y_1} < X_1\cdot1 \qquad \&\ \qquad Y_1\dfrac{Z}{X_1+Y_1} < Y_1\cdot1 \nonumber
\end{equation}
Then obviously $X_1\dfrac{Z}{X_1+Y_1}$ \&\ $Y_1\dfrac{Z}{X_1+Y_1}$ are lower number for $X$* and $Y$*, respectively and their sum must belong to $(X\text{*}+Y\text{*})$. Since $Z = X\dfrac{Z}{X+Y}+Y\dfrac{Z}{X+Y}$, $Z \in (X\text{*}+Y\text{*})$. Hence, $(X+Y)\text{*} \subset (X\text{*} + Y\text{*})$.
\medskip
\item From Definition \ref{def6}, lower number for ($X$*$\cdot$ $Y$*) will be of the form $X_1\cdot Y_1$ for which $X_1\cdot Y_1 < X\cdot Y$ (as $X_1<X$ and $Y_1<Y$). By Definition \ref{def6}, $(X_1\cdot Y_1)$ is a lower number for ($X\cdot Y$)*. Hence, $(X\text{*}\cdot Y\text{*}) \subset (X\cdot Y)\text{*}$.
\medskip
\item Let $Z$ be a arbitrary lower number for ($X\cdot Y$)* i.e. $Z<(X\cdot Y)$. Since ($X\cdot Y$)* is a cut, therefore $\exists$ a greater lower $Z_1\in (X\cdot Y)$* for every $Z$  . This implies  $Z<Z_1<(X\cdot Y)$ and this relation can be written as
\begin{equation}
\frac{Z}{Z_1} < 1 \quad \&\ \quad \frac{Z_1}{Y} < X \nonumber
\end{equation}
The number $\frac{Z_1}{Y}$ is a lower number for $X$* whereas $Y\frac{Z}{Z_1}$ is for $Y$* (as $\frac{Z}{Z_1} < 1$).
This implies $Z\in (X$*$\cdot Y$*) and $(X\cdot Y)\text{*} \subset (X\text{*}\cdot Y\text{*})$.
\end{enumerate}
From 1 and 2, $(X+Y)\text{*} = (X\text{*} + Y\text{*})$ , and \\
from 3 and 4, $(X\cdot Y)\text{*} = (X\text{*}\cdot Y\text{*})$.

\bigskip

\section{Real Numbers}
Now we get the intuition in our mind that cut is a good candidate to be set as a real number and following definition defines  natural numbers to rational numbers, the same way.
\begin{dfn} \label{def8} The symbol $X$ will now denote the cut $X$*, with following replacement.
\begin{itemize}
\item The term \textbf{natural numbers} ($\mathbb{N}$) will henceforth be used instead of natural cuts.
\item The term \textbf{integers} ($\mathbb{Z}$) will henceforth be used instead of integral cuts.
\item The term \textbf{rational number} ($\mathbb{Q}$) will henceforth be used instead of rational cuts.
\end{itemize}
\end{dfn}

Because of such replacement, interesting results arises, some of which needed to be proved; hence, is stated as theorems.

\begin{thm} \label{thm13}
The rational numbers are those cuts for which there exists a least upper number.
\end{thm}
\textbf{Proof:} By Definition \ref{def8}, rational numbers are rational cuts, i.e. if the number is \textbf{X}, then \textbf{X}=$X$* , which implies for every $Z<X$, $Z\in X$* but $X \notin X$* (where $Z$ is a rational number(old one)). This implies X is the least upper number.

\medskip

\begin{dfn} \label{def9}
Any cut which is not a rational number is called an \textbf{irrational number}. In other words, \textbf{irrational number} are those cuts for which there doesn't exists a least upper number.
\end{dfn}
Two irrational numbers could be added, multiplied and ordered as they are cuts.

Now we are ready to define real numbers because we have already defined rational and irrational number.

\begin{dfn} \label{def10}
A \textbf{real number} is a cut. In other words, collection of all rational and irrational numbers is called as \textbf{real number set} ($\mathbb{R}$).
\end{dfn}
\bigskip

There is yet another important definition which will enable us to identify cut as a number and element of a cut, i.e. number as a cut; any time.
\begin{dfn} \label{def11}
Let $\xi$ and X be a cut. Then X is a lower number for $\xi$ if and only if, $X<\xi$ and hence is an upper number if, $X\geq \xi$ .
\end{dfn}

\bigskip
\bigskip
\bigskip

\section{Dedekind's Fundamental Theorem}
\begin{thm} \label{thm14}
Let there be given any division of all real numbers into two classes with the following properties:
\begin{enumerate}
\item There exists a number of the first class, and also one of the second class.
\item Every number of the first class is less than every number of the second class.
\end{enumerate}
Then there exists exactly one real number $\theta$ such that every $H<\theta$ belongs to the first class and every $H>\theta$ to the second class.
\end{thm}
\textbf{Proof:} Consider a cut $\xi$ which consists of all the numbers of first class (except the greatest one, if any). This cut can be made as two requirements are already fulfilled according theorem's condition and the third one is fulfilled by excluding the greatest one. \\
This implies that for every such division of all real numbers we can associate a cut.\\
Also, by definition \ref{def11}, the numbers $< \xi$, $\in \xi$; and since, all lower numbers of $\xi$ are from first class implies that every real $H<\xi$ belongs to the first class.\\
Also, the numbers $> \xi$, $\notin \xi$; and since, all upper numbers of $\xi$ are from second class implies that every real $H>\xi$ belongs to the second class.\\

\bigskip

\section{Revisiting Peano's Axioms}
There is an interesting point still remaining towards defining real numbers and i.e. ``Do natural cuts satisfies Peano's Axioms?" . And the answer is stated as a theorem, which if true could become the reason for identifying natural cuts as natural numbers.

\begin{thm} \label{thm15}
The natural cut satisfy the five axiom of natural number if the role of 0 is assigned to 0* and if we set ($x$*)$'$ = $x$*+$1$* .
\end{thm}

\textbf{Proof:}
\begin{enumerate}
\item 0* is a natural number. \\
\textbf{Explanation}: given condition

\item If $x$* is a natural number then $\exists$ a unique successor denoted by ($x$*)$'$, which is also a natural number.\\ \textbf{Explanation}: $x$* is a cut and ($x$*)$'$ = $x$*+$1$* = $(x+1)$*; which is a natural cut, or in other words natural number.

\item If ($x$*)$'$ = ($y$*)$'$ , \quad then ($x$)* = ($y$)* \\
\textbf{Explanation}: if ($x$*)$'$ = ($y$*)$'$ then, $($x'$)\text{*} = ($y'$)\text{*}$ (as ($x$*)$'$ = $x$*+$1$* = $(x+1)$*); which by Theorem \ref{thm11} equivalent to the expression $x'=y'$ or more precisely, $x=y$. This implies $x\text{*}=y\text{*}$.

\item ($x$*)$'$ $\neq$ 0* \qquad $\forall$ $x$* \\
\textbf{Explanation}: since $x'\neq 0$ $\forall$ $x$, therefore by Theorem \ref{thm11}, $(x')\text{*} \neq 0\text{*}$. this implies $(x\text{*})' \neq 0\text{*} \qquad \forall x\text{*}$.

\item Let $\mathbb{N}$* be the set of all natural cuts and $M$* be a subset of it, s.t. 0* $\in$ $M$* \&\ ($m$*)$'$ $\in$ $M$* , whenever $m$* $\in$ $M$* ; then $M$* = $\mathbb{N}$* .
\textbf{Explanation}: Consider a set M = \{\ $m$ $\mid$ $m$* $\in$ $M$*\}\ . We can say, 0 $\in$ $M$ (since 0* $\in$ $M$*) and also, $m'$ $\in$ $M$, whenever $m$ $\in$ $M$ (as ($m$*)$'$ $\in$ $M$* , whenever $m$* $\in$ $M$* ). From axioms of Natural number we can conclude that $M=\mathbb{N}$, which implies $M$* = $\mathbb{N}$*.

\end{enumerate}

\subsection{Conclusion}
So with this, we can conclude that this so constructed real number set is an extension of rational number and the  pattern mentioned as equation \ref{eq1} is restored, i.e.
\begin{equation}
\mathbb{N}\:\subset \mathbb{Z}\:\subset \mathbb{Q}\: \subset \mathbb{R}
\end{equation}

\newpage
\section{Acknowledgement}
The author wishes to thank the DST-Inspire Programme and the IISc Mathematics department for providing the resources that went into this study. Considerable use has been made of the J.R.D. Tata Library, for which the author is correspondingly grateful. The author especially thanks his project guide, Prof. M.K. Ghosh, for his guidance and help during the project.

\newpage
\begin{thebibliography}{100}
\bibitem{Landau} Edmund Landau, \textit{Foundation of Analysis}, Chelsea Publishing Company New York, 1966
\bibitem{Spivak} Michael Spivak, \textit{Calculus}, Cambridge University Press, 1994
\bibitem{webpage} Wenliang Zhang, \textit{Supplementary notes on Dedekind's Cuts}, (http://www-personal.umich.edu/~wlzhang/dedekind-cuts.pdf)
\bibitem{webpage} Alexander Bogomolny, \textit{On Dedekind Cuts},\\ (http://www.cut-the-knot.org/proofs/Whittaker.shtml)
\end{thebibliography}

\end{document}


%---------%---------%---------%---------%---------%---------%---------%---------
\section{Inner Product Spaces. Hilbert Spaces}
\subsection{Inner Product Spaces. Hilbert Spaces}
  \paragraph{2.}
  \begin{proof}
    \[
      \|x+y\|^2 = \langle x+y, x+y\rangle = \|x\|^2+\|y\|^2+2\langle x, y\rangle
      =\|x\|^2+\|y\|^2,
    \]
    where the last equality comes from the hypothesis of orthogonality. Now we
    show that for mutually orthogonal $x_1,\dots,x_m$
    \[
      \left\|\sum_{i=1}^m x_i\right\|^2 = \sum_{i=1}^m\|x_i\|^2,
    \]
    by induction on $m$. The case where $m=2$ has already been showed and we
    assume that the equation holds for $m-1$. Since $x_m$ is orthogonal with
    each $i=1,\dots,m-1$, $x_m$ is orthogonal to $x_1+\cdots+x_{m-1}$. Hence,
    \[
      \left\|\sum_{i=1}^m x_i\right\|^2 =
      \left\|\sum_{i=1}^{m-1}x_i\right\|^2 + \|x_m\|^2 =
      \sum_{i=1}^m\|x_i\|^2,
    \]
    completing the proof.
  \end{proof}

  \paragraph{3.}
  \begin{proof}
    The equation implies $\langle x, y\rangle+\langle y, x\rangle=0$. The
    symmetric property of real inner products implies $\langle x, y\rangle=0$.
    Let $X=\mathbb{C}$ and $x=1, y=i$. It is easy to verify that $\|x+y\|^2=
    \|x\|^2+\|y\|^2=2$ but $x$ and $y$ are not orthogonal.
  \end{proof}

  \paragraph{7.}
  \begin{proof}
    It suffices to show that the zero vector is the only vector orthogonal to
    all vectors. Suppose that $\langle x_0, x\rangle=0$ for all $x\in X$, then
    $\|x_0\|^2=\langle x_0, x_0\rangle=0$. By the definiteness of the inner
    product, $x_0=0$.
  \end{proof}

  \paragraph{8.}
    We show that any norm satisfying the parallelogram equality can be derived
    form an inner product.
  \begin{proof}
    The proof of (IP3) is trivial and (IP4) follows immediately from the
    positive-definiteness of the norm. Hence we only show the linearity in the
    first factor here. For every $u, v, y\in X$, from the parallelogram equality
    we can derive, after some computation, that
    \begin{align*}
      4\langle u+v, y\rangle &= \|u+v+y\|^2-\|u+v-y\|^2  \\
      &= \|u+y\|^2-\|u-y\|^2+\|v+y\|^2-\|v-y\|^2 \\
      &= 4\langle u, y\rangle + 4\langle v, y\rangle.
    \end{align*}
    Namely, (IP1) holds. By induction we can show that $\langle nu, y\rangle=
    n\langle u, y\rangle$ for $n=1,2,\dots$. And since $\langle -u, y\rangle =
    \langle 0-u, y\rangle = \langle 0, y\rangle - \langle u, y\rangle = \langle
    u, y\rangle$,
    \[
      \langle nu, y\rangle = n\langle u, y\rangle,
      \quad\text{for $n\in\mathbb{Z}$}.
    \]
    Furthermore, for any positive integer $m$,
    \[
      m\left\langle\frac{n}{m}u, y\right\rangle =
      mn\left\langle\frac{1}{m}u, y\right\rangle =
      n\langle u, y\rangle.
    \]
    Dividing the both sides by $m$ yields
    \[
      \langle qu, y\rangle = q\langle u, y\rangle,
      \quad\text{for $q\in\mathbb{Q}$}.
    \]
    For every $\alpha\in\mathbb{R}$, let $(q_n)\subset\mathbb{Q}$ converges to
    $\alpha$. Now we show that $f(t)=\langle tu, y\rangle$ is continuous at $t=
    0$ and by the additivity we may conclude that $f$ is continuous on
    $\mathbb{R}$. Since
    \begin{align*}
      4|f(t)|
      &= |\|tu+y\|^2 - \|tu-y\|^2| \\
      &= (\|tu+y\|+\|tu-y\|)|\|tu+y\|-\|tu-y\|| \\
      &\le 4t\|u\|(t\|u\|+\|y\|) \to 0
    \end{align*}
    as $t\to 0$, $f(t)$ is continuous. For every $\alpha\in\mathbb{R}$, let
    $(q_n)\subset\mathbb{Q}$ be a convergent sequence with limit $\alpha$. Then
    \[
      \langle\alpha u, y\rangle=
      \lim\langle q_nu, y\rangle=
      \lim q_n\langle u, y\rangle=
      \alpha\langle u, y\rangle.
    \]
    Hence, $\langle\cdot,\cdot\rangle$ is linear in the first factor. Thus, it
    is an inner product. Meanwhile, it is easy to verify that the norm it
    introduces is exactly the original norm.
  \end{proof}
% end

\subsection{Further Properties of Inner Product Spaces}
  \paragraph{7.}
  \begin{proof}
    First we note that
    \[
      f(\alpha)=\|x+\alpha y\|^2-\|x-\alpha y\|^2
      = 2\bar{\alpha}\langle x,y\rangle + 2\alpha\langle y,x\rangle.
    \]
    Clear that $x\perp y$ implies $f(\alpha)=0$ for all scalar $\alpha$. For the
    converse, we suppose $f(\alpha)=0$ and put $\alpha=\langle x, y\rangle$.
    Then $0=f(\alpha)=2|\langle x, y\rangle|$. Thus, $x\perp y$.
  \end{proof}

  \paragraph{8.}
  \begin{proof}
    Clear that $x\perp y$ implies $\|x+\alpha y\|\ge \|x\|$. Therefore we only
    show the converse here. Without loss of generality, we assume $\|y\|=1$.
    Then $\|x+\alpha y\|\ge \|x\|$ for all scalar $\alpha$ implies
    \[
      |\alpha|^2 +
      \bar{\alpha}\langle x, y\rangle + \alpha\overline{\langle x, y\rangle}
      \ge 0.
    \]
    Put $\alpha=-\langle x, y\rangle$ and we get
    \[
      0 \le |\langle x, y\rangle|^2 - 2|\langle x, y\rangle|^2
      =-|\langle x, y\rangle|^2,
    \]
    which implies $\langle x, y\rangle=0$. Namely, $x\perp y$.
  \end{proof}

  \paragraph{9.}
  \begin{proof}
    For every $\vep>0$, put $\delta=\vep/\sqrt{b-a}$. Then for every $x_1,x_2\in
    V$ with $\|x_1-x_2\|_\infty<\delta$,
    \[
      \|x_1-x_2\|_2^2 = \int_a^b|x_1(t)-x_2(t)|^2\rd t
      \le (b-a)\delta^2 = \vep^2.
    \]
    Hence, $x\mapsto x$ is continuous.
  \end{proof}

  \paragraph{10.}
  \begin{proof}
    For every $u, w\in X$,
    \begin{align*}
      \langle Tu, w\rangle =
      & \frac{1}{4}(\langle T(u+w), u+w \rangle - \langle T(u-w), u-w \rangle)\\
      &+ \frac{i}{4}
        (\langle T(u+iw), u+iw\rangle - \langle T(u-iw), u-iw\rangle).\\
    \end{align*}
    Note that each component of the right hand side is of form $\langle Tx, x
    \rangle$ and hence equals to $0$. Putting $w=Tu$ yields $\|Tu\|^2=0$ for all
    $u\in X$. Thus, $T=0$.
  \end{proof}
% end

\subsection{Orthogonal Complements and Direct Sums}
  \paragraph{7.}
  \begin{proof}
    $\,$\par
    (a) $x\in A^{\perp\perp}$ iff for all $y\in A^\perp$, $\langle x, y\rangle=
    0$. By the definition of $A^\perp$, the identity holds if $x\in A$. Hence,
    $A\subset A^{\perp\perp}$.\par
    (b) For all $x\in B^\perp$ and $y\in A\subset B$, $\langle x, y\rangle=0$ by
    definition. Hence, $x\in A^\perp$. Namely, $B^\perp\subset A^\perp$.\par
    (c) We show that $A^\perp$ is closed (no matter whether $A$ is or not) and
    invoke Lemma 3.3-6 to complete the proof. Suppose that $(x_n)\subset
    A^\perp$ converges to $x$. For all $y\in A$, $\langle x_n, y\rangle=0$. By
    the continuity of the inner product, $\langle x, y\rangle=0$ and therefore
    $x\in A^\perp$. Hence, $A^\perp$ is closed. Thus, $A^\perp=A^{\perp\perp
    \perp}$.
  \end{proof}

  \paragraph{8.}
  \begin{proof}
    We have show this in Prob. 7.
  \end{proof}

  \paragraph{9.}
  \begin{proof}
    It has been shown in Lemma 3.3-6 that the closedness of $Y$ implies $Y=Y^{
    \perp\perp}$. Hence we only show the converse here. For every convergent
    $(x_n)\subset Y$, $(x_n)\subset Y^{\perp\perp}$. Since $Y^{\perp\perp}$ is
    closed by Prob. 8, the limit $x$ of $(x_n)$ belongs to $Y^{\perp\perp}$ and
    hence belongs to $Y$. Thus, $Y$ is closed.
  \end{proof}

  \paragraph{10.} TODO
% end

\subsection{Orthonormal Sets and Sequences}
  \paragraph{3.}
  \begin{proof}
    The situation where $x$ and $y$ are linearly dependent is obvious and hence
    we assume they are linearly independent here. By the homogeneity of the
    Schwarz inequality, we may assume without loss of generality that $\|x\|=
    \|y\|=1$. Put $z=(y-x\langle y,x\rangle)/\|y-x\langle y,x\rangle\|$. Then
    $\{x,z\}$ is orthonormal and therefore by (12*)
    \[
      |\langle y,x\rangle|^2+|\langle y,z\rangle|^2 \le \|y\|^2 = 1.
    \]
    Since $|\langle y,z\rangle|^2$ is nonnegative, this implies $|\langle x,y
    \rangle|^2\le 1$, the Schwarz inequality.
  \end{proof}

  \paragraph{7.}
  \begin{proof}
    For each positive integer $n$, by the Schwarz inequality and (12*),
    \[
      \sum_{k=1}^n|\langle x,e_k\rangle\langle y,e_k\rangle|\le
      \sqrt{\sum_{i=1}^n|\langle x,e_k\rangle|^2}
      \sqrt{\sum_{i=1}^n|\langle y,e_k\rangle|^2} \le
      \|x\|\|y\|.
    \]
    Since all terms in the summation is nonnegative, this implies $\sum_{k=1}
    ^\infty|\langle x,e_k\rangle\langle y,e_k\rangle|\le\|x\|\|y\|$.
  \end{proof}

  \paragraph{8.}
  \begin{proof}
    It follows immediately from Bessel inequality.
  \end{proof}
% end

\subsection{Series Related to Orthonormal Sequences}
  \paragraph{1.}
  \begin{proof}
    By Theorem 3.5-2, $\alpha_k=\langle x,e_k\rangle$. Meanwhile by the
    definition of the norm,
    \[
      \|x\|^2 =
      \left\langle \sum_{k=1}^\infty\langle x,e_k\rangle e_k, x\right\rangle =
      \sum_{k=1}^\infty \langle x,e_k\rangle\langle e_k, x\rangle =
      \sum_{k=1}^\infty|\alpha_k|^2,
    \]
    where the second equality follows from the continuity of the inner product.
  \end{proof}

  \paragraph{3.}
  \begin{solution}
    Put $x\equiv 1$ on $[-\pi,\pi]$ and $e_k=\sin kt$. Since $x$ is even but
    $e_k$ is odd for every $k$, the series does not converges to $x$.
  \end{solution}

  \paragraph{4.}
  \begin{proof}
    By the triangle inequality, $\|x_m+\cdots+x_n\| \le \|x_m\|+\cdots+\|x_n\|$
    for every $n\ge m>0$. Hence the convergence of $\sum \|x_k\|$ implies that
    $s_n$ is a Cauchy sequence.
  \end{proof}

  \paragraph{5.}
  \begin{proof}
    By Prob. 4, $\sum_{k=1}^n x_k$ is a Cauchy sequence. And since $H$ is
    complete, $\sum_{k=1}^\infty x_k$ converges.
  \end{proof}

  \paragraph{7.}
  \begin{proof}
    The existence of $y$ follows from Theorem 3.5-2(c). And for each $k$,
    \[
      \langle x-y,e_k\rangle =
      \langle x,e_k\rangle -
      \sum_{j=1}^\infty\langle x,e_j\rangle\langle e_k,e_j\rangle =
      \langle x,e_k\rangle - \langle x,e_k\rangle = 0,
    \]
    where the second equality comes from the fact that $(e_k)$ is orthonormal.
  \end{proof}

  \paragraph{8.}
    TODO: Show the validation of the change of the order of summation. Or maybe
    we can show the equality directly.
  \begin{proof}
    We suppose that $x\in\bar{M}$ here since the proof of the other direction is
    obvious. Then there exists $(p_n)\subset M$ such that $x=\sum_{n=1}^\infty
    p_n$. For each $n$, suppose $p_n=\sum_{k=1}^\infty \langle p_n,e_k\rangle
    e_k$. This is valid because $p_n\in M$ and therefore is a finite linear
    combination of $(e_k)$. In fact, there are only finitely many nonzero term
    in the summation. Then
    \[
      x=\sum_{n=1}^\infty p_n =
      \sum_{n=1}^\infty\sum_{k=1}^\infty\langle p_n,e_k\rangle e_k=
      \sum_{k=1}^\infty\left(\sum_{n=1}^\infty\langle p_n,e_k\rangle\right)e_k.
    \]
  \end{proof}

  \paragraph{9.}
  \begin{proof}
    First we suppose $\bar{M}_1=\bar{M}_2$. Then by Prob. 8, each $e_n$ and
    $\tilde{e}_n$ can be represented by (a) and (b) respectively.\par
    For the converse, (a) implies, again by Prob. 8, $e_n\in\bar{M}_2$ and
    therefore $M_1\subset\bar{M}_2$. Since $\bar{M}_2$ is closed, $\bar{M}_1
    \subset\bar{M}_2$. \textit{Mutatis mutandis}, this also shows $\bar{M}_2
    \subset\bar{M}_1$. Thus, $\bar{M}_1=\bar{M}_2$.
  \end{proof}

  \paragraph{10.}
  \begin{proof}
    Note that for every $m>0$, there are only finite $e_\kappa$ such that $
    \langle x,e_\kappa\rangle\ge 1/m$. Otherwise we may choose a countable
    subset of them, which will violate the result in Prob. 8, Sec 3.4. Hence,
    the collection of all nonzero Fourier coefficient
    \[
      \bigcup_{m=1}^\infty\{ e_\kappa:\, \langle x,e_\kappa\rangle\ge 1/m \}
    \]
    is at most countable.
  \end{proof}
% end

\subsection{Total Orthonormal Sets and Sequences}
  \paragraph{4.}
  \begin{proof}
    Suppose that $x$ and $y$ satisfy (3). We only show the relation for real
    cases here. The complex cases can be proved in a similar way. Using (9),
    Sec 3.1 and (3),
    \[
      \langle x,y\rangle = \frac{1}{4}(\|x+y\|^2-\|x-y\|^2) =
      \frac{1}{4}\sum_k
      \left(|\langle x+y,e_k\rangle|^2-|\langle x-y,e_k\rangle|^2 \right).
    \]
    Meanwhile,
    \[
      |\langle x\pm y,e_k\rangle|^2=
      \langle x\pm y,e_k\rangle\overline{\langle x\pm y,e_k\rangle}=
      |\langle x,e_k\rangle|^2+|\langle y,e_k\rangle|^2\pm
      2\langle x,e_k\rangle\overline{\langle y,e_k\rangle}.
    \]
    Hence, $\langle x,y\rangle=\sum_k\langle x,e_k\rangle\overline{\langle
    y,e_k\rangle}$.
  \end{proof}

  \paragraph{6.}
  \begin{proof}
    Suppose $M=(e_k)$. We collect the $e_k$ which does not belong to $\spn(e_1,
    \dots,e_{k=1})$ and denote the new sequence by $(\tilde{e}_k)$. Clear that
    $\spn(e_k)=\spn(\tilde{e}_k)$ and $(\tilde{e}_k)$ is linearly independent.
    Let $(f_k)$ be the sequence generated from $(\tilde{e}_k)$ by the
    Gram-Schmidt process. Then clear that $(f_k)$ is orthonormal. And since for
    every $n$, $\spn(\tilde{e}_1,\dots,\tilde{e}_n)=\spn(f_1,\dots,f_n)$,
    $M\subset\spn(\tilde{e}_k)=\spn(f_k)$. Finally, since $M$ is dense in $H$,
    $\overline{\spn(f_k)}=H$. Thus, $(f_k)$ is a total orthonormal sequence of
    $H$.
  \end{proof}

  \paragraph{7.}
  \begin{proof}
    It follows from the definition of the separable Hilbert space and Prob. 6
    immediately.
  \end{proof}

  \paragraph{9.}
  \begin{proof}
    $\langle v,x\rangle=\langle w,x\rangle$ implies $\langle v-w,x\rangle=0$ for
    all $x\in M$, that is, $x\perp M$. Since $M$ is total, by Theorem 3.6-2, $v
    -w=0$.
  \end{proof}

  \paragraph{10.}
  \begin{proof}
    It follows immediately from Theorem 3.6-2(b).
  \end{proof}
% end

\setcounter{subsection}{7}
\subsection{Functionals on Hilbert Spaces}
  \paragraph{3.}
  \begin{proof}
    The linearity follows from the sesquilinearity of the inner product and the
    boundedness from the Schwarz inequality. Furthermore, the Schwarz inequality
    also implies $\|f\|\le\|z\|$. Meanwhile, $\|f\|\ge\|f(z/\|z\|)\|=\|z\|$.
    Thus, $\|f\|=\|z\|$.
  \end{proof}

  \paragraph{4.}
  \begin{proof}
    Clear that the mapping $z\mapsto f$ is an isomorphism since it is
    surjective. And by Theorem 2.10-4, $X\hp$ is a Hilbert space. Hence, $X$ is
    also a Hilbert space.
  \end{proof}

  \paragraph{5.}
  \begin{proof}
    Since $l^2$ is complete. By Theorem 3.8-1, we may define $I:(l^2)\hp\to l^2$
    to be $f\mapsto z$. Clear that $I$ is linear and injective. Meanwhile, it
    preserves the norm. Furthermore, by Prob. 3, it is surjective. Hence, $I$
    is an isomorphism. Thus, $l^2$ is isomorphic to its dual.
  \end{proof}

  \paragraph{12.}
  \begin{proof}
    For every $x\in X$ and $y\in Y$,
    \begin{align*}
      |h(x+\Delta x, y+\Delta y)-h(x, y)|
      &=|h(\Delta x, y)+h(x, \Delta y)+h(\Delta x, \Delta y)| \\
      &\le|h(\Delta x, y)|+|h(x, \Delta y)|+|h(\Delta x, \Delta y)|.
    \end{align*}
    Since $h$ is bounded,
    \[
      |h(x+\Delta x, y+\Delta y)-h(x, y)|\le
      \|h\|(\|\Delta x|\|\|y\|+\|\Delta y|\|\|x\|+\|\Delta x|\|\|\Delta y\|).
    \]
    Thus, $h$ is continuous.
  \end{proof}

  \paragraph{14.}
  \begin{proof}
    If $h(x,x)=0$, then for any $t\in \mathbb{R}$,
    \[
      0\le h(th(y,x)x+y,th(y,x)x+y)=2t|h(x,y)|^2+h(y,y).
    \]
    Hence, $h(x,y)=0$, otherwise we may choose some $t<0$ such that is right
    hand side is negative. Thus, the inequality holds if $h(x,x)=0$.\par
    Now suppose $h(x,x)\ne 0$. Put
    \begin{equation}
      \label{eq:3.8.14}
      z=y-x\frac{h(y, x)}{h(x, x)}
    \end{equation}
    It is easy to verify that $h(z,x)=0$. Multiplying $z$ on the both sides of
    \eqref{eq:3.8.14} yields
    \[
      0\le h(z,z)=h\left(z,y-x\frac{h(y, x)}{h(x, x)}\right)=h(z,y)=
      h(y,y)-\frac{h(x,y)h(y,x)}{h(x,x)}.
    \]
    Thus, $|h(x,y)|^2\le h(x,x)h(y,y)$.
  \end{proof}
% end

\subsection{Hilbert-Adjoint Operator}
  \paragraph{1.}
  \begin{proof}
    By Theorem 3.9-4, $0^*=(0+0)^*=0^*+0^*$. Hence, $0^*=0$. For every $x,y\in
    X$,
    \[
      \langle(I^*-I)x, y\rangle = \langle I^*x, y\rangle-\langle Ix, y\rangle=
      \langle x, Iy\rangle-\langle Ix, y\rangle=0.
    \]
    Hence, by Lemma 3.9-3, $I=I^*$.
  \end{proof}

  \paragraph{2.}
  \begin{proof}
    By Theorem 3.9-4, $T^*(T\inv)^*=(T\inv T)^*=I^*=I$. Hence, $(T^*)\inv=
    (T\inv)^*$.
  \end{proof}

  \paragraph{3.}
  \begin{proof}
    Since $\|T_n^*-T^*\|=\|(T_n-T)^*\|=\|T_n-T\|$, $T_n^*\to T^*$ as long as
    $T_n\to T$.
  \end{proof}

  \paragraph{4.}
  \begin{proof}
    It suffices to show that for all $x_2\in T^*(M_2^\perp)$ and $x_1\in M_1$,
    $\langle x_1,x_2\rangle=0$. $x_2\in T^*(M_2^\perp)$ implies the existence
    of some $y_2\in M_2^\perp$ with $T^*y_2=x_2$. Then
    \[
      \langle x_1,x_2\rangle = \langle x_1,T^*y_2\rangle=
      \langle Tx_1,y_2\rangle = 0,
    \]
    where the last equality comes from the fact that $T(M_1)\subset M_2$ and
    $y_2\in M_2^\perp$. Thus, $M_1^\perp\supset T^*(M_2^\perp)$.
  \end{proof}

  \paragraph{5.}
  \begin{proof}
    By Prob. 4, $T^*(M_2^\perp)\subset M_1^\perp$ implies $M_2^{\perp\perp}
    \supset T(M_1^{\perp\perp})$. Since $M_1$ and $M_2$ are closed, by Prob. 9,
    Sec 3.3, $M_i^{\perp\perp}=M_i$ for $i=1,2$. Thus, $T(M_1)\subset M_2$.
    The converse part has already been proved in Prob. 4.
  \end{proof}

  \paragraph{6.}
  \begin{proof}
    $\,$\par
    (a) Since $T(M_1)=\{0\}\subset H_2$, by Prob. 4, $T^*(H_2)\subset
    M_1^\perp$.\par
    (b) For every $y\in[T(H_1)]^\perp$, $\langle y,Tx\rangle=0$ for all $x\in
    H_1$. Hence, $\langle T^*y, x\rangle=0$. By Lemma 3.8-2, $T^*y=0$ and
    therefore $y\in\mathcal{N}(T^*)$. Thus, $[T(H_1)]^\perp\subset\mathcal{N}
    (T^*)$.\par
    (c) Since $T^{**}=T$, it follows from (b) that $[T^*(H_2)]^\perp\subset
    M_1$. And since $M_1$ is closed, $M_1^{\perp\perp}=M_1$. Therefore, (a)
    implies $[T^*(H_2)]^\perp\supset M_1$. Thus, $M_1=[T^*(H_2)]^\perp$.
  \end{proof}

  \paragraph{7.}
  \begin{proof}
    It follows immediately from Lemma 3.9-3.
  \end{proof}

  \paragraph{8.}
  \begin{proof}
    For every $x\in H$ with $\|x\|=1$,
    \begin{align*}
      \|(I+T^*T)x\|
      &=\|x+T^*Tx\|=\langle x+T^*Tx,x+T^*Tx\rangle\\
      &=\|x\|^2+\|T^*Tx\|^2+\langle x,T^*Tx\rangle+\langle T^*Tx,x\rangle\\
      &=\|x\|^2+\|T^*Tx\|^2+\|Tx\|^2 \\
      &\ge 1.
    \end{align*}
    Then, by Prob 7, Sec 2.7, $I+T^*T$ is invertible.
  \end{proof}

  \paragraph{9.}
  \begin{proof}
    If $T$ can be represent by that form, then $\mathcal{R}(T)$ can be spanned
    by $w_1,\dots,w_n$. Hence, it is finite dimensional.\par
    Now we suppose that $T$ has a finite dimensional range. Let $\{w_1,\dots,
    w_n\}$ be a orthonormal basis of $\mathcal{R}(T)$. Then for every $x\in H$,
    \[
      Tx=\sum_{j=1}^n\varphi_j(x)w_j.
    \]
    Now we show that for each $j$, $\varphi_j$ is a bounded linear functional
    and invoke Riesz's Theorem to complete the proof. It is easy to verify the
    linearity of $\varphi_j$. For every $x$ with norm $1$, since $T$ is bounded
    and $(w_j)$ is orthonormal,
    \[
      \|T\|\ge\left\|\sum_{j=1}^n\varphi_j(x)w_j\right\|\ge |\varphi_j(x)|
    \]
    for each $j=1,\dots,n$. Hence, every $\varphi_j$ is a bounded linear
    functional and therefore can be represented by $\varphi_j(x)=\langle x,v_j
    \rangle$.
  \end{proof}
% end

\paragraph{Self-Adjoint, Unitary and Normal Operators}
  \paragraph{4.}
    We only show the uniqueness here.
  \begin{proof}
    $T_1+iT_2=S_1+iS_2$ implies $T_1-iT_2=S_1-iS_2$. Sum these two equations and
    we get $T_1=S_1$. Meanwhile, it also implies $i(T_1+iT_2)=i(S_1+iS_2)$.
    Summing these two gives $T_2=S_2$.
  \end{proof}

  \paragraph{6.}
  \begin{proof}
    $\,$\par
    (a) We argue by contradiction. Let $k$ be the smallest positive integer such
    that $T^{2k}=0$. Then for every $x\in H$
    \[
      0=\langle T^{2k}x,x\rangle = \langle T^kx,(T^k)^*x\rangle=
      \langle T^kx,T^kx\rangle=\|T^kx\|^2.
    \]
    Hence $T^k=0$, which contradicts with the smallest assumption of $k$. Hence,
    $T^n\ne 0$ for all even positive integer $n$.\par
    (b) If $T^n=0$ for some positive, not necessarily even, integer $n$, then so
    is $T^{2n}=0$. Hence, by (a), $T^n\ne 0$ for all $n\in\mathbb{N}$.
  \end{proof}

  \paragraph{9.}
  \begin{proof}
    Since $T$ is isometric, it preserves the topology. Hence $T(H)$ is closed
    as $H$ is closed.
  \end{proof}

  \paragraph{10.}
  \begin{proof}
    It suffices to show that $T$ is surjective. Let $\{e_1,\dots,e_n\}$ be an
    orthonormal basis of $X$. Then $\{Te_1,\dots,Te_n\}$ is also an orthonormal
    basis since $T$ is isometric. Hence, $T$ is surjective and therefore is
    unitary.
  \end{proof}

  \paragraph{13.}
  \begin{proof}
    It can be verified that $T_n^*T_n\to T^*T$ and $T_nT_n^*\to TT^*$. Since
    $T_n$ are normal, $T_n^*T_n=T_nT_n^*$. Hence,
    \[
      \|T^*T-TT^*\|\le \|T^*T-T_n^*T_n\|+\|T_nT_n^*-TT^*\|\to 0
    \]
    as $n\to\infty$. Thus, $T$ is normal.
  \end{proof}

  \paragraph{15.}
  \begin{proof}
    If $T$ is normal, clear that $\|T^*x\|=\|Tx\|$. Now we suppose $\|Tx\|=\|T^*
    x\|$ for all $x\in H$. Then $\langle TT^*x,x\rangle=\langle T^*Tx,x\rangle$.
    Since $X$ is complex, by Lemma 3.9-3, $TT^*=T^*T$. Namely, $T$ is normal.
    \par
    By (a), for every $x\in H$, $\|T^2x\|=\|T^*Tx\|$. Hence,
    \[
      \|T^2\|=\sup_{\|x\|=1}\|T^2x\|=\sup_{\|x\|=1}\|T^*Tx\|=\|T^*T\|=\|T\|^2,
    \]
    where the last equality comes from Theorem 3.9-4(e).
  \end{proof}
% end


% Copyright 2018-2021 Melvin Eloy Irizarry-Gelpí
\setcounter{chapter}{6}
\chapter{Thin Lenses}
%
In this experiment you will learn about the properties of images produced by thin lenses.
%
\section{Preliminary}
%
Mirrors can be used to redirect the path of light rays. When a ray encounters a mirror, it bounces off. Lenses can also be used to change the direction of light rays. However, a lens uses a different mechanism called \textbf{refraction}.

Refraction is what happens when a ray of light crosses the boundary between two different materials. For example, a light ray traveling through air and encountering a piece of glass. As the ray crosses from air to glass, its direction of travel changes.

Just like for mirrors, the size and shape of a lense affects how it refracts rays of light. You can have \textbf{concave}, \textbf{convex}, or \textbf{planar} (flat) lenses. In the previous experiment, you produced a real image on a screen with a concave mirror. Here you are going to use \textbf{convex lenses} to also produce real images. Strictly speaking, the lenses that you are going to use are \textbf{double convex lenses}, meaning that both the side where light enters the lens, and the side where light exits the lens, are convex.

As for mirrors, you have the distance between the object and the lens ($d_{\text{O}}$), the distance between the image and the lens ($d_{\text{I}}$), and the focal length of the lens ($f$). These three quantities are related via
\begin{equation}
    \frac{1}{d_{\text{O}}} + \frac{1}{d_{\text{I}}} = \frac{1}{f}
\end{equation}
This is the same relation that you found to hold for the concave mirror.

The image produce by the double convex lens might have a different size and orientation as the object, so it is useful again to work with the \textbf{magnification} quantity:
\begin{equation}
    m = \frac{h_{\text{I}}}{h_{\text{O}}} = \frac{d_{\text{I}}}{d_{\text{O}}}
\end{equation}
Here, as before, $h_{\text{I}}$ is the height of the image, and $h_{\text{O}}$ is the height of the object.
%
\section{Experiment}
%
The experiment with the convex lens is very similar to the experiment done with the concave mirror. The only difference is that, since the image from the convex lens is behind the lens, you can use a full screen to project the image instead of the half-screen used before with the mirror. You have two convex lenses available, so you can measure the focal length of each.
%
\section{Analysis}
%
Although the experiment is slightly different, the analysis of the data is exactly the same as done for the concave mirror data. With the position of the object ($x_{\text{O}}$), the position of the lens ($x_{\text{L}}$), and the position of the image ($x_{\text{I}}$), you can calculate the two relevant distances:
\begin{align}
    d_{\text{O}} = \left\vert x_{\text{O}} - x_{\text{L}} \right\vert && d_{\text{I}} = \left\vert x_{\text{I}} - x_{\text{L}} \right\vert
\end{align}
The chart with $1/d_{\text{I}}$ in the vertical axis, and $1/d_{\text{O}}$ in the horizontal axis should have a linear shape. The \textbf{slope} should be:
\begin{equation}
    \text{slope} = -1
\end{equation}
The \textbf{intercept} should correspond to the \textbf{inverse of the focal length} of the lens:
\begin{equation}
    \text{intercept} = \frac{1}{f}
\end{equation}
Taking the inverse gives the focal length:
\begin{equation}
    f = \frac{1}{\text{intercept}}
\end{equation}
You can do this for both lenses. You can also calculate the magnification in two different ways and show that both ways are essentially equivalent.
%
\section{My Data}
%
My data consist of more measurements at different positions than the ones suggested in class. As you can see from Figure \ref{figure.08.10cm} and Figure \ref{figure.08.20cm}, the relation between the inverse distances to the lens is observed. The results are in Table \ref{table.08.results}, and are very close to the expected value.

The magnification can be calculated in two ways. Instead of using height, I used \textbf{width}. In the end it does not matter, as long as you are consistent (in the sense that you cannot divide a height by a width). As can be seen from Table \ref{table.08.magnification.10cm} and \ref{table.08.magnification.20cm}, both ways of calculating magnification give similar results. However, it was hard to accurately measure the size of the smaller images. This is reflected in repeated values for the width. In this sense, the distance measurements provide a more refined way of estimating the magnification.
%
\section{Your Data}
%
You should have positions and heights for both double convex lenses.
%
% \newpage
% \section{Your Report}
% %
% Your report should include the following:
% \begin{itemize}
%     \item Tables like Table \ref{table.08.position.10cm} and \ref{table.08.position.20cm} with the raw position data for both lenses.
%     \item Tables like Table \ref{table.08.magnification.10cm} and \ref{table.08.magnification.20cm} with the calculated magnification using the size and also distance.
%     \item Figures like Figure \ref{figure.08.10cm} and \ref{figure.08.20cm} with the inverse distance data. Include the best-fit line and display the equation.
%     \item A table like Table \ref{table.08.results} with your results for the slope and the focal length for each lens. Include the percent difference.
%     \item Answer the following question: Which approach to calculating the magnification is more accurate and why?
% \end{itemize}
%
\newpage
\section{Tables}
%
\begin{table}[ht]
    \centering
    \begin{tabular}{r|r|r}
        $x_{\text{O}}$ (cm) & $x_{\text{L}}$ (cm) & $x_{\text{I}}$ (cm) \\
        \hline
        10 & 25 & 56.9 \\
        10 & 30 & 51.4 \\
        10 & 35 & 52.6 \\
        10 & 40 & 55.3 \\
        10 & 45 & 59.5 \\
        10 & 50 & 63.6 \\
        10 & 55 & 68 \\
        10 & 60 & 72.8 \\
        10 & 65 & 77.7 \\
        10 & 70 & 82.5 \\
        \hline
        \end{tabular}
    \caption{Raw Position Data for 10 cm Double Convex Lens}
    \label{table.08.position.10cm}
\end{table}
%
\begin{table}[ht]
    \centering
    \begin{tabular}{r|r}
        $w_{\text{I}}$ (cm) & $w_{\text{O}}$ (cm) \\
        \hline
        3.8 & 2 \\
        2 & 2 \\
        1.4 & 2 \\
        1 & 2 \\
        0.8 & 2 \\
        0.6 & 2 \\
        0.4 & 2 \\
        0.4 & 2 \\
        0.4 & 2 \\
        0.3 & 2 \\
        \hline
    \end{tabular}
    \caption{Raw Width Data for 10 cm Double Convex Lens}
    \label{table.08.width.10cm}
\end{table}
%
\begin{table}[ht]
    \centering
    \begin{tabular}{r|r}
        $w_{\text{I}} / w_{\text{O}}$ & $d_{\text{I}} / d_{\text{O}}$ \\
        \hline
        1.9 & 2.127 \\
        1 & 1.070 \\
        0.7 & 0.704 \\
        0.5 & 0.510 \\
        0.4 & 0.414 \\
        0.3 & 0.340 \\
        0.2 & 0.289 \\
        0.2 & 0.256 \\
        0.2 & 0.231 \\
        0.15 & 0.208 \\
        \hline
    \end{tabular}
    \caption{Magnification for 10 cm Double Convex Lens}
    \label{table.08.magnification.10cm}
\end{table}
%
\begin{table}[ht!]
    \centering
    \begin{tabular}{r|r|r}
        $x_{\text{O}}$ (cm) & $x_{\text{L}}$ (cm) & $x_{\text{I}}$ (cm) \\
        \hline
        5 & 30.7 & 120 \\
        5 & 94.1 & 120 \\
        10 & 36.4 & 120 \\
        10 & 93.4 & 120 \\
        15 & 42 & 120 \\
        15 & 93.1 & 120 \\
        20 & 47.5 & 120 \\
        20 & 92.6 & 120 \\
        25 & 53.6 & 120 \\
        25 & 91.1 & 120 \\
        30 & 59.8 & 120 \\
        30 & 89.1 & 120 \\
        35 & 67.6 & 120 \\
        35 & 87.6 & 120 \\
        \hline
        \end{tabular}
    \caption{Raw Position Data for 20 cm Double Convex Lens}
    \label{table.08.position.20cm}
\end{table}
%
\begin{table}[ht]
    \centering
    \begin{tabular}{r|r}
        $w_{\text{I}}$ (cm) & $w_{\text{O}}$ (cm) \\
        \hline
        6.3 & 2 \\
        0.6 & 2 \\
        5.8 & 2 \\
        0.6 & 2 \\
        5.4 & 2 \\
        0.7 & 2 \\
        4.8 & 2 \\
        0.8 & 2 \\
        4.1 & 2 \\
        0.7 & 2 \\
        3.6 & 2 \\
        0.9 & 2 \\
        2.9 & 2 \\
        1.4 & 2 \\
        \hline
    \end{tabular}
    \caption{Raw Width Data for 20 cm Double Convex Lens}
    \label{table.08.width.20cm}
\end{table}
%
\begin{table}[ht]
    \centering
    \begin{tabular}{r|r}
        $w_{\text{I}} / w_{\text{O}}$ & $d_{\text{I}} / d_{\text{O}}$ \\
        \hline
        3.15 & 3.475 \\
        0.3 & 0.291 \\
        2.9 & 3.167 \\
        0.3 & 0.319 \\
        2.7 & 2.889 \\
        0.35 & 0.344 \\
        2.4 & 2.636 \\
        0.4 & 0.377 \\
        2.05 & 2.322 \\
        0.35 & 0.437 \\
        1.8 & 2.020 \\
        0.45 & 0.523 \\
        1.45 & 1.607 \\
        0.7 & 0.616 \\
        \hline
    \end{tabular}
    \caption{Magnification for 20 cm Double Convex Lens}
    \label{table.08.magnification.20cm}
\end{table}
%
\begin{table}[ht]
    \centering
    \begin{tabular}{l|r|r|r}
        & \textbf{Expected Value} & \textbf{Observed Value} & \textbf{P.D.} (\%) \\
        \hline
        \textbf{Slope for 10 cm Double Convex Lens} & \textminus 1 & \textminus 1.004 & 0.04 \\
        $f$ \textbf{for 10 cm Double Convex Lens} & 10 cm & 10.22 cm & 2.19 \\
        \textbf{Slope for 20 cm Double Convex Lens} & \textminus 1 & \textminus 0.992 & \textminus 0.84 \\
        $f$ \textbf{for 20 cm Double Convex Lens} & 20 cm & 20.13 cm & 0.64 \\
        \hline
    \end{tabular}
    \caption{Results}
    \label{table.08.results}
\end{table}
%
\FloatBarrier
\newpage
\section{Figures}
%
\begin{figure}[ht]
    \centering
    \includegraphics[scale=0.74]{image/08-lenses/10cm.pdf}
    \caption{Linear Fit for 10 cm Double Convex Lens}
    \label{figure.08.10cm}
\end{figure}
%
\begin{figure}[ht]
    \centering
    \includegraphics[scale=0.74]{image/08-lenses/20cm.pdf}
    \caption{Linear Fit for 20 cm Double Convex Lens}
    \label{figure.08.20cm}
\end{figure}
%


\subsection{Impact of REV Size on Estimated Parameters}

The appropriateness of the REV size was tested using eight different sample REV radii and running the homogenization and parameter estimation algorithms for each. The assumed REV radius for the parameter estimation simulations is $4m$, which corresponds to a homogenization area of $57.7 m^2$. To validate this assumption, the REV radii is sampled at $0.5m$ intervals to see where the resultant parameters converge.

The convergence of three of the 11 parameters is shown in Figure \ref{fig:revconverge} as a function of REV size. The material parameters apparently converge at different sizes, illustrating part of the challenge in defining an REV; some parameters require a larger REV than others and it is not obvious \textit{a priori} which parameters will dominate. For the granite rock mass considered, an REV of radius $3m$ or with a homogenization area of $34.8 m^2$ is chosen to be the minimum size based on the convergence of the dilation angle - the last parameter to converge. The suitability of the assumed REV size is confirmed since it is larger than the minimum REV size determined by the convergence study.


%!TEX root = main.tex

% =============================================================================
\section{The Cost Model of  LSM Trees}
\label{sec:tuning_lsm_trees}
% =============================================================================

In this section, we provide the detailed cost model used in {\Endure} to
    accurately capture the behavior of an LSM tree.
Following prior work on LSM trees \cite{Dayan2018a, Luo2020}, we focus on four
    types of operations: point queries that return an empty result, point
    queries that have a match, range queries, and writes.

\subsection{Model Basics}

When modeling the read cost of LSM trees, a key quantity to accurately capture
    is the amount of extra read I/Os that take place.
While Bloom filters are used to minimize those, they allow a small fraction of
    false positives.
In particular, a point lookup probes a run's filter before accessing the run in
    secondary storage.
If the filter returns negative, the target key does not exist in the run, and
    so the lookup skips accessing the run and saves one I/O.
If a filter returns positive, then the target key may exist in the run, so the
    lookup probes the run at a cost of one I/O.
If the run actually contains the key, the lookup terminates.
Otherwise, we have a \emph{false positive} and the lookup continues to probe
    the next run.
False positives increase the I/O cost of lookups.
The false positive rate ($\epsilon$) of a standard Bloom filter desinged to
query $\mathbf{n}$ entries using a bit-array of size $\mathbf{m}$ is shown by
    \cite{Tarkoma2012} to be calculated as follows:
\begin{equation*}
\label{eq:bloom}
    \epsilon = e^{-\frac{\mathbf{m}}{\mathbf{n}} \cdot \ln(2)^2}.
\end{equation*}
Note that the above equation assumes the use of an optimal number of hash
    functions in the Bloom filter~\cite{enwiki:1025193696}.

Classically, LSM tree based key-value stores use the same number of
    bits-per-entry across all Bloom filters. This means that a lookup probes
    on average %{\small
    $ O\left(e^{-\nicefrac{\mfilt}{N}}\right)$%}
    of the runs,
    where $\mfilt$ is the overall amount of main memory allocated to the
    filters.
As $\mfilt$ approaches 0 or infinity, the term
    %{\small
    $O\left(e^{-\nicefrac{\mfilt}{N}}\right)$%}
    approaches 1 or 0
    respectively.
Here, we build on of the state-of-the-art Bloom filter allocation
    strategy proposed in Monkey \cite{Dayan2017,Dayan2018a} that uses different
    false positive rates at different levels of the LSM tree to offer
    optimal memory allocation; for a size ratio {\sizeratio}, the false positive rate
    corresponding to the Bloom filter at the level $i$ is given by
\begin{equation}
\label{eq:bloom2}
    f_i(T) = \frac{T^{\frac{T}{T-1}}}{T^{L(T)+1-i}}\cdot e^{-\frac{\mfilt}{N}\ln(2)^2}.
\end{equation}

Additionally, false positive rates for all levels satisfy $0 \leq f_i(T) \leq 1$.
It should be further noted that Monkey optimizes false positive rates at
    individual levels to minimize the worst case average cost of empty point
    queries.
Non-empty point query costs, being significantly lower than those of empty point
    queries, are not considered during the optimization process.

\Paragraph{LSM Tree Design \& System Parameters}
In Tables \ref{tab:model-design-params}, \ref{tab:model-system-params},
    and \ref{tab:workload-params} of Section \ref{sec:notation} we introduced
    the key design and system parameters needed to model LSM tree performance.
In addition to those parameters,
there are two auxiliary and derived parameters we use in the detailed cost model
    presented in this section: the potential storage asymmetry in reads and writes (\asym) and
    the expected selectivity of range queries (\querySel).

%Table \ref{tab:other-params} summarizes a few
%    auxiliary and derived parameters we use in the detailed cost model
%    presented in this section.
%These include the potential storage asymmetry in reads and writes (\asym) and
%    the expected selectivity of range queries (\querySel).

%\begin{table}[h]\centering
%\renewcommand{\arraystretch}{1.1}
%\begin{tabular}{cl}
%    \toprule
%    Term & Definition \\
%    \midrule
%        \asym & Read/write asymmetry in storage access cost  \\
%        \querySel & Expected selectivity of range queries  \\
%    \bottomrule
%\end{tabular}
%\caption{Auxiliary and derived LSM tree parameters.}
%    \label{tab:other-params}
%\end{table}

\subsection{The Cost Model}

In this section, we model the costs in terms of expected number of I/O
    operations required for the fulfillment of the individual queries.

\Paragraph{Expected Empty Point Query Cost ($Z_0$)}
A point query that returns an empty result will have to visit all levels (and
    every sorted run of every level for tiering) where false positives in the
    Bloom filters trigger I/O operations.
Thus, the expected number of I/O operations per level depend on the Bloom filter
    memory allocation at that level.
Hence, Equation \eqref{eq:read} expresses $Z_0$ in terms of the false positive
    rates at each level:
\begin{equation}
\label{eq:read}
Z_0(\configuration) =
\begin{cases}
{\color{white} (T-1) \cdot} \sum_{i=1}^{L(T)} f_i(T),	&  \text{if }\policy=\text{leveling} \\[4pt]
(T-1) \cdot \sum_{i=1}^{L(T)} f_i(T) ,	&  \text{if }\policy=\text{tiering}.  \\
\end{cases} \\
\end{equation}
In the leveling policy, each level has exactly one run.
On the other hand, with tiering policy, each level has up to $(T-1)$ runs.
All runs at the same level in tiering have equal false positives rates
    on account of their equal sizes.

\Paragraph{Expected Non-empty Point Query Cost ($Z$)}
There are two components to the expected non-empty point query
    cost.
First, we assume that the probability of a point query finding a non-empty
    result in a level is proportional to the size of the level.
Thus, the probability of such a query being satisfied on level $i$ by a unit
    cost I/O operation is simply
    $\frac{(T-1)T^{i-1}}{N_f(T)}\frac{\mbuf}{E}$, where $N_f(T)$ denotes the
    number of entries in a tree completely full upto $L(T)$ levels. Thus,

\begin{equation}
N_f(T) = \sum_{i=1}^{L(T)} (T-1)T^{i-1}\frac{\mbuf}{E}.
\end{equation}

Second, we assume that all levels preceding level $i$ trigger I/O
    operations with probability equivalent to the false positive rates of the
    Bloom filters at those levels.
Similar to the empty point queries, the expected cost of such failed
    I/Os on preceding levels is simply $\sum_{j=1}^{i-1}f_j(T)$.
In the case of tiering, we assume that on average, the entry is found in the
    middle run of the level resulting in an additional
    $\frac{(T-2)}{2}\cdot f_i(T)$ extra I/O operations.
Thus, we can compute the non-empty point query cost as an expectation over the
    entry being found on any of the $L(T)$ levels of the tree as follows:

\begin{equation}
\label{eq:read-non-empty}
Z_1(\configuration) =
\begin{cases}
    \sum_{i=1}^{L(T)} \frac{(T-1)T^{i-1}}{N_f(T)} \frac{\mbuf}{E} \bigg\{1 +
    \sum_{j=1}^{i-1}f_j(T)\bigg\}, &\text{if } \policy=\text{leveling} \\[8pt]
    \sum_{i=1}^{L(T)} \frac{(T-1)T^{i-1}}{N_f(T)} \frac{\mbuf}{E} \bigg\{1 +
        (T-1)\sum_{j=1}^{i-1}&f_j(T)\\
    {\color{white}\sum_{i=1}^{L(T)} \frac{(T-1)T^{i-1}}{N_f(T)}} +
\frac{(T-2)}{2}\cdot f_i(T)\bigg\}, &\text{if } \policy=\text{tiering}.  \\
\end{cases}
\end{equation}

\Paragraph{Range Queries Cost ($Q$)}
A range query issues $L(T)$ or $L(T) \cdot (\sizeratio-1)$ disk seeks
    (one per run) for leveling and tiering respectively.
Each seek is followed by a sequential scan. The cumulative number of pages
    scanned over all runs is $\querySel \cdot \frac{N}{B}$, where {\querySel}
    is the average proportion of all entries included in range lookups.
Hence, the overall range lookup cost $Q$ in terms of pages reads is as follows:

\begin{equation}
\label{eq:range}
Q(\configuration) =
\begin{cases}
    \querySel \cdot \frac{N}{B} + L(T),  ~~ & \text{if } \policy=\text{leveling}  \\[5pt]
    \querySel \cdot \frac{N}{B} + L(T) \cdot (\sizeratio-1)  , \qquad     & \text{if } \policy=\text{tiering.}  \\
\end{cases}  \\
\end{equation}

\Paragraph{Write Cost ($W$)}
We model worst-case writing cost assuming that the vast majority
    of incoming entries do not overlap.
This means that most entries will have to propagate through all levels of the
    LSM tree.
Following the state-of-the-art write cost model, we assume that every
    written item participated in $\approx \frac{\sizeratio-1}{\sizeratio}$ and
    $\approx \frac{\sizeratio-1}{2}$ merges with tiering and leveling
    respectively.
We multiply these costs by $L(T)$ since each entry gets merged across all
    levels, and we divide by the page size $B$ to get the units in terms of
    I/Os.
Since LSM trees often employ solid-state storage that has asymmetric cost for
    reads and writes, we represent this storage asymmetry as $\asym$.
For example, a device for which a write operation is twice as expensive as a
    read operation has $\asym=2$.
The overall I/O cost is captured by Equation \eqref{eq:write}:
\begin{equation}
\label{eq:write}
W(\configuration) =
\begin{cases}
    \frac{L(T)}{B} \cdot  \frac{ (\sizeratio-1)}{2  } \cdot (1 + \asym) ,  ~~ & \text{if } \policy=\text{leveling}\\[5pt]
    \frac{L(T)}{B} \cdot  \frac{ (\sizeratio-1)}{\sizeratio  } \cdot (1 + \asym) ,  \qquad    & \text{if }
    \policy=\text{tiering.}  \\
\end{cases}  \\
\end{equation}
When $\sizeratio$ is set to 2, tiering and leveling behave identically, so the
    two parts of the equation produce the same result.

\Paragraph{Total Expected Cost}
The total expected operation cost,
    $\cost(\workload, \configuration)$, is computed by
    weighing the empty point lookup cost $Z_0(\configuration)$ from
    Equation~\eqref{eq:read}, the non-empty point lookup cost
    $Z(\configuration)$ from Equation~\eqref{eq:read-non-empty}, the range
    lookup cost $Q(\configuration)$ from Equation~\eqref{eq:range}, and the
    write cost $W(\configuration)$ from Equation~\eqref{eq:write} by their
    proportion in the workload represented by the terms $z_0$, $z$, $q$ and $w$
    respectively\footnote{Note that $z_0 + z_1 + q + w = 1$}.
This is the exact computation of the cost done in Equation~\eqref{eq:thecost}
    and in the definitions of the {\nominal} and {\robustw} problems
    (Equations~\eqref{eq:nominal_problem} and~\eqref{eq:robust_workload_problem}
    respectively).


\documentclass[12pt]{scrartcl}

\input{preamble}

\makeatletter
\title{Hack 2.0}\let\Title\@title
\subtitle{Computer Science I\\
{\small
\vskip1cm
Department of Computer Science \& Engineering \\
University of Nebraska--Lincoln}
\vskip-1cm}
%\author{Dr.\ Chris Bourke}
\date{~}
\makeatother

\begin{document}

\maketitle

\hrule

\input{instructions.tex}

\section*{Problem Statement}

Consider two locations, an origin and a destination, on the globe
identified by their latitude and longitude.  The distance between
these two locations can be computed using the Spherical Law of
Cosines.  In particular, the distance $d$ is
 $$d = \arccos{(\sin(\varphi_1) \sin(\varphi_2) + \cos(\varphi_1) \cos(\varphi_2) \cos(\Delta) )} \cdot R$$
where
\begin{itemize}
  \item $\varphi_1$ is the latitude of location $A$, $\varphi_2$ is the latitude of location $B$
  \item $\Delta$ is the difference between location $B$'s longitude and location $A$'s longitude
  \item $R$ is the (average) radius of the earth, 6,371 kilometers
\end{itemize}

Write a program that \emph{prompts} the user to enter the latitude
and longitude of two locations and then computes the distance between them using
the above formula.  Note that latitude inputs will be in degrees and in the
range $[-90, 90]$ and longitude will be in degrees in the range $[-180, 180]$.
Negative values correspond to the western and southern hemispheres.

Note that the formula above assumes that latitude and longitude are
measured in radians $r$, $-\pi \leq r \leq \pi$.  You can convert from
degrees $deg$ to radians $r$ using the formula
  $$r = \frac{deg}{180} \cdot \pi$$

Your output should look something like the following.

\begin{minted}{text}
Location Distance
========================
Origin:      (41.948300, -87.655600)
Destination: (40.820600, -96.705600)
Air distance is 764.990931 kms
\end{minted}

\section*{Instructions}

\begin{itemize}
  \item You are encouraged to collaborate any number of students
  before, during, and after your scheduled hack session.
  \item Design at least 3 test cases \emph{before} you begin
  designing or implementing your program.  Test cases are
  input-output pairs that are known to be correct using means
  other than your program.
  \item Include the name(s) of everyone who worked together on
  this activity in your source file's header.
  \item Name your program \mintinline{text}{airDistance.c}, and
  turn it in via webhandin, making sure that it runs and executes
  correctly in the webgrader.  Each individual student will need
  to hand in their own copy and will receive their own individual
  grade.
  \item Remember to RTM (Read The Manual) on the math library
  to see which function(s) you may find useful and how to use
  them.
  \item Depending on your compiler/system configuration you \emph{may}
  need to use the \mintinline{text}{-lm} flag to link in the math
  library when compiling.  For example:

  \mintinline{text}{gcc -lm airDistance.c}

  or in some systems (ubuntu/CS50):

  \mintinline{text}{gcc airDistance.c -lm }

\end{itemize}

\end{document}


\documentstyle[11pt,reduce]{article}
\date{}
\title{A Vector Algebra and Calculus Package for REDUCE}
\author{David Harper \\
Astronomy Unit \\
Queen Mary and Westfield College \\
University of London \\
Mile End Road \\
London E1 4NS \\
England \\[0.05in]
Electronic mail: {\it adh@star.qmw.ac.uk}}
\begin{document}
\maketitle

\index{AVECTOR package}

\section{Introduction}

This package \footnote{Reference: Computer Physics Communications,
{\bf 54}, 295-305 (1989)}
is written in RLISP (the LISP meta-language) and is
intended for use with REDUCE 3.4. \index{vector algebra} It provides
REDUCE with the ability to perform vector algebra using the same
notation as scalar algebra.  The basic algebraic operations are
supported, as are differentiation and integration of vectors with
respect to scalar variables, cross product and dot product, component
manipulation and application of scalar functions ({\em e.g.} cosine)
to a vector to yield a vector result.

A set of vector calculus operators are provided for use with any
orthogonal curvilinear coordinate system. These operators are
gradient, divergence, curl and del-squared (Laplacian).  The Laplacian
operator can take scalar or vector arguments.

Several important coordinate systems are pre-defined and can be
invoked by name. It is also possible to create new coordinate systems
by specifying the names of the coordinates and the values of the scale
factors.

\section{Vector declaration and initialisation}

Any name may be declared to be a vector, provided that it has
not previously been declared as a matrix or an array. To
declare a list of names to be vectors use the VEC command:
\index{VEC command}
\begin{verbatim}
   VEC A,B,C;
\end{verbatim}
declares the variables {\tt A}, {\tt B} and {\tt C} to be vectors.
If they have already been assigned (scalar) values, these will be lost.

When a vector is declared using the {\tt VEC} command, it does not
have an initial value.

If a vector value is assigned to a scalar variable, then that
variable will automatically be declared as a vector and the
user will be notified that this has happened.

\index{AVEC function}
A vector may be initialised using the {\tt AVEC} function which
takes three scalar arguments and returns a vector made up
from those scalars. For example
\begin{verbatim}
   A := AVEC(A1, A2, A3);
\end{verbatim}
sets the components of the vector {\tt A} to {\tt A1}, {\tt A2} and {\tt A3}.

\section{Vector algebra}

(In the examples which follow, {\tt V}, {\tt V1}, {\tt V2} {\em etc}
are assumed to be vectors while {\tt S}, {\tt S1}, {\tt S2} etc are scalars.)

\index{+ ! vector} \index{- ! vector} \index{* ! vector} \index{/ ! vector}
The scalar algebra operators +,-,* and / may be used with
vector operands according to the rules of vector algebra.
Thus multiplication and division of a vector by a scalar
are both allowed, but it is an error to multiply or
divide one vector by another.

\begin{tabular}{l l}
{\tt V := V1 + V2 - V3;} & Addition and subtraction \\
{\tt V := S1*3*V1;} & Scalar multiplication \\
{\tt V := V1/S;} & Scalar division \\
{\tt V := -V1;} & Negation \\
\end{tabular}

\index{DOT ! vector} \index{Dot product} \index{CROSS ! vector}
\index{cross product}
\noindent Vector multiplication is carried out using the infix
operators {\tt DOT} and {\tt CROSS}. These are defined to have
higher precedence than scalar multiplication and
division.

\begin{tabular}{l l}
{\tt V := V1 CROSS V2;} & Cross product \\
{\tt S := V1 DOT V2;} & Dot product \\
{\tt V := V1 CROSS V2 + V3;} & \\
{\tt V := (V1 CROSS V2) + V3;} & \\
\end{tabular}

The last two expressions are equivalent due to the precedence of
the {\tt CROSS} operator.

\index{VMOD operator}
The modulus of a vector may be calculated using the {\tt VMOD} operator.

\begin{verbatim}
   S := VMOD V;
\end{verbatim}

A unit vector may be generated from any vector using the {\tt VMOD}
operator.

\begin{verbatim}
   V1 := V/(VMOD V);
\end{verbatim}

Components may be extracted from any vector using index notation
in the same way as an array.

\begin{tabular}{l l}
{\tt V := AVEC(AX, AY, AZ);} & \\
{\tt V(0);} & yields AX \\
{\tt V(1);} & yields AY \\
{\tt V(2);} & yields AZ \\
\end{tabular}

It is also possible to set values of individual components. Following
from above:

\begin{verbatim}
   V(1) := B;
\end{verbatim}

The vector {\tt V} now has components {\tt AX}, {\tt B}, {\tt AZ}.

\index{vector ! differentiation} \index{vector ! integration}
\index{differentiation ! vector} \index{differentiation ! vector}
Vectors may be used as arguments in the differentiation and
integration routines in place of the dependent expression.

\begin{tabular}{l l}
{\tt V := AVEC(X**2, SIN(X), Y);} & \\
{\tt DF(V,X);} & yields (2*X, COS(X), 0) \\
{\tt INT(V,X);} & yields (X**3/3, -COS(X), Y*X) \\
\end{tabular}

Vectors may be given as arguments to monomial functions such as {\tt
SIN}, {\tt LOG} and {\tt TAN}. The result is a vector obtained by
applying the function component-wise to the argument vector.

\begin{tabular}{l l}
{\tt V := AVEC(A1, A2, A3);} & \\
{\tt SIN(V);} & yields (SIN(A1), SIN(A2), SIN(A3)) \\
\end{tabular}

\section{ Vector calculus}

\index{DIV ! operator} \index{divergence ! vector field}
\index{GRAD ! operator} \index{gradient ! vector field}
\index{CURL ! operator} \index{curl ! vector field}
\index{DELSQ ! operator} \index{Laplacian ! vector field}
The vector calculus operators div, grad and curl are recognised.
The Laplacian operator is also available and may be applied to
scalar and vector arguments.

\begin{tabular}{l l}
{\tt V := GRAD S;} & Gradient of a scalar field \\
{\tt S := DIV V;} & Divergence of a vector field \\
{\tt V := CURL V1;} & Curl of a vector field \\
{\tt S := DELSQ S1;} & Laplacian of a scalar field \\
{\tt V := DELSQ V1;} & Laplacian of a vector field \\
\end{tabular}

These operators may be used in any orthogonal curvilinear coordinate
system. The user may alter the names of the coordinates and the values
of the scale factors. Initially the coordinates are {\tt X}, {\tt Y}
and {\tt Z} and the scale factors are all unity.

\index{COORDS vector} \index{HFACTORS scale factors}
There are two special vectors : {\tt COORDS} contains the names
of the coordinates in the current system and {\tt HFACTORS}
contains the values of the scale factors.

\index{COORDINATES operator}
The coordinate names may be changed using the {\tt COORDINATES}
operator.

\begin{verbatim}
   COORDINATES R,THETA,PHI;
\end{verbatim}

This command changes the coordinate names to {\tt R}, {\tt THETA} and
{\tt PHI}.

\index{SCALEFACTORS operator}
The scale factors may be altered using the {\tt SCALEFACTORS} operator.

\begin{verbatim}
   SCALEFACTORS(1,R,R*SIN(THETA));
\end{verbatim}

This command changes the scale factors to {\tt 1}, {\tt R} and {\tt R
SIN(THETA)}.

Note that the arguments of {\tt SCALEFACTORS} must be enclosed in
parentheses. This is not necessary with {\tt COORDINATES}.

When vector differential operators are applied to an expression,
the current set of coordinates are used as the independent
variables and the scale factors are employed in the calculation.
(See, for example, Batchelor G.K. 'An Introduction to Fluid
Mechanics', Appendix 2.)

\index{"!*CSYSTEMS global (AVECTOR)}
Several coordinate systems are pre-defined and may be invoked by
name. To see a list of valid names enter

\begin{verbatim}
   SYMBOLIC !*CSYSTEMS;
\end{verbatim}

and REDUCE will respond with something like

\begin{verbatim}
   (CARTESIAN SPHERICAL CYLINDRICAL)
\end{verbatim}

\index{GETCSYSTEM command}
To choose a coordinate system by name, use the command {\tt GETCSYSTEM}.

To choose the Cartesian coordinate system :
\begin{verbatim}
   GETCSYSTEM 'CARTESIAN;
\end{verbatim}
\index{PUTCSYSTEM command}

Note the quote which prefixes the name of the coordinate system. This
is required because {\tt GETCSYSTEM} (and its complement {\tt
PUTCSYSTEM}) is a {\tt SYMBOLIC} procedure which requires a literal
argument.

REDUCE responds by typing a list of the coordinate names in that
coordinate system. The example above would produce the response

\begin{verbatim}
   (X Y Z)
\end{verbatim}

whilst

\begin{verbatim}
   GETCSYSTEM 'SPHERICAL;
\end{verbatim}

would produce

\begin{verbatim}
   (R THETA PHI)
\end{verbatim}

Note that any attempt to invoke a coordinate system is subject to the
same restrictions as the implied calls to {\tt COORDINATES} and {\tt
SCALEFACTORS}.  In particular, {\tt GETCSYSTEM} fails if any of the
coordinate names has been assigned a value and the previous coordinate
system remains in effect.

A user-defined coordinate system can be assigned a name using the
command {\tt PUTCSYSTEM}. It may then be re-invoked at a later stage using
{\tt GETCSYSTEM}.

\example\index{AVECTOR package ! example}

We define a general coordinate system with coordinate names {\tt
X},{\tt Y},{\tt Z} and scale factors {\tt H1},{\tt H2},{\tt H3} :

\begin{verbatim}
   COORDINATES X,Y,Z;
   SCALEFACTORS(H1,H2,H3);
   PUTCSYSTEM 'GENERAL;
\end{verbatim}

This system may later be invoked by entering

\begin{verbatim}
   GETCSYSTEM 'GENERAL;
\end{verbatim}

\section{Volume and Line Integration}

Several functions are provided to perform volume and line integrals.
These operate in any orthogonal curvilinear coordinate system and
make use of the scale factors described in the previous section.

Definite integrals of scalar and vector expressions may be calculated
using the {\tt DEFINT} function.

\example\index{AVECTOR package ! example}

\index{DEFINT function} \index{integration ! definite (simple)}
\index{definite integration (simple)}
\noindent To calculate the definite integral of $\sin(x)^2$ between 0 and
2$\pi$ we enter

\begin{verbatim}
   DEFINT(SIN(X)**2,X,0,2*PI);
\end{verbatim}

This function is a simple extension of the {\tt INT} function taking
two extra arguments, the lower and upper bounds of integration
respectively.

\index{VOLINTEGRAL function} \index{integration ! volume}
Definite volume integrals may be calculated using the {\tt
VOLINTEGRAL} function whose syntax is as follows :

\noindent {\tt VOLINTEGRAL}({\tt integrand}, vector {\tt lower-bound},
vector {\tt upper-bound});

\example\index{AVECTOR package ! example}

\noindent In spherical polar coordinates we may calculate the volume of a
sphere by integrating unity over the range $r$=0 to {\tt RR}, $\theta$=0 to
{\tt PI}, $\phi$=0 to 2*$\pi$ as follows :

\begin{tabular}{l l}
{\tt VLB := AVEC(0,0,0);} & Lower bound \\
{\tt VUB := AVEC(RR,PI,2*PI);} & Upper bound in $r, \theta, \phi$
 respectively \\
{\tt VOLINTORDER := (0,1,2);} & The order of integration \\
{\tt VOLINTEGRAL(1,VLB,VUB);} & \\
\end{tabular}

\index{VOLINTORDER vector}
Note the use of the special vector {\tt VOLINTORDER} which controls
the order in which the integrations are carried out. This vector
should be set to contain the number 0, 1 and 2 in the required order.
The first component of {\tt VOLINTORDER} contains the index of the
first integration variable, the second component is the index of the
second integration variable and the third component is the index of
the third integration variable.

\example\index{AVECTOR package ! example}

Suppose we wish to calculate the volume of a right circular cone. This
is equivalent to integrating unity over a conical region with the
bounds:

\begin{tabular}{l l}
z = 0 to H  & (H = the height of the cone) \\
r = 0 to pZ & (p = ratio of base diameter to height) \\
phi = 0 to 2*PI & \\
\end{tabular}

We evaluate the volume by integrating a series of infinitesimally thin
circular disks of constant z-value. The integration is thus performed
in the order : d($\phi$) from 0 to $2\pi$, dr from 0 to p*Z, dz from 0 to H.
The order of the indices is thus 2, 0, 1.

\begin{verbatim}
   VOLINTORDER := AVEC(2,0,1);
   VLB := AVEC(0,0,0);
   VUB := AVEC(P*Z,H,2*PI);
   VOLINTEGRAL(1,VLB,VUB);
\end{verbatim}

(At this stage, we replace {\tt P*H} by {\tt RR}, the base radius of the cone,
to obtain the result in its more familiar form.)

\index{LINEINT function} \index{DEFLINEINT function}
\index{integration ! line} \index{line integrals}
Line integrals may be calculated using the {\tt LINEINT} and {\tt DEFLINEINT}
functions. Their general syntax is

\noindent {\tt LINEINT}({\tt vector-function}, {\tt vector-curve},
{\tt variable});

\noindent{\tt DEFLINENINT}({\tt vector-function}, {\tt vector-curve},
{\tt variable}, {\tt lower-bound}, {\tt upper-bound});

\noindent where
\begin{description}
\item[{\tt vector-function}] is any vector-valued expression;
\item[{\tt vector-curve}] is a vector expression which describes the path of
integration in terms of the independent variable;
\item[{\tt variable}] is the independent variable;
\item[{\tt lower-bound}]
\item[{\tt upper-bound}] are the bounds of integration in terms of the
independent variable.
\end{description}

\example\index{AVECTOR package ! example}

In spherical polar coordinates, we may integrate round a line of
constant theta (`latitude') to find the length of such a line. The
vector function is thus the tangent to the `line of latitude', (0,0,1)
and the path is {\tt (0,LAT,PHI)} where {\tt PHI} is the independent
variable. We show how to obtain the definite integral {\em i.e.} from
$\phi=0$ to $2 \pi$ :
\begin{verbatim}
DEFLINEINT(AVEC(0,0,1),AVEC(0,LAT,PHI),PHI,0,2*PI);
\end{verbatim}

\section{Defining new functions and procedures}

Most of the procedures in this package are defined in symbolic mode
and are invoked by the REDUCE expression-evaluator when a vector
expression is encountered. It is not generally possible to define
procedures which accept or return vector values in algebraic mode.
This is a consequence of the way in which the REDUCE interpreter
operates and it affects other non-scalar data types as well : arrays
cannot be passed as algebraic procedure arguments, for example.

\section{Acknowledgements}

This package was written whilst the author was the U.K. Computer
Algebra Support Officer at the University of Liverpool Computer Laboratory.
\end{document}