Sets
(集合)
Discrete Mathematics I
6th lecture, October 23, 2026
https://www.sw.it.aoyama.ac.jp/2026/Math1/lecture6.html
Martin J. Dürst

© 2005-26 Martin
J. Dürst Aoyama Gakuin
University
Minitest: Preparation
ミニテストの注意点 (準備)
Minitest: Latecommers
ミニテストの注意点 (遅刻者)
- Follow instructions by Professor and TA
(先生と TA の指示に従うこと)
- Sit at the place designated by the Professor
(指定された席に座ること)
- Take out pencils and eraser(s) from bag, leave everything else in bag and
put bag below your chair
(鞄から鉛筆と消しゴムだけ取り出し、スマフォを含め残り全部を鞄の中で椅子の下に置く)
Minitest: Collection
ミニテストの注意点 (終了時)
- Follow instructions by Professor and TA
(先生と TA の指示に従うこと)
- Do not move around or make noise before collection of all examinations is
completed
(試験用紙の回収が完全に終了するまでに一切動かない、音を出さない)
Today's Schedule
- Minitest
- Summary/homework of last lecture
- Sets:
- Set membership and notations
- Operations on sets
- Subsets, powersets, the empty set
- Cardinality of sets
- Laws for sets
- Limits of set theory
Summary of Last Lecture
- Logic circuits can be built from gates to implement Boolean
functions.
- The main gates are AND, OR, NOT, NAND (⊼), NOR (⊽), XOR (⊕).
- Logic circuits are drawn from left to right; intermediate connections are
also labeled.
- All Boolean formulæ can be expressed using only NAND or only NOR.
- There are many different ways to axiomatize Boolean logic (learn at least
one set of axioms).
- Logical operations important for symbolic logic are implication (→) and
equivalence (↔).
Homework Problem 1
For each of the 16 Boolean functions of two Boolean variables A
and B (same as problem 1 of last lecture), find the shortest formula
using only NAND. You can use NAND with any number of arguments ≧1, but you
cannot use T or F.
Hint: Start with simple formulæ using NAND and find out which functions
they represent.
How to Solve Problem 1
- Method 1: Use the solutions from problem one of lecture 4, replace ∨,
∧, and ¬ with their representation by NAND.
Problem: Solution may not be shortest one.
- Method 2: Work backwards: Take the negation of the results of a Boolean
function and try to create it from the disjunction of two Boolean functions
for which you already have a solution.
Example: FTTF = ¬(TFFT) = ¬(FTTT ∧ TTTF) = NAND(NAND(NAND(A), NAND(B)), NAND(B, A))
- Method 3: Start with simple formulæ and combine them to more complicated
formulæ, removing duplicates
A Program to Solve Problem 1 using Method 3
- The program uses the programming languge Ruby
- Formulæ are represented by arrays (shown as [element1, element2,...])
Examples: NAND(A) ⇒ [A],
NAND(A,B,C)⇒[A,B,C], NAND(NAND(A), B)
⇒ [[A],B]
- Start with simple formulæ, create longer, more complicated formulæ:
- The simplest formulæ are single variables: A,
B
- These form the 0th set of expressions: E0 =
{A, B}
- Create all formulæ with one or less NANDs:
All combinations of formulæ from E0 without the
empty combination, plus the formulæ in E0
- E1 = {A, B,
NAND(A), NAND(B), NAND(A,
B)}
- Continue in the same way for E2,
E3, and so on
- The number of formulæ increases dramatically, so at each step, only
keep one of the formulæ that produce the same result
Homework Problem 2
Draw logic circuits of the following three Boolean formulæ:
- A ∨ C ∧ ¬D
- NOR(G, H, XOR(G,
N))
- NAND(P, ¬T) ∨ S
The Importance of Sets
- Sets are one of the most fundamental concepts of Mathematics
- Sets can be used to represent natural numbers
- Sets are very important for Information Technology
Examples of Sets
The set of integers from 1 to 5: {1, 2, 3, 4, 5}
The set of prefectures in the Kanto area: {Kanagawa, Saitama, Chiba, Gunma,
Tochigi, Ibaraki}
The set of campuses of Aoyama Gakuin University: {Sagamihara, Aoyama}
The Concept of a Set
- An unordered collection of objects
(i.e. {Sagamihara, Aoyama} = {Aoyama, Sagamihara})
- Conditions:
- It must be clear whether an object belongs to a set or not
- It must be clear whether two objects are the same or not
(the same object can belong to a set only once)
- Sets are usually denoted with upper-case letters (e.g. A,
B, C)
Elements and Membership
- The objects belonging to a set are called its elements or
members
- Usually, lower-case letters are used to denote elements
- If an element b belongs to a set C, we write
b ∈ C (or C ∋ b)
(read: b is an element of set C; b is a
member of C; element b belongs to set
C; set C contains element
b)
- If an element does not belong to a set, we write b ∉
C or C ∌ b
(b∉C = ¬(b∈C))
Equality of Sets
- An element can belong to a set only once.
- The order of elements in a set is irrelevant.
- Example: {1, 2} = {2, 1} = {2, 1, 2},...
- More formally:
A=B ⇔ ∀x:
x∈A↔x∈B
- Reading of ∀x: for all x (see next lecture)
Element Uniformity
- Elements can be anything: instances, categories, types, concepts,...
Examples:
- Set of categories/types: {dog, cat, cow, horse, sheep, goat}
- Set of instances: {Garfield, Tom, Crookshanks,
コロ、Sunny}
- There is no need for the elements in a set to be uniform
Example: {horse, happyness, Garfield, Mt. Fuji}
- A set is also an object. Therefore, it can become an element of another
set:
Example: {1, {1,2}, {{1}, {1, {1,2}}}}
Notations for Sets: Denotation
- Denotation uses enumeration to describe a set
- The elements are listed up separated by commas, and enclosed in braces
({})
- Examples: {a, b, c}, {1, 2, 3, 4}, {1, 3, 5, 7,...}
- Reading for {a, b, c}: The set (with elements/members) a, b, and c.
Notations for Sets: Connotation
- Connotation is a formal description of the conditions for membership
- Examples:
A = {n|n ∈ ℕ, n>0,
n<5}
B = {{c, d}|
c,d∈ℕ, c>3, c<10,
d=3c-4}
- Alternatives:
A = {n|n ∈ ℕ ∧ n>0 ∧
n<5}
B = {{c, d}| c∈ℕ∧
d∈ℕ ∧ c>3 ∧ c<9 ∧
d=3c-4}
- Reading for {n|n ∈ ℕ, n>0,
n<5}: The set of all n, where n is a(n
element of the) natural number(s), n is
greater than 0, and n is smaller than 5
Express A and B using denotation:
A = {1, 2, 3, 4}
B={{4, 8}, {5, 11}, {23, 9}, {6, 14}, {17, 7},
{8, 20}}
Connotation Details
Elements of the notation, in order from left to right (example: {n|n ∈ ℕ,
n>0, n<5})
- {: Opening brace
- n: Variable or expression using variable(s)
- |: Separator
- n ∈ ℕ, n>0, n<5: Conditions,
connected by commas (for ∧) or logical operators; set-related conditions usually come first
- }: Closing brace
Frequently used Sets of Numbers
- ℕ: (set of) natural numbers (5, 12, 47,...)
ℕ0: ℕ including 0; ℕ+: positive ℕ, not
including 0
(ℕ may denote ℕ0 or ℕ+ depending on
context)
- ℤ: Integers (whole numbers; German: Zahlen
(numbers))
(-7, 13, -43, 0, 99,...)
- ℚ: Rational numbers (the Q comes from Quotient)
(¼, ½, -23, ¾, -⁵/₁₁, ⁵⁶⁷/₈₉,...)
- ℝ: Real numbers (0.37, π, e, sin(53°),...)
- ℂ: Complex numbers (23.7, √-1, -i,
7+3i,...)
- For logic, arithmetic, and other fields of mathematics, it is often
convenient to limit the objects used to be uniform.
Examples: Integers, students taking this lecture,...
- Often, there is only one main kind of objects of interest
- In such cases, the set of all such objects is called the universal set
- The universal set is often written U
- The universal set can also be the set of all possible elements (including
all possible sets)
The Empty Set
- The empty set is the set that contains no (zero) elements
- The empty set is written {} or ∅
- When working with sets, always check for the empty set
Operation on Sets: Union
(also called sum)
- The union of two sets A and B is written
A ∪ B.
- The union of sets A and B is the set of elements
that belong to A or B (or both):
A∪B = {d|
d∈A∨d∈B}
- Examples:
- A = {1, 2, 3, 4}; B = {2, 4, 6, 8, 10};
C = {3, 4, 5, 6}
A ∪ B = {1, 2, 3, 4, 6,
8, 10}
A ∪ C = {1, 2, 3, 4, 5,
6}
B ∪ C = {2, 3, 4, 5, 6,
8, 10}
Operation on Sets: Intersection
(also called product)
- The intersection of sets A and B is written
A ∩ B.
- The intersection of sets A and B is the set of
elements that belong to both A
and B:
A∩B =
{d|d∈A∧d∈B}
- Examples:
- A = {1, 2, 3, 4}; B = {2, 4, 6, 8, 10};
C = {3, 4, 5, 6}
A ∩ B = {2,
4}
A ∩ C = {3,
4}
B ∩ C = {4,
6}
Operation on Sets: Set Difference
(result is called difference set)
- The difference set of A and B is written
A - B (or A ∖ B).
- The difference set of sets A and B is the set of
elements that belong to A but not to
B.
A - B =
{e|e∈A∧e∉B}
- Examples:
- A = {1, 2, 3, 4}; B = {2, 4, 6, 8, 10};
C = {3, 4, 5, 6}
A - B = {1,
3} ; B - A = {6, 8, 10}
A - C = {1,
2} ; C - A = {5, 6}
B - C = {2, 8, 10}; C -
B = {3,
5}
Operation on Sets: Complement
(also: complementary set)
- The complement of A is written Ac.
- The complement of set A is the set of all elements that do not
belong to A (but belong to the universal set U).
Ac =
{e|e∈U∧e∉A} =
U - A.
- Examples:
U = {1,...,10}; A = {1, 2, 3, 4}; B = {2,
4, 6, 8, 10}
Ac = {5, 6, 7, 8, 9,
10}
Bc = {1, 3, 5, 7,
9}
Venn Diagram
Caution: Use laws and formula manipulation, not Venn diagrams, when working
on problems with sets or logic
Neutral Element of an Operation
(also unit element, identity element,
identity)
An element e is a neutral element for an operation △
if and only if
∀x: e△x = x =
x△e
- Neutral element of addition: 0
- Neutral element of multiplication: 1
- Neutral element of conjunction (∧): true
- Neutral element of disjunction (∨): false
- Neutral element of subtraction:
does not exist, but 0 is a rigth identity (satisfying only ∀x: x = x△e,
i.e. ∀x: x = x -
0)
- Neutral element of set union: {}
- Neutral element of set intersection: U
- Neutral element of set difference:
does not exist, but {} is a rigth identity (satisfying only
∀x: x = x△e, i.e.
∀x: x = x - {})
When to Use the Neutral Element
Sum of five terms:
a+b+c+d+e
Sum of four terms: a+b+c+d
Sum of three terms: a+b+c
Sum of two terms: a+b
Sum of one term: a
Sum of zero terms: 0 (= neutral element of addition)
Normal Form Special Cases
- What is the sum of 0 terms?
The neutral element of addition ⇒ 0
- What is the product of 0 factors?
The neutral element of multiplication ⇒ 1
- What is the DNF for a function of n
variables that is always false?
A disjunction of 0 terms ⇒ The neutral element of
disjunction ⇒ F
- What is the CNF for a function of n
variables that is always true?
A conjunction of 0 terms ⇒ The neutral element of
conjunction ⇒ T
Factorial of 0 (0!)
5! = 5 · 4 · 3 · 2 · 1 = 120
4! = 4 · 3 · 2 · 1 = 24
3! = 3 · 2 · 1 = 6
2! = 2 · 1 = 2
1! = 1 = 1
0! = neutral element of multiplication = 1
(see also https://www.youtube.com/watch?v=_v9xa2ohzIk)
Subset
- A subset of a set A is a set of some (zero or more)
of the elements of A
- We write B ⊂ A (B is a subset of
A) or A ⊃ B (A is a
superset of B)
- B ⊂ A ⇔ ∀x:
x∈B→x∈A
- ∀A: A ⊂ A (any set is a subset of
itself)
- If B ⊂ A and B ≠ A, then
B is a proper subset of A
(B⊊A).
- The empty set is a subset of every set (∀A: {} ⊂
A)
(reason: ∀A: ∀x:
x∈{}→x∈A)
(Notation: Some authors use ⊂ for proper subsets, and ⊆ for subsets in
general.)
Size of a Set
- A finite set is a set with a finite number of elements.
- The number of elements in a set A (the
size of set A) is written
|A|.
- Examples:
- |{dog, cat, cow, horse, sheep, goat}| = 6
- |{}| = 0
- |{n|n≤20, prime(n)}| = 8
- |{1, {1,2}, {{1}, {1, {1,2}}}}| = 3
Power Set
(also: powerset)
- The power set of A is written
P(A).
- The power set of a set A is the set of all subsets of
A:
P(A) =
{B|B⊂A}
- Examples:
- P({1, 2}) = {{}, {1}, {2}, {1, 2}}
- P({dog, cow, sheep}) = {{}, {dog}, {cow}, {sheep}, {dog, cow}, {dog, sheep},
{cow, sheep}, {dog, cow, sheep}}
- P({Mt. Fuji}) = {{}, {Mt.
Fuji}}
- P({}) = {{}}
Size of Infinite Sets
- All infinite subsets of ℕ and ℤ have the same cardinality
Example: |{1, 2, 3,...}| = |{1, 3, 5,...}|
Proof: 1↔1, 2↔3, 3↔5,...
- This cardinality is denoted by ℵ0
(aleph zero)
- |ℚ| is also ℵ0
- |ℝ| >ℵ0; |ℝ| = ℵ1
- In general: |S| = ℵn ⇒
|P(S)| = ℵn+1
- It is unknown whether there is a cardinality between
ℵ0 and ℵ1,... (Cantor's
continuum hypothesis)
Laws for Sets
- Idempotent laws: A ∩ A = A;
A ∪ A = A
- Commutative laws: A ∩ B = B ∩
A;
A ∪ B = B ∪ A
- Associative laws: (A∩B) ∩ C =
A ∩ (B∩C);
(A∪B) ∪ C = A ∪
(B∪C)
- Distributive laws: (A∪B) ∩ C =
(A∩C) ∪(B∩C);
(A∩B) ∪ C =
(A∪C) ∩ (B∪C)
- Absorption laws: A ∩ (A∪B) =
A; A ∪ (A∩B) =
A
- Involution law: A = (Ac)c
- Law of the excluded middle: A ∪ Ac =
U
- Law of (non)contradiction: A ∩ Ac =
{}
- Properties of U and {}:
U∩A = A,
U∪A = U,
{}∩A = {}, {}∪A = A
- De Morgan's laws: (A ∩ B)c =
Ac ∪ Bc;
(A ∪ B)c = Ac ∩
Bc
Comments on Laws for Sets
- The laws for sets are very similar to the laws for logical
operations.
- Differences:
- ∪ instead of ∨, ∩ instead of ∧, c instead of
¬
- {} instead of F, U instead of T
- Naming differences (e.g. involution law vs. double negative)
- Caution: Do not mix up logical operations and set operations
- We will look at an unification (Boolean Algebra) in lecture 12
Natural Numbers as Sets
- It is possible to represent natural numbers as sets,
by using 0 ≙ {} and succ(a) ≙
a∪{a}.
- This leads to the following values:
- 0 ≙ {}
- 1 ≙ {{}} (= {} ∪ {{}})
- 2 ≙ {{}, {{}}} (= {{}} ∪ {{{}}})
- 3 ≙ {{}, {{}}, {{}, {{}}}}
- 4 ≙ {{}, {{}}, {{}, {{}}}, {{}, {{}}, {{}, {{}}}}} (= {{}, {{}},
{{}, {{}}}} ∪ {{{}, {{}}, {{}, {{}}}}})
- 5 ≙ …
- The axioms of natural number arithmetic (Peano axioms) can then be
derived from the axioms of set theory
Limits of Sets
- Set theory seems to be able to deal with anything, but there are
limits.
- The following paradox shows the limits of set theory.
- We can divide (partition) the set of all sets U into two sets
A and B (with
A∪B=U, A∩B={}):
- A: The set of all sets that include themselves
(A = {c|c ∈ U,
c ∈ c})
- B: The set of all sets that do not include
themselves (B = {d|d ∈ U,
d ∉ d})
- B is a set and so B ∈ U. But does
B belong to A or to B?
- Let's assume B includes itself: B∈B
→B∈A → B∉B:
contradiction
- Let's assume B does not include itself:
B∉B → B∈B:
contradiction
- There is no solution, so this is a paradox.
- Concrete example: A library catalog of all library catalogs that do not
list themselves.
General Rules for Homework
(exceptions will be noted where needed; if not followed, there will be
deductions)
- Size: A4, vertical orientation
- Clean white paper (lines are okay, but NO colors, NO
advertisements,...)
- Single page, both sides okay (if more than one page is
allowed, staple together)
- NO cover page
- Easily readable handwriting (NO printouts)
- Name (kanji and kana) and student number at the top right
- Submit to box in front of room O-529 (building O, 5th floor)
(choose the right box)
This Week's Homework (due Oct. 29): Powersets
Deadline: October 29, 2026 (Thursday), 18:30; general rules apply
- Create a set with four elements. If you use the same elements as other
students, there will be a deduction.
- Create the powerset of the set you created in problem 1.
- For sets A of size zero to six, create a table of the sizes of
the powersets (|P(A)|). Example:
- Express the relationship between the size of a set A and the
size of its powerset P(A) as a formula.
- Explain the reason behind the formula in problem 4.
- Create a table that shows, for sets A of size zero to five,
and for each n (size of sets in P(A)), the
number of such sets.
Example: |A|=3, n=2 ⇒ | { S |
S⊂A ∧ |S|=n} | = 3
Homework Due November 5: Proofs of Logic Formulæ
Deadline: November 5, 2026 (Thursday), 18:30; general rules apply
Problem 1: Prove/check the following laws using truth tables:
- Reductio ad absurdum (A→¬A = ¬A)
- The associative law for conjunction
- Contraposition
((A→B)→(¬B→¬A))
- One of De Morgan's laws
Problem 2: Prove transitivity of implication by formula manipulation:
Prove transitivity of implication (((A→B) ∧
(B→C)) ⇒ (A→C)) by formula
manipulation. For each step, give the name of the law you used.
Hint: Show that ((A→B) ∧
(B→C)) → (A→C) is a tautology
by simplifying it to T.
Details: Multiple parallel applications of the same law can be done in one
step. Multiple sequential applications of the same law must be separated into
different steps. Application of commutativity and associativity laws can be
combined in one step.
Glossary
- set
- 集合
- prefecture
- 県
- element
- 元・要素
- denotation
- 外延的記法
- brace (curly bracket)
- 波括弧
- connotation
- 内包的記法
- natural number
- 自然数
- integer
- 整数
- rational number
- 有理数
- real number
- 実数
- complex number
- 複素数
- equality
- 同一性
- uniformity
- 一貫性
- instance
- 個体
- universal set
- 全体集合・普遍集合
- (set) union
- 和集合
- (set) intersection
- 積集合
- difference set/set difference
- 差集合
- complement, complementary set
- 補集合
- factorial
- 階乗
- Venn diagram
- ベン図
- subset
- 部分集合
- superset
- 上位集合
- proper subset
- 真 (しん) の部分集合
- empty set
- 空 (くう) 集合
- size of a set
- 集合の大きさ
- finite
- 有限
- finite set
- 有限集合
- power set
- べき (冪) 集合
- infinite set
- 無限集合
- cardinality, cardinal number
- 濃数
- aleph zero
- アレフ・ゼロ
- continuum hypothesis
- 連続体仮説
- involution law
- 対合律
- paradox
- パラドックス
- library catalog
- 図書目録
- deduction (of points)
- 減点