MPS115/MPS116 PRESENTATION LAB 3
This week we’ll use a different text editor as an alternative to TeXworks.
If you’re using Linux or macOS, rather than Windows, then it is fine to stick with your usual editor in this lab. However, if you are feeling adventurous and on top of everything then you could always experiment with a different editor, such as Visual Studio Code with LaTeX Workshop; you should be able to find instructions online.
Remember, text editors are just software used to type in LaTeX commands, so all the things learnt so far still apply.
On the Start Menu, search for TeXmaker and start it. If it’s not there, install it from the Software Center.
If you can’t get TeXmaker to work, you should just use TeXworks instead for this week.
Once TeXmaker has started, create a LaTeX document (using File | New on the
menu bar). In TeXmaker you process a LaTeX file by pressing the blue arrow
next to ‘Quick build’.
If you haven’t done so already, start a new file. Include the usual preamble (using
documentclass, begin and end document commands etc). You could just cut and
paste the preamble from the Lab 2 attempt on the website. Save it as
lab_3.tex.
Add the title ‘MPS115: Lab 3 Experiments’. Include the American Mathematical
Society (AMS) packages with the commands in the preamble, before your
\begin{document}.
\usepackage{amssymb}
\usepackage{amsthm}
\begin{enumerate}, and typeset the
following as the first \item.
Once you’ve typed it in, see what happens as you move your cursor past the brackets in the code.
\item on
your list.
The construction you are trying to get here is called an ‘underbrace’. Getting
text underneath something is usally done with the subscript underscore _.
The command \text{} allows text in maths mode and should help with the
‘ times’.
You get ‘’
with \cdots.
amssymb package allows you to use ‘Blackboard bold’ font which you
will sometimes need. Can you typeset the following using the \mathbb{}
command?
There is an online tool called ‘Detexify’ that can help you find the LaTeX command for a given symbol. Try it.
Start a new section called ‘The square-root of 2’. Here we’re going to experiment
further with environments, in particular the ‘thoerem-like’ environments provided
by the amsthm package.
We are going to investigate a solution of the
equation
\begin{equation}
x^2=2.
\end{equation}
Process this. The equation environment creates a numbered
equation.
\label{eq:root-2} after \begin{equation}.
The positive solution to equation~(\ref{eq:root-2})
is denoted $\sqrt{2}$.
and process the file. Does it work? If you see ‘??’ on your PDF, run it again. (LaTeX has to run twice to get autoreferencing to work.)
Now let’s make our first theorem. Add the following to the preamble after the
line where you include the amsthm package.
\newtheorem{thm}{Theorem}[section]
This will create a new environment called thm, which is numbered inside
sections. In the body of the document, write
\begin{thm}
The real number $\sqrt{2}$ is irrational.
\end{thm}
Process the file, and look at the output. The theorem should be numbered something like 2.1, where the 2 refers to the section number. Underneath the theorem, write
\begin{proof}
We prove this by contradiction. First we assume
that $\sqrt{2}$ is rational and so can be written
as $a/b$ for \emph{coprime} integers $a$ and $b$.
Blah blah blah.
\end{proof}
Here we’ve written rather than . Which looks better? In this case, I don’t think there’s a right answer.
We’ve started the proof by relying on a certain mathematical fact. Let’s include this as a lemma: a lemma is a short, usually uninteresting result in its own right which is used as an intermediate step towards a proposition or theorem. In order of importance, theorems come above propositions, which come above lemmas.
To include the lemma, you should first add the following in the preamble after
the \newtheorem{thm} command.
\newtheorem{lem}[thm]{Lemma}
This creates a new environment called lem, which is numbered the same as the
thm environment. Using this new environment, put a lemma before the statement
of the theorem that looks like the following.
When you process the file, notice how the numbering for the theorem automatically changes.
Add the following commands in the preamble after \newtheorem{lem}.
\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
Now change the line where you defined
into
a definition using \begin{defn} and \end{defn} to make the following.
Again, the numbering will automatically change. Look carefully at how the
lemma and the definition are typeset and see if you can find the difference that
\theoremstyle{definition} has made.
Here the amsthm package is using the mathematical typesetting convention is
that the statements of theorems, propositions and lemmas are typeset with
slanted text, whereas defintions are typeset with upright text. Experiment with
labelling and referencing your definition, lemma and theorem which is done in
the same way as for equations.
You can read more about how the \newtheorem command works on the webpage
http://en.wikibooks.org/wiki/LaTeX/Theorems.
Make sure you finish off the sheet. You can compare your work to the attempt provided on the module webpage. Also make sure you look at the ’model solution’ to the previous homework.
Create a document with title ‘MPS115: Homework 3’ (or ‘MPS116’) and your name on as author. Using the work you started in this sheet, write a good account of what the square root of is and why it is irrational by adding proper proofs of the lemma and theorem.
More specifically, you need to include a detailed proof of why any rational number can be written as in such a way that and are coprime, and you also need a full proof that is irrational.
Hand in printouts of the PDF and LaTeX files at next week’s lab, as usual.
_____________________________________________________________________
We are going to investigate a solution of the equation
|
| (1) |
Definition 4.1. The positive solution to equation (1) is denoted .
Proof. Suppose that we have a rational number where and are integers with . Blah blah blah. □
Proof. We prove this by contradiction. First we assume that is rational and so can be written as for coprime integers and . Blah blah blah. □