TITLE: Under what circumstances do we have $\partial(A \setminus B) = \partial A \cup (A \cap B)$?
QUESTION [5 upvotes]: Let $A$ and $B$ denote subsets of $\mathbb{R}^n$.
Then if $A$ is an open set and $B$ is a "sufficiently small" closed set, then we might expect the following to hold: $$\partial(A \setminus B) = \partial A \cup (A \cap  B)$$
For example, imagine that $X = \mathbb{R}^2$, that $A$ is the unit (open) ball centered at the origin, and that $B$ is a line through the origin. Then $\partial A$ is the unit circle centered at the origin, $A \cap B$ is a line segment of length $2$ through the origin, and $\partial(A \setminus B)$ is the union of these.

Question. Let $A$ and $B$ denote subsets of $\mathbb{R}^n$, with $A$ open and $B$ closed. Under what assumptions does the identity of interest hold? I'm also interested in generalizing beyond $\mathbb{R}^n$ to e.g. sufficiently well-behaved topological spaces.

I tried proving this under the assumption that $\mathrm{int}(B) = \emptyset$ but didn't get very far.

REPLY [2 votes]: I think I have a proof for the case when $B^o:=int(B)=\emptyset$. Let $a\in \partial(A-B)$. Then by definition, $a\in \overline{A-B}$. Since $B$ is closed and $A$ is open, $B^c\cap A=A-B$ is open. It follows that $a\not\in (A-B)$, otherwise $a$ would be an interior point of $(A-B)$. Hence, $a\in (A-B)^c=(A\cap B^c)^c=A^c\cup B$, so either $a\in B$ or $a\in A^c$. Since $\overline{A-B}\subset \overline{A}$, we have $a\in \partial A$ or $a\in A\cap B$. 
For the other direction, we need the following:
Lemma
If $B^o=\emptyset$, then $\overline{A-B}=\overline{B^c\cap A}=\overline{A}$.
proof
Since $B^o=\emptyset$, for each point $a\in B\cap A$ and all open balls $a\in B_{\epsilon}$, we have $B_{\epsilon}\cap (A\cap B^c)\neq \emptyset$. Hence, $B^c\cap A$ is dense in $A$ (in the subspace topology).  
Now back to our problem...Let $a\in \partial A\cup (A\cap B)$. If $a\in \partial A$, then $a\in \overline{A-B}$ by the lemma. Moreover, $a\not \in A-B$, since then $a\in A=A^o$ would contradict our hypothesis. Hence, $a\in \partial(A-B)$. If $a\in (A\cap B)$ then again we have that every open ball intersects points of $A-B$ and hence $a\in \overline{A-B}$. Finally, $a\not\in A-B$, otherwise $a\not\in B$.
Edit
I cleaned up the proof so that its a bit more readable. 
Also, the condition that $(A\cap B)^o=\emptyset$ is both necessary and sufficient. To see that its necessary, notice that if $(A\cap B)$ has interior points, then so does $\partial A\cup (A\cap B)$. However, $\partial(A-B)$ can't have any interior points. Indeed, $(A-B)=B^c\cap A$ is open and $\partial(A-B)=(\overline{A-B})-(A-B)$. If this set had an interior point, then there would be some open ball $B_{\epsilon}$ in $\overline{A-B}$, which does not intersect $A-B$. But then $\overline{A-B}-B_{\epsilon}=\overline{A-B}\cap B_{\epsilon}^c$ is a closed set containing $A-B$, contradicting the fact that $\overline{A-B}$ is the closure (smallest closed set containing $A-B$). 
Finally, this works in any topological space. Just replace $B_{\epsilon}$ by an element in a basis for the topology.