# 对称差

${\displaystyle A\operatorname {\triangle } B}$文氏图。对称差标为红色。

## 定义

1. ${\displaystyle A\operatorname {\triangle } B=(A-B)\cup (B-A)}$
2. ${\displaystyle A\operatorname {\triangle } B=(A\cup B)-(A\cap B)}$

## 性质

${\displaystyle A\operatorname {\triangle } B=B\operatorname {\triangle } A}$

${\displaystyle (A\operatorname {\triangle } B)\operatorname {\triangle } C=A\operatorname {\triangle } (B\operatorname {\triangle } C)}$

${\displaystyle \varnothing \operatorname {\triangle } A=A}$（空集是单位元）

${\displaystyle A\operatorname {\triangle } A=\varnothing }$

${\displaystyle A\cap (B\operatorname {\triangle } C)=(A\cap B)\operatorname {\triangle } (A\cap C)}$

${\displaystyle A\operatorname {\triangle } (B\cap C)\neq (A\operatorname {\triangle } B)\cap (A\operatorname {\triangle } C)}$
${\displaystyle A\cup (B\operatorname {\triangle } C)\neq (A\cup B)\operatorname {\triangle } (A\cup C)}$
${\displaystyle A\operatorname {\triangle } (B\cup C)\neq (A\operatorname {\triangle } B)\cup (A\operatorname {\triangle } C)}$

### 布尔环

${\displaystyle A\operatorname {\triangle } \varnothing =A}$
${\displaystyle A\operatorname {\triangle } A=\varnothing }$
${\displaystyle A\operatorname {\triangle } B=B\operatorname {\triangle } A}$
${\displaystyle (A\operatorname {\triangle } B)\operatorname {\triangle } C=A\operatorname {\triangle } (B\operatorname {\triangle } C)}$
${\displaystyle A\operatorname {\triangle } B=A\operatorname {\triangle } C\Rightarrow B=C}$

## 与逻辑和布尔代数的关系

${\displaystyle A\operatorname {\triangle } B=\{x\mid (x\in A)\oplus (x\in B)\}}$

${\displaystyle x\operatorname {\triangle } y=(x\lor y)\land \neg (x\land y)=(x\land \neg y)\lor (y\land \neg x)}$