Existence and Uniqueness
CS311H: Discrete Mathematics
I
Common math proofs involve showing existence and
uniqueness of certain objects
I
Existence proofs require showing that an object with the
desired property exists
I
Uniqueness proofs require showing that there is a unique
object with the desired property
Sets, Russell’s Paradox, and Halting Problem
Instructor: Işıl Dillig
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
Instructor: Işıl Dillig,
1/31
Existence Proofs
One simple way to prove existence is to provide an object that
has the desired property
I
This sort of proof is called constructive proof
I
Example: Prove there exists an integer that is the sum of two
perfect squares
I
Can also prove existence through other methods (e.g., proof
by contradiction or proof by cases)
I
Prove: ”There exist irrational numbers x , y s.t. x y is rational”
I
We’ll prove this using a non-constructive proof (by cases),
without providing irrational x , y
I
Consider
I
Case 1: We have x = y =
I
Such indirect existence proofs called nonconstructive proofs
Instructor: Işıl Dillig,
Sets, Russell’s Paradox, and Halting Problem
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
Instructor: Işıl Dillig,
3/31
Proving Uniqueness
√ √2
2 . Either (i) it is rational or (ii) it is irrational
√
2 s.t. x y is rational
√ √2
√
Case 2: Let √
x = 2 and y = 2, so both are irrational.
√ 2
√ 2
√ 2
Then, 2
= 2 = 2. Thus, x y is rational
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
4/31
Example of Uniqueness Proof
I
Some statements in mathematics assert uniqueness of an
object satisfying a certain property
I
Prove: ”If a and b are real numbers with a =
6 0, then there
exists a unique real number r such that ar + b = 0”
I
To prove uniqueness, must first prove existence of an object x
that has the property
I
Existence: Using a constructive proof, we can see r = −b/a
satisfies ar + b = 0
I
Second, we must show that for any other y s.t. y 6= x , then y
does not have the property
I
I
Alternatively, can show that if y has the desired property that
x =y
Uniqueness: Suppose there is another number s such that
s 6= r and as + b = 0. But since ar + b = as + b, we have
ar = as, which implies r = s.
Instructor: Işıl Dillig,
2/31
Non-Constructive Proof Example
I
I
CS311H: Discrete Mathematics
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
5/31
Instructor: Işıl Dillig,
1
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
6/31
Invalid Proof Strategies
Sets and Basic Concepts
I
Proof by obviousness: ”The proof is so clear it need not be
mentioned!”
I
Proof by intimidation: ”Don’t be stupid – of course it’s true!”
I
Proof by mumbo-jumbo: ∀α ∈ θ∃β ∈ α β ≈ γ
I
Proof by intuition: ”I have this gut feeling..”
I
Proof by resource limits: ”Due to lack of space, we omit this
part of the proof...”
I
I
A set is unordered collection of distinct objects
I
Example: Positive even numbers less than 10: {2, 4, 6, 8}
I
Objects in set S are called members (or elements) of that set
I
If x is a member of S , we write x ∈ S
I
# elements in a set is called its cardinality, written |S |
Proof by illegibility: ”sdjikfhiugyhjlaks??fskl; QED.”
Don’t use anything like these in CS311!!
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
7/31
Instructor: Işıl Dillig,
Important Sets in Mathematics
I
Many sets that play fundamental role in mathematics have
infinite cardinality
I
Set of integers Z = {. . . , −2, −1, 0, 1, 2, . . .}
I
Set of positive integers: Z+ = {1, 2, . . .}
I
Natural numbers: N = {0, 1, 2, 3, ...}
I
Set of real numbers:
R = {π, . . . , −1.999, . . . , 0, . . . , 0.000001, . . .}
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
Sets, Russell’s Paradox, and Halting Problem
8/31
Set Builder Notation
I
Infinite sets are often written using set builder notation
S = {x | x has property p}
9/31
I
Example: S = {x | x ∈ Z ∧ x %2 = 0}
I
Which set is S ?
I
Example: Q = {p/q | p ∈ Z ∧ q ∈ Z ∧ q 6= 0}
I
Which set if Q?
Instructor: Işıl Dillig,
Special Sets
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
10/31
Subsets and Supersets
I
I
CS311H: Discrete Mathematics
The universal set, written U , includes all objects under
consideration
A set A is a subset of set B , written A ⊆ B , iff every element
in A is also an element of B (∀x . x ∈ A ⇒ x ∈ B )
U
B
I
The empty set, written ∅ or {}, contains no objects
I
A set containing exacly one element is called a singleton set
I
What special set is S = {x | p(x ) ∧ ¬p(x )} equal to?
I
What special set is S = {x | p(x ) ∨ ¬p(x )} equal to?
A
I
If A ⊆ B , then B is called a superset of A, written B ⊇ A
I
A set A is a proper subset of set B , written A ⊂ B , iff:
(∀x . x ∈ A ⇒ x ∈ B ) ∧ (∃x . x ∈ B ∧ x 6∈ A)
I
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
11/31
Instructor: Işıl Dillig,
2
Sets A and B are equal, written A = B , if A ⊆ B and B ⊆ A
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
12/31
Power Set
I
I
Ordered Tuples
The power set of a set S , written P (S ), is the set of all
subsets of S .
Example: What is the powerset of {a, b, c}?
I
An important operation on sets is called Cartesian product
I
To define Cartesian product, need ordered tuples
I
An ordered n-tuple (a1 , a2 , . . . , an ) is the ordered collection
with a1 as its first element, a2 as its second element, . . . , and
an as its last element.
2n
I
Fact: If cardinality of S is n, then |P (S )| =
I
What is the power set of ∅?
I
Observe: (1, 2) and (2, 1) are not the same!
I
What is the power set of {∅}?
I
Tuple of two elements called pair (3 elements called triple)
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
13/31
Instructor: Işıl Dillig,
Cartesian Product
I
A × B = {(a, b) | a ∈ A ∧ b ∈ B }
I
Example: Let A = {1, 2} and B = {a, b, c}. What is A × B ?
I
Example: What is B × A?
I
Observe: A × B 6= B × A in general!
I
Observe: If |A| = n and |B | = m, |A × B | is nm.
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
15/31
Cartesian product generalizes to more than two sets
I
Cartesian product of A1 × A2 . . . × An is the set of all ordered
n-tuples (a1 , a2 , . . . , an ) where ai ∈ Ai
I
Example: If A = {1, 2}, B = {a, b}, C = {?, ◦}, what is
A × B × C?
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
16/31
Set union:
I
Intersection:
Two set A and B are called disjoint if A ∩ B = ∅
U
A ∩ B = {x | x ∈ A ∧ x ∈ B }
I
14/31
Disjoint Sets
A ∪ B = {x | x ∈ A ∨ x ∈ B }
I
I
Instructor: Işıl Dillig,
Set Operations
I
Sets, Russell’s Paradox, and Halting Problem
More on Cartesian Products
The Cartesian product of two sets A and B , written A × B , is
the set of all ordered pairs (a, b) where a ∈ A and b ∈ B
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
A
B
Difference:
A − B = {x | x ∈ A ∧ x 6∈ B }
I
Complement:
A = {x | x 6∈ A}
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
17/31
Instructor: Işıl Dillig,
3
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
18/31
Exercise
Naive Set Theory and Russell’s Paradox
Prove De Morgan’s law for sets: A ∪ B = A ∩ B
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
Let R be the set of sets that are not members of themselves:
I
Two possibilities: Either R ∈ R or R 6∈ R
I
Suppose R ∈ R.
I
But by definition of R, R does not have itself as a member,
i.e., R ∈
6 R
I
But this contradicts R ∈ R
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
21/31
In naive set theory, any definable collection is a set (axiom of
unrestricted comprehension)
I
In other words, unrestricted comprehension says that
{x | F (x )} is a set, for any formula F
I
In 1901, Bertrand Russell showed that Cantor’s set theory is
inconsistent
I
This can be shown using so-called Russell’s paradox
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
I
Russell’s paradox and other similar paradoxes inspired artists
at the turn of the century, esp. Escher and Magritte
I
Belgian painter Rene Magritte made a graphical illustration of
Russell’s paradox:
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
I
Now suppose R 6∈ R (i.e., R not a member of itself)
I
But since R is the set of sets that are not members of
themselves, R must be a member of R!
I
This shows that set R cannot exist, contradicting the axiom
of unrestricted comprehension!!
I
Since we have a contradiction, one can prove any nonsense
using naive set theory!
I
Much research on consistent versions of set theory ⇒
Zermelo’s ZFC, Russell’s type theory etc.
Instructor: Işıl Dillig,
Illustration of Russell’s Paradox
Instructor: Işıl Dillig,
I
20/31
Russell’s Paradox, cont.
R = {S | S 6∈ S }
Instructor: Işıl Dillig,
Intuitive formulation of sets is called naive set theory – goes
back to German mathematician George Cantor (1800’s)
Instructor: Işıl Dillig,
19/31
Russell’s Paradox
I
I
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
22/31
Undecidability
23/31
I
A proof similar to Russell’s paradox can be used to show
undecidability of the famous Halting problem
I
A decision problem is a question of a formal system that has a
yes or no answer
I
Example: satisfiability/valid in FOL or propositional logic
I
A decision problem is undecidable if it is not possible to have
algorithm that always terminates and gives correct answer
Instructor: Işıl Dillig,
4
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
24/31
The Halting Problem
Undecidability of Halting Problem
I
The famous Halting problem in CS undecidable.
I
Halting problem: Given a program P 0 and an input w , does
P 0 terminate on w ?
I
What does it mean for this problem to be (un)decidable?
YES
P'
P' halts
on w
P
NO
P' does not
halt on w
I
Undecidability of Halting Problem
proved by Alan Turing in 1936
I
Proof is quite similar to Russell’s
paradox
Input w
I
Important: For this problem to be decidable, P should
terminate on all inputs and give correct yes/no answer
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
25/31
Instructor: Işıl Dillig,
Proof of Undecidability of Halting Problem
Assume such a program P exists
I
Now, construct program P 0 such that P 0 halts iff its input
does not halt on itself:
P''
P'
YES
26/31
Now, consider running P 0 on itself:
P'
P'
YES
I
LOOP
FOREVER
LOOP
FOREVER
P
NO
HALT
Two possibilities:
1. P’ halts on itself: P must answer yes ⇒ P 0 loops forever on
P 0 , i.e., ⊥
P
NO
Sets, Russell’s Paradox, and Halting Problem
Proof of Undecidability, cont.
I
I
CS311H: Discrete Mathematics
HALT
2. P’ does not halt on P’: P must answer no ⇒ P 0 halts on itself,
i.e., ⊥
I
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
Instructor: Işıl Dillig,
27/31
Other Famous Undecidable Problems
Validity in first-order logic: Given an arbitrary first order logic
formula F , is F valid? (Hilbert’s Entscheidungsproblem)
I
Program verification: Given a program P and a non-trivial
property Q, does P satisfy property Q? (Rice’s theorem)
I
Hilbert’s 10th problem: Does a diophantine equation
p(x1 , . . . , xn ) = 0 have solutions? (i.e., integer solutions)
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
28/31
Provability and Computability
I
I
Hence, such a program P cannot exist, i.e., Halting problem is
undecidable!
29/31
Instructor: Işıl Dillig,
5
If paradoxes and computability/provability proofs interest
you...
I
Take theory of computation and mathematical logic courses
I
Book recommendation: ”Godel, Escher, Bach”
by Douglas Hofstadter
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
30/31
Exercise: Barber’s paradox
I
According to an ancient
Sicilian legend, a remote
town can only be reached by
traveling a dangerous
mountain road.
I
The barber of this town
shaves all those people, and
only those people, who do
not shave themselves.
I
Can such a barber exist?
Instructor: Işıl Dillig,
CS311H: Discrete Mathematics
Sets, Russell’s Paradox, and Halting Problem
31/31
6
© Copyright 2026 Paperzz