Why does this condition about closures characterize open sets? Let $X$ a topologic space and $U\subseteq X$, then $U\in \tau \iff$ for all $A⊆X,$ $\overline{U\cap\bar{A}}=\overline{U\cap A}.$
I already prove that if $U$ is an open subset of $X$, then the equality holds using that $x\in\bar{A} \iff$ every open set $U$ containing $x$ intersects $A$.
But im stucked trying to prove that in fact, $U$ is an open set if I assume equality. My first try was to use the same theorem but I didn't get anything and then I tried to prove that  $U$=int$U$ but is that the way to prove it or I'm missing something?
EXTRA: I know that $\overline{U\cap\bar{A}}=\overline{U\cap A}$ tells me that $U$ is very close to $\bar{A}$ as well as $A$, so in fact, $U$ must be open :c
Any help will be appreciated.
 A: To use the property "for all $A \subseteq X$, $\overline{U\cap\bar{A}}=\overline{U\cap A}$", it makes sense to pick some cleverly chosen $A$, depending on $U$, and apply the property to that $A$.
I admit that my first attempts were to try $A = \varnothing$, $A = X$, and $A = U$, and neither of those tell us anything useful about $U$.
But if we try setting $A = U^c$ (that is, the complement $X-U$), then the resulting condition $\overline{U\cap\overline {U^c}}=\overline{U\cap U^c}$ simplifies nicely:

*

*First, to $\overline{U\cap\overline{U^c}} = \overline{\varnothing} = \varnothing$. (Having the RHS simplify in this way was my motivation to try $A = U^c$ to begin with.)


*If $\overline S = \varnothing$, then $S = \varnothing$. (Why?) Therefore $U \cap \overline{U^c} = \varnothing$.


*We have $\overline{U^c} = (\operatorname{int}(U))^c$. (Why?) Therefore $U \cap (\operatorname{int}(U))^c = \varnothing$, which is another way of saying $U \subseteq \operatorname{int}(U)$. This is only true if $U$ is open.
A: I saw Misha Lavrov solution, and thanks for the ones who answered and helped me to fix the problem of quantiers with the subset $A$. Now I gonna show my solution:
I'm gonna prove that $X\backslash U$ is a closed set of X, i.e $\overline{X\backslash U}\subseteq X\backslash U$\
Since for all $A \subseteq X$, $\overline{U\cap\bar{A}}=\overline{U\cap A}$, consider $A=X\backslash U$ hence, $U\cap\overline{X\backslash U}\subseteq \overline{U\cap\overline{X\backslash U}}=\overline{U\cap X\backslash U} $ but U\cap $U\cap X\backslash U=\emptyset$ and $\bar{\emptyset}=\emptyset$. Therefore, $U\cap\overline{X\backslash U}=\emptyset$.
So $\overline{X\backslash U}\subseteq X\backslash U $ so, $\overline{X\backslash U}=X\backslash U$, that means, $X\backslash U$ is a closed subset of X, indeed $U$ is open in X.
