差集

来自GSXAB的知识库
差集
术语名称 差集
英语名称 difference
别名 差, 相对补集, relative complement

差集(difference)是对两个集合,由所有属于第一个集合但不属于第二个集合的元素构成的新集合。

定义

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


对集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math] ,由所有属于集合 [math]\displaystyle{ A }[/math] 但不属于集合 [math]\displaystyle{ B }[/math] 的元素所构成的集合,叫做集合 [math]\displaystyle{ A }[/math] 与集合 [math]\displaystyle{ B }[/math]差集(difference)或 集合 [math]\displaystyle{ A }[/math] 在集合 [math]\displaystyle{ B }[/math] 中的相对补集(relative complement)、集合 [math]\displaystyle{ A }[/math] 相对于集合 [math]\displaystyle{ B }[/math]补集,简称,记作 [math]\displaystyle{ A \setminus B }[/math] ,有时也记作 [math]\displaystyle{ A - B }[/math][1] 。 即: [math]\displaystyle{ A \setminus B = \left\{ x \mid x \in A \land x \notin B \right\} }[/math]

diff.svg

字符
Unicode码位 U+2216 Set Minus
Latex命令序列 \setminus


性质

根据差集和补集的关系,差集也可以定义为:[math]\displaystyle{ A \setminus B = A \cap B^\complement }[/math]

  • 特殊值
    • 空集是差集运算的右幺元[math]\displaystyle{ A \setminus \varnothing = A }[/math]
    • 空集是差集运算的左零元 [math]\displaystyle{ \varnothing \setminus A = \varnothing }[/math]
    • [math]\displaystyle{ A \setminus A = \varnothing }[/math]
    • 如果允许全集[math]\displaystyle{ A \setminus U = \varnothing }[/math]
    • 如果允许全集, [math]\displaystyle{ U \setminus A = A^\complement }[/math]
  • 包含关系
    • [math]\displaystyle{ A \setminus B \subseteq A }[/math]
      • [math]\displaystyle{ A \setminus B \subset A \Leftrightarrow A \cap B \neq \varnothing }[/math]
    • [math]\displaystyle{ A \setminus B = \varnothing \Leftrightarrow A \subseteq B }[/math]
    • [math]\displaystyle{ A \subset B \implies C \setminus A \supset C \setminus B }[/math]
      • [math]\displaystyle{ A \subseteq B \implies C \setminus A \supseteq C \setminus B }[/math]
  • 和交并的关系
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math],有 [math]\displaystyle{ A \cap (A \setminus B) = A \setminus B }[/math][math]\displaystyle{ A \cup (A \setminus B) = A }[/math]
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math][math]\displaystyle{ C }[/math],有 [math]\displaystyle{ A \setminus (B \cup C) = (A \setminus B) \cap (A \setminus C) }[/math][math]\displaystyle{ A \setminus (B \cap C) = (A \setminus B) \cup (A \setminus C) }[/math]
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math][math]\displaystyle{ C }[/math],有 [math]\displaystyle{ A \setminus (B \setminus C) = (A \cap C) \cup (A \setminus B) }[/math]
      • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math],有 [math]\displaystyle{ A \setminus (A \setminus B) = A \cap B }[/math]
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math][math]\displaystyle{ C }[/math],有 [math]\displaystyle{ (A \cap B) \setminus C = (A \setminus C) \cap B = A \cap (B \setminus C) = (A \setminus C) \cap (B \setminus C) }[/math]
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math][math]\displaystyle{ C }[/math],有 [math]\displaystyle{ (A \cup B) \setminus C = (A \setminus C) \cup (B \setminus C) }[/math]
    • 对于任意集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math][math]\displaystyle{ C }[/math],有 [math]\displaystyle{ (A \setminus B) \cup C = (A \cup C) \setminus (B \setminus C) }[/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. 直接用减号,有时会造成和闵氏和对应的减法的歧义,即元素作差可能取值构成的集合。