From dc76fc91c1430a1d0bd9808dbdff2af3d9c94cc0 Mon Sep 17 00:00:00 2001 From: sreahw Date: Mon, 2 Jun 2025 18:53:14 +0100 Subject: [PATCH 1/2] Update numbers_and_sets.tex various small typos --- IA_M/numbers_and_sets.tex | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/IA_M/numbers_and_sets.tex b/IA_M/numbers_and_sets.tex index 6ef74d4..f50147d 100644 --- a/IA_M/numbers_and_sets.tex +++ b/IA_M/numbers_and_sets.tex @@ -241,7 +241,7 @@ \subsection{Sets} $(A=B)\Leftrightarrow (A\subseteq B \text{ and }B\subseteq A)$ \end{thm} -Suppose $X$ is a set and $P$ is the property of some elements in $x$, we can write a set $\{x\in X:P(x)\}$ for the subset of $x$ comprising of the elements for which $P(x)$ is true. e.g.\ $\{n\in \N : n \text{ is prime}\}$ is the set of all primes. +Suppose $X$ is a set and $P$ is the property of some elements in $X$, we can write a set $\{x\in X:P(x)\}$ for the subset of $X$ comprising of the elements for which $P(x)$ is true. e.g.\ $\{n\in \N : n \text{ is prime}\}$ is the set of all primes. \begin{defi}[Intersection, union, set difference, symmetric difference and power set] Given two sets $A$ and $B$, we define the following: @@ -314,7 +314,7 @@ \subsection{Functions} \end{eg} \begin{defi}[Bijective function] - A function is \emph{bijective} if it is both injective and surjective. i.e.\ it hits everything exactly once. + A function is \emph{bijective} if it is both injective and surjective, i.e.\ it hits everything exactly once. \end{defi} \begin{defi}[Permutation] @@ -322,7 +322,7 @@ \subsection{Functions} \end{defi} \begin{defi}[Composition of functions] - The \emph{composition} of two functions is a function you get by applying one after another. In particular, if $f: X \rightarrow Y$ and $G: Y\rightarrow Z$, then $g\circ f: X \rightarrow Z$ is defined by $g\circ f(x) = g(f(x))$. Note that function composition is associative. + The \emph{composition} of two functions is a function you get by applying one after another. In particular, if $f: X \rightarrow Y$ and $g: Y\rightarrow Z$, then $g\circ f: X \rightarrow Z$ is defined by $g\circ f(x) = g(f(x))$. Note that function composition is associative. \end{defi} \begin{defi}[Image of function] @@ -447,7 +447,7 @@ \subsection{Relations} \begin{defi}[Equivalence relation] A relation is an \emph{equivalence relation} if it is reflexive, symmetric and transitive. e.g.\ (i) and (vi) in the above examples are equivalence relations. \end{defi} -If it is an equivalence relation, we usually write $\sim$ instead of $R$. As the name suggests, equivalence relations are used to describe relations that are similar to equality. For example, if we want to represent rational numbers as a pair of integers, we might have an equivalence relation defined by $(n, m)\sim (p, q)$ iff $nq = mp$, such that two pairs are equivalent if they represent the same rational number. +If it is an equivalence relation, we usually write $\sim$ instead of $R$. As the name suggests, equivalence relations are used to describe relations that are similar to equality. For example, if we want to represent rational numbers as pairs of integers, we might have an equivalence relation defined by $(n, m)\sim (p, q)$ iff $nq = mp$, such that two pairs are equivalent if they represent the same rational number. \begin{eg} If we consider a deck of cards, define two cards to be related if they have the same suite. @@ -640,7 +640,7 @@ \subsection{Euclid's Algorithm} \[ \frac{57}{21} = 2 + \cfrac{1}{1 + \cfrac{1}{2 + \cfrac{1}{2}}} \] -Expanding this continued fractions term by term, we can have the sequence $2, 2 + \frac{1}{1} = 3$, $2 + \frac{1}{1 + \frac{1}{2}} = \frac{8}{3}$. These are called the ``convergents''. The sequence happens to be $\frac{A_i}{B_i}$. +Expanding this continued fraction term by term, we can have the sequence $2, 2 + \frac{1}{1} = 3$, $2 + \frac{1}{1 + \frac{1}{2}} = \frac{8}{3}$. These are called the ``convergents''. The sequence happens to be $\frac{A_i}{B_i}$. \subsection{Primes} There are a lot of ways we can define prime numbers in $\N$. The definition we will use is the following: @@ -653,7 +653,7 @@ \subsection{Primes} \end{thm} \begin{proof} - If $n\in \N$ is not a prime itself, then by definition $n = ab$. If either $a$ or $b$ is not prime, then that number can be written as a product, say $b = cd$. Then $n = acd$ and so on. Since these numbers are getting smaller, and the process will stop when they are all prime. + If $n\in \N$ is not a prime itself, then by definition $n = ab$. If either $a$ or $b$ is not prime, then that number can be written as a product, say $b = cd$. Then $n = acd$ and so on. Since these numbers are getting smaller, the process will stop when they are all prime. \end{proof} In the proof, we handwaved a bit when we said ``and so on''. We will later come up with the principle of (strong) induction that rigorously justifies this. This is the case for many proofs we will have here. @@ -697,9 +697,9 @@ \subsection{Primes} \end{proof} \begin{cor} - If $p$ is a prime and $p\mid n_1n_2\cdots n_i$, then $p \mid n_i$ for some $i$. + If $p$ is a prime and $p\mid n_1n_2\cdots n_k$, then $p \mid n_i$ for some $i$. \end{cor} -Note that when we defined primes, we defined it in terms of factors of $p$. This corollary is the opposite --- it is about how $p$ behaves as a factor of other numbers. +Note that when we defined $p$ to be prime, we defined it in terms of factors of $p$. This corollary is the opposite --- it is about how $p$ behaves as a factor of other numbers. \begin{thm}[Fundamental Theorem of Arithmetic] Every natural number is expressible as a product of primes in exactly one way. In particular, if $p_1p_2\cdots p_k = q_1q_2\cdots q_l$, where $p_i, q_i$ are primes but not necessarily distinct, then $k = l$. $q_1, \cdots q_l$ are $p_1, \cdots p_k$ in some order. @@ -812,7 +812,7 @@ \subsection{Basic counting} &= \sum_x 1 - \sum_i\sum_x i_{A_i}(x) + \sum_{i < j}\sum_x i_{A_i\cap A_j}(x) - \cdots\\ & + \sum_x (-1)^ni_{A_1\cap A_2\cap A_3\cap \cdots \cap A_n}(x)\\ &= |X| - \sum_i |A_i| + \sum_{i < j}|A_i\cap A_j|\\ - & - \sum_{i < j < k}|A_i\cap A_j\cap A_k| + \cdots + (-1)^n|A_1\cap A_2\cap \cdots A_n|\qedhere + & - \sum_{i < j < k}|A_i\cap A_j\cap A_k| + \cdots + (-1)^n|A_1\cap A_2\cap \cdots \cap A_n|\qedhere \end{align*} \end{proof} @@ -910,7 +910,7 @@ \subsection{Combinations} \begin{eg} A bank prepares a letter for each of its $n$ customers, saying how much it cares. (Each of these letters costs the customer $\pounds 40$) There are $n!$ ways to put the letters in the envelopes. In how many ways can this be done so that no one gets the right letter (i.e.\ how many \emph{derangements} are there of $n$ elements)? - We let $X$ be the set of all envelopings (permutation of $n$). $|X| = n!$. For each $i$, let $A_i = \{x\in X: x \text{ assigns the correct letter to customer }i\}$. We want to know $|\bigcap_i \bar A_i|$. We know that $|A_i| = (n - 1)!$ since $i$'s letter gets in $i$'s envelopes and all others can be placed randomly. We have $|A_i\cap A_j| = (n - 2)!$ as well. Similarly, $|A_i\cap A_j \cap A_k| = (n - 3)!$. + We let $X$ be the set of all envelopings (permutation of $n$). $|X| = n!$. For each $i$, let $A_i = \{x\in X: x \text{ assigns the correct letter to customer }i\}$. We want to know $|\bigcap_i \bar A_i|$. We know that $|A_i| = (n - 1)!$ since $i$'s letter gets in $i$'s envelope and all others can be placed randomly. We have $|A_i\cap A_j| = (n - 2)!$ as well. Similarly, $|A_i\cap A_j \cap A_k| = (n - 3)!$. By the inclusion-exclusion formula, we have \begin{align*} @@ -973,7 +973,7 @@ \subsection{Well-ordering and induction} Suppose we have $n + 1$ rings. We can move the top $n$ rings to peg C, then move the bottom ring to peg B, then move the $n$ rings from $C$ back to $B$. Assuming $P(n)$ is true, this needs at most $2\times (2^n - 1) + 1 = 2^{n + 1} -1 $ moves. - Can we do it in fewer moves? To succeed, we must free the bottom ring, so we must shift the top $n$ rings to another pe.g.\ This needs $\geq 2^n - 1$ moves by $P(n)$. Then we need to shift the bottom ring. Then we need to shift the $n$ smaller rings to the big one. This needs $\geq 2^n - 1$ moves by $P(n)$. So this needs $\geq 2^{n + 1} - 1$ moves altogether. + Can we do it in fewer moves? To succeed, we must free the bottom ring, so we must shift the top $n$ rings to another peg. This needs $\geq 2^n - 1$ moves by $P(n)$. Then we need to shift the bottom ring. Then we need to shift the $n$ smaller rings to the big one. This needs $\geq 2^n - 1$ moves by $P(n)$. So this needs $\geq 2^{n + 1} - 1$ moves altogether. So we showed that $P(n)\Rightarrow P(n + 1)$ (we used $P(n)$ four times). By the WPI, $P(n)$ is true for all $n$. \end{eg} @@ -987,7 +987,7 @@ \subsection{Well-ordering and induction} \end{thm} \begin{proof} - Let $P(n)$ be the statement ``for any sets $A_1\cdots A_n$'', we have $|A_1\cup \cdots \cup A_n| = \sum_i|A_i| - \sum_{i < j} |A_i\cap A_j| + \cdots \pm |A_i\cap A_2\cap \cdots \cap A_n|$''. + Let $P(n)$ be the statement ``for any sets $A_1\cdots A_n$'', we have $|A_1\cup \cdots \cup A_n| = \sum_i|A_i| - \sum_{i < j} |A_i\cap A_j| + \cdots \pm |A_1\cap A_2\cap \cdots \cap A_n|$''. $P(1)$ is trivially true. $P(2)$ is also true (see above). Now given $A_1 \cdots A_{n + 1}$, Let $B_i = A_i\cap A_{n + 1}$ for $1 \leq i\leq n$. We apply $P(n)$ both to the $A_i$ and $B_i$. @@ -1049,7 +1049,7 @@ \subsection{Well-ordering and induction} }; \end{tikz} \end{center} - Let $P(n)$ be the statement $n - 1$ mutants produces $n$ animals. Given some tree with $n$ animals, remove the top mutant to get two sub-trees, with $n_1$ and $n_2$ animals, where $n_1 + n_2 = n$. If $P(k)$ is true $\forall k < n$, then $P(n_1)$ and $P(n_2)$ are true. So the total number of mutants is $1 + (n_1 - 1) + (n_2 - 1) = n - 1$. So $P(n)$ is true. Hence by strong principle of induction, $P(n)$ is true for all $n$. + Let $P(n)$ be the statement ``$n - 1$ mutants produces $n$ animals''. Given some tree with $n$ animals, remove the top mutant to get two sub-trees, with $n_1$ and $n_2$ animals, where $n_1 + n_2 = n$. If $P(k)$ is true $\forall k < n$, then $P(n_1)$ and $P(n_2)$ are true. So the total number of mutants is $1 + (n_1 - 1) + (n_2 - 1) = n - 1$. So $P(n)$ is true. Hence by strong principle of induction, $P(n)$ is true for all $n$. \end{eg} \begin{thm} @@ -1059,7 +1059,7 @@ \subsection{Well-ordering and induction} \begin{proof} Clearly the strong principle implies the weak principle since if $P(n)\Rightarrow P(n + 1)$, then $(P(1)\wedge P(2)\wedge \cdots \wedge P(n))\Rightarrow P(n + 1)$. - Now show that the weak principle implies the strong principle. Suppose that $P(1)$ is true and $(\forall n)\,P(1)\wedge P(2)\wedge \cdots \wedge P(n - 1)\Rightarrow P(n)$. We want to show that $P(n)$ is true for all $n$ using the weak principle. + Now we show that the weak principle implies the strong principle. Suppose that $P(1)$ is true and $(\forall n)\,P(1)\wedge P(2)\wedge \cdots \wedge P(n - 1)\Rightarrow P(n)$. We want to show that $P(n)$ is true for all $n$ using the weak principle. Let $Q(n) = $ ``$P(k)$ is true $\forall k\leq n$''. Then $Q(1)$ is true. Suppose that $Q(n)$ is true. Then $P(1)\wedge P(2)\wedge\cdots \wedge P(n)$ is true. So $P(n+1)$ is true. Hence $Q(n + 1)$ is true. By the weak principle, $Q(n)$ is true for all $n$. So $P(n)$ is true for all $n$. \end{proof} @@ -1554,7 +1554,7 @@ \subsubsection*{Construction of real numbers} \end{enumerate} Similarly, $s\in X$ is a \emph{greatest lower bound} (or \emph{infimum}) if $s$ is a lower bound and any lower bound $t \leq s$. \end{defi} -By definition, the least upper bound for $S$, if exists, is unique. +By definition, the least upper bound for $S$, if it exists, is unique. The problem with $\Q$ is that if we let $S = \{q\in \Q: q^2 < 2\}$, then it has no supremum in $\Q$. @@ -1612,7 +1612,7 @@ \subsubsection*{Construction of real numbers} Note that these cases differ by $\sup S\in S$ but $\sup T\not\in T$. $S$ has a maximum element $1$ and the maximum is the supremum. $T$ doesn't have a maximum, but the supremum can still exist. \end{eg} -The real numbers has a rather interesting property. +The real numbers have a rather interesting property. \begin{thm}[Axiom of Archimedes] Given $r\in \R$, there exists $n\in \N$ with $n > r$. \end{thm} From cc99a40b41d063d14d6e7088980cb56a9a57911d Mon Sep 17 00:00:00 2001 From: sreahw Date: Thu, 12 Jun 2025 19:26:22 +0100 Subject: [PATCH 2/2] Update numbers_and_sets.tex --- IA_M/numbers_and_sets.tex | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/IA_M/numbers_and_sets.tex b/IA_M/numbers_and_sets.tex index f50147d..db16ccd 100644 --- a/IA_M/numbers_and_sets.tex +++ b/IA_M/numbers_and_sets.tex @@ -749,7 +749,7 @@ \subsection{Basic counting} \item $i_A = i_B \Leftrightarrow A = B$ \item $i_{A\cap B} = i_A i_B$ \item $i_{\bar{A}} = 1 - i_A$ - \item $i_{A\cup B} = 1 - i_{\overline{A\cup B}} = 1 - i_{\bar A\cap \bar B} = 1 - i_{\bar{A}}i_{\bar{B}} = 1 - (1 - i_A)(1 - i_B) = i_A + i_B - i_{A\cap B}$. + \item $i_{A\cup B} = 1 - i_{\overline{A\cup B}} = 1 - i_{\bar A\cap \bar B} = 1 - i_{\bar{A}}i_{\bar{B}} = 1 - (1 - i_A)(1 - i_B) = i_A + i_B - i_{A\cap B}$ \item $i_{A\setminus B} = i_{A\cap \bar B} = i_Ai_{\bar B} = i_A(1 - i_B) = i_A - i_{A\cap B}$ \end{enumerate} \end{prop} @@ -780,7 +780,7 @@ \subsection{Basic counting} \begin{proof} \begin{align*} - |A\cup B| &= \sum_{x\in X} i_{A(x)\cup B(x)}\\ + |A\cup B| &= \sum_{x\in X} i_{A\cup B}(x)\\ &= \sum (i_A(x) + i_B(x) - i_{A\cap B}(x))\\ &= \sum i_A(x) + \sum i_B(x) - \sum i_{A\cap B}(x)\\ &= |A| + |B| - |A\cap B|\qedhere @@ -791,7 +791,7 @@ \subsection{Basic counting} \begin{thm}[Inclusion-Exclusion Principle] Let $A_i$ be subsets of a finite set $X$, for $1 \leq i\leq n$. Then \[ - |\bar A_1\cap \cdots \cap \bar A_n| = |X| - \sum_i |A_i| + \sum_{i < j}|A_i\cap A_j| - \cdots + (-1)^n|A_1\cap \cdots A_n|. + |\bar A_1\cap \cdots \cap \bar A_n| = |X| - \sum_i |A_i| + \sum_{i < j}|A_i\cap A_j| - \cdots + (-1)^n|A_1\cap \cdots \cap A_n|. \] Equivalently, \[ @@ -810,9 +810,9 @@ \subsection{Basic counting} \intertext{Thus} |\bar A_1\cap \cdots \cap \bar A_n| &= \sum_{x\in X} i_{\bar A_1\cap \bar A_2\cap \cdots \cap \bar A_n}(x)\\ &= \sum_x 1 - \sum_i\sum_x i_{A_i}(x) + \sum_{i < j}\sum_x i_{A_i\cap A_j}(x) - \cdots\\ - & + \sum_x (-1)^ni_{A_1\cap A_2\cap A_3\cap \cdots \cap A_n}(x)\\ + & \phantom{=} + \sum_x (-1)^ni_{A_1\cap A_2\cap A_3\cap \cdots \cap A_n}(x)\\ &= |X| - \sum_i |A_i| + \sum_{i < j}|A_i\cap A_j|\\ - & - \sum_{i < j < k}|A_i\cap A_j\cap A_k| + \cdots + (-1)^n|A_1\cap A_2\cap \cdots \cap A_n|\qedhere + & \phantom{=} - \sum_{i < j < k}|A_i\cap A_j\cap A_k| + \cdots + (-1)^n|A_1\cap A_2\cap \cdots \cap A_n|. \qedhere \end{align*} \end{proof} @@ -1015,8 +1015,8 @@ \subsection{Well-ordering and induction} \end{thm} Note that (i) is redundant as it follows from (ii), but we state it for clarity. -\begin{eg} - ``Evolutionary trees'' Imagine that we have a mutant that can produce two offsprings. Each offspring is either an animal or another mutant. A possible evolutionary tree is as follows: +\begin{eg}[Evolutionary trees] +Imagine that we have a mutant that can produce two offsprings. Each offspring is either an animal or another mutant. A possible evolutionary tree is as follows: \tikzstyle{level 1}=[level distance=1cm, sibling distance=3.5cm] \tikzstyle{level 2}=[level distance=1cm, sibling distance=2cm] @@ -1131,7 +1131,7 @@ \subsection{Well-ordering and induction} \section{Modular arithmetic} We are going to study \emph{modular arithmetic}. In modular arithmetic, we first pick a particular natural number to be the \emph{modulus}, say 7. Then we consider two numbers to be ``equal'' if their difference is a multiple of the modulus. For example, modulo 7, we will think that 3 and 10 are ``the same'', while 2 and 4 are different. -We will study arithmetic under this number system. Like the integers, we are allowed to add and multiply numbers. However, while in $\Z$, we can only divide by 1 and -1, in modular arithmetic, more numbers can be divided. For example, modulo 10, we are allowed to divide by 3. +We will study arithmetic under this number system. Like the integers, we are allowed to add and multiply numbers. However, while in $\Z$, we can only divide by 1 and $-1$, in modular arithmetic, more numbers can be divided. For example, modulo 10, we are allowed to divide by 3. An important application of modular arithmetic is RSA encryption. This is a widely deployed asymmetric encryption algorithm. By asymmetric, we mean that the key for encryption is different from the key for decryption. This is very useful in real life, since we can broadcast the encryption key to the world, and keep the decryption key to ourselves. This way anyone can send you encrypted messages that only you can decrypt. @@ -1175,7 +1175,7 @@ \subsection{Modular arithmetic} Since $a\equiv b\pmod m$ and $u\equiv v \pmod m$, we have $m \mid (a - b)u + b(u - v) = au - bv$. So $au \equiv bv \pmod m$. \end{proof} -This means that we can do arithmetic modulo $n$. Formally, we are doing arithmetic with the congruence classes, i.e $\Z_m$. For example, in $\Z_7$, $[4] + [5] = [9] = [2]$. +This means that we can do arithmetic modulo $n$. Formally, we are doing arithmetic with the congruence classes, i.e.\ $\Z_m$. For example, in $\Z_7$, $[4] + [5] = [9] = [2]$. Modular arithmetic can sometimes be used to show that equations have no solutions. \begin{eg} @@ -1229,7 +1229,7 @@ \subsection{Modular arithmetic} \begin{proof} Let $d = (a, m)$. If there is a solution to $ax \equiv b\pmod m$, then $m \mid ax - b$. So $d \mid ax - b$ and $d \mid b$. - On the contrary, if $d \mid b$, we have $ax \equiv b\pmod m \Leftrightarrow ax - b = km$ for some $k\in Z$. Write $a = da'$, $b = db'$ and $m = dm'$. So $ax\equiv b\pmod m \Leftrightarrow da'x - db' = dkm'\Leftrightarrow a'x - b' = km'\Leftrightarrow a'x \equiv b'\pmod {m'}$. Note that $(a', m') = 1$ since we divided by their greatest common factor. Then this has a unique solution modulo $m'$. + On the contrary, if $d \mid b$, we have $ax \equiv b\pmod m \Leftrightarrow ax - b = km$ for some $k\in \Z$. Write $a = da'$, $b = db'$ and $m = dm'$. So $ax\equiv b\pmod m \Leftrightarrow da'x - db' = dkm'\Leftrightarrow a'x - b' = km'\Leftrightarrow a'x \equiv b'\pmod {m'}$. Note that $(a', m') = 1$ since we divided by their greatest common factor. Then this has a unique solution modulo $m'$. \end{proof} \begin{eg} @@ -1275,7 +1275,7 @@ \subsection{Multiple moduli} \begin{proof} $(\Rightarrow)$ If $\exists u$ such that $cu \equiv 1 \pmod {mn}$, then $cu \equiv 1\pmod m$ and $cu\equiv 1\pmod n$. So $c$ is a unit mod $m$ and $n$. - $(\Leftarrow)$ Suppose there exists $u, v$ such that $cu\equiv 1\pmod m$ and $cv \equiv 1\pmod n$. Then by CRT, $\exists w$ with $w\equiv u \pmod m$ and $w\equiv v\pmod n$. Then $cw\equiv cu\equiv 1\pmod m$ and $cw\equiv cv\equiv 1\pmod n$. + $(\Leftarrow)$ Suppose there exist $u, v$ such that $cu\equiv 1\pmod m$ and $cv \equiv 1\pmod n$. Then by CRT, $\exists w$ with $w\equiv u \pmod m$ and $w\equiv v\pmod n$. Then $cw\equiv cu\equiv 1\pmod m$ and $cw\equiv cv\equiv 1\pmod n$. But we know that $1\equiv 1\pmod m$ and $1\equiv 1\pmod n$. So $1$ is a solution to $cw \equiv 1\pmod m$, $cw\equiv 1\pmod n$. By the ``uniqueness'' part of the Chinese remainder theorem, we must have $cw\equiv 1\pmod {mn}$. \end{proof} @@ -1319,7 +1319,7 @@ \subsection{Prime moduli} \end{thm} \begin{proof} - If $p$ is a prime, then $1, 2, \cdots, p - 1$ are units. Among these, we can pair each number up with its inverse (e.g.\ 3 with 4 in modulo 11). The only elements that cannot be paired with a different number are $1$ and $-1$, who are self-inverses, as show below: + If $p$ is a prime, then $1, 2, \cdots, p - 1$ are units. Among these, we can pair each number up with its inverse (e.g.\ 3 with 4 in modulo 11). The only elements that cannot be paired with a different number are $1$ and $-1$, who are self-inverses, as shown below: \begin{align*} &\;x^2 \equiv 1\pmod p\\ \Leftrightarrow&\; p \mid (x^2 - 1)\\ @@ -1413,7 +1413,7 @@ \subsubsection*{Tossing a coin over a phone} We can test whether a large number is prime by doing Fermat-like checks. We choose random numbers and take it to the $(p - 1)$th power and see if they become 1. If it is not 1, then it is definitely not a prime. If we do sufficiently many tests that all result in 1, we can be sufficiently certain that it is a prime (even though not with 100\% certainty). -(Recent advancements in algorithms have found efficient ways of deterministic prime test, but they are generally slower than the above algorithm and is not widely used) +(Recent advancements in algorithms have found efficient ways of deterministic prime test, but they are generally slower than the above algorithm and are not widely used) It is currently believed that it is hard to prime factorize a number, so this is secure as far as we know. \subsubsection*{RSA encryption} @@ -1482,7 +1482,7 @@ \subsubsection*{Construction of integers} We write $a$ for $[(a, 0)]$ and $-a$ for $[(0, a)]$, and define the operations by \begin{align*} (a, b) + (c, d) &= (a + c, b + d)\\ - (a, b)\times (c, d) &= (ac + bd, bd + ad). + (a, b)\times (c, d) &= (ac + bd, bc + ad). \end{align*} We can check that these are well-defined and satisfy the usual properties. \end{defi} @@ -1515,7 +1515,7 @@ \subsubsection*{Construction of rationals} \end{defi} \begin{prop} - $\Q$ is a totally ordered-field. + $\Q$ is a totally ordered field. \end{prop} Examples of non-totally-ordered fields include $\Z_p$, which is a field but not totally ordered. @@ -1672,9 +1672,9 @@ \subsubsection*{Construction of real numbers} \end{defi} The requirement that $R$ has no minimum corresponds to our (arbitrary) decision that the rationals should be embedded as \[ - q\mapsto \{x\in q: x \leq \Q\}, \{x\in \Q: x> q\}, + q\mapsto \{x\in \Q: x \leq q\}, \{x\in \Q: x> q\}, \] -instead of $q\mapsto \{x\in q: x < \Q\}, \{x\in \Q: x \geq q\}$, +instead of $q\mapsto \{x\in \Q: x < q\}, \{x\in \Q: x \geq q\}$, We can then construct the set $\R$ from $\Q$ by letting $\R$ be the set of all Dedekind cuts. The supremum of any bounded set of real numbers is obtained by taking the union of (the left sides) of the Dedekind cuts. The definition of the arithmetic operations is left as an exercise for the reader (to actually define them is tedious but not hard). @@ -1759,11 +1759,11 @@ \subsection{Sequences} We will now prove the following basic properties of convergence: \begin{thm}\leavevmode \begin{enumerate} - \item If $a_n\to a$ and $a_n\to b$, then $a = b$ (i.e.\ limits are unique) + \item If $a_n\to a$ and $a_n\to b$, then $a = b$. (i.e.\ limits are unique) \item If $a_n \to a$ and $b_n = a_n$ for all but finitely many $n$, then $b_n \to a$. \item If $a_n = a$ for all $n$, then $a_n \to a$. - \item If $a_n\to a$ and $b_n\to b$, then $a_n + b_n \to a+ b$ - \item If $a_n\to a$ and $b_n \to b$, then $a_nb_n\to ab$ + \item If $a_n\to a$ and $b_n\to b$, then $a_n + b_n \to a+ b$. + \item If $a_n\to a$ and $b_n \to b$, then $a_nb_n\to ab$. \item If $a_n\to a\not= 0$, and $\forall n(a_n \not= 0)$. Then $1/a_n \to 1/a$. \item If $a_n \to a$ and $b_n \to a$, and $\forall n(a_n\leq c_n\leq b_n)$, then $c_n \to a$. (Sandwich theorem) \end{enumerate} @@ -1775,7 +1775,7 @@ \subsection{Sequences} \begin{enumerate} \item Suppose instead $a < b$. Then choose $\varepsilon = \frac{b - a}{2}$. By the definition of the limit, $\exists N_1$ such that $\forall n\geq N_1$, $|a_n - a| < \varepsilon$. There also $\exists N_2$ st. $\forall n\geq N_2$, $|a_n - b| < \varepsilon$. - Let $N = \max\{N_1, N_2\}$. If $n\geq \max\{N_1, N_2\}$, then $|a - b| \leq |a - a_n| + |a_n - b| < 2\varepsilon = b - a.$ + Let $N = \max\{N_1, N_2\}$. If $n\geq N$, then $|a - b| \leq |a - a_n| + |a_n - b| < 2\varepsilon = b - a.$ Contradiction. So $a = b$. \item Given $\varepsilon > 0$, there $\exists N_1$ st. $\forall n\geq N_1$, we have $|a_n - a| < \varepsilon$. Since $b_n = a_n$ for all but finitely many $n$, there exists $N_2$ such that $\forall n\geq N_2$, $a_n = b_n$. @@ -1784,7 +1784,7 @@ \subsection{Sequences} \item Given $\varepsilon > 0$, $\exists N_1$ such that $\forall n\geq N_1$, we have $|a_n - a| < \varepsilon/2$. Similarly, $\exists N_2$ such that $\forall n\geq N_2$, we have $|b_n - b| < \varepsilon/2$. Let $N = \max\{N_1, N_2\}$. Then $\forall n \geq N$, $|(a_n + b_n) - (a + b)| \leq |a_n - a| + |b_n - b| < \varepsilon$. - \item Given $\varepsilon > 0$, Then there exists $N_1, N_2, N_3$ such that + \item Given $\varepsilon > 0$, there exist $N_1, N_2, N_3$ such that \begin{align*} &\forall n\geq N_1: |a_n - a| < \frac{\varepsilon}{2(|b| + 1)}\\ &\forall n\geq N_2: |b_n - b| < \frac{\varepsilon}{2|a|}\\ @@ -2017,7 +2017,7 @@ \subsection{Algebraic numbers} \section{Countability} After messing with numbers, we finally get back to sets. Here we are concerned about the sizes of sets. We can count how big a set is by constructing bijections. Two sets have the same number of things if there is a bijection between them. In particular, a set has $n$ things if we can bijection it with $[n] = \{1, 2, 3, \cdots, n\}$. -First prove a few preliminary properties about bijecting with $[n]$ that should be obviously true. +First we prove a few preliminary properties about bijecting with $[n]$ that should be obviously true. \begin{lemma} If $f:[n] \to [n]$ is injective, then $f$ is bijective.