对称差

来自GSXAB的知识库
对称差
术语名称 对称差
英语名称 symmetric difference
别名 对称差

对称差(symmetric difference)是对两个集合,包含仅属于其中一个集合(属于第一个集合但不属于第二个集合,或属于第二个集合但不属于第一个集合)的元素的新的集合。 推广到多元是属于其中奇数个。

定义

对称差
运算名称 对称差
运算符号 [math]\displaystyle{ \triangle }[/math]
Latex
\triangle
运算对象 集合
运算元数 2
运算结果 集合



对集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math] ,由所有属于集合 [math]\displaystyle{ A }[/math] 但不属于集合 [math]\displaystyle{ B }[/math] 的元素,或属于集合 [math]\displaystyle{ B }[/math] 但不属于集合 [math]\displaystyle{ A }[/math] 的元素所构成的集合,叫做集合 [math]\displaystyle{ A }[/math] 与集合 [math]\displaystyle{ B }[/math]对称差(symmetric difference),记作 [math]\displaystyle{ A \triangle B }[/math] ,有时也记作 [math]\displaystyle{ A \ominus B }[/math]。即: [math]\displaystyle{ A \triangle B = \left\{ x \mid (x \in A \land x \notin B) \lor (x \in B \land x \notin A) \right\} = \left\{ x \mid (x \in A) \oplus (x \in B) \right\} }[/math]

字符
Unicode码位 U+2206 Increment[1]
Latex命令序列
\triangle


性质

作为布尔代数的运算,对称差可以定义为:[math]\displaystyle{ A \triangle B = (A \cup B) \cap (A \cap B)^\complement = (A \cap B^\complement) \cup (A^\complement \cap B) }[/math]

  • 对称
    • 结合性:对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math][math]\displaystyle{ C }[/math],有 [math]\displaystyle{ (A \triangle B) \triangle C = A \triangle (B \triangle C) }[/math]
    • 交换性:对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math],有 [math]\displaystyle{ A \triangle B = B \triangle A }[/math]
  • 特殊值
    • [math]\displaystyle{ A \triangle \varnothing = A }[/math]
      • 空集是对称差运算的幺元。
    • [math]\displaystyle{ A \triangle U = A^\complement }[/math]
    • [math]\displaystyle{ A \triangle A = \varnothing }[/math]
      • 任意集合是自身在对称差运算下的逆元。
      • [math]\displaystyle{ A \triangle B = \varnothing \Leftrightarrow A = B }[/math]
  • 包含关系
    • [math]\displaystyle{ A \triangle B \subseteq A \cap B }[/math]
  • 和交并补的关系
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math][math]\displaystyle{ C }[/math],有 [math]\displaystyle{ A \cap (B \triangle C) = (A \triangle B) \cap (A \triangle C) }[/math]
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math],有 [math]\displaystyle{ A \triangle B = A^\complement \triangle B^\complement }[/math]

多元对称差

对集合 [math]\displaystyle{ A_1, A_2, \dots , A_n }[/math] ,由所有属于奇数个集合的元素所构成的集合,叫做这些集合的对称差(symmetric difference),记作 [math]\displaystyle{ A_1 \triangle A_2 \triangle \dots \triangle A_n }[/math]。即 [math]\displaystyle{ A_1 \triangle A_2 \triangle \dots \triangle A_n = \left\{ x \mid \sum_{i=1}^n \boldsymbol{1}_{A_i}(x) \equiv 1\pmod 2 \right\} }[/math]


集合
特殊集合 空集 [math]\displaystyle{ \varnothing }[/math]全集
关系 成员关系/属于 [math]\displaystyle{ \in }[/math]
包含关系/子集/超集 [math]\displaystyle{ \subseteq }[/math]、真包含关系/真子集/真超集 [math]\displaystyle{ \subset }[/math]相等关系 [math]\displaystyle{ = }[/math]
运算 基础运算 交集 [math]\displaystyle{ \cap }[/math]并集 [math]\displaystyle{ \cup }[/math]补集 [math]\displaystyle{ \bullet^\complement }[/math]差集 [math]\displaystyle{ \setminus }[/math]
复合运算 对称差集 [math]\displaystyle{ \triangle }[/math]
笛卡尔积运算 笛卡尔积 [math]\displaystyle{ \times }[/math]、笛卡尔幂 [math]\displaystyle{ \bullet^n }[/math]幂集 [math]\displaystyle{ \mathcal{P}(\bullet) }[/math]/[math]\displaystyle{ 2^\bullet }[/math]映射的集合 [math]\displaystyle{ \bullet^\bullet }[/math]
不交并运算 不交并 [math]\displaystyle{ \sqcup }[/math]
商运算 商集 [math]\displaystyle{ \bullet/\sim }[/math]
  1. 有别名 Laplace OperatorForward DifferenceSymmetric Difference (in Set Theory)