A further help required for what is a linear map restricted to a subspace A related question was posted here.
I have further question as the following.

If $x_1,x_2$ is an orthonormal basis of an eigenspace of $A$ pertaining to some eigenvalue $\lambda$, why $(x_1,x_2)^TA(x_1,x_2)$ can be viewed as the linear map $A$ restricted to that eigenspace spanned by $\{x_1,x_2\}$? I am puzzled that the matrix $(x_1,x_2)^TA(x_1,x_2)$ is a 2 by 2 matrix that is even not compatible with vectors in $span \{x_1,x_2\}$.

 A: Let me be a little more precise. Given a matrix $A \in M_n(\mathbb{R})$, denote by $T_A \colon \mathbb{R}^n \rightarrow \mathbb{R}^n$ the associated linear map defined by $T_A(x) = Ax$ where we think of elements of $\mathbb{R}^n$ as column vectors. The relation between the linear map $T_A$ and the matrix $A$ is that the matrix $A$ represents the linear operator $T_A$ with respect to the standard basis $(e_1,\dots,e_n)$ of $\mathbb{R}^n$.
Now, let $x_1, \dots, x_k \in \mathbb{R}^n$ be an orthonormal set of eigenvectors associated to the same eigenvalue $\lambda$ and let $W := \operatorname{span} \{ x_1, \dots, x_k \}$. The subspace $W$ is an invariant subspace of $T_A$ (meaning $T_A(W) \subseteq W$) and so we can restrict the linear map $T_A$ to the subspace $W$ and consider the linear map $T_A|_{W} \colon W \rightarrow W$. This map is an operator on a $k$-dimensional space and so can be represented with respect to any choice of basis for $W$ by a $k \times k$ matrix. 
Claim: The operator $T_A|_{W}$ is represented with respect to the basis $\mathcal{B} = (x_1, \dots, x_k)$ of $W$ by the matrix $(x_1, \dots, x_k)^T A (x_1, \dots, x_k)$ where $(x_1, \dots, x_k)$ is the $n \times k$ matrix whose columns are the vectors $x_1, \dots, x_k$.
Proof: Since $T_A|_{W}(x_i) = T_A(x_i) = \lambda x_i$, the matrix $\left[T_A|_{W} \right]_{\mathcal{B}}$ should be the diagonal matrix $\lambda I_k$. And indeed,
$$ (x_1, \dots, x_k)^T A (x_1, \dots, x_k) = (x_1, \dots, x_k)^T (Ax_1, \dots, Ax_k) = (x_1, \dots, x_k)^T (\lambda x_1, \dots, \lambda x_k) = \lambda (x_1, \dots, x_k)^T (x_1, \dots, x_k) = \lambda I_k $$
as $(x_1,\dots,x_k)$ is an orthonormal set.
