# Basis for $p-1$-dimensional subspace such that projection of a $p$-dimensional triangular matrix is triangular

Given a lower-triangular matrix $L \in \mathbf{R}^{p \times p}$ and vector $v \in \mathbf{R}^p$, how can I construct a basis $B$ for the subspace $S = \mathbf{R}^p / \operatorname{span}(\{v\})$ such that the projection of $L$ onto $S$ is lower-triangular in $\mathbf{R}^{(p-1) \times (p-1)}$ with respect to basis $B$?

-

Super quick: $S$ isn't a subspace, it's a quotient yeah? That is, it doesn't live inside $\mathbb{R}^p$, but rather it's what you get by forcing things in $\mathbb{R}^p$ to be equal that weren't before (namely those whose difference lie in $\text{span}(\{v\})$. Also, for the "projection" of $L$ onto $S$ to be well defined, you need $v$ to be an eigenvector of $L$.
Short answer: take the quotients of the standard basis, $\bar{e_1}, \ldots \bar{e_p}$, if $v$ is in the span of $e_1, \ldots e_i$, for $i$ minimal (i.e. $i$ is the last coordinate of $v$ which is nonzero), then $\bar{e_1}, \ldots \bar{e_{i-1}}, \bar{e_{i+1}}, \ldots \bar{e_p}$ span, hence form a basis, over which $L$ is upper triangular.
Long answer: To see they span, take any $w$, use the things past $e_i$ to subtract off all later coordinates, subtract off $\lambda v$ to remove the $i^{th}$ coordinate (set it to 0), now we're in the span of $e_1, \ldots e_{i-1}$. Said differently, these $p-1$ guys and $v$ span $\mathbb{R}^p$, so these $p-1$ span in the quotient.
With respect to this basis we're upper triangular on the nose: for $\bar{e}_j$, $j < i$, if before $$e_j \mapsto \sum_{k \leqslant j} \lambda_k e_k$$then now still $$\bar{e}_j \mapsto \sum_{k \leqslant j} \lambda_k \bar{e}_k$$For $\bar{e}_j$, $j > i$, if before $$e_j \mapsto \lambda_i e_i + \sum_{k \leqslant j, k \neq i} \lambda_k e_k$$Subtract off a multiple of $v$ from the latter to cancel $\lambda_i e_i$, we have $$e_j \mapsto \lambda_i e_i + \sum_{k \leqslant j, k \neq i} \lambda_j e_j \sim \sum_{k \leqslant j, k \neq i} \lambda'_j e_j$$Hence$$\bar{e}_j \mapsto \sum_{k \leqslant j, k \neq i} \lambda'_j \bar{e}_j$$