Alright, I've done research regarding this question have attained answers that identify $f$ as the function (which is obvious) and identify $\mathbb R \rightarrow \mathbb R$ as meaning "the domain is the set of all real numbers and the codomain is the set of all real numbers",

I've also read that, say $f : x \rightarrow x^2$ can be used as the notation for a function, and can otherwise be written as $f(x) = x^2$, which makes sense, but say for example, $f : 2\sqrt x \rightarrow \displaystyle \frac{x}{4}$, would this be equivalent to $f(x) = \displaystyle \frac{x^2}{64}$?

Furthermore, can the use of symbols indicating the sets of, for example, all real or rational numbers always be used to distinguish between when this notation is referring to a function and when it is referring to the domain and codomain of a function? All I would like is confirmation to these ideas so that I am aware of how to use them in the future. Thank you.

  • $\begingroup$ a function $f:A\to B$ is a special subset of the set $A\times B$. In general the usual notation to describe a function is like $f:A\to B,\, x\mapsto f(x)$, where $f(x)$ is explicitly described, by example as $x^2$, $\lfloor x\rfloor$, $\ln x$, etc... $\endgroup$ – Masacroso Sep 6 '17 at 4:58
  • $\begingroup$ I will enfatize the answer of Mathematician42: you cannot define a function properly if you dont says what is it domain and what is it codomain, so $f(x)=x^2$ doesnt define correctly a function. $\endgroup$ – Masacroso Sep 6 '17 at 5:06

The notation $f:A\to B$ is read "f is a function from $A$ to $B$." I always have imagined the colon to be "is a" or "has the type." (You could potentially also write $f\in B^A$ if you are comfortable with $B^A$ being the set of functions $A\to B$.)

I wouldn't use $f:x\to x^2$ as notation for an algebraic definition of a function since, if $x$ is a set, it could mean "$f$ is a function from $x$ to the set of pairs of values from $x$." Perhaps $f:x\mapsto x^2$, though I usually say "let $f$ be a function defined by $x\mapsto x^2$" or better "let $f:\mathbb{R}\to\mathbb{R}$ be the function defined by $x\mapsto x^2$." It is not unheard of to write $f=(x\mapsto x^2)$.

You may define a function implicitly, like $2\sqrt{x}\mapsto x/4$, but you must make sure it is well defined. For instance, it cannot be defined for negative numbers since $2\sqrt{x}$ is not negative. It is indeed equivalent to $f(x)=x^2/64$ if you make the domain of $f$ clear.

If I'm parsing it correctly, I think the answer to your last question is that you should use $\mapsto$ when you give an algebraic definition of a function and $\to$ when you give the type (domain and codomain) of a function.

  • $\begingroup$ Thanks for the response, is there a way in which I can identify the domain and range and the function in one notation, or would it have to be written as $x \mapsto \displaystyle \frac{x^2}{64}$ and $Dom(f)=\mathbb R^+$ or $f : \mathbb R^+ \rightarrow \mathbb R^+$? $\endgroup$ – joshuaheckroodt Sep 6 '17 at 5:17
  • 2
    $\begingroup$ (Just in case: don't get the impression that learning math is about learning and using ever more cryptic notations. Clear communication is key.) If there is one, I have never used it. I'm pretty sure I only ever say something like "Let $f:\mathbb{R}^+\to\mathbb{R}$ be defined by $x\mapsto x^2/64$." or "Let $f:\mathbb{R}^+\to\mathbb{R}$ be defined by $f(x)=x^2/64$. If you insist, I could imagine $f(x:\mathbb{R}^+)=x^2:\mathbb{R}$, but don't do this unless you explain your notation to the reader. (Be careful with the word range: it could mean "codomain" or "image.") $\endgroup$ – Kyle Miller Sep 6 '17 at 5:26

You are making this more complicated than it is.

The proper notation for a function is $$f:X\rightarrow Y:x\mapsto f(x).$$ The part $f:X\rightarrow Y$ means that $X$ is the domain of the function and $Y$ is the target/codomain. The part $x\mapsto f(x)$ explains what happens to elements of $x$. Here a particular $x$ is mapped to $f(x)\in Y$.

In case the domain and target are understood, people often use the bad notation $f(x)=\mbox{some expression}$. For example $f(x)=\sqrt{x}$, however this does not completely define the function as it is not clear what the domain and target are. Indeed comparing the functions $f:[0,1]\rightarrow [0,1]:x\mapsto \sqrt{x}$ and $g:\mathbb{R}^+\rightarrow \mathbb{R}^+:x\mapsto f(x)$, we see that $f$ has a maximum whereas $g$ does not, a huge difference.

The notation $x\mapsto f(x)$ is the same story as it really only specifies $f(x)$.

Writing $f:2\sqrt{x}\mapsto \frac{x}{4}$ is not done. The problem is that you do not specify the domain and a priori it's not clear that any element in $X$ can be written as $2\sqrt{x}$. Indeed, writing $\sqrt{x}$ implies that $x$ should be positive, but when you rewritre this function as $f(x)=\frac{x^2}{64}$, this restriction dissapears.

For sake of completeness, let me give some examples of functions which have weirder domains and codomains.

Consider the map $f:C([0,1])\rightarrow \mathbb{R}:h\mapsto \max_{x\in [0,1]}h(x)$, it's non-trivial that this map is well-defined, i.e. the maximum exists. Here $C([0,1])$ is the set of all real-valued continuous functions on $[0,1]$. Here's another one $g:\mathbb{R}[X]\rightarrow \mathbb{R}[X]:p(X)\mapsto p'(X)$. Here $\mathbb{R}[X]$ is the set of all polynomials in $X$ with real coefficients and $p'(X)$ denotes the derivative of $p(X)$.

  • $\begingroup$ So, i.e. if I were to correctly write out the function in the question, would it be $f : \mathbb R^+ \rightarrow \mathbb R^+ : 2\sqrt{x} \mapsto \displaystyle \frac{x}{4}$, which means the domain and codomain of $f(x)$ has now been identified. $\endgroup$ – joshuaheckroodt Sep 6 '17 at 5:09
  • 1
    $\begingroup$ I have never seen the notation $f:X\to Y:x\mapsto f(x)$ before (in particular, the second colon). Where have you seen this? $\endgroup$ – Kyle Miller Sep 6 '17 at 5:13
  • 1
    $\begingroup$ @joshuaheckroodt: You could write that, but it's bad practice. In order for that to make sense you need to explain that any element in $\mathbb{R}^+$ has a unique representation as $2\sqrt{x}$. $\endgroup$ – Mathematician 42 Sep 6 '17 at 5:17
  • $\begingroup$ Thank you @Mathematician42 $\endgroup$ – joshuaheckroodt Sep 6 '17 at 5:21
  • $\begingroup$ @KyleMiller: Are you serious? (Non-offensive, I'm just surprised). I know certain countries shuffle the order around, but other than that, this is standard notation. How do you write it? $\endgroup$ – Mathematician 42 Sep 6 '17 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.