Books Sample

Functions

Definition 1.1function
A function 𝑓:𝐴→𝐡𝑓:𝐴\to 𝐡 is a rule that assigns to each π‘Žβˆˆπ΄π‘Ž\in 𝐴 exactly one π‘βˆˆπ΅π‘\in 𝐡. The set 𝐴𝐴 is the domain, and 𝐡𝐡 is a codomain.

The value at π‘Žπ‘Ž is written 𝑓(π‘Ž)𝑓(π‘Ž). Two functions 𝑓:𝐴→𝐡𝑓:𝐴\to 𝐡 and 𝑔:𝐢→𝐷𝑔:𝐢\to 𝐷 are the same when 𝐴=𝐢𝐴=𝐢, 𝐡=𝐷𝐡=𝐷, and 𝑓(π‘Ž)=𝑔(π‘Ž)𝑓(π‘Ž)=𝑔(π‘Ž) for every π‘Žβˆˆπ΄π‘Ž\in 𝐴 β€” even if the expressions look different. See Spivak (1967).

The graph is a set of pairs, not the rule:

graph(𝑓)={(π‘₯,𝑓(π‘₯)):π‘₯∈𝐴}\text{graph}(𝑓)=\{(π‘₯,𝑓(π‘₯)):π‘₯\in 𝐴\}
(1.1)

A picture of that set in the plane is useful, but it is not the function. The function is the rule. I keep wanting to say β€œthe function is the curve”; then I remember that two different-looking formulas can draw the same curve, and that some functions have no curve I can draw at all.

A first family

The identity 𝐼:Rβ†’R𝐼:\mathbb{R}\to \mathbb{R} given by 𝐼(π‘₯)=π‘₯𝐼(π‘₯)=π‘₯ is the dullest interesting example. A constant function 𝑐𝑏:Rβ†’R{𝑐}_{𝑏}:\mathbb{R}\to \mathbb{R} given by 𝑐𝑏(π‘₯)=𝑏{𝑐}_{𝑏}(π‘₯)=𝑏 forgets its input entirely. Absolute value is the first one that is not a single algebraic expression:

∣π‘₯∣={π‘₯if π‘₯β‰₯0βˆ’π‘₯if π‘₯<0|π‘₯|=\begin{cases}π‘₯\quad & \text{if}\, π‘₯\geq 0 \\ -π‘₯\quad & \text{if}\, π‘₯<0\end{cases}
(1.2)

Each piece is a function on a smaller domain; glued together they still assign one output to each real π‘₯π‘₯. That is all I am asking for. At 00 the two clauses agree, so there is no fight about the value.

Figure 1.1 A sketch of a graph in the plane
Table 1.1 Values of ∣π‘₯∣|π‘₯|
π‘₯π‘₯ βˆ’1-1 00 11
∣π‘₯∣|π‘₯| 11 00 11
def abs(x):
return x if x >= 0 else -x
Listing 1.1 Absolute value in Python

The picture is Figure 1.1, the table is Table 1.1, and the listing is Listing 1.1. All three are the same function (1.2), written three ways.

Domain is part of the data

The same formula on two domains is two functions. Restriction of π‘₯β†¦βˆ£π‘₯∣π‘₯\mapsto |π‘₯| to [0,∞)[0,\infty ) is the identity on that interval; restriction to (βˆ’βˆž,0](-\infty ,0] is π‘₯β†¦βˆ’π‘₯π‘₯\mapsto -π‘₯. I will need that distinction when I ask for an inverse.

I am not requiring a closed-form expression, and I am not requiring that the graph be drawable in one stroke. Continuity comes later. For now, a function may jump, or exist only on (0,1)(0,1), or be defined by a different clause on each integer. The definition does not care.

Example 1.1
The function Ο‡Q:Rβ†’R{\chi }_{\mathbb{Q}}:\mathbb{R}\to \mathbb{R} with Ο‡Q(π‘₯)=1{\chi }_{\mathbb{Q}}(π‘₯)=1 if π‘₯∈Qπ‘₯\in \mathbb{Q} and 00 otherwise is a perfectly good function. I cannot sketch it. That is my problem, not the definition’s.
Remark
Once I accept Example 1.1, β€œfunction” stops meaning β€œformula I can type.” A formula is one way to present a rule. The rule is the object.
Exercise 1.1
Let 𝑓(π‘₯)=π‘₯2π‘₯𝑓(π‘₯)=\frac{{π‘₯}^{2}}{π‘₯} for π‘₯β‰ 0π‘₯\neq 0, and let 𝑔(π‘₯)=π‘₯𝑔(π‘₯)=π‘₯ for all π‘₯∈Rπ‘₯\in \mathbb{R}. Are 𝑓𝑓 and 𝑔𝑔 the same function?
Solution to Exercise 1.1
No. The domain of 𝑓𝑓 is Rβˆ–{0}\mathbb{R}βˆ–\{0\}, the domain of 𝑔𝑔 is R\mathbb{R}. They agree where both are defined, and that is not enough. If I extend 𝑓𝑓 by setting 𝑓(0)=0𝑓(0)=0, then the extension equals 𝑔𝑔.