Projective variety with a prescribed-dimensional singular locus (source code)

= Projective variety with a prescribed-dimensional singular locus

For $n>k\geq0$, take an $(n-k)$-dimensional irreducible projective variety with one singular point and form its product with $\mathbb P^k$. The Segre embedding makes the product projective, and its singular locus is the singular point times $\mathbb P^k$, of dimension $k$. A quadric cone works in dimension at least two and a cuspidal cubic works in dimension one.