How to think of a function as a vector?

In order to apply the ideas of vector spaces to functions, the text I have (Wavelets for Computer Graphics: Theory and Applications by Stollnitz, DeRose and Salesin) conveniently says

Since addition and scalar multiplication of functions are well defined, we can then think of each constant function over the interval $[0,1)$ as a vector, and we'll let $V^0$ denote the vector space of all such functions.

Ok, so I've heard this notion before, and it kind of makes sense. You want to apply the rules of vector spaces (and define things like inner product) for functions, so you go and say "a function is a vector."

But how does this mesh with the traditional physics definition of vector? A vector must have a magnitude and direction. What's going on here between algebra and physics?

-
I finally found something that made intuitive sense to me linking the traditionally taught idea of a vector to these vectors as functions. I could never quite understand where the integral product $\langle\cdot,\cdot\rangle=\int_0^1 f(x)g(x)dx$ came from. I was always told it was just defined that way, but the lecturers never explained why this might be the case... eng.fsu.edu/~dommelen/quantum/style_a/funcvec.html. Seems that a suitably well-behaved function defined over a finite interval $[0,1]$ can represent an infinite dimensional vector. Makes sense now. – poirot Oct 26 '15 at 22:13

Any vector is a function in the trivial sense that you can re-interpret it as the trivial constant map sending anything to that particular vector, $f_v:D\to\{v\}\in V$. In this way every $v\in V$ can be understood as the associated "function" $f_v$ regardless of domain $D$.

The other direction - the idea that functions can form a vector space - is more general than that of the usual $\mathbb{R}^n$ vector spaces with canonically understood magnitude and direction, which both come from an inner product $\langle\cdot,\cdot\rangle$ on $V$. The general idea is that vector analysis provides a model for situations where mathematical objects can be decomposed into a linear combination of components over a field of scalars (and modules if over a ring). In this way they form the natural backdrop for linear algebra, which again doesn't always come with a geometric formalism in all circumstances, but they coincide exactly in the obvious cases. Bottom line: It's just the universal practice in mathematics of noticing one structure is a smaller case of a bigger one, where sometimes the first or smaller structure has special meaning (e.g. geometry) associated to it.

-
Mea culpa. I understand now what you're saying. I've removed my previous comment. – ruakh Nov 21 '11 at 23:53

What's going on here is that physics and mathematics use the word with different (but related) meanings. It's just a problem of terminology, not really hiding anything deep technically.

Everything that physics calls a vector is also a vector in mathematics. But there are things that mathematicians call vectors which physicists wouldn't. My understanding is that the physicist's sense of "vector" corresponds best to what mathematics would call a "tangent vector" of a manifold. (The familiar $\mathbb R^3$ vectors in Euclidean space are a special case of this).

Computer science has a third, related but again different, sense of "vector". That's somewhat unfortunate, but eventually just the way the world is.

-
Agreed, this was my first thought. Even within physics, the meaning of "vector" varies from one context to another, and sometimes can correspond to the mathematical definition (physicists do talk about vector spaces frequently). – David Z Nov 18 '11 at 23:54
The CS vector comes from the math vector. A std::vector is supposed to be an N-element vector, with constant time random element access. I always thought this was misnamed (better to name it array) – bobobobo Nov 19 '11 at 15:35

Mathematics and physics are not really compatible.

In the plane, or the 3D space (and so forth) it is fine to represent a vector space as a magnitude and direction.

However, the formal definition of a vector space requires not the need for either of those in order to represent a vector. In fact, a vector - formally - is just an element of a vector space.

This can go on, not all vector spaces have norms defined on them. Without the axiom of choice, not all have a basis, decomposition into a direct sum, nontrivial functionals, and so on.

Similarly, not all topological spaces are normal, regular, Hausdorff, etc., however we like to think of the physical world as $\mathbb R^3$ which is normal, regular, Hausdorff, etc..

In the finite dimensional case, or assuming the axiom of choice, we have a basis for the space. That is every vector can be written as a linear combination of the elements of the basis. You can think of the vector, if so, as a function from a set into the field.

The set, of course, is the basis; or some other set with the same number of elements. For a vector $v = \sum_{n=1}^k\alpha_n\cdot v_n$ we can think of $v$ as a function from the set $\{1,\ldots,k\}$ into the field: $v(n)=\alpha_n$. Of course, after changing a basis we "change the function", but this is why vector spaces are isomorphic and not the same.

-