8

I've seen an answer in which the user defined a function called $D$ where this function takes and input $f$ and gives output $f'$

like an example : if $f(x)=x^2$ then $D(f)=f'=2x$

but is there is a something really like function of functions well acorrding to the function $D$ it takes a function as an input an gives another function as an output

but the definition of function that i've studied is that a function defined by it's graph where a function $f=$$\{ (a,f(a)) \}$ which is a set of ordered pairs

acorrding to this defintion then there isn't something called function of functions because we can't define a specific graph to it

like if we defined another function like $I$ where it takes input a function and gives it's integral out like \begin{gather} I(2x) =x^2 \end{gather}

we can't define a graph to this function

correct me if I said something wrong

Mans
  • 512
  • 7
    The "functions of functions" you refer to are called operators. – Abezhiko Feb 18 '23 at 18:39
  • 10
    The graph of a function doesn't have to be a subset of $\mathbb{R}^2$. A function can be anything which for any object in one set $X$ (which could be real numbers, or vectors, or, as in your case, functions), produces a unique object in another set $Y$ (again, this could also really be anything). So we can definitely say that $D$ is a function, defined on some set of functions, which returns functions from some other set of functions. The thing is thag then the graph becomes pairs of functions. In particular you have that$$D={(f,f'):f\in X},$$where $X$ is your set of functions – Lorago Feb 18 '23 at 18:42
  • 5
    (In the world of Computer Science, they're usually called functors or higher-order functions.) – gidds Feb 19 '23 at 09:13
  • 1
    Not only can we have functions that take functions as input and return functions as output, but we can also have functions that take functions as input and return numbers as output, or functions that take numbers as input and return functions as output. For instance, consider the function $x \mapsto f_x$ such that $f_x : y \mapsto x + y$, which maps a real number $x$ to a function $f_x$; or consider the function $f \mapsto f(0)$, which maps a function $f$ to the real number which is its value at 0. – Stef Feb 19 '23 at 18:32
  • As for defining your function $I$ which maps a real function to its primitive, be careful to definite it unambiguously. Typically, there can be a infinity of primitives, so you should be specific and define for instance that $I(f)$ is the primitive of $f$ that has value 0 at 0, and restrict $I$ to operate only on functions that are defined on all of $\mathbb{R}$, or at least only on a convex interval containing $0$. – Stef Feb 19 '23 at 18:38
  • 1
    To continue with the remarks by @Stef, there are even naturally occurring (e.g. used in quantum mechanics) functions whose inputs are functions-of-functions and whose outputs are functions-of-functions -- see this MSE answer. – Dave L. Renfro Feb 19 '23 at 19:30
  • we can't define a specific graph to it - why not? – slebetman Feb 20 '23 at 08:21

3 Answers3

21

To answer your question up front: yes! Functions of functions are a thing, and a very important thing in many advanced fields of math.

In general, a "function" is any rule for turning inputs into outputs. If your input is itself a function, say $f(x) = x^2$, you can define a rule for generating a different, output function from this one, say by taking the derivative, $f'(x) = 2x$. Then the function $D$ which is defined by this rule, $D(f) = f'$, is in fact a function.

From a young age we are commonly trained to equate the word "function" with "function on the real numbers", or even more restrictively "function on the real numbers which can be expressed by one or many finite algebraic expressions, involving operations like $+$, $\cdot$, $\div$, exponentiation, integers and other named real constants like $e$ or $\pi$, and various special functions like trigonometric functions and logarithms" (by the way, such expressions define what are commonly called "elementary functions").

For this reason, when it comes to functions of functions, we often employ different terminology - we call them "operators" or "transformations" or something else to distinguish and emphasize the fact that we are thinking of these objects as things which transform or modify functions. But mathematically, they all fall under the definition of "function".

Also, as already mentioned in the comments, you can still use the idea of a graph to define a function of functions, but it is no longer something which you can draw or represent graphically. The input space is a collection of functions, and so is the output space, and we don't have a universally recognized geometric interpretation of "the space of all functions", nor do I think such an interpretation (that is useful) is even possible to come up with.

The formal definition of "function" is as a special case of a relation, which is roughly any rule for relating elements of one set to elements of another. For example, the relation "$xy$ is an even integer" describes a relation on the set of integers. Then $x = 2$ and $y = 3$ would relate under this rule, and so would $x = 2$ and $y = 4$ (as well as $x = 2$ and $y = $ any other integer at all, in fact).

A function is a special type of relation for which, for each choice of $x$, there is only a single $y$ such that $x$ relates to $y$. In other words, for each input there is only one possible output. This aligns with our usual concept of function because, for instance, if you pick a number and square it ($f(x) = x^2$), then there is only one possible answer to "what is the square of $x$?" Graphically, this property can be checked using something called the "vertical line test", which you may be familiar with from basic algebra.

Rob
  • 6,727
  • This is a nice answer. Though, in fact, there are many interesting ways to think about the geometry of the space of certain classes of functions. – Peter Feb 18 '23 at 18:53
  • Certainly, but there is probably not a way that would, for instance, allow you to "draw the graph" of the derivative operator – Rob Feb 18 '23 at 18:55
  • 1
    Agreed, but I would have trouble drawing the graph of a function from $\mathbb{R}^3$ to $\mathbb{R}^3$ as well... – Peter Feb 18 '23 at 18:57
  • @Rob my only comment to your answer is the word ''rule'' because this is an ambiguous and there is a difficulty in interpreting what does this mean , a good argument was written in spivak calculus – Mans Feb 18 '23 at 18:58
  • @Abdelrahman, that replaces the question “what’s a rule?” with the question “what’s a subset (of the cartesian product)?”. Now this is good because we have to deal with subsets anyway, so we now have one problem instead of two, but until you get into the nitty-gritty of set theory it doesn’t really clarify things. And when you do, things may even get more complicated ;) – Carsten S Feb 19 '23 at 15:19
  • @CarstenS I mean that the word "rule" has more than one interpretation so it's a vague word – Mans Feb 19 '23 at 17:08
12

"which is a set of ordered pairs"

Pairs of what? And the answer is that there is no restriction. They could be pairs of colors, of animals, or of functions. Now, admittedly, ordered pairs of real numbers is the only case where we can easily imagine the graph, and draw a nice picture of it, but we've taken the word "graph" and generalized it to also possibly refer to a collection of ordered pairs of kittens.

So yes, there are functions that take in functions and spit out functions, although, as noted in the comments, we often call them operators, just to help keep straight what's taking things in and what's being taken in.

By the way, you've only asked about higher order functions that take in and put out the same "kind" of mathematical object. But there's no restriction like this either. There are functions that take in functions, and return numbers. Two nice examples (where I'll leave out some details/restrictions for the sake of simplicity) are

$$ \textrm{Definite integral: } T(f) = \int_0^2 f(x) dx$$

$$\textrm{Point evaluation: } E_3(f) = f(3)$$

(Of course the interval of integration ($[0,2]$), or the point you evaluate at ($x=3$), can be changed, so these are in fact entire families of functions defined on functions.)

And just like it's traditional to call the functions that map functions to functions "operators", functions that map functions to numbers are often called "functionals". But again that's just a bit of terminology to help us keep things straight, not a profound difference - they're all just functions.

JonathanZ
  • 10,615
  • Are you working in a set theory which has kittens as atoms, or which kind of sets are feline? – Carsten S Feb 19 '23 at 14:33
  • 12
    Cats show up at $V_{\omega^2+3}$ of the Von Neumann hierarchy, as you first have to construct mice, birds, and attitude before you reach $\textbf {Cat}$. Although I am now wondering if I've made a mistake, as I refer to an ordered pair of kittens, and we all know cats can't be ordered to do anything. – JonathanZ Feb 19 '23 at 15:43
0

One prominent example of a "function of functions" is given by the double dual of a vector space. If $V$ is a vector space (over $\mathbb R$, say), then its dual $V^*$ is the set of linear maps $V\to\mathbb R$, equipped with pointwise vector addition and scalar multiplication. With these operations, $V^*$ is itself a vector space, and so we can iterate this construction, obtaining the "double dual" $V^{**}$, which is simply the dual of $V^*$. Every member of $V^{**}$ is a linear map $V^*\to\mathbb R$; so a member of $V^{**}$ takes in a linear map $V\to\mathbb R$, and it spits out a real number.

Joe
  • 19,636