Subspaces in General Vector Spaces
Definition
 If a nonempty subset $W$ of a vector space $V$ is itself a vector space, we call $W$ a subspace in $V$.
Summary
 (Subspace Criteria) A subset $W$ of a vector space $V$ is a subspace if and only if
 The zero vector in $V$ is in $W$.
 For any vectors $A, B \in W$, the addition $A+B\in W$.
 For any vector $A\in W$ and a scalar $c$, the scalar multiplication $cA\in W$.
=solution
Problems
 Each of the following sets are not a subspace of the specified vector space. For each set, give a reason why it is not a subspace.
(1) \[S_1=\left \{\, \begin{bmatrix}
x_1 \\
x_2 \\
x_3
\end{bmatrix} \in \R^3 \quad \middle  \quad x_1\geq 0 \,\right \}\] in the vector space $\R^3$.
(2) \[S_2=\left \{\, \begin{bmatrix}
x_1 \\
x_2 \\
x_3
\end{bmatrix} \in \R^3 \quad \middle  \quad x_14x_2+5x_3=2 \,\right \}\] in the vector space $\R^3$.
(3) \[S_3=\left \{\, \begin{bmatrix}
x \\
y
\end{bmatrix}\in \R^2 \quad \middle  \quad y=x^2 \quad \,\right \}\] in the vector space $\R^2$.
(4) Let $P_4$ be the vector space of all polynomials of degree $4$ or less with real coefficients.
\[S_4=\{ f(x)\in P_4 \mid f(1) \text{ is an integer}\}\] in the vector space $P_4$.
(5) \[S_5=\{ f(x)\in P_4 \mid f(1) \text{ is a rational number}\}\] in the vector space $P_4$.
(6) Let $M_{2 \times 2}$ be the vector space of all $2\times 2$ real matrices.
\[S_6=\{ A\in M_{2\times 2} \mid \det(A) \neq 0\} \] in the vector space $M_{2\times 2}$.
(7) \[S_7=\{ A\in M_{2\times 2} \mid \det(A)=0\} \] in the vector space $M_{2\times 2}$.
(8) Let $C[1, 1]$ be the vector space of all real continuous functions defined on the interval $[a, b]$.
\[S_8=\{ f(x)\in C[2,2] \mid f(1)f(1)=0\} \] in the vector space $C[2, 2]$.
(9) \[S_9=\{ f(x) \in C[1, 1] \mid f(x)\geq 0 \text{ for all } 1\leq x \leq 1\}\] in the vector space $C[1, 1]$.
(10) Let $C^2[a, b]$ be the vector space of all realvalued functions $f(x)$ defined on $[a, b]$, where $f(x), f'(x)$, and $f^{\prime\prime}(x)$ are continuous on $[a, b]$. Here $f'(x), f^{\prime\prime}(x)$ are the first and second derivative of $f(x)$.
\[S_{10}=\{ f(x) \in C^2[1, 1] \mid f^{\prime\prime}(x)+f(x)=\sin(x) \text{ for all } 1\leq x \leq 1\}\] in the vector space $C[1, 1]$.
(11) Let $S_{11}$ be the set of real polynomials of degree exactly $k$, where $k \geq 1$ is an integer, in the vector space $P_k$.
(12) Let $V$ be a vector space and $W \subset V$ a vector subspace. Define the subset $S_{12}$ to be the complement of $W$,
\[ V \setminus W = \{ \mathbf{v} \in V \mid \mathbf{v} \not\in W \}.\] 
Let $V$ be the vector space over $\R$ of all real valued functions defined on the interval $[0,1]$. Determine whether the following subsets of $V$ are subspaces or not.
(a) $S=\{f(x) \in V \mid f(0)=f(1)\}$.
(b) $T=\{f(x) \in V \mid f(0)=f(1)+3\}$. 
Let $V$ be the vector space over $\R$ of all real valued function on the interval $[0, 1]$ and let
\[W=\{ f(x)\in V \mid f(x)=f(1x) \text{ for } x\in [0,1]\}\] be a subset of $V$. Determine whether the subset $W$ is a subspace of the vector space $V$. 
Let $C[1,1]$ be the vector space over $\R$ of all realvalued continuous functions defined on the interval $[1, 1]$. Consider the subset $F$ of $C[1, 1]$ defined by
\[F=\{ f(x)\in C[1, 1] \mid f(0) \text{ is an integer}\}.\] Prove or disprove that $F$ is a subspace of $C[1, 1]$. 
Let $P_3$ be the vector space over $\R$ of all degree three or less polynomial with real number coefficient. Let $W$ be the following subset of $P_3$.
\[W=\{p(x) \in P_3 \mid p'(1)=0 \text{ and } p^{\prime\prime}(1)=0\}.\] Here $p'(x)$ is the first derivative of $p(x)$ and $p^{\prime\prime}(x)$ is the second derivative of $p(x)$. Show that $W$ is a subspace of $P_3$ and find a basis for $W$. 
Let $V$ be the vector space over $\R$ consisting of all $n\times n$ real matrices for some fixed integer $n$. Prove or disprove that the following subsets of $V$ are subspaces of $V$.
(a) The set $S$ consisting of all $n\times n$ symmetric matrices.
(b) The set $T$ consisting of all $n \times n$ skewsymmetric matrices.
(c) The set $U$ consisting of all $n\times n$ nonsingular matrices.  Let $V$ be the vector space of $n \times n$ matrices with real coefficients, and define
\[ W = \{ \mathbf{v} \in V \mid \mathbf{v} \mathbf{w} = \mathbf{w} \mathbf{v} \mbox{ for all } \mathbf{w} \in V \}.\] The set $W$ is called the center of $V$. Prove that $W$ is a subspace of $V$.  Let $C(\mathbb{R})$ be the vector space of realvalued functions on $\mathbb{R}$. Consider the set of functions $W = \{ f(x) = a + b \cos(x) + c \cos(2x) \mid a, b, c \in \mathbb{R} \}$. Prove that $W$ is a vector subspace of $C(\mathbb{R})$.
 For what real values of $a$ is the set
\[ W_a = \{ f \in C(\mathbb{R}) \mid f(0) = a \}\] a subspace of the vector space $C(\mathbb{R})$ of all realvalued functions?  Let $V$ be the vector space of $n \times n$ matrices, and $M \in V$ a fixed matrix. Define
\[W = \{ A \in V \mid AM = MA \}.\] The set $W$ here is called the centralizer of $M$ in $V$. Prove that $W$ is a subspace of $V$.  Let $V$ be the vector space of $k \times k$ matrices. Then for fixed matrices $R, S \in V$, define the subset $W = \{ R A S \mid A \in V \}$. Prove that $W$ is a vector subspace of $V$.
 Let $V$ denote the vector space of all real $n\times n$ matrices, where $n$ is a positive integer. Determine whether the set $U$ of all $n\times n$ nilpotent matrices is a subspace of the vector space $V$ or not.
 Let $V$ be a vector space over a scalar field $K$.
Let $\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k$ be vectors in $V$ and consider the subset
\[W=\{a_1\mathbf{v}_1+a_2\mathbf{v}_2+\cdots+ a_k\mathbf{v}_k \mid a_1, a_2, \dots, a_k \in K \text{ and } a_1+a_2+\cdots+a_k=0\}.\] So each element of $W$ is a linear combination of vectors $\mathbf{v}_1, \dots, \mathbf{v}_k$ such that the sum of the coefficients is zero. Prove that $W$ is a subspace of $V$. 
Suppose that $S$ is a fixed invertible $3$ by $3$ matrix. This question is about all the matrices $A$ that are diagonalized by $S$ so that $S^{1}AS$ is diagonal. Show that these matrices $A$ form a subspace of $3$ by $3$ matrix space.
(MIT)  Let $\mathbf{P}_2$ be the vector space of polynomials of degree $2$ or less. Prove that the set $\{ 1 , 1 + x , (1 + x)^2 \}$ is a basis for $\mathbf{P}_2$.

Let $V$ be a real vector space of all real sequences
\[(a_i)_{i=1}^{\infty}=(a_1, a_2, \cdots).\] Let $U$ be the subset of $V$ defined by
\[U=\{ (a_i)_{i=1}^{\infty} \in V \mid a_{k+2}5a_{k+1}+3a_{k}=0, k=1, 2, \dots \}.\] Prove that $U$ is a subspace of $V$.  Let $V$ be a vector space over a field $K$. If $W_1$ and $W_2$ are subspaces of $V$, then prove that the subset
\[W_1+W_2:=\{\mathbf{x}+\mathbf{y} \mid \mathbf{x}\in W_1, \mathbf{y}\in W_2\}\] is a subspace of the vector space $V$.