First, note next definition.
Definition 1. Let $X$ be a topological space. (1) Let $Z \subseteq X$ be a closed irreduiclbe subset. The codimension $\operatorname{codim}(Z,X)$ of $Z$ in $X$ is the supremum of the legnth of chains of irreduicible closed subsets $Z_0 \supsetneq Z_1 \supsetneq \cdots \supsetneq Z_l$ such that $Z_l = Z$. (2) Let $Z\subseteq X$ be a closed subset. We say that $Z$ is equi-codimensional ( of codimension $r$),if all irreduiclbe components of $Z$ have the same codimension in $X$ (equal to $r$).
Now, let $X=\operatorname{Spec}A$ be an integral affine $k$-scheme of finite type. Assume that there exist $f_1 ,\dots f_{r-1} \in A$ such that the irreducible components $Y_1 , \dots,Y_N$ of $V(f_1,\dots , f_{r-1}$) all have codimension $r-1$. Let $f_r \in A$ such that $V(f_r)$ does not contain all $Y_i$ , $1 \le i \le N$.
Q. Then, $V(f_1, \dots , f_r) = V(f_r ) \cap V(f_1, \dots, f_{r-1})$ is equi-codimensional of codimension $r$ ? If not, when?
This question originates from following question : In proof of Proposition 5.34 in the Gortz's Algebraic Geometry book. If our question is true, then $V(f_1, \dots, f_r)$ in the linked question is equi-codimensional of codimension $r$ ).
EDIT : I think that for the associated question noted as duplicate, there is a difference between that and mine , for two reasons.
$1)$ First, to apply the Proposition I.7.1. in the KReiser's answer in the associated question, I think that it needs that we can view $V(f_r)$ and $V(f_1,\dots, f_{r-1})$ as varieties in $\mathbb{A}^{d}_k$ where $d:=\dim X =\dim A$. But I don't know how these are guranteed. I think that the KReiser's Proposition 1.7.1. may not be directly applied to our general(?) situation that $X = \operatorname{Spec}A$ is an integral affine $k$-scheme of fintie type. On the other hand, from https://stacks.math.columbia.edu/tag/0AZP, if $X$ is nonsingular variety, then we have for an irreducible component $Z \subseteq V(f_1, \dots, f_r) = V(f_r) \cap V(f_1, \dots f_{r-1})$, $$\dim Z \ge \dim V(f_r) + \dim V(f_1, \dots f_{r-1}) -d = \dim V(f_r) + d-(r-1) -d = \dim V(f_r) - (r-1) = d-r,$$ if $\dim V(f_r) =d-1$. But $X=\operatorname{Spec}A$ may not be nonsingular. I think that for rigorousity, we need more general theorem to guarantee $\dim Z \ge d-r$.
EDIT for 1) My second attempt is as follows. Let $d:=\dim X = \dim A$. Since $A$ is a finitely generated $k$-algebra, by the Nother normalization, there exists a finite injective $k$-algebra homomorphism $\varphi : k[T_1 , \dots , T_d ] \hookrightarrow A$. Let $f: X \to \mathbb{A}^{d}_k$ be the induced morphism between spectrums. I am trying to apply next proposition ( Gortz's Algebraic Geometry book ) :
Proposition 5.12. Let $X=\operatorname{Spec}B$ and $Y= \operatorname{Spec}A$ be affine schemes. let $\varphi : A\to B$ be a integral ring homomorphism, and let $f:X\to Y$ be the corresponding scheme morphism. If $Z=V(\mathfrak{b}) \subseteq X$ is a closed subscheme, where $\mathfrak{b} \subseteq B$ is an ideal then $$ f(Z)= V(\varphi^{-1}(\mathfrak{b})).$$ In particular, $f$ is closed. Moreover : (1) One has $\dim f(Z)=\dim Z$. (2) If $\varphi$ is in addition injective, then $f$ is surjective.
Again, let $Z\subseteq V(f_1 ,\dots f_r)$ be an irreducible component. Then my interlude questions are,
Q.1-1) $f(Z)$ is also an irreducible component of $f(V(f_1,\dots , f_r))$?
Q.1-2) $f(V(f_1,\dots , f_r)) = f( V(f_r) \cap V(f_1, \dots, f_{r-1})) = f(V(f_r)) \cap f(V(f_1,\dots , f_{r-1})) $? ( Since $f$ may not be injective, the last equality may be false.. )
If these interlude questions are true, then we show by the above Proposition 5.12. and the Affine Dimension Theorem ( Hartshorne, Proposition I.7.1. C.f. Reference request for the dimension of intersection of affine varieties ) that
$$\dim Z = \dim f(Z) \ge \dim f(V(f_r)) + \dim f(V(f_1 ,\dots , f_{r-1})) - d = \dim V(f_r) + \dim V ( f_1, \dots , f_{r-1}) -d = d-r,$$
if $\dim V(f_r) =d-1$ as above. But there is a possibility of falsity of the interlude qeustions. Or is there any other route to show that $\dim Z \ge d-r $? How can we breakthrough this difficulty?
$2)$ Second, although we prove that $\dim Z \ge d-r$, it remains to prove that $\dim Z \le d-r$. I don't know how to prove this until now. Is there a simple route to show this? It seems that having the KReiser's answer in the associated question alone is not enough to prove that $\dim Z \le d-r$. Can anyone give me hint?
EDIT for 2) : We can show that $\dim Z \le d-r$ as follows. First, since $Z \subseteq V(f_1, \dots ,f_{r-1})$, $Z = Z \cap V(f_1 , \dots, f_{r-1}) = Z \cap ( Y_1 \cup \cdots \cup Y_N) = (Z\cap Y_1) \cup \cdots \cup (Z \cap Y_N)$. Since each $(Z \cap Y_i)$ is closed in $Z$, by the Munkres, Topology, Corollary 50.3., $\dim Z = \max \{\dim (Z \cap Y_1 ) ,\dots, \dim (Z \cap Y_N) \}$. But second, note that since $V(f_r)$ does not contain all $Y_i$ so that $V(f_r) \cap Y_i$ is proper closed subset of $Y_i$, $\dim(V(f_r) \cap Y_i) < \dim Y_i = \dim X - \operatorname{codim}(Y_i ,X) =d-(r-1)$ so that $\dim (V(f_r) \cap Y_i) \le d-r$ for all $i$. Since $(Z \cap Y_i ) \subseteq V(f_r) \cap Y_i$, we are done.
So it remains to deal with issue in $1)$ above.
Can anyone help?