I am refreshing a bit my basic knowledge of mathematics, and I have some doubts, I am sure you can help me with.

Let's take this function in python:

def f (x): return x ** 2

I gather that this can be written as:

$$f:\Bbb R \to \Bbb R \\ x \mapsto x^2$$

Both domain and codomain of this function are $\Bbb R$.

How about this function:

def g (f, x):
    def h (y): return x * f (y)
    return h

Assuming that $f$ is a function from $\Bbb R$ to $\Bbb R$, and that both $x, y \in \Bbb R$, how do I write this python function in mathematical notation.

I think I can figure out the domain and codomain:

$$ g: \Bbb R ^ \Bbb R \times \Bbb R \to \Bbb R ^ \Bbb R\\$$

But how do you express the actual function mapping?

  • $\begingroup$ What do you mean "the actual function mapping"? I think your boxed text explains the mapping $g$ very clearly. $\endgroup$ – rschwieb Mar 1 '13 at 21:14

$(f,x)\mapsto (y\mapsto x\cdot f(y))$


Note you can also do an iterated pointwise definition:

$$ g(f,x)(y) := x f(y) $$


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.