When you’re trying to work out whether something’s a function, there are three bits of the definition where things can go wrong:
- “each ”
A function must be defined for every single element of the domain. Why does not define a function ?
is not defined at zero
- “unique element”
A function must have only one value at any given element of the domain. If we set to be the real number whose square is , why does that not define a function ?
could be or .
A function must return values within its codomain. Why does not define a function ?
does not lie inside .
Two functions are equal if:
they have the same domain and codomain, as ; and
their values are equal, for every point in the domain: in other words, for all , we have .
Given two functions and , we can define their composite by the rule:
Functions don’t have to be described by formulae (as they are in the examples, and non-examples, above).
For example, if the domain is finite we can define them pictorially. Accordingly, here is a function from the set of Teletubbies, as considered earlier, to the set of colours:
Now we’re well-equipped to describe functions, we can start describing their properties.
Here are some useful words.
Definition: A function is said to be injective if, for any two elements with , then . I think of this as saying that “nothing is hit twice”, or equivalently that “no two elements of the domain have the same image”.
Definition: A function is said to be surjective if, for every element , there is some element with . I think of this as saying that “every element of the codomain is hit at least once”.
Definition: A function is said to be bijective if it is both injective and surjective. I think of this as saying that “every element of the codomain is hit exactly once”.
For example, let’s consider our function assigning colours to Teletubbies.
It is injective, because each one of the Teletubbies has a different colour.
However, it is not surjective, because there are no pink Teletubbies in all of Teletubbyland. Hence it is also not bijective.
Also, note that these properties (injective, surjective, bijective) don’t just depend on the rule that defines it: they depend on the domain and codomain.
For example, consider the rule . Is this injective, considered as a function ?
Yes! Every natural number has a different square.
Is it injective as a function ?
Similarly, consider the rule . Is this surjective, considered as a function ?
No; there is no with .
Is it surjective as a function ?
Yes it is! For any we have .
Note that that function also has an inverse, a function which undoes . Namely, we can take the inverse to be .
You’ll see a lot more about inverses next semester.
By the way, I’d like you to try to remove phrases like “one-to-one” from your vocabulary: it’s never clear whether “ is one-to-one” means “ is injective”, “ is bijective”, or simply “ is a function”, and many people who use it treat this as an excuse for not explaining which they mean.
Now we’ll briefly move on to another building block of mathematics: logic. Logic studies the properties of statements, which can be either true or false.
Much of logic involves deductive reasoning. Here’s the definition that encapsulates that:
Definition: Let and be statements. We say that implies , written , to mean “if is true, then also has to be true”.
There are many common ways of saying the same thing, used by mathematicians. These include:
If , then ;
only if ;
is sufficient for ;
is necessary for .
Notice that cannot be used to mean “ is true, and so is also true”.
For example, let be the statement “I visited Cardiff last week”, and be the statement “I’ve been to Wales this month”. We can all agree that is true, which says
“If I visited Cardiff last week, then I must have been to Wales in the last month.”
However, as it happens, neither of these is true: in fact, I haven’t been in Wales for a while longer than that.
As such, it is quite different to saying “ is true, and therefore is also true”. Beginning students often get these confused.
The implication only says something interesting about if happens to be true! If is false, then we have no matter whether is true or false.
For example, it’s correct to say
“If , then this course is lectured by Dr Cranch”.
“If , then this course is lectured by Robert de Niro”.
This may be a surprise if you’re basing your intuition on ordinary English, where people use the words “if…then” in several different ways, sometimes slightly ambiguously.
Another important point is that if does not say that is true only if is true (that would be , in fact).
So it’s correct to say
If it rains next Wednesday, then .
In fact, it’s true that no matter whether it rains next Wednesday, but that’s not a problem. Whether or not it’s helpful to say that is another question!
We can sum up the comments above by giving a truth table for implication. We write for false and for true.
First off, note that if is true, then is definitely true no matter whether is true.
Also, if is false, then is true no matter whether is true.
In fact, it’s only if is true and is false that is false.