Definition:Set Difference
Definition
The (set) difference between two sets $S$ and $T$ is written $S \setminus T$, and means the set that consists of the elements of $S$ which are not elements of $T$:
- $x \in S \setminus T \iff x \in S \land x \notin T$
It can also be defined as:
- $S \setminus T = \set {x \in S: x \notin T}$
- $S \setminus T = \set {x: x \in S \land x \notin T}$
Illustration by Venn Diagram
The difference $S \setminus T$ between the two sets $S$ and $T$ is illustrated in the following Venn diagram by the red area:
Examples
Example: $\set {1, 2, 3} \setminus \set { 2, 4, 5, 6}$
Let $S$ and $T$ be sets such that:
- $S = \set {1, 2, 3}$
- $T = \set {2, 4, 5, 6}$
Let $\setminus$ denote set difference.
Then:
- $S \setminus T = \set {1, 3}$
while:
- $T \setminus S = \set {4, 5, 6}$
Arbitrary Example $1$
Let:
\(\ds A\) | \(=\) | \(\ds \set {1, 2}\) | ||||||||||||
\(\ds B\) | \(=\) | \(\ds \set {2, 3}\) |
Then:
- $A \setminus B = \set 1$
Arbitrary Example $2$
Let $S$ and $T$ be sets such that:
- $A = \set {1, 2, 3}$
- $B = \set {1, 2, 4, 5}$
Let $\setminus$ denote set difference.
Then:
- $A \setminus B = \set 3$
Also known as
Some sources refer to $S \setminus T$ as the difference set (as opposed to set difference).
Some authors call $S \setminus T$ the relative difference between $S$ and $T$.
Some authors call $S \setminus T$ the (relative) complement of $T$ in $S$, but the standard definition for the latter concept requires that $T \subseteq S$.
$S \setminus T$ can be voiced:
- $S$ slash $T$
- $S$ cut down by $T$.
Another frequently seen notation for $S \setminus T$ is $S - T$.
Both notations may be encountered on this website, but $\setminus$ is preferred.
Some sources use $S \sim T$.
Also see
- Definition:Class Difference, the same concept in the context of class theory
- Results about set difference can be found here.
Sources
- 1955: John L. Kelley: General Topology ... (previous) ... (next): Chapter $0$: Subsets and Complements; Union and Intersection
- 1960: Paul R. Halmos: Naive Set Theory ... (previous) ... (next): $\S 5$: Complements and Powers
- 1964: W.E. Deskins: Abstract Algebra ... (previous) ... (next): $\S 1.1$: Definition $1.2$
- 1964: Steven A. Gaal: Point Set Topology ... (previous) ... (next): Introduction to Set Theory: $1$. Elementary Operations on Sets
- 1965: Claude Berge and A. Ghouila-Houri: Programming, Games and Transportation Networks ... (previous) ... (next): $1$. Preliminary ideas; sets, vector spaces: $1.1$. Sets: footnote $\dagger$
- 1965: J.A. Green: Sets and Groups ... (previous) ... (next): $\S 1.6$. Difference and complement
- 1965: Seth Warner: Modern Algebra ... (previous) ... (next): Chapter $\text I$: Algebraic Structures: $\S 3$: Unions and Intersections of Sets
- 1966: Richard A. Dean: Elements of Abstract Algebra ... (previous) ... (next): $\S 0.2$. Sets
- 1967: George McCarty: Topology: An Introduction with Application to Topological Groups ... (previous) ... (next): Introduction: Set-Theoretic Notation
- 1968: A.N. Kolmogorov and S.V. Fomin: Introductory Real Analysis ... (previous) ... (next): $1$ Set Theory: $1$. Sets and Functions: $1.2$: Operations on sets
- 1970: Avner Friedman: Foundations of Modern Analysis ... (previous) ... (next): $\S 1.1$: Rings and Algebras
- 1970: B. Hartley and T.O. Hawkes: Rings, Modules and Linear Algebra ... (previous) ... (next): Chapter $1$: Rings - Definitions and Examples: $2$: Some examples of rings: Ring Example $6$
- 1971: Allan Clark: Elements of Abstract Algebra ... (previous) ... (next): Chapter $1$: The Notation and Terminology of Set Theory: $\S 8$
- 1971: Robert H. Kasriel: Undergraduate Topology ... (previous) ... (next): $\S 1.5$: Complementation: Definition $5.1$
- 1971: Gaisi Takeuti and Wilson M. Zaring: Introduction to Axiomatic Set Theory: $\S 5.14$
- 1972: A.G. Howson: A Handbook of Terms used in Algebra and Analysis ... (previous) ... (next): $\S 2$: Sets and functions: Sets
- 1975: T.S. Blyth: Set Theory and Abstract Algebra ... (previous) ... (next): $\S 1$. Sets; inclusion; intersection; union; complementation; number systems
- 1975: W.A. Sutherland: Introduction to Metric and Topological Spaces ... (previous) ... (next): Notation and Terminology
- 1978: Thomas A. Whitelaw: An Introduction to Abstract Algebra ... (previous) ... (next): $\S 6$: Subsets
- 1979: John E. Hopcroft and Jeffrey D. Ullman: Introduction to Automata Theory, Languages, and Computation ... (previous) ... (next): Chapter $1$: Preliminaries: $1.4$ Set Notation: Operations on Sets $3)$
- 1982: P.M. Cohn: Algebra Volume 1 (2nd ed.) ... (previous) ... (next): Chapter $1$: Sets and mappings: $\S 1.2$: Sets
- 1986: Geoffrey Grimmett and Dominic Welsh: Probability: An Introduction ... (previous) ... (next): $1$: Events and probabilities: $1.2$: Outcomes and events
- 1989: Ephraim J. Borowski and Jonathan M. Borwein: Dictionary of Mathematics ... (previous) ... (next): difference: 2. a. (of two sets)
- 1990: H.A. Priestley: Introduction to Complex Analysis (revised ed.) ... (previous) ... (next): Notation and terminology
- 1996: H. Jerome Keisler and Joel Robbin: Mathematical Logic and Computability ... (previous) ... (next): Appendix $\text A$: Sets and Functions: $\text{A}.2$: Boolean Operations
- 1993: Keith Devlin: The Joy of Sets: Fundamentals of Contemporary Set Theory (2nd ed.) ... (previous) ... (next): $\S 1$: Naive Set Theory: $\S 1.2$: Operations on Sets
- 1993: Keith Devlin: The Joy of Sets: Fundamentals of Contemporary Set Theory (2nd ed.) ... (previous) ... (next): $\S 1$: Naive Set Theory: $\S 1.3$: Notation for Sets: Exercise $1.3.1 \ \text{(iii)}$
- 1998: David Nelson: The Penguin Dictionary of Mathematics (2nd ed.) ... (previous) ... (next): difference: 2.
- 1999: András Hajnal and Peter Hamburger: Set Theory ... (previous) ... (next): $1$. Notation, Conventions: $12$
- 2000: James R. Munkres: Topology (2nd ed.) ... (previous) ... (next): $1$: Set Theory and Logic: $\S 1$: Fundamental Concepts
- 2002: Thomas Jech: Set Theory (3rd ed.) ... (previous) ... (next): Chapter $1$: Separation Schema
- 2005: René L. Schilling: Measures, Integrals and Martingales ... (previous) ... (next): $\S 2$
- 2008: Paul Halmos and Steven Givant: Introduction to Boolean Algebras ... (previous) ... (next): Appendix $\text{A}$: Set Theory: Operations on Sets
- 2008: David Nelson: The Penguin Dictionary of Mathematics (4th ed.) ... (previous) ... (next): difference: 2.
- 2012: M. Ben-Ari: Mathematical Logic for Computer Science (3rd ed.) ... (previous) ... (next): Appendix $\text{A}.2$: Definition $\text{A}.8$