Intro to Math - 1
The logical underbelly of mathematics feels almost secretive, like something "big mathematics" does not want you to see. But the truth is, there is probably no single exact formal logic used all the time everywhere.
(I am not a formal logic guy, so this section will be short and take it with a big pile of salt).
Among other things, mathematical logic is the study of writing mathematical arguments in formal logical systems. But mathematics itself is not only the study of formal logic.
One of the things that bothered me when I first started out was the act of over-formalization. I thought I would have to write all my mathematical arguments in perfect first-order logic.
There has been a lot of work on making formal foundations for set theory, the natural numbers, and constructions that extend from the natural numbers all the way to the algebraically closed complex numbers (meaning any univariate polynomial with complex coefficients has zeros in the complex numbers).
And now, the formal logical foundations of mathematics are quite strong. Today, most textbooks and papers are not sticklers for setting up set theory from scratch every time, or being extremely careful about which formal logic system we are (implicitly) using and so on.
Instead, there is comfort in writing mathematics in what I call mathematical English. This is some mixture of English, notation, and something resembling first-order logic, where you have propositions but also quantifiers.
Propositions
A proposition is a statement that is clearly either true or false, never both, and never ambiguous.
For example:
"Pigs have the innate biological ability to fly with no external assistance whatsoever."
This is a statement we can all agree is false.
Similarly, in mathematics, a statement like:
"1 is a natural number"
is a proposition.
Classical logic works on the principle that if
This includes the law of the excluded middle: if a statement is not true, then it is false; if it is not false, then it is true.
We can also negate a proposition. The negation of
Implication
One of the most important tools in mathematics is implication, written
For example:
"If
is a natural number, then is a natural number."
We know this implication is true, because
To be precise, we can connect implication to the logical connectives
Formally:
Now, let us look at the truth table. (Here
We see that the only case where
This matches our intuition: starting from a true statement and then claiming it implies something false is simply wrong.
On the other hand, if
In mathematical writing, implications are usually hidden inside plain English, but it is good to be able to recognize them.
The Converse and the Contrapositive
The converse of
You should pause and ask: if an implication is true, is its converse always true? (Try reasoning in natural language, or check with a truth table if you are not convinced.)
The contrapositive of
The key fact is that the contrapositive is logically equivalent to the original implication: both have the same truth table.
That is why in mathematics we often use "proof by contrapositive", or the stronger "proof by contradiction".
If and Only If
If both
This is read as "p if and only if q", or simply "p iff q".
This kind of two-way implication is very common. Let us break it down.
- When
is true, we can say: whenever is true, must also be true. So is necessary for . - When
is true, then whenever is true, must also be true. So is sufficient for .
Thus,
is necessary and sufficient for .
Variables and Quantifiers
We really want to write statements like: "if
A quantifier allows you to make a statement about a variable.
Let us see another statement:
"For all natural numbers
, there exists a unique natural number called the successor of , ".
Here, we see two quantifiers (the most common in mathematics): For all, which in notation uses the inverted 'A',
Okay, let us examine them individually.
Take the statement:
"For all natural numbers
, is a natural number too."
What do you think is the negation of the above statement?
Is it: "For all natural numbers
Well, obviously not. When you make an assertion about all elements of some object, to negate that assertion, you only need to show ONE element of that object that does not fit the assertion.
The correct negation then is:
"Not all natural numbers
have the property that is also a natural number."
which naturally becomes a statement about the existence of a counterexample:
"There exists a natural number
such that is not a natural number."
That is, the negation of a "for all" assertion is a "there exists" counterexample assertion.
Next consider:
"There exists a rational number
for which ."
And its negation:
"There exists no rational number
for which ."
which naturally becomes a statement about universality:
"For all rational numbers
, ."
Cool!
Sets, and functions
You might see a statement compressed in math notation (note that
That is a bit of notation mess. Let us unpack it.
The blackboard capital fonts
We need a little more machinery to unpack the above statement. (We will not do a formal and axiomatic treatment of set theory.)
A set (often denoted with capital letters)
In order to do math, one has to allow undefined terms like "set" and "element", otherwise you can get into an infinite descent of defining a term, then defining the terms in that term, and so on.
The elements of a set can themselves be sets too. (There are some paradoxes that arise from this. However, for most math, there usually isn't a situation where such paradoxes arise, so we can ignore dealing with them.)
A set does not hold copies of elements — every element of a set is unique.
The only thing we need to build most of the set operations is the following: for any element
That is, we write
We can then use this "belongs to" or "is in" relation between elements and sets to define our familiar union, intersection, and difference.
The most common way to build sets is to use set-builder notation, which looks like
This means that
But in practice, of course,
For the following section, let
- Union: The set
. - Intersection: The set
. - Difference: The set
.
When we write
The empty set, and subsets
The empty set
That is, in the same way that it is nice to have an answer to "I give you X apples and then take them back, now how many do you have," it is also nice to have an answer to:
Now, we say that
"For each
, implies ."
(Note that for style and emphasis, "for all" may be written as "for every", "for each", and so on.)
Due to the logic of implications, the empty set
Now, two sets are equal if they both contain the exact same elements. That is,
In many proofs involving equality of two sets, we may first prove that
Note: the properties of union, intersection, De Morgan laws, and all that good stuff, are left as exercises for the reader. This is a good way to understand math logic, sets, and proofs for those that are new.
Functions
Functions are the heart of math. Almost everything is a "function + more rules". A linear map is just a function between vector spaces that respects the linear combination structure.
So what are they?
A function is an object that takes elements from one set and assigns them to elements of another set, but there are some rules.
First, write
Now, what are the rules?
- Every element
of (often called the domain of ) has to have an element in . - For a single input
, the function can only give a single output . That is, always denotes ONE element in . No more, no less.
And that's it.
Let us understand a little more now.
Firstly, I want you to think of the function as three things:
- The input set
, often called the domain of the function. - The output set
, which is called many things: "codomain", "range", "target" are some that I've seen. - A prescription or a rule, which tells us how elements of
are mapped to elements of .
To give this prescription explicitly, we write
Another way to write this prescription is the familiar
It is a little problematic to think of the function only as the prescription
The inputs and outputs can be natural numbers, integers, rational numbers, real numbers, or even complex numbers. In some cases, the function may even be ill-defined (the reader can pause here and work things out).
This is going to be a series, writing some basic equipment for doing math in a slightly conversational style.
Why do this when lots of texts do it better? I don't know, maybe one person will find this particular writing useful. And that's guuci.