Mascot image.
#EECS#Python#Intro

Predicates, Numbers, and Sets

Predicate Logic

We realise that propositional logic is not enough. If we know that “all men are mortal” and “Socrates is a man”, it ought to follow that “Socrates is mortal.” But propositional logic cannot reach this conclusion: it treats each sentence as an indivisible whole and cannot look inside to see the relationship between the object (Socrates), the property (being a man), and the consequence (being mortal).

To see the problem more concretely, consider the following mathematical argument:

Every prime number greater than 22 is odd. The number 77 is a prime number greater than 22. Therefore, 77 is odd.

This looks like a straightforward application of modus ponens (Lesson 1). Yet propositional logic cannot carry it out: there is no way to symbolise “Every prime number greater than 22 is odd” as a conditional pqp \to q whose premise pp is “The number 77 is a prime number greater than 22.” The first sentence speaks about all primes; the second speaks about a specific number. Propositional logic has no mechanism to connect the two.

What is missing is the ability to distinguish the object of our speech from the description we make about it. To overcome this, we introduce predicate logic, which allows us to reason about objects and their properties.

Variables and Predicates

Recall that a variable is a symbol standing in for an object that has not yet been specified, and a term is a symbol denoting an object (Lesson 1). Specific terms such as the natural number 55 or the constant π\pi are called constants; variables are terms whose value has not been determined. A term on its own does not form a complete sentence and has no truth value.

We can attach a description to a variable: write man(x)\text{man}(x) to say ”xx is a man”, or x>3x > 3 to say ”xx is a number larger than 33.” These expressions are not propositions (Definition 1), because their truth value depends on what xx actually is.

Definition 15 (Predicate)

Let x1,,xnx_1, \ldots, x_n be variable symbols. We say φ(x1,,xn)\varphi(x_1, \ldots, x_n) is an nn-ary predicate if replacing each variable xix_i with a term tit_i results in a proposition φ(t1,,tn)\varphi(t_1, \ldots, t_n) that has a truth value.

  • A 11-ary (monadic) predicate describes a property, e.g., IsPrime(x)\text{IsPrime}(x).
  • A 22-ary (dyadic) predicate describes a relation between two terms, e.g., IsGreaterThan(x,y)\text{IsGreaterThan}(x, y).
  • An nn-ary predicate describes a relation among nn terms.

If PP is the monadic predicate for being prime and 77 is a term, then P(7)P(7) is the proposition ”77 is prime.” If GG is the dyadic predicate for “is greater than”, then G(π,3)G(\pi, 3) is the proposition ”π\pi is greater than 33.” These are the atomic propositions of first-order logic.

Example 14

Let R(x,y,z)R(x, y, z) denote x+y=zx + y = z, where the variables range over the integers. Then R(2,1,5)R(2, -1, 5) is \bot since 2+(1)52 + (-1) \neq 5; R(3,4,7)R(3, 4, 7) is \top since 3+4=73 + 4 = 7; and R(x,3,z)R(x, 3, z) is still a predicate, since x+3=zx + 3 = z can be \top or \bot depending on the values of xx and zz.

A predicate’s variables take values in a domain UU, called the universe of discourse. In the previous example, UU is the integers. Once values from UU are substituted, the predicate becomes a proposition with truth value \top or \bot. Hence the logical connectives from Lesson 1 apply directly.

Example 15

Let P(x)P(x) denote x>0x > 0. Then the following are \top:

P(3)P(1),P(3)¬P(1)P(3) \lor P(-1), \qquad P(3) \to \neg P(-1)

And the following are \bot:

P(3)P(1),P(3)P(1)P(3) \land P(-1), \qquad P(3) \to P(-1)

More generally, we can build new predicates out of old ones using connectives. Expressions constructed from predicates and logical connectives that still contain free variables are called propositional functions.

Example 16

Using P(x)P(x) as above, the following are propositional functions:

R(x,y):=P(x)P(y),S(y):=P(3)P(y)R(x, y) := P(x) \to P(y), \qquad S(y) := P(3) \land P(y)

R(x,y)R(x, y) is a predicate in two variables; S(y)S(y) is a predicate in one variable (since P(3)P(3) is already a proposition).

Problem 17

Consider the expressions man(x)\text{man}(x), x>3x > 3, and 2+3=52 + 3 = 5. Which of these are propositions (Definition 1) and which are predicates? For each predicate, give one substitution that makes it \top and one that makes it \bot.

Remark (History and Significance of Predicate Logic)

Aristotle developed a limited form of predicate logic through his theory of syllogisms. The modern version was independently developed by Frege and Peirce between the 19th and 20th centuries, roughly 2000 years later, mirroring the timeline of propositional logic itself (Lesson 1). Predicate logic (also called first-order logic) is now the standard language for mathematical statements and is equally fundamental in computer science, appearing in database queries, logic programming (Prolog), automated theorem proving, software verification, and symbolic AI. Some mathematicians, notably Hilbert, hoped it would be a complete system for all of mathematics, but Gödel’s incompleteness theorem showed otherwise: no fixed set of axioms can prove all true mathematical statements.

Sets and Numbers

We have been throwing around numbers and their collections somewhat loosely. In Lesson 1, Example 1 asserted "2+3=52 + 3 = 5" and Example 1 item 3 stated “For any real number xx, x20x^2 \geq 0”, while the truth tables themselves are indexed by rows we count with integers. Earlier we had hints to specific collections of numbers. It is time to properly introduce them.

Fundamental to mathematics is the notion of a set. We will study sets in great detail in later lessons, but from this point onwards you will find them in every chapter of this textbook, so we take some time to think about them now. We will not treat sets formally at this stage; for now, the following definition will suffice.

Definition 16 (Set (to be revised))

A set is a collection of objects. The objects in the set are called elements of the set. If XX is a set and xx is an object, then we write xXx \in X to denote the assertion that xx is an element of XX.

The sets of concern to us first and foremost are the number sets: sets whose elements are particular types of number. At this introductory level, many details will be temporarily swept under the rug; we will work at a level of precision which is appropriate for our current stage, but still allows us to develop a reasonable amount of intuition.

Later on, if time permits, we plan to cover the construction of the number systems from first principles. For now, we start with the simple build-up.

Numbers and Magnitude

The study of mathematics is built upon the study of increasing and decreasing quantities, or magnitudes, sometimes referred to as the science of quantity.

From the fruit that a person purchases at a store, to the measurement of vast interstellar distances, the concept of quantity is ubiquitous. However, we cannot quantify or determine a specific amount except by comparing it to a similar magnitude of the same kind. For instance, when enumerating fruit, we might regard the collection as a single total or distinguish them by category (apples, pears, bananas). To formalise this comparison, we require a standard.

Definition 17 (Unit)

A unit is a chosen reference magnitude of a particular species, fixed as the standard for comparison within that species.

Remark

A unit is the basic reference “one” for a kind of quantity. For continuous quantities it is not a smallest possible part, because we may subdivide further. If you change the unit, the numerical measure changes, but the quantity being measured remains the same.

Definition 18 (Measure)

A measure is the number assigned to a magnitude relative to a chosen unit of the same species. If MM is a magnitude and uu is the chosen unit, its measure is the number nn such that M=nuM = n u.

Definition 19 (Number)

In this measurement frame (used for N,Z,Q,R\mathbb{N}, \mathbb{Z}, \mathbb{Q}, \mathbb{R}), a number records the signed comparison of a magnitude with a chosen unit of the same species. The complex numbers will later extend this arithmetic framework geometrically.

Example 17 (Sand on a Beach)

Stand at the edge of a beach and draw a small square in the sand. Everything inside that square is our amount of sand. Before we start, we choose a unit: one handful. Now scoop the sand out, one handful at a time, saying the numbers out loud as you go. The last number you say is the measure of that sand in handfuls.

If you switch to a bigger scoop and repeat, you will finish sooner and stop at a smaller number. If you switch to a tiny spoon, you will take longer and stop at a bigger number. The sand did not change. Only the unit changed, so the number you report changed with it.

Write the chosen unit as uu and the magnitude as MM. The measured number is nn with M=nuM = n u. This is exactly the model we use on the number line: once 00 and the unit length are fixed, each point gets the signed measure of its displacement from 00 in that unit.

Problem 17A (Unit and Measure Check)

Suppose a rope has measure 1212 when the unit is 11 metre.

  1. What is its measure if the unit is changed to 0.250.25 metre?
  2. What is its measure if the unit is changed to 22 metres?
  3. Explain, in one sentence, why these two answers do not describe two different ropes.

The Number Line

In order to define the number sets, we will need three things: an infinite line, a fixed point on this line, and a fixed unit of length.

So here we go. Here is an infinite line:

An infinite line

The arrows indicate that it is supposed to extend in both directions without end. The points on the line will represent numbers (specifically, real numbers, a misleading term that will be defined later).

Now let us fix a point on this line, and label it 00:

The line with zero marked

This point represents the number zero; it is the point against which all other numbers will be measured. Numbers to the left of 00 on the line are said to be negative, and those to the right are positive; 00 itself is neither positive nor negative.

Finally, let us fix a unit of length:

The line with zero and a unit of length

This unit of length turns position into measure: each point is assigned a signed number telling how many unit lengths it lies from 00.

Definition 20 (The Number Line)

The above infinite line, together with its fixed zero point and fixed unit length, constitute the (real) number line.

We will use the number line to construct the principal number sets of interest to us: the set N\mathbb{N} of natural numbers, the set Z\mathbb{Z} of integers, the set Q\mathbb{Q} of rational numbers, and the set R\mathbb{R} of real numbers. Each of these sets has a different character and is used for different purposes, as we will see throughout this course.

Natural Numbers (N\mathbb{N})

The natural numbers are the numbers used for counting. They are the answers to questions of the form “how many”: I have three uncles, three guinea pigs, and zero cats.

Definition 21 (The Natural Numbers)

The numbers we use for counting objects, such as 0,1,2,3,40, 1, 2, 3, 4, and so on, are called the natural numbers. This family of numbers is generated by starting at 00 and successively adding one unit. We use the symbol N\mathbb{N} as a shorthand to refer to all natural numbers.

The natural numbers are represented by the points on the number line which can be obtained by starting at 00 and moving right by the unit length any number of times:

The natural numbers on the number line

In more familiar terms, they are the non-negative whole numbers. The notation nNn \in \mathbb{N} means that nn is a natural number.

Remark (On Number Bases)

There is an important aspect of this topic we will not study now: the representation of numbers in different bases. In English, the Arabic numerals are used as the ten digits 0,1,2,3,4,5,6,7,8,90, 1, 2, 3, 4, 5, 6, 7, 8, 9, forming the most popular system (base 1010). Other bases exist and are fundamental in computing (base 22, base 1616), but their treatment is deferred to a later chapter.

Integers (Z\mathbb{Z})

Addition combines magnitudes; its inverse takes them away. This inverse operation is called subtraction, denoted by the symbol -. Formally, subtraction is the inverse of addition, meaning the operation b-b undoes the effect of +b+b, and vice versa. This relationship is expressed by:

a+bb=aandab+b=aa + b - b = a \quad \text{and} \quad a - b + b = a
Remark

The symbols ++ and - act as signs that instruct how a quantity is to be treated. A preceding ++ means “to be added”; a preceding - means “to be subtracted.” The expression a+ba + b means “to the quantity aa, add the quantity bb.”

We can also view subtraction as finding a “missing addend.”

Definition 22 (Subtraction as a Missing Addend)

For numbers aa and bb, the difference aba - b is the unique number cc that one must add to bb to obtain aa. We write     \implies to mean “implies”, marking a valid step from one statement to the next:

c+b=a    c=abc + b = a \quad \implies \quad c = a - b

Our definition of subtraction has so far assumed that aa is larger than bb. What about 353 - 5? Using Definition 22, we seek a number cc such that c+5=3c + 5 = 3. No such number exists among the natural numbers.

Algebra is the general theory of these operations; we establish laws and follow them. When results like 353 - 5 cannot be interpreted with our current numbers, they force us to invent new concepts that are consistent with our laws.

Mechanically, calculating 353 - 5 means starting at 33 and applying the predecessor action 1-1 five times:

31211101  ?3 \xrightarrow{-1} 2 \xrightarrow{-1} 1 \xrightarrow{-1} 0 \xrightarrow{-1} \;?

A step to the left from 00 takes us off the natural number line. To resolve this, we must extend our system. A step of 1-1 from 00 lands on a point we call negative one, or 1-1. A further step lands on 2-2.

Definition 23 (Negative Number)

A negative number, denoted a-a, is the number that results from subtracting a positive number aa from zero:

a:=0a-a := 0 - a

With this, we can complete our calculation: 35=(33)2=02=23 - 5 = (3 - 3) - 2 = 0 - 2 = -2.

By extending our number line to include these new negative numbers, along with zero and the natural numbers, we form a more complete system.

Definition 24 (The Integers)

The system of numbers formed by combining the natural numbers (N\mathbb{N}), their negative counterparts, and zero is called the integers. This collection of whole numbers, stretching infinitely in both positive and negative directions, is denoted by the symbol Z\mathbb{Z}:

,3,2,1,0,1,2,3,\ldots, -3, -2, -1, 0, 1, 2, 3, \ldots

The integers can be used for measuring the difference between two natural numbers. For example, suppose you have five apples and five bananas. Another person, also holding apples and bananas, wishes to trade. After the exchange, you have seven apples and only one banana. Thus you have two more apples and four fewer bananas.

Since an increment in quantity can be represented by moving to the right on the number line by the unit length, a decrement in quantity can therefore be represented by moving to the left by the unit length. Doing so gives rise to the integers:

The integers on the number line

The notation nZn \in \mathbb{Z} means that nn is an integer.

Rational Numbers (Q\mathbb{Q})

Just as subtraction forced us beyond the natural numbers, division now forces us beyond the integers. But before we can discuss division, we need its prerequisite.

Definition 25 (Multiplication)

Multiplication of a number aa by a natural number nn is the repeated addition of aa exactly nn times:

an=a+a++an timesa \cdot n = \underbrace{a + a + \cdots + a}_{n \text{ times}}
Definition 26 (Division as a Missing Factor)

For numbers aa and bb (where bb is not zero), the quotient a÷ba \div b is the unique number cc that one must multiply by bb to obtain aa:

cb=a    c=a÷bc \cdot b = a \quad \implies \quad c = a \div b

In the expression a÷ba \div b, aa is the dividend and bb is the divisor.

Another standard notation for division is the fraction bar, where a÷ba \div b is written as ab\frac{a}{b}. This notation is familiar from arithmetic, where ab\frac{a}{b} represents aa of the bb-th parts of a unit. We can see that these two ideas are the same: if we take bb copies of the quantity ab\frac{a}{b}, we have babb \cdot \frac{a}{b}, which by the arithmetical definition is aa. Since this matches our algebraic definition (Definition 26), the notations are equivalent and can be used interchangeably.

Remark (Multiplication Notation)

In this chapter, abab, aba \cdot b, and a×ba \times b all denote multiplication. We use ×\times only when repeated addition or counting factors is being emphasised.

The motivation for the next number system is that the result of dividing one integer by another is not necessarily another integer. However, the result is sometimes an integer; for example, six apples can be divided between three people, and each person receives an integral number of apples.

This makes division interesting: how can we measure the failure of one integer’s divisibility by another? How can we deduce when one integer is divisible by another? What is the structure of the set of integers when viewed through the lens of division? This set of questions is so important it spans a large portion of the second half of this course, in something called number theory.

But for now, we simply need a system of numbers that can express the result of any division (except by zero). Bored of eating apples and bananas, suppose you buy a pizza which is divided into eight slices. A friend and you decide to share it. You eat three slices and your friend eats five. Unfortunately, we cannot represent the proportion of the pizza each of you has eaten using natural numbers or integers. However, we are not far off: we can count the number of equal parts the pizza was split into, and of those parts, we can count how many we had. On the number line, this is represented by splitting the unit line segment from 00 to 11 into eight equal pieces, and proceeding from there. This kind of procedure gives rise to the rational numbers.

Definition 27 (The Rational Numbers)

The rational numbers are represented by the points on the number line which can be obtained by dividing any of the unit line segments between integers into an equal number of parts. The rational numbers are those of the form ab\frac{a}{b}, where aa and bb are integers and b0b \neq 0. We denote this collection by Q\mathbb{Q}.

The rational numbers on the number line

The notation qQq \in \mathbb{Q} means that qq is a rational number.

Problem 18

Why must b0b \neq 0 in Definition 27? Using Definitions 25 and 26, suppose b=0b = 0 and a0a \neq 0.

Remark

The rational numbers are a very important example of a type of algebraic structure known as a field. We will define this term precisely later. They are particularly central to algebraic number theory and algebraic geometry, subjects we will encounter later.

Real Numbers (R\mathbb{R})

Quantity and change can be measured in the abstract using real numbers.

Definition 28 (The Real Numbers)

The real numbers are the points on the number line. We write R\mathbb{R} for the collection of all real numbers; thus, the notation aRa \in \mathbb{R} means that aa is a real number.

The real numbers are central to real analysis, a branch of mathematics introduced later in this course. They turn the rationals into a continuum by “filling in the gaps”: they have the property of completeness, meaning that if a quantity can be approximated with arbitrary precision by real numbers, then that quantity is itself a real number. We will state a fully formal definition later.

We can define the basic arithmetic operations (addition, subtraction, multiplication and division) on the real numbers, and a notion of ordering, in terms of the infinite number line.

Ordering. A real number aa is less than a real number bb, written a<ba < b, if aa lies to the left of bb on the number line. The usual conventions for the symbols \leq apply: aba \leq b means that either a<ba < b or a=ba = b.

Addition. Suppose we want to add a real number aa to a real number bb. We translate aa by bb units to the right; if b<0b < 0 then this amounts to translating aa by an equivalent number of units to the left. Concretely, take two copies of the number line, one above the other, with the same choice of unit length. Move the 00 of the lower number line beneath the point aa of the upper number line. Then a+ba + b is the point on the upper number line lying above the point bb of the lower number line.

Multiplication. Suppose we want to multiply a real number aa by a real number bb. We scale the number line, and perhaps reflect it. Concretely, take two copies of the number line, one above the other. Align the 00 points on both number lines, and stretch the lower number line evenly until the point 11 on the lower number line is below the point aa on the upper number line (if a<0a < 0, the number line must be reflected for this to work). Then aba \cdot b is the point on the upper number line lying above bb on the lower number line.

Remark (On the Construction of $\mathbb{R}$)

Real numbers can be constructed rigorously from set theory and about a semester of mathematics. We will accept their existence and properties as axioms for now. If time allows, we plan to properly construct the number systems later. The interested reader may consult constructions via Dedekind cuts or Cauchy sequences.

The real numbers satisfy a collection of axioms that characterise them completely. We state these now for reference; their consequences will be explored throughout the course.

Terms such as “field”, “totally ordered field”, “least upper bound”, and “complete” are signposts for structure that we will define rigorously later. In this chapter, treat (A1)-(A11) as the operational rules for calculation and proof.

(A1) Addition commutes: a+b=b+aa + b = b + a for all a,bRa, b \in \mathbb{R}.

(A2) Addition is associative: (a+b)+c=a+(b+c)(a + b) + c = a + (b + c) for all a,b,cRa, b, c \in \mathbb{R}.

(A3) Zero is the additive identity: a+0=0+a=aa + 0 = 0 + a = a for all aRa \in \mathbb{R}.

(A4) Additive inverses: for each aRa \in \mathbb{R} there exists aR-a \in \mathbb{R} such that a+(a)=0a + (-a) = 0.

(A5) Multiplication commutes: ab=baab = ba for all a,bRa, b \in \mathbb{R}.

(A6) Multiplication is associative: (ab)c=a(bc)(ab)c = a(bc) for all a,b,cRa, b, c \in \mathbb{R}.

(A7) One is the multiplicative identity: a1=aa \cdot 1 = a for all aRa \in \mathbb{R}.

(A8) Multiplicative inverses for nonzero elements: for each a0Ra \neq 0 \in \mathbb{R} there exists 1aR\frac{1}{a} \in \mathbb{R} such that a1a=1a \cdot \frac{1}{a} = 1.

(A9) Distributive properties: a(b+c)=ab+aca(b + c) = ab + ac and (a+b)c=ac+bc(a + b)c = ac + bc for all a,b,cRa, b, c \in \mathbb{R}.

(A10) Totally ordered field: for a,bRa, b \in \mathbb{R}:

  • (i) Antisymmetry: if aba \leq b and bab \leq a then a=ba = b.
  • (ii) Transitivity: if aba \leq b and bcb \leq c then aca \leq c.
  • (iii) Totality: aba \leq b or bab \leq a.

(A11) Least upper bound property: every nonempty subset of R\mathbb{R} that has an upper bound has a least upper bound. This makes the real numbers complete.

Remark

An axiom is a basic belief which cannot be further reduced in the conversation at hand. The axioms (A1)–(A9) make R\mathbb{R} a field, just as Q\mathbb{Q} is. Axiom (A10) gives it an ordering. Axiom (A11) is what separates R\mathbb{R} from Q\mathbb{Q}: the rationals satisfy (A1)–(A10) but not (A11).

Apparent obvious facts about numbers require the axioms stated above, and the proofs are worth seeing once: they practise reasoning from first principles and build a toolkit for the chapters ahead.

Uniqueness of zero. Axiom (A3) says that 00 is an additive identity. The following argument shows it is the only one. Suppose a+x=aa + x = a for some number aa. Then

(a)+(a+x)=(a)+a=0(A4)((a)+a)+x=0(A2)0+x=0(A4)x=0(A3)\begin{aligned} (-a) + (a + x) &= (-a) + a = 0 && \text{(A4)} \\ ((-a) + a) + x &= 0 && \text{(A2)} \\ 0 + x &= 0 && \text{(A4)} \\ x &= 0 && \text{(A3)} \end{aligned}

All four properties (A1)–(A4) were needed to justify what amounts to “subtracting aa from both sides.” A similar argument shows that additive inverses are unique: if a+x=0a + x = 0 then x=ax = -a.

Multiplication by zero. Why is a0=0a \cdot 0 = 0? The number 00 appears only in (A3) and (A4), which concern addition. Without (A9), the axioms say nothing about multiplying by 00. Since 0+0=00 + 0 = 0 by (A3), distributivity gives

a0=a(0+0)=a0+a0a \cdot 0 = a \cdot (0 + 0) = a \cdot 0 + a \cdot 0

Adding (a0)-(a \cdot 0) to both sides yields a0=0a \cdot 0 = 0.

The sign rules. Why is the product of two negative numbers positive? This is not a convention; (A1)–(A9) force it. First, (a)b=(ab)(-a) \cdot b = -(a \cdot b):

(a)b+ab=[(a)+a]b=0b=0(-a) \cdot b + a \cdot b = [(-a) + a] \cdot b = 0 \cdot b = 0

so (a)b(-a) \cdot b is the additive inverse of aba \cdot b. With this in hand:

(a)(b)+[(ab)]=(a)(b)+(a)b=(a)[(b)+b]=(a)0=0(-a)(-b) + [-(ab)] = (-a)(-b) + (-a) \cdot b = (-a)[(-b) + b] = (-a) \cdot 0 = 0

Adding abab to both sides: (a)(b)=ab(-a)(-b) = ab. The product of two negative numbers is positive not because we decided it should be, but because (A1)–(A9) leave no alternative.

The zero-product property. If ab=0ab = 0 and a0a \neq 0, then b=0b = 0:

a1(ab)=a10=0,(a1a)b=0,1b=0,b=0a^{-1}(ab) = a^{-1} \cdot 0 = 0, \quad (a^{-1} a)\, b = 0, \quad 1 \cdot b = 0, \quad b = 0

by (A6), (A8), and (A7) in turn. Equivalently: if ab=0ab = 0 then a=0a = 0 or b=0b = 0. This is the workhorse behind solving polynomial equations by factoring. If (x1)(x2)=0(x - 1)(x - 2) = 0, then x1=0x - 1 = 0 or x2=0x - 2 = 0, so x=1x = 1 or x=2x = 2. The factorisation x23x+2=(x1)(x2)x^2 - 3x + 2 = (x - 1)(x - 2) is itself a triple application of (A9):

(x1)(x2)=x(x2)+(1)(x2)=x22xx+2=x23x+2(x - 1)(x - 2) = x(x - 2) + (-1)(x - 2) = x^2 - 2x - x + 2 = x^2 - 3x + 2

Ordering and squares. The phrase “totally ordered field” in (A10) bundles in two requirements linking the ordering to arithmetic: if aba \leqslant b then a+cb+ca + c \leqslant b + c for all cc; and if a,b0a, b \geqslant 0 then ab0ab \geqslant 0. Together with the sign rules these yield: if a<0a < 0 and b<0b < 0 then ab>0ab > 0, since (a)(b)=ab(-a)(-b) = ab and a,b>0-a, -b > 0.

In particular, a2>0a^2 > 0 whenever a0a \neq 0, whether aa is positive or negative. Since 1=121 = 1^2 and 101 \neq 0 (if 1=01 = 0 then a=a1=a0=0a = a \cdot 1 = a \cdot 0 = 0 for every aa, collapsing the number system to a single element), we obtain 1>01 > 0.

Problem 19

What is wrong with the following “proof”? Let x=yx = y. Then

x2=xyx2y2=xyy2(x+y)(xy)=y(xy)x+y=y2y=y2=1\begin{aligned} x^2 &= xy \\ x^2 - y^2 &= xy - y^2 \\ (x + y)(x - y) &= y(x - y) \\ x + y &= y \\ 2y &= y \\ 2 &= 1 \end{aligned}
Problem 20

Prove the following, using only the axioms (A1)–(A9). Write a1a^{-1} for 1a\frac{1}{a} (axiom A8).

(i) ab=acbc\frac{a}{b} = \frac{ac}{bc}, if b,c0b, c \neq 0.

(ii) ab+cd=ad+bcbd\frac{a}{b} + \frac{c}{d} = \frac{ad + bc}{bd}, if b,d0b, d \neq 0.

(iii) (ab)1=a1b1(ab)^{-1} = a^{-1} b^{-1}, if a,b0a, b \neq 0. Hint: remember the defining property of (ab)1(ab)^{-1}.

(iv) abcd=acbd\frac{a}{b} \cdot \frac{c}{d} = \frac{ac}{bd}, if b,d0b, d \neq 0.

(v) ab÷cd=adbc\frac{a}{b} \div \frac{c}{d} = \frac{ad}{bc}, if b,c,d0b, c, d \neq 0.

(vi) If b,d0b, d \neq 0, then ab=cd\frac{a}{b} = \frac{c}{d} if and only if ad=bcad = bc. Also determine when ab=ba\frac{a}{b} = \frac{b}{a}.

Remark (On Proofs at This Stage)

When we ask you to “prove” something in the exercises above, we mean: use the algebraic rules and logical equivalences from Lessons 1 and 1a to show, step by step, that one expression can be transformed into another. Formal proof techniques (contradiction, contrapositive, induction) will be introduced later.

Irrational Numbers

Before we can talk about irrational numbers, we should say what they are.

Definition 29 (Irrational Number)

An irrational number is a real number that is not rational.

Unlike N\mathbb{N}, Z\mathbb{Z}, Q\mathbb{Q}, and R\mathbb{R}, there is no standard single letter denoting the irrational numbers. However, once we develop the language of sets more fully, we will be able to write the collection of irrational numbers as RQ\mathbb{R} \setminus \mathbb{Q} (read: “the reals set minus the rationals”).

That such numbers exist at all is not obvious. Consider an isosceles right-angled triangle with both shorter sides of length 11:

Isosceles right triangle with sides 1, 1 and hypotenuse sqrt(2)

By the Pythagorean theorem, the hypotenuse has length 12+12=2\sqrt{1^2 + 1^2} = \sqrt{2}. This is a perfectly concrete geometric magnitude: it is the distance between two corners of a unit square. Yet 2\sqrt{2} is not rational. There is no fraction ab\frac{a}{b} with a,bZa, b \in \mathbb{Z} and b0b \neq 0 that equals 2\sqrt{2} exactly.

Remark (A Historical Crisis)

The discovery of irrational numbers is traditionally attributed to the Pythagorean school (circa 5th century BC). The Pythagoreans believed that all magnitudes could be expressed as ratios of whole numbers. The realisation that the diagonal of a unit square cannot be so expressed is said to have caused a genuine intellectual crisis. According to legend, the member who disclosed this fact, Hippasus of Metapontum, was drowned at sea for his trouble.

Proving that a real number is irrational is not particularly easy, in general. The classical proof that 2Q\sqrt{2} \notin \mathbb{Q} proceeds by contradiction and is one of the most celebrated arguments in all of mathematics. We will carry out this proof later. For now, the interested reader may consult the proof that 2\sqrt{2} is irrational. Similar arguments establish the irrationality of 3\sqrt{3}, 5\sqrt{5}, and in fact n\sqrt{n} for any natural number nn that is not a perfect square.

Other important irrational numbers arise throughout mathematics: π\pi (the ratio of a circle’s circumference to its diameter) and ee (the base of the natural logarithm) are both irrational, though their proofs require substantially more machinery.

We can use the irrationality of 2\sqrt{2} to observe something about how rational and irrational numbers interact under multiplication.

Example 18

Let a=b=2a = b = \sqrt{2}. Then aa and bb are both irrational, yet ab=2=21ab = 2 = \frac{2}{1}, which is rational (Definition 27). The fraction arithmetic established in Problem 20 applies to this number. So the product of two irrational numbers can be rational.

Problem 21

Let rr be a rational number and let aa be an irrational number. Prove that it is possible that rara be rational, and it is possible that rara be irrational.

Complex Numbers (C\mathbb{C})

We have seen that multiplication by real numbers corresponds with scaling and reflection of the number line: scaling alone when the multiplicand is positive, and scaling with reflection when it is negative. We could alternatively interpret this reflection as a rotation by half a turn, since the effect on the number line is the same.

You might then wonder what happens if we rotate by arbitrary angles, rather than only half turns. What we end up with is a plane of numbers, not merely a line. Moreover, the rules that we expect arithmetic operations to satisfy still hold: addition corresponds with translation, and multiplication corresponds with scaling and rotation. This resulting number system is that of the complex numbers.

Definition 30 (The Complex Numbers)

The complex numbers are those obtained from the non-negative real numbers upon rotation by any angle about the point 00. We write C\mathbb{C} for the collection of all complex numbers; thus, the notation zCz \in \mathbb{C} means that zz is a complex number.

There is a particularly important complex number, ii, which is the point in the complex plane exactly one unit above 00:

The complex plane

Multiplication by ii has the effect of rotating the plane by a quarter turn anticlockwise. In particular, we have

i2=ii=1i^2 = i \cdot i = -1

The complex numbers have the astonishing property that square roots of all complex numbers exist, including all the real numbers.

Every complex number can be written in the form a+bia + bi, where a,bRa, b \in \mathbb{R}. This number corresponds with the point on the complex plane obtained by moving aa units to the right and bb units up, reversing directions as usual if aa or bb is negative. Arithmetic on the complex numbers works just as with the real numbers; in particular, using the fact that i2=1i^2 = -1, we obtain

(a+bi)+(c+di)=(a+c)+(b+d)i(a + bi) + (c + di) = (a + c) + (b + d)i (a+bi)(c+di)=(acbd)+(ad+bc)i(a + bi) \cdot (c + di) = (ac - bd) + (ad + bc)i

We will discuss complex numbers further in the portion of this course on polynomials.

Polynomials

Each of the number sets introduced above comes equipped with nicely behaving notions of addition and multiplication. Polynomials are built from these two operations.

Definition 31 (Polynomial)

Let S=N,Z,Q,RS = \mathbb{N}, \mathbb{Z}, \mathbb{Q}, \mathbb{R} or C\mathbb{C}. A (univariate) polynomial over SS in the indeterminate xx is an expression of the form

a0+a1x++anxna_0 + a_1 x + \cdots + a_n x^n

where nNn \in \mathbb{N} and each akSa_k \in S. The numbers aka_k are called the coefficients of the polynomial. If not all coefficients are zero, the largest value of kk for which ak0a_k \neq 0 is called the degree of the polynomial. By convention, the degree of the polynomial 00 is -\infty, indicating that 00 has no highest nonzero power term.

Polynomials of degree 1,2,3,41, 2, 3, 4 and 55 are respectively called linear, quadratic, cubic, quartic and quintic polynomials.

Example 19

The following expressions are all polynomials:

32x1(3+i)x2x3 \qquad 2x - 1 \qquad (3 + i)x^2 - x

Their degrees are 00, 11 and 22, respectively. The first two are polynomials over Z\mathbb{Z}, and the third is a polynomial over C\mathbb{C}.

Problem 22

Write down a polynomial of degree 44 over R\mathbb{R} which is not a polynomial over Q\mathbb{Q}.

Instead of writing out the coefficients of a polynomial each time, we may write p(x)p(x) or q(x)q(x). The "(x)(x)" indicates that xx is the indeterminate of the polynomial. If α\alpha is a number and p(x)p(x) is a polynomial in indeterminate xx, we write p(α)p(\alpha) for the result of substituting α\alpha for xx in the expression p(x)p(x).

Note that, if SS is any of the sets N,Z,Q,R\mathbb{N}, \mathbb{Z}, \mathbb{Q}, \mathbb{R} or C\mathbb{C}, and p(x)p(x) is a polynomial over SS, then p(α)Sp(\alpha) \in S for all αS\alpha \in S.

Example 20

Let p(x)=x33x2+3x1p(x) = x^3 - 3x^2 + 3x - 1. Then p(x)p(x) is a polynomial over Z\mathbb{Z} with indeterminate xx. For any integer α\alpha, the value p(α)p(\alpha) will also be an integer. For example:

p(0)=03302+301=1andp(3)=33332+331=8p(0) = 0^3 - 3 \cdot 0^2 + 3 \cdot 0 - 1 = -1 \qquad \text{and} \qquad p(3) = 3^3 - 3 \cdot 3^2 + 3 \cdot 3 - 1 = 8
Definition 32 (Root of a Polynomial)

Let p(x)p(x) be a polynomial. A root of p(x)p(x) is a complex number α\alpha such that p(α)=0p(\alpha) = 0.

The quadratic formula tells us that the roots of the polynomial x2+ax+bx^2 + ax + b, where a,bCa, b \in \mathbb{C}, are precisely the complex numbers

a+a24b2andaa24b2\frac{-a + \sqrt{a^2 - 4b}}{2} \qquad \text{and} \qquad \frac{-a - \sqrt{a^2 - 4b}}{2}

Note our avoidance of the symbol "±\pm", which is commonly found in discussions of quadratic polynomials. The symbol "±\pm" is dangerous because it may suppress the word “and” or the word “or”, depending on context. This kind of ambiguity is not something we will want to deal with when discussing the logical structure of a proposition (Lesson 1).

Example 21

Let p(x)=x22x+5p(x) = x^2 - 2x + 5. The quadratic formula tells us that the roots of pp are:

2+4452=1+4=1+2iand24452=14=12i\frac{2 + \sqrt{4 - 4 \cdot 5}}{2} = 1 + \sqrt{-4} = 1 + 2i \qquad \text{and} \qquad \frac{2 - \sqrt{4 - 4 \cdot 5}}{2} = 1 - \sqrt{-4} = 1 - 2i

The numbers 1+2i1 + 2i and 12i1 - 2i are related in that their real parts are equal and their imaginary parts differ only by a sign.

A recurring technique in mathematics is completing the square: rewriting a quadratic expression so that the indeterminate appears inside a single squared term. The key identity is

x2+ax+b=(x+a2)2+ba24x^2 + ax + b = \left(x + \frac{a}{2}\right)^2 + b - \frac{a^2}{4}

which one can verify by expanding the right-hand side. This is useful because the squared term (x+a/2)2(x + a/2)^2 is always non-negative, while the remaining constant ba2/4b - a^2/4 does not depend on xx.

Problem 23

(a) Find the smallest possible value of 2x23x+42x^2 - 3x + 4. Hint: write 2x23x+4=2(x3/4)2+  ?2x^2 - 3x + 4 = 2(x - 3/4)^2 + \;?

(b) Find the smallest possible value of x23x+2y2+4y+2x^2 - 3x + 2y^2 + 4y + 2.

(c) Find the smallest possible value of x2+4xy+5y24x6y+7x^2 + 4xy + 5y^2 - 4x - 6y + 7.

The following exercise uses completing the square to classify the real roots of a quadratic polynomial entirely in terms of its coefficients.

Problem 24 (Challenge)

Let a,bRa, b \in \mathbb{R} and let p(x)=x2+ax+bp(x) = x^2 + ax + b. The value Δ=a24b\Delta = a^2 - 4b is called the discriminant of pp.

(a) Suppose Δ0\Delta \geq 0. Show that the numbers a+Δ2\frac{-a + \sqrt{\Delta}}{2} and aΔ2\frac{-a - \sqrt{\Delta}}{2} both satisfy p(x)=0p(x) = 0.

(b) Suppose Δ<0\Delta < 0. Show that p(x)>0p(x) > 0 for all xx. Hint: complete the square.

(c) Use part (b) to prove that if xx and yy are not both 00, then x2+y2>0x^2 + y^2 > 0.

(d) For which real numbers α\alpha is it true that x2+αxy+y2>0x^2 + \alpha xy + y^2 > 0 whenever xx and yy are not both 00?

(e) Find the smallest possible value of x2+ax+bx^2 + ax + b. More generally, for c>0c > 0, find the smallest possible value of cx2+ax+bcx^2 + ax + b.

Example 22

Consider the polynomial x22x+5x^2 - 2x + 5. Its discriminant is (2)245=16(-2)^2 - 4 \cdot 5 = -16, which is negative. By Problem 24(b), x22x+5>0x^2 - 2x + 5 > 0 for all real xx, so this polynomial has no real roots. Its complex roots, 1+2i1 + 2i and 12i1 - 2i, were found in Example 21 via the quadratic formula.

Now consider the polynomial x22x3x^2 - 2x - 3. Its discriminant is (2)24(3)=16(-2)^2 - 4 \cdot (-3) = 16, which is non-negative. By Problem 24(a), its roots are 2+162=3\frac{2 + \sqrt{16}}{2} = 3 and 2162=1\frac{2 - \sqrt{16}}{2} = -1; and indeed

x22x3=(x+1)(x3)x^2 - 2x - 3 = (x + 1)(x - 3)
Problem 25

Let P(x)P(x) denote ”x2<xx^2 < x.” Determine whether P(x)P(x) is \top or \bot for each of the following: x=12x = \frac{1}{2}, x=1x = 1, x=3x = -3, x=0x = 0.

Problem 26

For each of the following numbers, list all of the sets N,Z,Q,R,C\mathbb{N}, \mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C} to which it belongs: 7-7,   34\;\frac{3}{4},   2\;\sqrt{2},   0\;0,   2+3i\;2 + 3i,   π\;\pi.

Problem 27

Let p(x)=x2+1p(x) = x^2 + 1. Show that pp has no real roots. Then find both roots of pp in C\mathbb{C}.