# How to prove subspaces of function spaces?

In teaching Linear Algebra, I would like to prove or disprove whether a nonempty subset of a vector space, is a subspace. For this, I would show that the subset is closed under both addition and scalar multiplication, or not.

E.g., for polynomials, and looking at closure under addition only, we have this non-subspace (trust me, this looks better in mathematical notation!):

Reduce[ForAll[{a1, b1, a2, b2, k1, k2, x},
Element[a1 | b1 | a2 | b2 | k1 | k2 | x, Reals],
Exists[{a3, b3}, Element[a3 | b3, Reals],
k1*(a1*x^2 + b1*x -1) + k2*(a2*x^2 + b2*x -1) == x^2*a3 +
x*b3 -1]]]


which correctly produces False.

In addition, we can see why it is false with:

Reduce[! (Exists[{a3, b3}, Element[a3 | b3, Reals],
k1*(a1*x^2 + b1*x -1) + k2*(a2*x^2 + b2*x -1) ==
a3*x^2 + b3*x -1]), {a1, b1, a2, b2, k1, k2, x}, Reals]


producing: (k2 < 1 - k1 && x == 0) || (k2 > 1 - k1 && x == 0), i.e., that k1 + k2 != 1.

When the subset is a subspace, I show the relationship between the parameters with another Reduce[]:

Reduce[ForAll[x, Element[x, Reals],
k1 (a1 x^2 + b1 x) + k2 (a2 x^2 + b2 x) == a3 x^2 + b3 x],
{a3, b3}, Reals]


which produces: a3 == a1 k1 + a2 k2 && b3 == b1 k1 + b2 k2

My question is how to do this for functions in general. I guess I would have to start with being able to define a vector space for functions, e.g., those defined (or continuous) on [0,2]. But I do not know how to do that. With that, I could define a subset, e.g.: $$\left\{f(x)\in C^0[0,2]|f(1)=4\right\}$$.

Or, somehow (I am really groping in the dark here) that the following is not a subspace:

f[1] = 4; g[1] = 4; h[1] = 4; h[x_]:=f[x]+g[x];
Reduce[ForAll[{k1, k2, x},
Element[k1 | k2, Reals] &&
Element[x, ImplicitRegion[0 <= x <= 2, {x}]],
Exists[{h[x]},k1*f[x] + k2*g[x] == h[x]]]]


which just generates: Reduce::nsmet: This system cannot be solved with the methods available to Reduce.

Any direction would be most appreciated. Thanx.

• With "nice" functions a necessary condition is that the quantidier elimination works on Taylor polynomial approximatiions. So that might provide a means for at least falsifying. Validating however might take more work. – Daniel Lichtblau Mar 3 at 22:33
• Well, your example involving polynomials is finite dimensional. The set of continuous functions on [0,2] would form an infinite dimensional space. May be tough to verify with any computer program. What is your Reduce when your polynomials do form a subspace? – mjw Mar 4 at 5:49
• Thank you both for your replies. Daniel, do you mean to say that there is no way to specify, e.g., the set of continuous function on an interval (C^0 [0,2]) ? For my purposes, I would not want to limit myself to the necessary condition you mention. mjw, indeed the function space is infinitely dimensional. However, we see for the example I gave, that there is no closure for addition, at x == 1. The question is how to convince Mathematica to "see" this. (I have added to my post, the Reduce[] for the subspace case.) – Aharon Naiman Mar 4 at 8:01