Suppose $V$ and $W$ are finite-dimensional vector spaces and $X\leq V$ and $Y \leq W.$
I need to show that $$\dim\{\alpha \in \mathcal{L}(V,W) \, : \, \alpha(X) \subseteq Y\}=\dim X \times \dim Y + \operatorname{codim}X \times \dim W.$$
$\color{red}{\text{Is what I write below a valid proof? Is there a better coordinate-free proof?}}$
Proof(?). Start by taking bases $\{x_1,\ldots,x_r\}$ and $\{y_1,\ldots,y_s\}$ for $X$ and $Y.$
Extend these to bases $\{x_1,\ldots,x_r,v_{r+1},\ldots,v_m\}$ and $\{y_1,\ldots,y_s,w_{s+1},\ldots,w_n\}$ for $V$ and $W.$
A linear map $\alpha:V \to W$ satisfies $\alpha(X)\subseteq Y$ if and only if its matrix with respect to these bases looks like $$\begin{bmatrix} * & * \\ O & * \end{bmatrix}$$ where $O$ is the $(n-s)\times r$ zero matrix.
It follows that $$\dim\{\alpha \in \mathcal{L}(V,W) \, : \, \alpha(X) \subseteq Y\}=mn-(n-s)r=rs+(m-r)n$$ and this is what we wanted.