Let $V = \mathbb F_p^9$ and $W \subset V$ a dimension $5$ subspace. Find the number of subspaces $U \subset V$ with $\dim(U) = 6, \dim(W \cap U) = 3$ 
Let $K = \mathbb F_p$ be a finite field with $p$ elements where $p$ is a prime Let $V = K^9$ be a vector space, and let $W \subset V$ be a subspace of $V$ such that $\dim(W) = 5$. Find the number of subspaces $U \subset V$ such that $\dim(U) = 6$ and $\dim(W \cap U) = 3$.

Let $v_1,...,v_5$ be a basis of $W$. Because we are in a field, we may still apply Gram-Schmitt process to find $ W^c := \text{span} \{v_6,...,v_9\} $ such that $ W^c \cap W = \{0 \}$ and $W \cup W^c = V$. For any given $U$ that satisfies the condition, we have $U = (U \cap W) \bigoplus (U \cap W^c)$ so that $6 = \dim(U) = \dim(U \cap W) + \dim (U \cap W^c) = 3 + \dim (U \cap W^c)$ so that $3 = \dim (U \cap W^c)$. Here is where I got stuck. Normally, in $\mathbb R^4$, there would be infinitely many subspaces of dimension $3$ by picking a line that is orthogonal to a subspace of dimension $3$. However, we are in a finite vector space, so I am not sure how to count (1) the number of subspaces of $W$ that has dimension $3$, and (2) the number of subspaces of $W^c$ that has dimension $3$. The answer I believe should be then the product of (1) and (2). Please correct me if any of what I have mentioned is not correct.
 A: We can reduce this problem to a simpler one using the correspondence theorem.

The Simpler Problem
Given:

*

*a finite-dimensional vector space $V$ over a finite field $F$,

*a subspace $W \leq V$, and

*a natural number $n \leq \dim V - \dim W$,

how many subspaces $U \leq V$ satisfy

*

*$\dim U = n$ and

*$U \cap W = 0$?

Let's call this number $\mathcal{A}(V,W,n)$.
We'll think about how to solve this problem (aka how to compute $\mathcal{A}(V,W,n)$) later. For now let's imagine that we can solve this problem, and use it to solve the problem you stated.

The Reduction
Here's the plan:

*

*Determine, for a fixed $3$-dimensional subspace $K \leq W$, how many $6$-dimensional subspaces $U \leq V$ there are such that $U \cap W = K$.

*Multiply by the number of $3$-dimensional subspaces of $W$.

So, let's do it!
1. Fix a $3$-dimensional subspace $K \leq W$. Then we want to find how many $6$-dimensional subspaces $U \leq V$ there are such that $U \cap W = K$. In particular, we need $K \leq U$, so we focus our search only on those subspaces. By the correspondence theorem, we can equivalently think about the subspaces of $V/K$! The condition that $U \cap W = K$ is then equivalent to $U/K \cap W/K = K/K = 0$, and $\dim U = 6$ is equivalent to $\dim U/K = 3$. So, the number of $6$-dimensional subspaces $U \leq V$ such that $U \cap W = K$ is just $\mathcal{A}(V/K,W/K,3)$.
2. The number of $3$-dimensional subspaces of $W$ is just $\mathcal{A}(W,0,3)$.
So, the final answer will be
$$\mathcal{A}(V/K,W/K,3) \cdot \mathcal{A}(W,0,3)$$
where $K$ is any $3$-dimensional subspace of $W$.

Solving the Simpler Problem
Let $F$, $V$, $W$, and $n$ be as given in the statement of the simpler problem above. Let $a = \dim V$, and $b = \dim W$, and $c = \lvert F \rvert$.
We will now count the number of $n$-tuples $(v_1, \dots, v_n) \in V$ such that

*

*$(v_1, \dots, v_n)$ is linearly independent

*$\operatorname{span}\{v_1, \dots, v_n\} \cap W = 0$
Each such $n$-tuple will be an ordered basis for an $n$-dimensional subspace of $V$ which intersects $W$ trivially. So, if we divide the number of such $n$-tuples by the number of ordered bases of an $n$-dimensional $F$-vector space, we will have successfully computed $\mathcal{A}(V,W,n)$.
We now note the the two above conditions are equivalent to the following:
For all $1 \leq i \leq n$, $v_i \notin \operatorname{span}(W \cup \{v_1, \dots, v_{i-1}\})$.
This makes it easy to construct the desired tuples one vector at a time.

*

*$v_1$ can be any element of $V \setminus W$. $\lvert V \rvert = c^a$ and $\lvert W \rvert = c^b$, so there are $c^a - c^b$ possible choices for $v_1$.

*$v_2$ can be any element of $V \setminus \operatorname{span}(W \cup \{v_1\})$. Since $v_1 \notin W$, $\dim \operatorname{span}(W \cup \{v_1\}) = \dim W + 1 = b+1$, so there are $c^a - c^{b+1}$ possible choices for $v_2$.

*$v_3$ can be any element of $V \setminus \operatorname{span}(W \cup \{v_1,v_2\})$. Since $v_2 \notin \operatorname{span}(W \cup \{v_1\})$, $\dim \operatorname{span}(W \cup \{v_1,v_2\}) = \operatorname{span}(W \cup \{v_1\}) + 1 = b+2$, so there are $c^a - c^{b+2}$ possible choices for $v_3$.

...
In the end, we find that there are
$$\prod_{i=0}^{n-1} (c^a - c^{b+i})$$
ordered $n$-tuples with the desired properties.
Replacing $W$ with $0$, this also tells us the number of ordered bases of a finite-dimensional $F$-vector space! So, we get
$$\mathcal{A}(V,W,n) = \prod_{i=0}^{n-1} (c^a - c^{b+i}) / \prod_{i=0}^{n-1} (c^n - c^i) = \prod_{i=0}^{n-1} \frac{\lvert V \rvert - \lvert W \rvert \lvert F \rvert^i}{\lvert F \rvert^n - \lvert F \rvert^i}.$$

Now all that's left is to plug in your particular numbers :)
