Let $X$ be an affine variaty in a commutative ring $R$ and let $,Y_1,Y_2$ be subvarieties of $X$. Show that in the coordinate ring $A(X)=K[x_1,...,x_n]/I(X)$, where $K$ is an algebraically closed field, holds $I(\overline{Y_1 \setminus Y_2}) = I(Y_1):I(Y_2)$.
Remark: In a ring $R$ the ideal quotient of the ideals $J_1, J_2 \vartriangleleft R$ is defined by $(J_1:J_2)=\{f\in R\mid fJ_2\subset J_1\}$.
My attempt is as follows:
$\subseteq:$ If $f \in I(\overline{Y_1 \setminus Y_2})$, then by the definitions $f(x) = 0$ for all $x \in \overline{Y_1 \setminus Y_2}$, which, by the fact that for any $y \in Y_1$ either $y \in Y_1 \setminus Y_2$ or $y \in Y_2$ holds, implies $fI(Y_2) \subseteq I(Y_1)$.
$\supseteq:$ If $f \in I(J_1):I(J_2)$, then $fI(Y_2) \subseteq I(Y_1)$. We now make a case distinction: If $Y_1 = Y_2$, then $I(\overline{Y_1 \setminus Y_2}) = I(\emptyset) = A(X)$, thus $I(\overline{Y_1 \setminus Y_2})$. If $Y_1 \ne Y_2$, then $fI(Y_2) \subseteq I(Y_1)$ implies $f \in I(\overline{Y_1 \setminus Y_2})$.
I am unsure why this seemingly does not require us to use that we are working in $A(X)$. I also do not get we need to consider $\overline{Y_1 \setminus Y_2}$ instead of $Y_1 \setminus Y_2$. Could you please explain this to me?