Exercise I1.7 in Hartshorne states if $Z$ is an affine variety of dimension $r$ and $H$ a hypersurface then either $Z \subset H$ or every irreducible component $Z \cap H$ is dimension $r-1$. My question is does this hold more generally where we replace irreducible $Z$ with $Z \setminus V$ with some Zariski closed subset $V$?
In other words, suppose $Z$ is an affine variety and $V$ is some Zariski closed subset of $Z$, and $\dim Z \setminus V = r$. Then either $(Z \setminus V) \subset H$ or every irreducible component of $(Z \setminus V) \cap H$ is dimension $r-1$?
I was wondering if removing a closed subset could have some effect on this nice behavior
edit. I changed pure dimension of $r-1$ to every irreducible component is dimension $r-1$.
Take $Z=\mathbb{A}^1\subset \mathbb{A}^2$ as the $x$-axis. Let $H=y$-axis. Then $Z\cap H=(0, 0)$ of dimension 0.
Let $V=(0, 0)$. $Z-V= \mathbb{A}^1-(0, 0)$.
Now $Z-V\nsubseteq H$, and $(Z-V)\cap H=\emptyset$ so of dimension $-1$ or $-\infty$ depending on your preference.