Does $y = f(x) = ax+b$ actually have two mappings inside it?

188 Views Asked by At

I’m just a high school student, so I may be somewhat logically flawed in understanding this.

According to wikipedia, the definition of function requires an input $x$ with its domain $X$ and an output $y$ with its domain $Y$, and the function $f$ maps $x$ to $y$.

But how about $f(x)$? I often see syntaxes such as $f(1) = 0$ in my textbook. Doesn’t that mean it is $f(x)$ being first assigned a value and then transfer the value into $y$? So, there must be two transitions/mappings between the input $x$ and the output $y$ right?

My conceptual model of function is like this: A definition of function requires an input $x$ with its domain $X$, a forwarder $f(x)$ with its domain $F$ and an output $y$ with its domain $Y$. The function $f$ first maps $x$ to $f(x)$ then maps $f(x)$ to $y$.

These two definitions are not quite the same.


On 2022.6.29: The picture below had solved my confusion.

enter image description here

5

There are 5 best solutions below

1
On BEST ANSWER

Equality is not just a mapping. It means two things are one and the same.

We wrote $f(x) = y$ not to indicate that we are mapping $f(x)$ to $y$; it means that $f(x)$ is $y$.

Consider a function $f$ that maps any value $x$ in the domain $\mathbb Z$ (the integers) to a value $y$ in the codomain $\mathbb Z$. (Codomain rather than domain is the correct word here.) In particular, $f$ is the function that maps each integer to the previous integer, so $f$ maps $3$ to $2$, $f$ maps $2$ to $1,$ and $f$ maps $1$ to $0.$

Then the notation $f(1)$ is simply a way of saying "the number that $f$ maps $1$ to." So if you ask, "What is $f(1)$," the answer is $0$, because $f$ maps $1$ to $0$.

Again: $f$ maps $1$ to $0$, therefore the number $f$ maps $1$ to is $0$; that is, $f(1)$ is $0$. We express this in the equation, $f(1) = 0$.


It is certainly possible to set up a situation in which a member of one set is mapped to something which is then mapped to something else. But that is not how a single function is defined. A function defines exactly one transition from one set to another, and the notation $f(x)$ is one way to express the final result of that transition. If $f$ maps from a domain $X$ to a codomain $Y$ then $f(x)$ is already a member of $Y$ and needs no further "transitioning" to get to $Y$.

Notice that in the previous paragraph I never mentioned any variable named $y$. Indeed I too take issue with the part of the Wikipedia article that says, "this relation is denoted by $y = f (x)$ ... where the element $x$ is the argument or input of the function, and $y$ is the value of the function ... ." The symbol $y$ is completely superfluous here; if we use $x$ to represent the input of the function, the usual denotation for the value of the function is $f(x)$, and a denotation that actually shows the relation of an element $x$ in the domain to an element in the codomain is $x \mapsto f(x).$ Here $f(x)$ is the element of the codomain and $\mapsto$ is the relation.

1
On

We talk about domains and codomains of a function, not of the variables of a function. You might not have come across the term codomain before, but I think that it's the best for what you're trying to describe.

So, the domain of $f$ is $X$ and the codomain of $f$ is $Y$. Often, we write this as $f:X\rightarrow Y$ to indicate that the valid inputs to $f$ are points in $X$ and every output of $f$ is a point in $Y$.

In your example, $x$ is a point in $X$, which is the domain of $f$, and $y$ is a point in the codomain of $f$, which is $Y$.

0
On

The notation $f(1)=0$ means that $f$ maps $1 \in X$ to $0 \in Y$. This agrees with the familiar notation $y=f(x)$ form that most people encounter in high school such as $y=ax^2+bx+c$. This means that $f(x) \in Y$ is always true. There is no other assignment operation occurring. Alternatively if you define functions as a kind of relation $f \subset X \times Y$ then $f(1)=0$ means $(1,0) \in f$. In both cases it's merely two names of the same thing.

6
On

I see what you are saying, but there are ways to think about this without using more than one mapping, as the other answers have pointed out.

But here is what I think you are getting at (which I agree with):

$x \mapsto f(x) \mapsto ax+b$. where we have a general function of $x$ and we send it to some expression in terms of the variable $x$.

Then $x$ maps to $f(x)$ as normal by using the domain and codomain.

7
On

I'm the OP, and I now kind of know what was causing me confusion back then.

I was actually thinking of function in a more computer science way. When we use the notation $y = f(x)$ in programming languages, it actually functions in the same way as I described in the question above. It first calculates $f(x)$ with the input $x$ and then stores the result into a temporary variable, and it then assigns the value of the temporary variable to the variable $y$. It does have two transitions in the process.

Yes, of course one can argue that function in mathematics doesn't need to have the same definition as function in programming languages. I agree, even though it is really weird to have two different definitions describing the same concept. But it is actually worthwhile to talk about which of them is more appropriate and more intuitive.

If we redefine function in mathematics in a more computer science way. We can define a function as $f: I → O$ , where $f$ maps the input $x$ in the domain $I$ to the output $f(x)$ in the codomain $O$. Defining function in this way makes a much more elegant expression, which would get rid of the redundant usage of $y$ which just means the same as $f(x)$. Confusion in choosing which notation to use happens all the time, not only in choosing between $f(x) = ax+b$ or $y = f(x) = ax+b$ but also $dy/dx$ or $df(x)/dx$.

Moreover, if we look back to the definition of function in programming languages, this kind of redundancy just doesn’t exist at all, and it never caused any problem. The variable $y$ is not pre-defined in the function itself, and is actually only needed when we want to “store” the final result, not to “use” the result for further calculation. The “real” output of the function $f$ is $f(x)$, not $y$.

The variable y can still be used with function in mathematics, but now it should no longer be seen as part of the definition of function. The expression $y = f(x) = ax+b$ thus should be understood alternatively as simultaneous equations of $y=f(x)$ and $f(x) = ax+b$.

To conclude, I think the original definition is obviously outdated and flawed compared to the more modern one used in computer science. It deserves a refurbished definition as it has been a quite fundamental and frequently used concept in mathematics, hopefully urgently.