Rozdiel množín A a B zobrazený pomocou Vennovho diagramu
V matematike sa ako rozdiel dvoch množín označuje množina obsahujúca všetky prvky, ktoré sa nachádzajú v prvej z týchto množín a nenachádzajú sa v druhej z množín. Rozdiel množín A a B sa označuje symbolom A - B , prípadne A \ B .[ 1]
Formálny zápis:
x
∈
A
−
B
⇔
(
x
∈
A
∧
x
∉
B
)
{\displaystyle x\in A-B\Leftrightarrow (x\in A\land x\notin B)}
Rozdiel nie je komutatívny , ani asociatívny .
Napríklad rozdiel množín
A
=
{
0
,
2
,
4
,
6
,
8
,
10
,
12
,
14
}
{\displaystyle A=\{0,2,4,6,8,10,12,14\}}
a
B
=
{
0
,
3
,
6
,
9
,
12
,
15
,
16
}
{\displaystyle B=\{0,3,6,9,12,15,16\}}
je
A
∖
B
=
{
2
,
4
,
8
,
10
,
14
}
{\displaystyle A\setminus B=\{2,4,8,10,14\}}
,
ale
B
∖
A
=
{
3
,
9
,
15
,
16
}
{\displaystyle B\setminus A=\{3,9,15,16\}}
.
Rozdielom množiny reálnych čísel
R
{\textstyle \mathbb {R} }
a množiny racionálnych čísel
Q
{\textstyle \mathbb {Q} }
je množina iracionálnych čísel
I
{\textstyle \mathbb {I} }
. Teda
R
∖
Q
=
I
{\textstyle \mathbb {R} \setminus \mathbb {Q} =\mathbb {I} }
.
Rozdielom množiny celých čísel
Z
{\textstyle \mathbb {Z} }
a množiny prirodzených čísel
N
+
{\textstyle \mathbb {N} ^{+}}
je množina záporných celých čísel
{
x
∈
Z
,
x
<
0
}
{\textstyle \{x\in \mathbb {Z} ,x<0\}}
. Teda
Z
∖
N
+
=
{
x
∈
Z
,
x
<
0
}
{\textstyle \mathbb {Z} \setminus \mathbb {N} ^{+}=\{x\in \mathbb {Z} ,x<0\}}
.
Pre ľubovoľné množiny
A
{\textstyle A}
,
B
{\textstyle B}
a
C
{\textstyle C}
platia nasledujúce rovnosti množinových operácií :
C
∖
(
A
∩
B
)
=
(
C
∖
A
)
∪
(
C
∖
B
)
{\displaystyle C\setminus (A\cap B)=(C\setminus A)\cup (C\setminus B)}
C
∖
(
A
∪
B
)
=
(
C
∖
A
)
∩
(
C
∖
B
)
{\displaystyle C\setminus (A\cup B)=(C\setminus A)\cap (C\setminus B)}
C
∖
(
B
∖
A
)
=
(
A
∩
C
)
∪
(
C
∖
B
)
{\displaystyle C\setminus (B\setminus A)=(A\cap C)\cup (C\setminus B)}
(
B
∖
A
)
∩
C
=
(
B
∩
C
)
∖
A
=
B
∩
(
C
∖
A
)
{\displaystyle (B\setminus A)\cap C=(B\cap C)\setminus A=B\cap (C\setminus A)}
(
B
∖
A
)
∪
C
=
(
B
∪
C
)
∖
(
A
∖
C
)
{\displaystyle (B\setminus A)\cup C=(B\cup C)\setminus (A\setminus C)}
A
∖
A
=
∅
{\displaystyle A\setminus A=\varnothing }
∅
∖
A
=
∅
{\displaystyle \varnothing \setminus A=\varnothing }
A
∖
∅
=
A
{\displaystyle A\setminus \varnothing =A}
Ďalej platí
Ak platí
A
⊂
B
{\textstyle A\subset B}
, potom platí aj
C
∖
A
⊃
C
∖
B
{\textstyle C\setminus A\supset C\setminus B}
.
Výraz
A
⊇
B
∖
C
{\textstyle A\supseteq B\setminus C}
je ekvivalentný výrazu
C
⊇
B
∖
A
{\textstyle C\supseteq B\setminus A}
.
Prienik množín
C
∩
A
{\textstyle C\cap A}
je možné zapísať aj ako rozdiel
C
∖
(
C
∖
A
)
{\textstyle C\setminus (C\setminus A)}
.
↑ JELÍNEK, Miloš. Množiny . [s.l.] : SPN, n. p., 1978.