Combining $f(x)$ and $f\colon x\to y$ notation

82 Views Asked by At

If $f(x)=x^3$, then we can rewrite this as $f:\begin{array}{}\Bbb{R}\to\Bbb{R}\\x\mapsto x^3\end{array}$

But let's say I have a piece wise function of $x$ called $g$. Let's define it as: $$g(x)=\begin{cases} x & (-\infty ,0]\\x^2 & (0,\infty )\end{cases}$$

So, if $$f(x)=y\Rightarrow f:\begin{array}{}X\to Y\\x\mapsto y\end{array}$$ then doesn't it follow that we could say $$g:\begin{array}{}\Bbb{R}\to\Bbb{R}\\x\mapsto\begin{cases} x & (-\infty ,0]\\x^2 & (0,\infty )\end{cases}\end{array}$$ I mean, theoretically speaking?

2

There are 2 best solutions below

0
On

First and foremost, notation is just notation, so really you can do whatever you like as long as you communicate your intentions. I don't think there's anything opaque about what you've written here, but I think stacking all these things vertically is perhaps a little clunky.

The way that I write down all this information is to write $f:X \rightarrow Y:x \mapsto y$. The notation comes in three parts. The name of the function, the domain and codomain, and what the mapping does. You might like this a little better, since it's one less thing to stack in your notation.

1
On

I think the following may be the cleanest way to communicate what you want:

Consider the mapping $f\colon\mathbb{R}\to\mathbb{R}$ defined by $$ f(x)= \begin{cases} x & \text{if $x\leq0$},\\[0.5em] x^2 & \text{if $x>0$}. \end{cases} $$