Possibly related, though of a different flavour.
Background
In most of the precalculus texts with which I am familiar, readers/students are given a crash course in set theory, handed the definition of a relation, then told that a function is a special kind of relation that associates only one element of the codomain to each element of the domain. For example, a relevant screenshot from Sullivan's Precalculus:
This is, of course, entirely correct. A function is defined by its domain, its codomain, and how it associates elements of the domain with elements of the codomain.
The problem I have with this standard approach is that students are often asked to answer questions of the type
Let $f(x) := \sqrt{x+3}$. What are the the domain and range $f$?.
It seems that students are meant to implicitly understand that $f$ is a real-valued function of a real variable. However, as neither is actually specified, there are two reasonable answers:
- The domain is $\mathbb{R}$. In this case, the codomain is $\mathbb{C}$, at which point the question of the range becomes quite difficult, as I imagine we don't want to talk about branches of complex functions in a precalculus class. Unfortunately, most of my college freshman precalculus students have been exposed (if only briefly) to complex numbers in their high school algebra classes, so they often want to argue that $\sqrt{-4} = -2i$, and therefore there is no issue with negative real numbers.
The domain is $[-3,\infty)$, in which case I would argue that the question is ill-posed, and might better be written
Let $f(x) := \sqrt{x+3}$. What is the largest set of real numbers on which this formula defines a function with codomain $\mathbb{R}$? What is the range of this function?
This seems reasonable, but there is something about it that just "tastes" off to me. I can't really put my finger on the discomfort, but I feel like this approach causes some confusion when we describe restricting domains in order to define inverse functions.
I am also concerned that this approach elides the importance of specifying the domain before defining a function---a function without a specified domain doesn't even make sense, so what is the notation $f(x)$ meant to represent?
My Solution
Instead of taking the traditional route, I am considering the introduction of a slightly modified definition of a function:
A function $f : X \to Y$ is a relation that associates to each element of $X$ at most one element of $Y$. The set $X$ is called the natural domain, and the set $Y$ is called the natural range (or codomain). If $x\in X$ and there is some $y\in Y$ such that $f$ associates $y$ to $x$, then we write $x\mapsto y$ and say that $y$ is the image of $f$ at $x$. The set of all $x\in X$ such that $x\mapsto y$ for some $y\in Y$ is called the domain of $f$, and the set of all $y$ such that $x \mapsto y$ for some $x\in X$ is called the range of $f$.
Here the question of the domain and range of $f(x) := \sqrt{x+3}$ becomes straightforward:
Define a function $f : \mathbb{R} \to \mathbb{R}$ by $f(x) := \sqrt{x+3}$. What are the domain and range of $f$?
Additionally, we continue to emphasize the fact that the collection of possible inputs and outputs is specified in advance, thus dealing with the potential observation that imaginary numbers exist---we've already ruled them out as outputs by specifying the codomain.
I don't think that this approach is entirely unreasonable, and it even has some moderate precedent. For example, when dealing with unbounded operators on Banach spaces, we understand that the operators naturally live on the Banach space, but must be restricted to the domain where they actually make sense.
Questions
In writing $f : X \to Y$, we are saying that $X$ is the largest set of values that we want to consider as inputs, rather than the actual set of inputs. The emphasis is on first determining the universe of possible inputs, then deciding on which inputs are actually valid (as opposed to the reverse). Does this seem like a reasonable approach?
This is nonstandard, and actively conflicts with the usual notation. However, most of my precalculus students are unlikely to take higher math (indeed, for many of them precalculus is a terminal math class), and I think that those going on to calculus or even proofs-based math classes should be just fine. As such, am I causing any harm if I introduce the concepts in this way?
Am I missing anything important? Is there any obvious drawback to this approach?