alexandria/documents/by-course/math-8/course-notes/main.typ

1009 lines
31 KiB
Text

#import "@youwen/zen:0.1.0": *
#show: zen.with(
title: "Math 8 Course Notes",
author: "Youwen Wu",
date: "Winter 2025",
subtitle: [Taught by Matt Porter],
abstract: [
In the broad light of day mathematicians check their equations and their
proofs, leaving no stone unturned in their search for rigour. But, at night,
under the full moon, they dream, they float among the stars and wonder at the
miracle of the heavens. They are inspired. Without dreams there is no art, no
mathematics, no life.
#align(end, [-- Michael Atiyah])
],
)
#outline()
= Introduction
Math 8 is an introductory course on mathematical logic and the methods of
proof. In general it will be quite trivial for anyone somewhat familiar with
competition mathematics or proofs. If you are at UCSB, I highly recommend you
take this course as soon as possible to unlock the rest of the higher
mathematics offerings here (which are much more interesting).
= Course logistics
Everything in this section is information only valid for the Winter 2025 quarter with Professor Porter.
The textbook for the course is _Smith, Eggen, Andre. A Transition to Advanced
Mathematics. 8th ed_. #smallcaps[isbn:] `978-1-285-46326-1`. Chapters 1-5 will
be covered.
Lecture meets every M-W-F from 12:00 -- 12:50 in Phelps 1444. Recitation meets
M-W from 7:00 -- 7:50 in HSSB 1236.
== Homework
Homework is from textbook and is worth 30% of the grade, due on Gradescope.
Homework is due every W at 11:59 PM. LaTeX is recommended for typesetting but
of course we will be using Typst, the superior typesetting software for
mathematics.
Section and problem numbers should be clearly labeled and problems should be
done on a single column.
The lowest homework score will be dropped.
== Exams
Each exam is 20% of the grade. The final exam will replace the lowest of the
first two exam scores if it is higher.
= Lecture #datetime(year: 2025, month: 1, day: 6).display()
== Trivial preliminaries
Definitions barely worth considering. Included purely for posterity.
#definition("Proposition")[
A proposition is a sentence which is either true or false.
]
#example("Primes")[
The numbers 5 and 7 are prime.
]
#example("Not a proposition")[
$x^2 + 6x + 8 = 0$
]
Propositions may be stated in the formalism of mathematics using connectives,
as *propositional forms*.
#definition("Propositional forms")[
Let $P$ and $Q$ be propositions. Then:
+ The conjunction of $P$ and $Q$ is written $P and Q$ ($P$ and $Q$).
+ The disjunction of $P$ and $Q$ is written $P or Q$ ($P$ or $Q$) (here "or" is the inclusive or).
+ The negation of $P$ is written $not P$.
]
#definition("Tautology")[
A propositional form for which all of its values are true. In other words, a statement which is always true.
]
#definition("Contradiction")[
A propositional form for which all of its values are false. In other words, a statement which is always false.
]
#problem[Prove that $(P or Q) or (not P and not Q)$ is a tautology][
Trivial, omitted.
]
#example[Several denials of the statement "integer $n$ is even"][
- It is not the case that integer $n$ is even.
- Integer $n$ is not even.
- $n != 2m, forall m in ZZ$
- $n = 2m + 1, exists m in ZZ$
]
DeMorgan's Laws tell us how to distribute logical connectives across
parentheses.
#fact[DeMorgan's Laws][
+ $not (P or Q) = not P and not Q$
+ $not (P and Q) = not P or not Q$
]
#proof[
Trivially, by completing a truth table.
]
Also, propositional forms obey commutative, associative, distributive laws,
which can be trivially obtained from symbolic manipulations and will not be
restated. Together with the double negation law and the _law of the excluded
middle_, these comprise the axioms of a system of propositional logic.
#fact[
We abbreviate propositional forms by eliding parentheses, according to the rules:
+ $not$ is applied to the smallest proposition following it.
+ $and$ connects the smallest propositions surrounding it.
+ $or$ connects the smallest propositions surrounding it.
]
= Notes on Logic and Proofs, 1.2
_Prototypical example for this section:_ If $sin pi = 1$, then $6$ is prime.
#definition[
For a *antedecent* $P$ and *consequent* $Q$, the *conditional sentence* $P =>
Q$ is the proposition "If $P$, then $Q$."
]
#remark[
The statement $P => Q$ states $P$ _implies_ $Q$ and is only false if $P$ is
true and $Q$ is false, since this is the only case where $P$ did not imply $Q$.
]
A conditional may be true even when the antedecent and consequent are unrelated.
= Lecture #datetime(day: 8, month: 1, year: 2025).display()
== More propositional forms
#definition[
Let $P$ and $Q$ be propositions. The *biconditional sentence*
$ P <=> Q $
is true exactly when $P$ and $Q$ are both true or both false.
]
#example[Ways of stating $P <=> Q$][
- $P$ if and only if $Q$
- $P$ iff. $Q$
- $P$ is equivalent to $Q$
]
#exercise[
Translate each statement into symbols, where $a$ is a fixed real number.
+ $a > 5$ is sufficient for $a > 3$
+ $a > 3$ is necessary for $a > 5$
+ $a > 5$ only if $a > 3$
+ $|a| = -a$ whenever $a < 0$
+ $|a| = 2$ is necessary and sufficient for $a^2 = 4$
]
#definition[
#set enum(numbering: "a.")
Let $P$ and $Q$ be propositions.
+ The converse of $P => Q$ is $Q => P$
+ The contrapositive of $P => Q$ is $not Q => not P$
]
#theorem[
Let $P$ and $Q$ be propositions. Then:
]
#example[
If $f(x)$ is differentiable at $x = a$, then $f(x)$ is continuous at $x = a$.
$ P => Q $
+ $not Q => not P$: if $f$ is not continuous at $x=a$, then $f$ is not differentiable at $x = a$.
+ $Q => P$: if $f$ is continuous at $x = a$, then $f$ is diffferentiable at $x = a$.
]
#fact[
We apply our new logical connectives in the following order: $not, and, or, => , <=>$
]
#example[
Include parentheses to clarify the expression.
$ P or Q => not R <=> S and T $
]
#theorem[
#set enum(numbering: "a.")
For propositions $P$, $Q$, and $R$, the following are equivalent:
+ $P => Q "and" not P or Q$
+ $P <=> Q "and" (P => Q) and (Q => P)$
+ $not (P => Q) "and" P and not Q$
+ $not (P and Q) "and" P => not Q$
+ $not (P and Q) "and" Q => not P$
+ $P => (Q => R) "and" (P and Q) => R$
+ $P => (Q and R) "and" (P => Q) and (P => R)$
+ $(P or Q) => R "and" (P => R) and (Q => R)$
]
== Quantified statements
#definition[
A *predicate* or *open sentence* is a sentence involving one or more variables.
]
#example[
Consider the open sentence $P(x,y): x^2 + y^2 = 25$. Write a true and a false proposition.
$
P(3,-4) &: 3^2 + (-4)^2 = 25 &"(true)" \
P(2,0) &: 2^2 + 0^2 = 25 &"(false)" \
$
]
#definition[
The *universe* is the set of all objects available for substitution into an open sentence. Denoted $U$.
]
#definition[
A *truth set* is all objects in $U$ that make an open sentence true.
]
#example[
Let the universe be the set of all real numbers for the open sentence $P(x) : x^2 + x = 6$. Find the truth set.
$
U = RR \
"truth set:" {2,-3}
$
]
#definition[
Let $P(x)$ be an open sentence with variable $x$.
The *universal quantifier* is the sentence
$ forall x in U, P(x) $
The *existential quantifier* is the sentence:
$ exists x in U, P(x) $
The *unique existence quantifier* is the sentence
$ exists! x in U, P(x) $
]
#example[
Let the universe be the set of all real numbers and consider the open sentence
$ P(x) : x^2 + 1 >= 0 $
Consider the quantified sentence $forall x in U,P(x)$. Then
$ forall x in RR, x^2 + 1 >= 0 $
is a true statement.
However, if instead $U = CC$, then the sentence is false.
]
#example[
Let the universe be the set of all real numbers and consider the open sentence
$
Q(x) "where" x in ZZ \
R(x) "is a perfect square" \
$
Consider the quantified sentence
$ exists Q(x), R(x) $
]
#example[
Let the universe be the set of all real numbers and consider the open sentence
$ P(x,y) : y = x^3 + 4 $
Consider the quantified sentence
$ forall y in U, exists! x in U, P(x,y) $
It is true because $P(x,y)$ is injective (one-to-one).
]
= Missed a bunch of lecture :(
Probably not any important content, though.
= Lecture #datetime(day: 17, month: 1, year: 2025).display()
== Proof of a biconditional statement
To prove a biconditional statement of the form $P <=> Q$, we need to show
$ P => Q and Q => P $
#theorem("Fundamental Theorem of Arithmetic")[
$forall x in ZZ, x > 1$, $x$ can be written as a product of prime factors.
Additionally, these prime factors are unique, i.e. there is only one set of
prime factors that uniquely factorizes $x$. Hence it is sometimes called the
_unique factorization theorem_ or the _prime factorization theorem_.
]
#example[
Assume $p$ is prime. Then $p | b$ iff $p | b^2$.
#proof[
First let us show $p | b => p | b^2$. We know $b$ can be written as the
product of the prime $p$ and some other integer $n$.
$ b = p n $
Then
$ b^2 = p^2 n^2 $
which implies $p$ is a factor of and divides $b^2$. So,
$ p | b => p | b^2 $
Now let us show the converse, i.e. $p | b^2 => p | b$.
By the unique factorization theorem, $b^2$ can be written as a unique
product of primes, one of which is $p$. But we also know $b^2 = b dot b$
and so at least one $b$ must have a prime factor $p$. But $b$ has unique
prime factors (again by the same theorem) so $b$ always has a prime factor
$p$. Hence,
$ p | b^2 => p | b $
]
]
== Proof by contradiction
#definition[
A proof by contradiction of the statement $P$ proceeds by assuming $not P$,
then showing that this fact leads to a contradiction.
A proof by contradiction of $P => Q$ proceeds by assuming $P and not Q$, then
showing a contradiction, forcing that $P$ indeed implies $Q$.
]
#definition[
A real number $x in RR$ is called rational iff
$ exists p,q in ZZ, x = p / q $
]
#definition[
$x$ is irrational if it is not rational.
]
#example[
Prove that if $x$ is rational and $y$ is irrational, then $2x - y$ is irrational.
#proof[
Suppose that $x$ is rational and $y$ is irrational but $2x - y$ is
rational. Then $x = a / b$ and $2x - y = c/d$ where $a,b,c,d in ZZ$ and $b
!= 0, d != 0$.
Then
$
2a / b - y &= c / d \
y &= (2a) / b - c / d \
y = (2a d - b c) / (b d) &= m / n
$
which implies $y = m/n$ and therefore we have a contradiction. So $2x - y$
is irrational.
]
]
#fact[$sqrt(2)$ is irrational.]
The proof of this fact generalizes nicely to show that the square root of any
non-perfect square is irrational.
#example[
Prove that $sqrt(6)$ is irrational.
#proof[
Seeking a contradiction, suppose $sqrt(6)$ is rational. Then $sqrt(6) =
a/b, exists a,b in ZZ$ with $b != 0$.
Then
$ a^2 = 6b^2 = 3 (2b^2) $
Since $a^2 = a dot a$, $a$ has $j = 0,1,2, ...$ factors of $3$ in its
unique prime factorization, then $a^2$ has $2j$ factors of $3$, which is to
say that $a^2$ has an even $hash$ factors of 3.
Similarly, $b^2$ has an even $hash$ of 3, say $2k$, where $k = 0, 1, 2,
...$. Then $3(2b^2)$ has $2k + 1$ $hash$ factors of 3, an odd amount.
But $a^2$ = $3(b^2)$ so they must have the same factors, a contradiction.
Therefore $sqrt(6)$ must be irrational.
]
]
#exercise[
Prove that $sqrt(2)$ is irrational using the method above.
]
#exercise[
Show that $sqrt(15)$ is irrational.
]
#problem("Euclid's Theorem")[
Show the infinitude of primes (there are an infinite amount of prime numbers).
]<euclid>
#problem[
Show that in general, given any integer $n$ that is not a perfect square,
i.e. $ exists.not a in ZZ, n = a^2 $ $sqrt(n)$ is irrational.
]<perfectsquare>
== Proofs involving quantifiers
Many of our proofs up to this point have been of the form
$ forall x in U, P(x) => Q(x) $
To prove a statement of this form,
+ Let $x in U$.
+ Assume $P(x)$.
+ Show $Q(x)$.
+ Conclude $forall x in U, P(x) => Q(x)$.
#example[
Prove that $forall x,y in ZZ$, $2x + 14y != 3$.
#proof[
Seeking a contradiction, suppose instead $2x + 14y = 3$. Then
$2x $ is even, and $14y = 2(7y)$ is even, and therefore $2x + 14y$ is even.
But $3$ is odd, so they cannot be equal.
Alternatively simply write
$ x + 7y = 1.5 $
but the ring of $ZZ$ is closed under addition so we have a contradiction.
]
]
To prove a statement of the form
$ exists x in U, P(x) $
+ Find at least one $x in U$ that makes $P(x)$ true.
+ Conclude $exists x in U, P(x)$.
#example[
Prove that there is a natural number $N$ such that for all natural numbers $n > N$,
$ 1 / n < 0.02 $
We want $1/n < 0.02$, so the idea is to play around with this statement. Taking reciprocals,
$ n > 50 $
#proof[
Let $N = 50$. Then $forall n in NN$ and $n > N$,
$ 1 / n < 1 / 50 = 0.02 $
]
]
#exercise[
Prove that between any two rational numbers $x$ and $y$ there is another
rational number $z$.
]<rational-between>
= Lecture #datetime(day: 27, month: 1, year: 2025).display()
== Basic properties of sets
#definition[
A set is a collection of elements.
]
#definition[
The cardinality of a set is the amount of elements in the set.
]
#example[
Prove $A subset.eq B$ iff. $A sect B = A$.
#proof[
Assume $A subset.eq B$. Let $x in A sect B$. Then $x in A$ and $x in B$. So
$x in A$ and $A sect B subset.eq A$. Now let $x in A$. Since $A subset.eq
B$, then $x in B$. Thus $x in A$ and $x in B$, so $x in A sect B$. Then $A
subset.eq A sect B$.
Now we show the other direction. Assume $A sect B = A$. Then $x in A sect
B$ implies $x in A$ and $x in B$. In particular $forall x in A, x in B$.
Thus $a subset.eq B$.
]
]
#theorem[
Let $U$ be the universe, and let $A$ and $B$ be subsets of $U$. Then
+ $(A^c)^c = A$
+ $A union A^c = U$
+ $A sect A^c = emptyset$
+ $A - B = A sect B^c$
+ $A subset.eq B <=> B^c subset.eq A^c$
+ $A sect B = emptyset <=> A subset.eq B^c$
+ $(A union B)^c = A^c sect B^c$
+ $(A sect B)^c = A^c union B^c$
]<basic-sets>
#example[part of @basic-sets][
Show that $(A sect B)^c = A^c union B^c$.
$
&x in (A sect B)^c \
&<=> x in.not A sect B \
&<=> x in A^c, x in B^c \
&<=> x in A^c union B^c
$
]
#definition[
The Cartesian product of sets $A$ and $B$:
$ A times B = {(a,b) : a in A "and" b in B} $
]
#fact[
If $A$ has cardinality $m$, $B$ has cardinality $n$, then $A times B$ has
cardinality $n dot m$.
]
#example[
Prove that $A times emptyset = emptyset$.
#proof[
Suppose that $A times emptyset != emptyset$. Then $exists (a,b), a in A, b in
emptyset$. But $b in emptyset$ is a contradiction by its definition.
]
]
== Index families of sets
#definition[A set of sets is called a family or collection of sets.]
#definition[
Let $Delta$ be a nonempty index set such that $forall alpha in Delta, exists
A_alpha$. The family of sets $cal(A) = {A_alpha : alpha in Delta}$ is an
index family of sets.
]
#example[
Let $A in {1,3}$ and consider $cal(P)(A)$.
]
#example[
Define $A_n = (n,n+2)$, the open interval from $n$ to $n+2$, for each $n in
NN$.
$cal(A) = {(n, N + 2) : n in NN} = {A_n : n in NN}$
Let $Delta = NN$ and then $alpha in Delta <=> n in NN$.
]
#definition[
The union over $cal(A)$ is the set
$ union.big_(A in cal(A)) A = {x : x in A, exists A in cal(A)} $
]
#definition[
The intersection over $cal(A)$ is the set
$ sect.big_(A in cal(A)) A = {x : x in A, forall A in cal(A)} $
]
#example[
Let $cal(A) = {{1}, {1,2},{2,3}}$. Then
$
&union.big_(A in cal(A)) A = {1,2,3} \
&sect.big_(A in cal(A)) A = emptyset
$
]
#example[
Let $A_n = [-1/n,1/n]$, the closed interval from $-1/n$ to $1/n$ for each $N in NN$. Consider the family of sets $cal(A) = {A_n : n in NN}$. Then
$
&union.big_(A in cal(A)) A = union.big_(n=1)^infinity A_n = A_1 union A_2 union A_3 union dots.c = {x : x in [-1,1]} \
&sect.big_(A in cal(A)) A = sect.big_(n=1)^infinity A_n = 0
$
]
#example[
Let $A_n = [0,n)$ for each $n in NN$ and let $cal(A) = {A_n : n in NN}$. Then
$
&union.big_(A in cal(A)) A = [0, infinity] \
&sect.big_(A in cal(A)) = [0,1)
$
]
= Solutions to selected exercises and problems
Solutions to selected problems and exercises.
#linebreak()
*@euclid.* We begin by considering primes $p_1, p_2, ..., p_n$. Let $P = p_1 dot p_2 dot ... dot p_n$. Then let $q = P + 1$.
Then if $q$ is prime, we have an additional prime not in the original list.
Otherwise, $q$ is not prime and we have a unique prime factorization of $q$.
Without loss of generality, take one such prime to be $p_k$. $p_k$ cannot be in
the original list $p_1, p_2, ..., p_n$.
If $p_k$ were in the original list, then since $P$ is divisible by $p_k$, and $P
+ 1$ is also divisible by $p_k$, 1 must be divisible by $p_k$ which is
impossible. So $p_k$ is a new prime.
For completeness, let's finish the proof explicitly. Start with primes $p_1$,
$p_2$. The method above implies the existence of another prime, which we denote
$p_3$. Repeat this to find additional primes $p_(k+1)$.
*@perfectsquare.* This is a generalization of the proof $sqrt(6)$ is
irrational. Seeking a contradiction, suppose $sqrt(a)$ is irrational.
$
exists p,q in ZZ, sqrt(a) = p / q \
p^2 = a q^2
$
Then by the fundamental theorem of arithmetic,
$ a = b_1 dot b_2 dot ... dot b_n $
where $b_i$ is prime.
$ p^2 = (Pi^n_(i=1) b_1) dot q^2 $
Notice all $b_i$ are unique (again by the same theorem) and without loss of
generality, choose a $b_k$, $1 <= k <= n$.
Then $p$ has $j = 1,2,...$ $hash$ of $b_k$ in its factors. Then $p^2$ has $2j$
$hash$ of $b_k$. Similarly, $q$ has $L = 1,2,...$ $hash$ of $b_k$, and $q^2$
has $2L$. Then $(Pi ^n _(i=1)) q^2$ has $2L + 1$ $hash$ of $b_k$. But
$ p^2 = (Pi^n_(i=1)) q^2 $
and by unique factorization they must have the same $hash$ of the prime factor $b_k$, so $sqrt(a)$ is irrational.
Note that if $a$ was a perfect square, TODO
*@rational-between.* Effectively we are asked to show that given $x,y in QQ$,
where $x < y$, $exists z in QQ$ such that $x < z < y$.
First, let us take the difference between $x$ and $y$.
$
exists a,b,c,d in ZZ \
x = a / b \
y = c / d \
y - x = (b c - a d) / (b d)
$
So we know that
$
y = x + (b c - a d) / (b d)
$
We see that if we can find any nonzero integer less than $(b c - a d)/(b d)$,
adding it to $x$ gives us the number between $x$ and $y$ we desire. One option is
$
(b c - a d) / (b d + 1) < (b c - a d) / (b d) \
x < x + (b c - a d) / (b d + 1) < x + (b c - a d) / (b d) = y \
$
So one such $z$ is
$ z = x + (b c - a d) / (b d + 1) $
#remark[
There is a minor hole in this proof, if $b d + 1 = 0$, $z$ is undefined. We
can easily avoid this by replacing all instances of $b d + 1$ with, say, $b d
+ 2$, when $b d + 1 = 0$.
]
#remark[
A much easier and less roundabout proof is to take
$ z = (x + y) / 2 $
Then $(x + y)/2$ is obviously rational and strictly between $x$ and $y$.
]
= Induction
Induction is a way to prove that a statement is true for all $NN$. Formally, it
is introduced like this: say you have a set $S subset.eq NN$ such that $1 in
S$. Then, if $n in S => n + 1 in S$, $S = NN$. Usually we plug $n$ into a
proposition $P$ to make it more useful for proving statements. If $(forall n in
S)(P(n))$, and we can show $S = NN$ by induction, then $P(n)$ is true for all
$n in NN$.
Induction consists of two main parts. First, we have to show that $1 in S$.
This is the _base case_. Then, we assume the _inductive hypothesis_, $n in S$.
If we can prove, using the inductive hypothesis, that $n in S$ implies that $n
+ 1$ in $S$, then we'll have sufficient justification for $S = N$. When proving
a statement in practice, if $S$ is the set of all inputs to $P(n)$ that make it
true, we show that $P(1)$ is true ($1 in S$) and then show that $P(n) =>
P(n+1)$, which implies $(forall n in NN) P(n)$.
There are two equivalent formulations of induction, the principle of
mathematical induction (PMI, also called _weak induction_), and the principle
of complete induction (PCI, also called _strong induction_). They are
equivalent, but in some cases one is much more straightforward to show than the
other.
The previous strategy we discussed was _weak induction_, named such because we
need only show $P(1) and P(n) => P(n+1)$. _Strong induction_ requires us to
show a much stronger result, but also allows us to make a stronger assumption.
#definition[Strong induction][
If ${1,2,3,...,n-1} subset.eq S => n in S$, then $S = NN$.
]
Essentially in strong induction we assume that every natural up to $n$ is in
$S$, and if we can show that this implies $n$ is also in $S$, we have $S = NN$.
Note that in this case we do not have to show $1 in S$, but this is implied.
When proving a proposition $P$, we have to prove $P(1) and P(2) and ... and
P(n-1) => P(n)$, but we can assume the strong inductive hypothesis $P(1) and
P(2) and ... and P(n-1)$.
#example[Game theory of Nim][
In the game of _Nim_, two players take turns taking coins from two piles of
$n$ coins each. If there are $m$ coins in a pile, a player may choose to take
$1,2,3,...,m$ coins, *except* $m - 1$ coins. That is, a player may take any
nonzero amount, but may not leave exactly one coin left in the pile. The
player to take the last coin in play wins.
Example game: if there are 6 coins on the left and 8 coins on the right,
player 1 goes first and takes 4 coins from the left. Player 2 takes the
remaining 2 coins on the left. Player 1 takes all 8 coins from the right and
wins.
Prove that Player 2 has a winning strategy in all games of _Nim_.
This is actually a somewhat unexpected way in which strong induction can be
very useful. Let $S$ be a set of the natural numbers where Player 2 has a
winning strategy when there are $n in S$ coins left in both piles.
Suppose $m$ is a natural number and ${1,2,3,...,m-1} subset.eq S$. This is
our inductive hypothesis, we assume that Player 2 has a winning strategy for
when the game starts with $1,2,3,...,m-1$ coins in each pile. Now we seek to
show that this implies that Player 2 has a winning strategy when there are
$m$ coins in the pile. For the special case when $m = 1$, Player 1 takes 1
coin from either pile and Player 2 takes both, winning the game. Otherwise,
for $m > 1$, if Player 1 takes $m$ coins from a pile, Player 2 takes all the
coins in the other pile, winning. If Player 1 takes $j$ coins from either
pile where $1 <= j < m - 1$, leaving $m - j > 1$ coins in the pile, Player 2
can take $j$ coins from the other pile, leaving both piles with $m - j$
coins. This is essentially a new game of Nim with $m - j$ coins in each pile.
Then $m - j in {1,2,3,...,m-1}$ since $j <= 1 < m-1$, so by our inductive
hypothesis Player 2 has a winning strategy from this point on. Therefore
Player 2 has a winning strategy when $m$ coins are in each pile.
Since ${1,2,3,...,m-1} subset.eq S => m in S$, by strong induction, $S = NN$
and Player 2 has a winning strategy for all possible games of _Nim_.
]
#example[A hint for the fundamental theorem of arithmetic][
Prove that all natural numbers can be expressed as the product of primes.
#proof[
Let $m$ be a natural number. Note that $m = 2$ is prime so its the product
of itself and 1. Now assume that all natural numbers $n$ such that $1 < n <
m$ can be written as the product of primes. Then $m$ is either prime, in
which case its prime factors are $1 dot m$, or $(exists s,t in
{1,2,...,m-1})(m = s t)$. Then by our inductive hypothesis both $s$ and $t$
can be written as the product of primes, so $m$ is also the product of
primes. By strong induction, we conclude all natural numbers can be written
as the product of primes.
]
]<fundamental-thm-arithmetic-hint>
== Well ordering principle
This is another property that characterizes $NN$.
#fact[Well ordering principle][
Every nonempty subset of $NN$ has a smallest element.
]
We demonstrate the WOP in an alternative proof of
@fundamental-thm-arithmetic-hint.
#example[
All natural numbers can be expressed as the product of primes.
#proof[
Suppose there exists some non-empty set $S subset.eq NN$ that contains all
of the natural numbers which cannot be expressed as a product of primes.
By the WOP, there is a least number in this set, $T in S$. $T$ cannot be
prime because it would be the product of $1 dot T$, so it must be
composite. Then $T = s t$ for some natural numbers $s,t$, which are less
than $T$. But $T$ is the least element of $S$ so neither $s$ nor $t$ are in
$S$, and therefore they both have prime factorizations. But this implies
that $T$ also has a prime factorization, a contradiction. Therefore no such
set $S$ can exist, and all natural numbers have a prime factorization.
]
]
#theorem[The division algorithm][
For all integers $a$ and $b$, with $a != 0$, there exist unique integers $q$
and $r$ such that $b = a q + r$ and $0 <= r < |a|$.
#proof[
Let us consider the case where $a > 0$. Then we have a set
$
S = {b - a k, k in ZZ, b - a k >= 0}
$
It follows that we should exclude 0 from $S$ because otherwise if $0 in S$,
$b - a k = 0$ for some integer $k$, and $a | b$, so $b = a dot b/a$.
In our restricted $S$, there is a least element, call it $r$. Then for some
integer $q$, $a q + r = b$. We know that $r > 0$ so let's show $r < |a|$.
Since we're considering only $a > 0$ for simplicity, we just show $r < a$.
If $r >= a$, then either $0 in S$ when $r = a$ because $a q + a = b$
implies that $a | b$, or, when $r > a$, there exists another element in
$S$, $b - a (q + 1)$. This is a contradiction since we assumed $b - a q$
was the smallest element in $S$ and clearly $b - a q - a$ is smaller.
Therefore $r < |a|$.
Now we show the uniqueness of $q, r$. Suppose there were other integers
satisfying the properties of $q$ and $r$, $q'$ and $r'$. Then we have
$
r' >= r
$
without loss of generality (otherwise just relabel). Then $a q + r = a q' +
r'$, so $a(q - q') = r' - r$. Then $a$ divides $r' - r$.
]
]
== Relations, partitions
#definition[
A relation on a set $A$ is a set of ordered pairs $(a,b)$ where $a,b in A$. A
relation from a set $A$ to a set $B$ is set of ordered pairs $(a,b)$ where $a
in A$ and $b in B$.
]
#abuse[
If $R$ is a relation from $A$ to $B$, for $a in A$ and $b in B$ where $(a,b)
in R$, we can abbreviate it $a R b$.
]
#definition[
For any set $A$, the identity relation on $A$ is the set
$
I_A = {(a,a) : a in A}
$
]
#definition[
The domain of the relation $R$ from $A$ to $B$ is the set
$
"Dom"(R) = {x in A : (exists y in B)(x R y)} \
$
The range is
$
"Rng"(R) = {y in B : (exists x in A)(x R y)}
$
]
So the domain of $R$ is the set of all first coordinates and the range is the
set of all second coordinates.
#theorem[
1. $"Dom"(R^(-1)) = "Rng"(R)$
2. $"Rng"(R^(-1)) = "Dom"(R)$
]
#definition[
Let $R$ be a relation from $A$ to $B$, let $S$ be a relation from $B$ to $C$.
The composite of $R$ and $S$ is
$
S compose R = {(a,c) : (exists b in B)((a,b) in R and (b,c) in S)}
$
]
== Equivalence relations
Let $A$ be a set and $R$ a relation on $A$.
We say $R$ is reflexive on $A$ if $forall x in A, x R x$. $R$ is symmetric if
$forall x,y in A$, if $x R y$, then $y R x$. $R$ is transitive if $forall x,y,z
in A$, if $x R y$ and $y R z$, then $x R z$.
#theorem[
Let $A$ be a set. For the power set $cal(P)(A)$, the relation "is a subset of"
is reflexive on $cal(P)(A)$ and transitive but not symmetric.
]
#definition[
A relation $R$ on a set $A$ is an equivalence relation on $A$ if $R$ is
reflexive on $A$, symmetric, and transitive.
]
We make an equivalence relation when we think of objects as being related by
having the same property.
An equivalence relation on a set divides the set into subsets of related
elements.
#definition[
Let $R$ be an equivalence class on a set $A$. For $x in A$, the equivalence
class of modulo $R$ (or $x mod R$) is the set
$
overline(x) = {y in A : x R y}
$
Each element of $overline(x)$ is a *representative* of the class. The set
$
A \/ R = {overline(x) : x in A}
$
of all equivalence classes is called $A "modulo" R$.
]
#theorem[
Let $R$ be an equivalence relation on a nonempty set $A$. For all $x$ and $y$
in $A$,
1. $x in overline(x)$ and $overline(x) subset.eq A$
2. $x R y$ if and only if $overline(x) = overline(y)$
3. $x cancel(R) y$ if and only if $overline(x) sect overline(y) = emptyset$
]
== Congruence relations
Now we define congruence relations on $ZZ$ and show that congruence mod $m$ is
an equivalence relation. We describe its equivalence classes.
#definition[
Let $m$ be a fixed positive integer. For $x,y in ZZ$, we say $x$ is congruent
to $y$ modulo $m$ and write $x = y (mod m)$ if $m$ divides $(x-y)$. The number
$m$ is called the modulus of the congruence.
]
#theorem[
For every fixed positive integer $m$, congruence modulo $m$ is an equivalence
relation on $ZZ$.
]
#proof[
1. Reflexivity. Let $x$ be an integer. We show $x = x (mod m)$. $m dot 0 = 0 = x - x$, $m | x - x$.
2. For symmetry, suppose $x = y (mod m)$. Then $m | x - y$. Thus $(exists k)(x - y = k m)$. But $-(x-y) = -(k m)$, or $y - x = (-k) m$. So $m | y - x$ so $y = x (mod m)$
3. Suppose $x = y (mod m)$ and $y = z (mod m)$. Thus $m | x - y$ and $m | y - z$. Thus $m | x - y + y - z <=> m | x - z$ so $x = z (mod m)$. So congruence modulo $m$ is transitive.
]
#definition[
The set of equivalence classes for the relation congruence modulo $m$ is
denoted $ZZ_m$.
]
#theorem[
Let $m$ be a fixed positive integer. Then
1. for integers $x$ and $y$, $x = y (mod m)$ if and only if the remainder when $x$ is divided by $m$ equals the remainder when $y$ is divided by $m$
2. $ZZ_m$ consists of $m$ distinct equivalence classes.
]
The equivalence classes of $ZZ_m$ $overline(0), overline(1), ...,
overline(m-1)$ which are exactly all of the possible remainders when integers
are divided by $m$. For this reason the elements of $ZZ_m$ are sometimes called
the residue classes modulo $m$.
== Partitions
#definition[
Let $A$ be a nonempty set. $cal(P)$ is a partition of $A$ if $cal(P)$ is a set of subsets of $A$ such that
1. if $X in cal(P)$, then $X != emptyset$
2. if $X in cal(P)$ and $Y in cal(P)$, then $X = Y$ or $X sect Y = emptyset$
3. $union.big_(X in cal(P)) X = A$
]
In other words a partition of a set $A$ is a pairwise disjoint collection of
nonempty subsets of $A$ whose union is $A$.
#theorem[
If $R$ is an equivalence relation on a nonempty set $A$, then $A\/R$ is a
partition of $A$.
]
#proof[
Every equivalence class $overline(x)$ is a subset of $A$ and is nonempty
because it contains $x$. Any two equivalence classes are either equal or
disjoint. Also,
$
union.big_(x in A) overline(x) subset.eq A
$
because each $overline(x) subset.eq A$. To prove $A subset.eq union.big _(x in A) overline(x)$, suppose $y in A$. Because $y in overline(y)$, then
$
y = union.big_(x in A) overline(x)
$
Thus,
$
A = union.big_(x in A) overline(x)
$
]