Function definition notation

1.6k Views Asked by At

When I've a function $\text{f}$ and it can be depended on $x$ (where $x$ will be a real number) or other real number(s) (constant(s)), can I define the function as follows?:

$$\exists\space\text{f}\left(x\right)\mapsto\left\{\text{f}\left(x\right)\in\mathbb{R}:\forall\space x\right\}$$

Or is there a more common or good notation?

4

There are 4 best solutions below

4
On

If the function $f$ depends only from one real variable $x$ and has a real value, than you can write: $$ f:X\to \mathbb{R} \qquad X \subset \mathbb{R} $$ remember that the function is well defined only if for all $x \in X$ we have a value $f(x) \in \mathbb{R}$.

7
On

The "signature" of the function (a programming term, I believe, which might not be standard amongst mathematicians; it basically means "domain and codomain" in this context) is written $f: S \to \mathbb{R}$, whatever $S$ is. Note that this does not involve the input to the function, so (for instance) it's really quite weird to write something like $f: x \to \mathbb{R} \ (x \in \mathbb{R})$; in this instance, $x$ is the input to $f$ and hence shouldn't appear in the function's signature. Notice also that $\mapsto$ tells us what happens to a particular input to the function, while $\to$ tells us what the domain and codomain of the function are.

For example, we may write the factorial function in the following ways (by no means an exhaustive list!):

  • $f: \mathbb{N} \to \mathbb{R}$ given by $n \mapsto n!$
  • $f: \mathbb{N} \to \mathbb{R}$ given by $x \mapsto x!$
  • $f: \{ 1, 2, 3, \dots \} \to \{ x: x \in \mathbb{R} \}$ given by sending $i$ to $i \times (i-1) \times \dots \times 2 \times 1$.
  • $G: \mathbb{N} \to \mathbb{R}$ given by $r \mapsto r!$
  • $n \mapsto n!$ (this expression, without specifying the "signature" of the function, will suffice if the domain and codomain are clear from context)
0
On

I prefer : $$f:\begin{Bmatrix} X\rightarrow \Bbb R \\ x\mapsto f(x) \end{Bmatrix}$$ Where $\operatorname{dom}\text{f}=X\subset \Bbb R$

1
On

You could write $f:X\times Y \to \mathbb{R}$ where $$f(x,y)=\begin{cases} g(x) : y=0 \\ c : y\neq 0, \end{cases}$$ where $y\in \{0,1\}$ is a variable that determines whether $x$ is relevant, and $g:X\to \mathbb{R}$. We don't have functions that have optional arguments in math.