Functions – Why Are Vector Valued Functions Well-Defined?

functionsmultivalued-functions

I'm looking for an 'intuitive' answer here, because I have no formal mathematical training but find myself in a comparatively math-heavy PhD (visual perception; lots of neuroscientists on the one side and CS folk on the other).

Only functions which map some number of inputs to a single output are considered 'true' or 'well-defined' functions. I've seen squaring (and presumably other exponents) given as an example: [any number] squared produces a single 'output', though some outputs for different inputs may be the same: e.g. -2 and 2 squared both equal 4. By contrast, I've seen square-root given as an example of a NON-'well-defined' function, because sqrt(4) can equal both 2 and -2. A single input maps to multiple outputs, violating the definition of a 'true' function.

(EDIT: As @Eff says in the comments, this is an incorrect example because sqrt(4) is in fact defined to equal 2 alone. But I hope my broader point is still clear)

Presumably, the benefits of 'true' functions as defined by this constraint come in terms of assumptions one can make, and guarantees one can rely on when reasoning about the function. Vector-valued functions return multiple scalar values (organised within a tuple) and considering my programmer background I can't see how this differs, except in terminology, from a multivalued function.

Yet I have never read anybody suggesting vector-valued functions aren't true functions. As it stands, if I were faced with the task of inverting a function which takes multiple inputs, I'd simply define the inverse as vector-valued, to sidestep the constraint. My sqrt(4) would be the tuple (2,-2). From a software engineering perspective, even in C where functions may return no more than one argument, that argument could be an array or a struct. It feels like either both or neither of multivalued and vector-valued functions meet the definition of being 'well-defined' / 'true' functions. What am I misunderstanding?

Best Answer

What you are getting confused by most probably is the fact that a vector seems to be multiple elements, but really it's not, it's just a single element which (often) has multiple parts.

You can even have so called set-valued functions. An easy one to think of is the function which takes a positive integer to the set of its prime divisors. Let's call this function $\pi$.

The important thing in both these cases is that a given input only has one output. So in the case of a vector-valued function the output is the full vector (all of its parts). In the case of the set valued function for prime divisors you have to get the set of all the prime divisors. So for example $\pi(15)=\{3,5\}$ you can't have $\pi(15)=\{3\}$ or $\pi(15)=\{5\}$. There is only the one set containing all the divisors. It's the same situation with vector-valued functions. There is only one vector for any input. The function can't return just part of a vector. Thus we still have only one output for every input--it's just a bigger output.

As to why we don't define inverses as vector valued, that has a very easy reason. They wouldn't be inverses anymore. The definition of an inverse to a function $f$ is a function $g$ for which $g(f(x))=x$ if the value of $g$ is a vector containing $x$ that doesn't do what we want. It doesn't tell us the value of the original input to function $f$.