More about the definition of function

Maya Incaand commented on my post Definition of "function":

Why did you decide against "two inequivalent descriptions in common use"?  Is it no longer true?

This question concerns [1], which is a draft article.  I have not promoted it to the standard article in abstractmath because I am not satisfied with some things in it. 

More specifically, there really are two inequivalent descriptions in common use.  This is stated by the article, buried in the text, but if you read the beginning, you get the impression that there is only one specification.  I waffled, in other words, and I expect to rewrite the beginning to make things clearer.

Below are the two main definitions you see in university courses taken by math majors and grad students.  A functional relation has the property that no two distinct ordered pairs have the same first element.

Strict definition: A function consists of a functional relation with specified codomain (the domain is then defined to be the set of first elements of pairs in the relation).  Thus if $A$ and $B$ are sets and $A\subseteq B$, then the identity function $1_A:A\to A$ and the inclusion function $i:A\to B$  are two different functions.

Relational definition: A function is a functional relation.  Then the identity and inclusion functions are the same function.  This means that a function and its graph are the same thing (discussed in the draft article).

These definitions are subject to variations:

Variations in the strict definition: Some authors use "range" for "codomain" in the definition, and some don't make it clear that two functions with the same functional relation but different codomains are different functions.

Variations in the relational definition: Most such definitions state explicitly that the domain and range are determined by the relation (the set of first coordinates and the set of second coordinates). 

Formalism

There are many other variations in the formalism used in the definition.  For example, the strict definition can be formalized (as in Wikipedia) as an ordered triple $(A, B, f)$ where $A$ and $B$ are sets and $f$ is a functional relation with the property thar every element of $A$ is the first element of an ordered pair in the relation.  

You could of course talk about an ordered triple $(A,f,B)$ blah blah.  Such definitions introduce arbitrary constructions that have properties irrelevant to the concept of function.  Would you ever say that the second element of the function $f(x)=x+1$ on the reals is the set of real numbers?  (Of course, if you used the formalism $(A,f,B)$ you would have to say the second element of the function is its graph! )

It is that kind of thing that led me to use a specification instead of a definition.  If you pay attention to such irrelevant formalism there seems to be many definitions of function.  In fact, at the university level there are only two, the strict definition and the relational definition.  The usage varies by discipline and age.  Younger mathematicians are more likely to use the strict definition.  Topologists use the strict definition more often than analysts (I think).

Usage

There is also variation in usage.

  • Most authors don't tell you which definition they use, and it often doesn't matter anyway. 
  • If an author defines a function using a formula, there is commonly an implicit assumption that the domain includes everything for which the formula is well-defined.  (The "everything" may be modified by referring to it as an integer, real, or complex function.)

Definitions of function on the web

Below are some definitions of function that appear on the web.  I have excluded most definitions aimed at calculus students or below; they often assume you are talking about numbers and formulas.  I have not surveyed textbooks and research papers.  That would have to be done for a proper scholarly article about mathematical usage of "function". But most younger people get their knowledge from the web anyway.

  1. Abstractmath draft article: Functions: Specification and Definition.  (Note:  Right now you can't get to this from the Table of Contents; you have to click the preceding link.) 
  2. Gyre&Gimble post: Definition of "function"
  3. Intmath discussion of function  Function as functional relation between numbers, with induced domain and range.
  4. Mathworld definition of function Functional-relation definition.  Defines $F:A\to B$ in a way that requires $B$ to be the image.
  5. Planet Math definition of function Strict definition.
  6. Prime Encyclopedia of Mathematics Functional-relation definition.
  7. Springer Encyclopedia of Math definition of function  Strict definition, except not clear if different codomains mean different functions.
  8. Wikipedia definition of function Discusses both definitions.
  9. Wisconsin Department of Public Instruction Definition of function  Function as functional relation.

The Mathematical Definition of Function

Introduction

This post is a completely rewritten version of the abstractmath article on the definition of function. Like every part of abstractmath, the chapter on functions is designed to get you started thinking about functions. It is no way complete. Wikipedia has much more complete coverage of mathematical functions, but be aware that the coverage is scattered over many articles.

The concept of function in mathematics is as important as any mathematical idea. The mathematician’s concept of function includes the kinds of functions you studied in calculus but is much more abstract and general. If you are new to abstract math you need to know:

  • The precise meaning of the word “function” and other concepts associated with functions. That’s what this section is about.
  • Notation and terminology for functions. (That will be a separate section of abstractmath.org which I will post soon.)
  • The many different kinds of functions there are. (See Examples of Functions in abmath).
  • The many ways mathematicians think about functions. The abmath article Images and Metaphors for Functions is a stub for this.

I will use two running examples throughout this discussion:

  • $latex {F}&fg=000000$ is the function defined on the set $latex {\left\{1,\,2,3,6 \right\}}&fg=000000$ as follows: $latex {F(1)=3,\,\,\,F(2)=3,\,\,\,F(3)=2,\,\,\,F(6)=1}&fg=000000$. This is a function defined on a finite set by explicitly naming each value.
  • $latex {G}&fg=000000$ is the real-valued function defined by the formula $latex {G(x)={{x}^{2}}+2x+5}&fg=000000$.

Specification of function

We start by giving a specification of “function”. (See the abstractmath article on specification.) After that, we get into the technicalities of the definitions of the general concept of function.

Specification: A function $latex {f}&fg=000000$ is a mathematical object which determines and is completely determined bythe following data:

  • $latex {f}&fg=000000$ has a domain, which is a set. The domain may be denoted by $latex {\text{dom }f}&fg=000000$.
  • $latex {f}&fg=000000$ has a codomain, which is also a set and may be denoted by $latex {\text{cod }f}&fg=000000$.
  • For each element $latex {a}&fg=000000$ of the domain of $latex {f}&fg=000000$, $latex {f}&fg=000000$ has a value at $latex {a}&fg=000000$, denoted by $latex {f(a)}&fg=000000$.
  • The value of $latex {f}&fg=000000$ at $latex {a}&fg=000000$ is completely determined by $latex {a}&fg=000000$ and $latex {f}&fg=000000$ .
  • The value of $latex {f}&fg=000000$ at $latex {a}&fg=000000$ must be an element of the codomain of $latex {f}&fg=000000$.

The operation of finding $latex {f(a)}&fg=000000$ given $latex {f}&fg=000000$ and $latex {a}&fg=000000$ is called evaluation.

Examples

  • The definition above of the finite function $latex {F}&fg=000000$ specifies that the domain is the set $latex {\left\{1,\,2,\,3,\,6 \right\}}&fg=000000$. The value of $latex {F}&fg=000000$ at each element of the domain is given explicitly. The value at 3, for example, is 2, because the definition says that $latex {F(2) = 3}&fg=000000$. The codomain of $latex {F}&fg=000000$ is not specified, but must include the set $latex {\{1,2,3\}}&fg=000000$.
  • The definition of $latex {G}&fg=000000$ above gives the value at each element of the domain by a formula. The value at 3, for example, is $latex {G(3)=3^2+2\cdot3+5=20}&fg=000000$. The definition does not specify the domain or the codomain. The convention in the case of functions defined on the real numbers by a formula is to take the domain to be all real numbers at which the formula is defined. In this case, that is every real number, so the domain is $latex {{\mathbb R}}&fg=000000$. The codomain must include all real numbers greater than or equal to 4. (Why?)

Comment: The formula above that defines the function $latex G$ in fact defines a function of complex numbers (even quaternions).

Definition of function

In the nineteenth century, mathematicians realized that it was necessary for some purposes (particularly harmonic analysis) to give a mathematical definition of the concept of function. A stricter version of this definition turned out to be necessary in algebraic topology and other fields, and that is the one I give here.

To state this definition we need a preliminary idea.

The functional property

A set R of ordered pairs has the functional property if two pairs in R with the same first coordinate have to have the same second coordinate (which means they are the same pair).

Examples

  • The set $latex {\{(1,2), (2,4), (3,2), (5,8)\}}&fg=000000$ has the functional property, since no two different pairs have the same first coordinate. It is true that two of them have the same second coordinate, but that is irrelevant.
  • The set $latex {\{(1,2), (2,4), (3,2), (2,8)\}}&fg=000000$ does not have the functional property. There are two different pairs with first coordinate 2.
  • The graphs of functions in beginning calculus have the functional property.
  • The empty set $latex {\emptyset}&fg=000000$ has the functional property .

Example: Graph of a function defined by a formula

The graph of the function $latex {G}&fg=000000$ given above has the functional property. The graph is the set

$latex \displaystyle \left\{ (x,{{x}^{2}}+2x+5)\,\mathsf{|}\,x\in {\mathbb R} \right\}.&fg=000000$

If you repeatedly plug in one real number over and over, you get out the same real number every time. Example:

  • if $latex {x = 0}&fg=000000$, then $latex {{{x}^{2}}+2x+5=5}&fg=000000$.  You get 5 every time you plug in 0.
  • if $latex {x = 1}&fg=000000$, then $latex {{{x}^{2}}+2x+5=8}&fg=000000$.
  • if $latex {x =-2}&fg=000000$, then $latex {{{x}^{2}}+2x+5=5}&fg=000000$.

This set has the functional property because if $latex {x}&fg=000000$ is any real number, the formula $latex {{{x}^{2}}+2x+5}&fg=000000$ defines a specific real number. (This description of the graph implicitly assumes that $latex {\text{dom } G={\mathbb R}}&fg=000000$.)  No other pair whose first coordinate is $latex {-2}&fg=000000$ is in the graph of $latex {G}&fg=000000$, only $latex {(-2, 5)}&fg=000000$. That is because when you plug $latex {-2}&fg=000000$ into the formula $latex {{{x}^{2}}+2x+5}&fg=000000$, you get $latex {5}&fg=000000$ every time. Of course, $latex {(0, 5)}&fg=000000$ is in the graph, but that does not contradict the functional property. $latex {(0, 5)}&fg=000000$ and $latex {(-2, 5)}&fg=000000$ have the same second coordinate, but that is OK.

How to think about the functional property

The point of the functional property is that for any pair in the set of ordered pairs, the first coordinate determines what the second one is. That’s why you can write “$latex {G(x)}&fg=000000$” for any $latex {x }&fg=000000$ in the domain of $latex {G}&fg=000000$ and not be ambiguous.

Mathematical definition of function

A function$latex {f}&fg=000000$ is a mathematical structure consisting of the following objects:

  • A set called the domain of $latex {f}&fg=000000$, denoted by $latex {\text{dom } f}&fg=000000$.
  • A set called the codomain of $latex {f}&fg=000000$, denoted by $latex {\text{cod } f}&fg=000000$.
  • A set of ordered pairs called the graph of $latex { f}&fg=000000$, with the following properties:
    • $latex {\text{dom } f}&fg=000000$ is the set of all first coordinates of pairs in the graph of $latex {f}&fg=000000$.
    • Every second coordinate of a pair in the graph of $latex {f}&fg=000000$ is in $latex {\text{cod } f}&fg=000000$ (but $latex {\text{cod } f}&fg=000000$ may contain other elements).
    • The graph of $latex {f}&fg=000000$ has the functional property. Using arrow notation, this implies that $latex {f:A\rightarrow B}&fg=000000$.

Examples

  • Let $latex {F}&fg=000000$ have graph $latex {\{(1,2), (2,4), (3,2), (5,8)\}}&fg=000000$ and define $latex {A = \{1, 2, 3, 5\}}&fg=000000$ and $latex {B = \{2, 4, 8\}}&fg=000000$. Then $latex {F:A\rightarrow B}&fg=000000$ is a function.
  • Let $latex {G}&fg=000000$ have graph $latex {\{(1,2), (2,4), (3,2), (5,8)\}}&fg=000000$ (same as above), and define $latex {A = \{1, 2, 3, 5\}}&fg=000000$ and $latex {C = \{2, 4, 8, 9, 11, \pi, 3/2\}}&fg=000000$. Then $latex {G:A\rightarrow C}&fg=000000$ is a (admittedly ridiculous) function. Note that all the second coordinates of the graph are in $latex {C}&fg=000000$, along with a bunch of miscellaneous suspicious characters that are not second coordinates of pairs in the graph.
  • Let $latex {H}&fg=000000$ have graph $latex {\{(1,2), (2,4), (3,2), (5,8)\}}&fg=000000$. Then $latex {H:A\rightarrow {\mathbb R}}&fg=000000$ is a function.

According to the definition of function, $latex {F}&fg=000000$, $latex {G}&fg=000000$ and $latex {H}&fg=000000$ are three different functions.

Identity and inclusion

Suppose we have two sets A and B with $latex {A\subseteq B}&fg=000000$.

  • The identity function on A is the function $latex {{{\text{id}}_{A}}:A\rightarrow A}&fg=000000$ defined by $latex {{{\text{id}}_{A}}(x)=x}&fg=000000$ for all$latex {x\in A}&fg=000000$. (Many authors call it $latex {{{1}_{A}}}&fg=000000$).
  • The inclusion function from A to B is the function $latex {i:A\rightarrow B}&fg=000000$ defined by $latex {i(x)=x}&fg=000000$ for all $latex {x\in A}&fg=000000$. Note that there is a different function for each pair of sets A and B for which $latex {A\subseteq B}&fg=000000$. Some authors call it $latex {{{i}_{A,\,B}}}&fg=000000$ or $latex {\text{in}{{\text{c}}_{A,\,B}}}&fg=000000$.

Remark The identity function and an inclusion function for the same set A have exactly the same graph, namely $latex {\left\{ (a,a)|a\in A \right\}}&fg=000000$.

Graphs and functions

  • If $latex {f}&fg=000000$ is a function, the domain of $latex {f}&fg=000000$ is the set of first coordinates of all the pairs in $latex {f}&fg=000000$.
  • If $latex {x\in \text{dom } f}&fg=000000$, then $latex {f(x)}&fg=000000$ is the second coordinate of the only ordered pair in $latex {f}&fg=000000$ whose first coordinate is $latex {x}&fg=000000$.

Examples

The set $latex {\{(1,2), (2,4), (3,2), (5,8)\}}&fg=000000$ has the functional property, so it is the graph of a function. Call the function $latex {H}&fg=000000$. Then its domain is $latex {\{1,2,3,5\}}&fg=000000$ and $latex {H(1) = 2}&fg=000000$ and $latex {H(2) = 4}&fg=000000$. $latex {H(4)}&fg=000000$ is not defined because there is no ordered pair in H beginning with $latex {4}&fg=000000$ (hence $latex {4}&fg=000000$ is not in $latex {\text{dom } H}&fg=000000$.)

I showed above that the graph of the function $latex {G}&fg=000000$, ordinarily described as “the function $latex {G(x)={{x}^{2}}+2x+5}&fg=000000$”, has the functional property. The specification of function requires that we say what the domain is and what the value is at each point. These two facts are determined by the graph.

Other definitions of function

Because of the examples above, many authors define a function as a graph with the functional property. Now, the graph of a function $latex {G}&fg=000000$ may be denoted by $latex {\Gamma(G)}&fg=000000$.  This is an older, less strict definition of function that doesn’t work correctly with the concepts of algebraic topology, category theory, and some other branches of mathematics.

For this less strict definition of function, $latex {G=\Gamma(G)}&fg=000000$, which causes a clash of our mental images of “graph” and “function”. In every important way except the less-strict definition, they ARE different!

A definition is a device for making the meaning of math technical terms precise. When a mathematician think of “function” they think of many aspects of functions, such as a map of one shape into another, a graph in the real plane, a computational process, a renaming, and so on. One of the ways of thinking of a function is to think about its graph. That happens to be the best way to define the concept of function.  (It is the less strict definition and it is a necessary concept in the modern definition given here.)

The occurrence of the graph in either definition doesn’t make thinking of a function in terms of its graph the most important way of visualizing  it. I don’t think it is even in the top three.

Technical meanings clash with everyday meanings

Recently (see note [a]) on MathOverflow, Colin Tan asked [1] “What does ‘kernel’ mean in ‘integral kernel’?”  He had noticed the different use of the word in referring to the kernels of morphisms.

I have long thought [2] that the clash between technical meanings and everyday meaning of technical terms (not just in math) causes trouble for learners.  I have recently returned to teaching (discrete math) and my feeling is reinforced — some students early in studying abstract math cannot rid themselves of thinking of a concept in terms of familiar meanings of the word.

One of the worst areas is logic, where “implies” causes well-known bafflement.   “How can ‘If P then Q’ be true if P is false??”  For a large minority of beginning college math students, it is useless to say, “Because the truth table says so!”.  I may write in large purple letters (see [3] for example) on the board and in class notes that The Definition of a Technical Math Concept Determines Everything That Is True About the Concept but it does not take.  Not nearly.

The problem seems to be worse in logic, which changes the meaning of words used in communicating math reasoning as well as those naming math concepts. But it is bad enough elsewhere in math.

Colin’s question about “kernel” is motivated by these feelings, although in this case it is the clash of two different technical meanings given to the same English word — he wondered what the original idea was that resulted in the two meanings.  (This is discussed by those who answered his question.)

Well, when I was a grad student I made a more fundamental mistake when I was faced with two meanings of the word “domain” (in fact there are at least four meanings in math).  I tried to prove that the domain of a continuous function had to be a connected open set.  It didn’t take me all that long to realize that calculus books talked about functions defined on closed intervals, so then I thought maybe it was the interior of the domain that was a, uh, domain, but I pretty soon decided the two meanings had no relation to each other.   If I am not mistaken Colin never thought the two meanings of “kernel” had a common mathematical definition.

It is not wrong to ask about the metaphor behind the use of a particular common word for a technical concept.  It is quite illuminating to get an expert in a subject to tell about metaphors and images they have about something.  Younger mathematicians know this.  Many of the questions on MathOverflow are asking just for that.  My recollection of the Bad Old Days of Abstraction and Only Abstraction (1940-1990?) is that such questions were then strongly discouraged.

Notes

[a] The recent stock market crash has been blamed [4] on the fact that computers make buy and sell decisions so rapidly that their actions cannot be communicated around the world fast enough because of the finiteness of the speed of light.  This has affected academic exposition, too.  At the time of writing, “recently” means yesterday.

References

[1] Colin Tan, “What does ‘kernel’ mean in ‘integral kernel’?

[2] Commonword names for technical concepts (previous blog).

[3] Definitions. (Abstractmath).

[4] John Baez, This weeks finds in mathematical physics, Week 297.