# Problem with proving that relation is congruent.

I have difficulties with following problem. I think it may be connected with some elementary misunderstanding of relevant concepts.

Let $\mathcal{F}$ be filter in $\mathcal{B}\subseteq\mathcal{P}(X)$.

Let's define equvilanece relation $A\equiv B$ iff $\exists_{D\in\mathcal{F}} A\cap D=B\cap D$

Now I need to prove that this is congruence relation in structure $<\mathcal{B},\emptyset,X,\cup,\cap,->$.

So for example I need to show that if $A\equiv A'$ and $B\equiv B'$, then $A\cup B=A'\cup B'$

My idea was to take $D_A$ and $D_B$ which make two above equivalences true. Then take $D_A\cap D_B=D$ which by definition of $\mathcal{F}$ belong to filter. Now I can divide all sets into parts conatined in $D$ and parts outside of $D$.

But now I do not know how to proceed. Let say that $D=D_1\cup D_2$ and $x,y\notin D,x\neq y$. $A=D_1\cup\{x\}, A'=D_1\cup\{y\}$ and $B=B'=D_2$. If I understand everything correctly then relevant equivalences hold. But clearly $A\cup B\neq A'\cup B'$.

But also $A\equiv A'\equiv D_1$ and $A\cup A'\neq D_1\cup D_1$ which indicates that something is horribly wrong.

You have $A\cap D_A = A' \cap D_A$, $B\cap D_B = B'\cap D_B$.
Then $(A\cup B)\cap (D_A\cap D_B) = (A\cap D_A\cap D_B) \cup (B\cap D_B\cap D_A) = (A'\cap D_A\cap D_B) \cup (B'\cap D_B\cap D_A) = (A'\cup B')\cap (D_A\cap D_B)$.
Since $D_A\cap D_B \in \mathcal{F}$, you get $A\cup B\equiv A'\cup B'$