Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Symmetric difference
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Properties == [[File:Venn 0110 1001.svg|thumb| Venn diagram of <math>~(A \Delta B) \Delta C</math> {{nowrap|[[File:Venn 0110 0110.svg|40px]] <math>~ \Delta~</math> [[File:Venn 0000 1111.svg|40px]]}} <math>~=~</math> [[File:Venn 0110 1001.svg|40px]] ]] The symmetric difference is equivalent to the [[union (set theory)|union]] of both [[complement (set theory)|relative complement]]s, that is:<ref name=":0">{{Cite web |last=Taylor |first=Courtney |date=March 31, 2019 |title=What Is Symmetric Difference in Math? |url=https://www.thoughtco.com/what-is-the-symmetric-difference-3126594 |access-date=2020-09-05 |website=ThoughtCo |language=en}}</ref> :<math>A\, \Delta\,B = \left(A \setminus B\right) \cup \left(B \setminus A\right),</math> The symmetric difference can also be expressed using the [[Exclusive or|XOR]] operation β on the [[Predicate (mathematical logic)|predicates]] describing the two sets in [[set-builder notation]]: :<math>A\mathbin{ \Delta}B = \{x : (x \in A) \oplus (x \in B)\}.</math> The same fact can be stated as the [[indicator function]] (denoted here by <math>\chi</math>) of the symmetric difference, being the XOR (or addition [[Modular arithmetic|mod 2]]) of the indicator functions of its two arguments: <math>\chi_{(A\, \Delta\,B)} = \chi_A \oplus \chi_B</math> or using the [[Iverson bracket]] notation <math>[x \in A\, \Delta\,B] = [x \in A] \oplus [x \in B]</math>. The symmetric difference can also be expressed as the union of the two sets, minus their [[intersection (set theory)|intersection]]: :<math>A\, \Delta\,B = (A \cup B) \setminus (A \cap B),</math><ref name=":0" /> In particular, <math>A \mathbin{ \Delta} B\subseteq A\cup B</math>; the equality in this non-strict [[Subset|inclusion]] occurs [[if and only if]] <math>A</math> and <math>B</math> are [[disjoint sets]]. Furthermore, denoting <math>D = A \mathbin{ \Delta} B</math> and <math>I = A \cap B</math>, then <math>D</math> and <math>I</math> are always disjoint, so <math>D</math> and <math>I</math> [[Partition of a set|partition]] <math>A \cup B</math>. Consequently, assuming intersection and symmetric difference as primitive operations, the union of two sets can be well ''defined'' in terms of symmetric difference by the right-hand side of the equality :<math>A\,\cup\,B = (A\, \Delta\,B)\, \Delta\,(A \cap B)</math>. The symmetric difference is [[commutativity|commutative]] and [[associativity|associative]]: :<math>\begin{align} A\, \Delta\,B &= B\, \Delta\,A, \\ (A\, \Delta\,B)\, \Delta\,C &= A\, \Delta\,(B\, \Delta\,C). \end{align}</math> The [[empty set]] is [[identity element|neutral]], and every set is its own inverse: :<math>\begin{align} A\, \Delta\,\varnothing &= A, \\ A\, \Delta\,A &= \varnothing. \end{align}</math> Thus, the [[power set]] of any set ''X'' becomes an [[abelian group]] under the symmetric difference operation. (More generally, any [[field of sets]] forms a group with the symmetric difference as operation.) A group in which every element is its own inverse (or, equivalently, in which every element has [[Order (group theory)|order]] 2) is sometimes called a [[Boolean group]];<ref name="GivantHalmos2009">{{cite book |last1=Givant |first1=Steven |last2=Halmos |first2=Paul |author-link2=Paul Halmos |year=2009 |title=Introduction to Boolean Algebras |publisher=Springer Science & Business Media |isbn=978-0-387-40293-2 |page=6}}</ref><ref name="Humberstone2011">{{cite book |last=Humberstone |first=Lloyd |year=2011 |title=The Connectives |url=https://archive.org/details/connectives00humb |url-access=limited |publisher=MIT Press |isbn=978-0-262-01654-4 |page=[https://archive.org/details/connectives00humb/page/n800 782]}}</ref> the symmetric difference provides a prototypical example of such groups. Sometimes the Boolean group is actually defined as the symmetric difference operation on a set.<ref name="Rotman2010">{{cite book |last=Rotman |first=Joseph J. |year=2010 |title=Advanced Modern Algebra |publisher=American Mathematical Soc. |isbn=978-0-8218-4741-1 |page=19}}</ref> In the case where ''X'' has only two elements, the group thus obtained is the [[Klein four-group]]. Equivalently, a Boolean group is an [[elementary abelian group|elementary abelian 2-group]]. Consequently, the group induced by the symmetric difference is in fact a [[vector space]] over the [[GF(2)|field with 2 elements]] '''Z'''<sub>2</sub>. If ''X'' is finite, then the [[singleton (mathematics)|singleton]]s form a [[basis (linear algebra)|basis]] of this vector space, and its [[dimension (vector space)|dimension]] is therefore equal to the number of elements of ''X''. This construction is used in [[graph theory]], to define the [[cycle space]] of a graph. From the property of the inverses in a Boolean group, it follows that the symmetric difference of two repeated symmetric differences is equivalent to the repeated symmetric difference of the [[Multiset#Operations|join]] of the two multisets, where for each double set both can be removed. In particular: :<math>(A\, \Delta\,B)\, \Delta\,(B\, \Delta\,C) = A\, \Delta\,C.</math> This implies triangle inequality:<ref>{{cite book |last1=Rudin |first1=Walter |date=January 1, 1976 |title=Principles of Mathematical Analysis |url=https://archive.org/details/principlesofmath00rudi |url-access=registration |edition=3rd |publisher=McGraw-Hill Education |isbn=978-0070542358 |page=[https://archive.org/details/principlesofmath00rudi/page/306 306]}}</ref> the symmetric difference of ''A'' and ''C'' is contained in the union of the symmetric difference of ''A'' and ''B'' and that of ''B'' and ''C''. Intersection [[distributivity|distributes]] over symmetric difference: :<math>A \cap (B\, \Delta\,C) = (A \cap B)\, \Delta\,(A \cap C),</math> and this shows that the power set of ''X'' becomes a [[ring (mathematics)|ring]], with symmetric difference as addition and intersection as multiplication. This is the prototypical example of a [[Boolean ring]]. Further properties of the symmetric difference include: * <math>A \mathbin{ \Delta} B = \emptyset</math> if and only if <math>A = B</math>. * <math>A \mathbin{ \Delta} B = A^c \mathbin{ \Delta} B^c</math>, where <math>A^c</math>, <math>B^c</math> is <math>A</math>'s complement, <math>B</math>'s complement, respectively, relative to any (fixed) set that contains both. * <math>\left(\bigcup_{\alpha\in\mathcal{I}}A_\alpha\right) \Delta\left(\bigcup_{\alpha\in\mathcal{I}}B_\alpha\right)\subseteq\bigcup_{\alpha\in\mathcal{I}}\left(A_\alpha \mathbin{ \Delta} B_\alpha\right)</math>, where <math>\mathcal{I}</math> is an arbitrary non-empty index set. * If <math>f : S \rightarrow T</math> is any function and <math>A, B \subseteq T</math> are any sets in <math>f</math>'s codomain, then <math>f^{-1}\left(A \mathbin{ \Delta} B\right) = f^{-1}\left(A\right) \mathbin{ \Delta} f^{-1}\left(B\right).</math> The symmetric difference can be defined in any [[Boolean algebra (structure)|Boolean algebra]], by writing :<math> x\, \Delta\,y = (x \lor y) \land \lnot(x \land y) = (x \land \lnot y) \lor (y \land \lnot x) = x \oplus y.</math> This operation has the same properties as the symmetric difference of sets.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)