# Function of Function notation.

Suppose I have a function $$f:\mathbb{R}_+ \to [0,1]$$ and another similar function $$g$$.
I consider $$g$$ to be a fixed function, and I want to know how close $$f$$ is to $$g$$. For this purpose, I define a `residual operator' $$R$$ which calculates the difference between the two functions, but as a function of $$f(x)$$. Can I write:

$$R: f \mapsto (f(x) \mapsto (f(x) - g(x)\;)$$?

In other words, the output of $$Rf$$ is a function whose output is the difference evaluated at $$f(x)$$.

P.s. I suppose to be more rigorous I could write this as

$$R: (f,g) \mapsto (f(x) \mapsto (f(x) - g(x)\;)$$.

I'm getting a lot of answers that I should write $$R: (f,g) \mapsto f - g$$. However, please notice that when I plot $$Rf$$ I want the horizontal axis to be the value of $$f(x)$$. I know this is possible in practice, because I have plotted this many times, but I'm having difficulty representing what I am calculating in function notation.

With the help of the very nice responses, I think I know how to write this in rigorous function notation. The object I'm interested in is a plot, and a plot is really just a collection of points in two dimensions. How do I write "a collection of points in two dimensions"? One such collection might be written:

$$\{(x(t),y(t)) \;|\; x,y: \mathbb{R}_+ \to \mathbb{R} , t\ge 0\} \subset \mathbb{R}^2$$.

My operator becomes

$$R: (f,g) \mapsto \{\,(f(t),f(t)-g(t)) \;|\; f,g: \mathbb{R}_+ \to \mathbb{R} , t\ge 0\}$$.

In summary, we can think of $$R(f,g)$$ as a subset of $$\mathbb{R}^2$$.

• I don't see why $R(f) = f-g$ wouldn't work. Commented Mar 22 at 16:04
• More like $R: f \mapsto ( x \mapsto f(x) - g(x) )$, but why not simply $R(f) = f - g$? Commented Mar 22 at 16:04
• @whpowell96 I'd like it to be a function of $f(x)$. When I plot it, I'd like the horizontal axis to be $f(x)$. Commented Mar 22 at 16:09
• Regarding the edit, the thing you want is not a function in general. What it sounds like you want is a parametric graph of the form $x\mapsto (f(x), f(x)-g(x))$ Commented Mar 22 at 17:08
• I agree. My operator is giving me a set of point in the 2D plane. Which is not the same as a function. I now see this with the help of these comments. Please see my edited question. Commented Mar 22 at 18:01