Lecture Slides
Lecture Slides
Commands
Commands
cannot
cannot be
be true
true
or
or false.
false.
Things That Aren't Propositions
Questions
Questions
cannot
cannot be
be true
true
or
or false.
false.
Propositional Logic
●
Propositional logic is a mathematical system
for reasoning about propositions and how they
relate to one another.
●
Every statement in propositional logic consists
of propositional variables combined via
propositional connectives.
●
Each variable represents some proposition, such as
“You liked it” or “You should have put a ring on it.”
●
Connectives encode how propositions are related,
such as “If you liked it, then you should have put a
ring on it.”
Propositional Variables
●
Each proposition will be represented by a
propositional variable.
●
Propositional variables are usually
represented as lower-case letters, such
as p, q, r, s, etc.
●
Each variable can take one one of two
values: true or false.
Propositional Connectives
●
There are seven propositional connectives,
many of which will be familiar from
programming.
●
First, there’s the logical “NOT” operation:
¬p
●
You’d read this out loud as “not p.”
●
The fancy name for this operation is logical
negation.
Propositional Connectives
●
There are seven propositional connectives,
many of which will be familiar from
programming.
●
Next, there’s the logical “AND” operation:
p∧q
●
You’d read this out loud as “p and q.”
●
The fancy name for this operation is logical
conjunction.
Propositional Connectives
●
There are seven propositional connectives,
many of which will be familiar from
programming.
●
Then, there’s the logical “OR” operation:
p∨q
●
You’d read this out loud as “p or q.”
●
The fancy name for this operation is logical
disjunction. This is an inclusive or.
Truth Tables
●
A truth table is a table showing the
truth value of a propositional logic
formula as a function of its inputs.
●
Let’s go look at the truth tables for the
three connectives we’ve seen so far:
¬ ∧ ∨
Summary of Important Points
●
The ∨ connective is an inclusive “or.” It's true if at least
one of the operands is true.
●
Similar to the || operator in C, C++, Java, etc. and
the or operator in Python.
●
If we need an exclusive “or” operator, we can build it
out of what we already have.
Try
Tryitityourself:
yourself:Combine
Combinethethe¬,
¬,∧, and∨∨operators
∧,and operators
together
togetherto toform
formananexpression
expressionthat
thatrepresents
representsthe the
exclusive
exclusiveororof ofppand
andqq(something
(somethingthat’s
that’strue
trueififand
andonly
only
ififexactly
exactlyone
oneof
ofppand
andqqare
aretrue).
true).
Respond
Respondat
atpollev.com/cs103
pollev.com/cs103
Mathematical Implication
Implication
●
We can represent implications using this
connective:
p→q
●
You’d read this out loud as “p implies q.”
●
The fancy name for this is the material
conditional.
Question:
Question:WhatWhatshould
shouldthe
thetruth
truthtable
tablefor
forpp→→qq
look
looklike?
like?Enter
Enteryour
yourguess
guessas
asaalist
listof
offour
fourvalues
valuesto
to
fll
fllin
inthe
therightmost
rightmostcolumn
columnof ofthe
thetable.
table.
Respond
Respondat
atpollev.com/cs103
pollev.com/cs103
Gives quality
ingots. Contract
Nanni pays upheld?
Ea-Nasir
p q p→q
Nanni Ea-Nasir
Ancient Contract:
If Nanni pays money to Ea-Nasir, then
Ea-Nasir will give Nanni quality copper ingots.
Gives quality
ingots. Contract
Nanni pays upheld?
Ea-Nasir
p q p→q
$ T T T
Nanni Ea-Nasir
Ancient Contract:
If Nanni pays money to Ea-Nasir, then
Ea-Nasir will give Nanni quality copper ingots.
Gives quality
ingots. Contract
Nanni pays upheld?
Ea-Nasir
p q p→q
F F T
$ T T T
Nanni Ea-Nasir
Ancient Contract:
If Nanni pays money to Ea-Nasir, then
Ea-Nasir will give Nanni quality copper ingots.
Gives quality
ingots. Contract
Nanni pays upheld?
Ea-Nasir
p q p→q
F F T
F T T
$ T T T
Nanni Ea-Nasir
Ancient Contract:
If Nanni pays money to Ea-Nasir, then
Ea-Nasir will give Nanni quality copper ingots.
Gives quality
ingots. Contract
Nanni pays upheld?
Ea-Nasir
p q p→q
F F T
F T T
T F F
$ T T T
Nanni Ea-Nasir
Ancient Contract:
If Nanni pays money to Ea-Nasir, then
Ea-Nasir will give Nanni quality copper ingots.
p q p→q
F F T
F T T
T F F
T T T
p q p→q
F F T
F T T
T F F
T T T
An
Animplication
implicationisisfalse
falseonly
only Every
Everyformula
formulaisiseither
eithertrue
true
when
whenthe
theantecedent
antecedentisistrue
true or
orfalse,
false,so
sothese
theseother
other
and
andthe
theconsequent
consequentisisfalse.
false. entries
entrieshave
havetotobe
betrue.
true.
p q p→q
F F T
F T T
T F F
T T T
Important
Importantobservation:
observation:
The
Thestatement
statementpp→→qqisistrue
true
whenever
wheneverpp∧∧¬q
¬qisisfalse.
false.
p q p→q
F F T
F T T
T F F
T T T
An
Animplication
implicationwith
withaa An
Animplication
implicationwith
withaa
false
falseantecedent
antecedentisis true
trueconsequent
consequentisiscalled
called
calledvacuously
called vacuouslytrue.
true. trivially
triviallytrue.
true.
p q p→q
F F T
F T T
T F F
T T T
Please
Pleasecommit
committhis
thistable
table
to
tomemory.
memory.We’re
We’regoing
goingtoto
need
needit,
it,extensively,
extensively,over
over
the
thenext
nextcouple
coupleof
ofweeks.
weeks.
Fun Fact: The Contrapositive Revisited
The Biconditional Connective
The Biconditional Connective
●
On Friday, we saw that “p if and only if q” means
both that p → q and q → p.
●
We can write this in propositional logic using the
biconditional connective:
p↔q
●
This connective’s truth table has the same meaning
as “p implies q and q implies p.”
Question:
Question:WhatWhatshould
shouldthe
thetruth
truthtable
tablefor
forpp↔↔qq
look
looklike?
like?Enter
Enteryour
yourguess
guessas
asaalist
listof
offour
fourvalues
values
to
tofll
fllin
inthe
therightmost
rightmostcolumn
columnof ofthe
thetable.
table.
Respond
Respondat
atpollev.com/cs103
pollev.com/cs103
Biconditionals
●
The biconditional connective p ↔ q is
read “p if and only if q.”
●
Here's its truth table:
p q p↔q
F F T
F T F
T F F
T T T
Biconditionals
●
The biconditional connective p ↔ q is
read “p if and only if q.”
●
Here's its truth table:
p q p↔q
One
One interpretation
interpretation of of ↔↔
F F T isis to
to think
think of
of it
it as
as
F T F equality:
equality: the
the two
two
propositions
propositions must
must have
have
T F F equal
equal truth
truth values.
values.
T T T
True and False
●
There are two more “connectives” to
speak of: true and false.
●
The symbol ⊤ is a value that is always true.
●
The symbol ⊥ is value that is always false.
●
These are often called connectives,
though they don't connect anything.
●
(Or rather, they connect zero things.)
Proof by Contradiction
●
Suppose you want to prove p is true using a
proof by contradiction.
●
The setup looks like this:
●
Assume p is false.
●
Derive something that we know is false.
●
Conclude that p is true.
●
In propositional logic:
(¬p → ⊥) → p
Operator Precedence
●
How do we parse this statement?
¬x → y ∨ z → x ∨ y ∧ z
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
¬x → y ∨ z → x ∨ y ∧ z
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → y ∨ z → x ∨ y ∧ z
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → y ∨ z → x ∨ y ∧ z
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → y ∨ z → x ∨ (y ∧ z)
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → y ∨ z → x ∨ (y ∧ z)
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → (y ∨ z) → (x ∨ (y ∧ z))
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → (y ∨ z) → (x ∨ (y ∧ z))
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → ((y ∨ z) → (x ∨ (y ∧ z)))
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
How do we parse this statement?
(¬x) → ((y ∨ z) → (x ∨ (y ∧ z)))
●
Operator precedence for propositional logic:
¬
∧
∨
→
↔
●
All operators are right-associative.
●
We can use parentheses to disambiguate.
Operator Precedence
●
The main points to remember:
●
¬ binds to whatever immediately follows it.
●
∧ and ∨ bind more tightly than →.
●
We will commonly write expressions like
p ∧ q → r without adding parentheses.
●
For more complex expressions, we'll try to
add parentheses.
●
Confused? Please ask!
The Big Table
Connective Read Aloud As C++ Version Fancy Name
¬ “not” ! Negation
∨ “or” || Disjunction
“I
“I won't
won't see
see aa total
total solar
solar
eclipse
eclipse if
if I'm
I'm not
not inin the
the
path
path of
of totality.”
totality.”
Question:
Question:How
Howwould
wouldyou
youexpress
expressthis
this
statement
statementin
inpropositional
propositionallogic?
logic?
Respond
Respondat
atpollev.com/cs103
pollev.com/cs103
“p if q”
translates to
q→p
It does not translate to
p→q
Some Sample Propositions
a: I will be in the path of totality.
b: I will see a total solar eclipse.
c: There is a total solar eclipse today.
Some Sample Propositions
a: I will be in the path of totality.
b: I will see a total solar eclipse.
c: There is a total solar eclipse today.
“If
“If II will
will be
be in
in the
the path
path of
of totality,
totality,
but
but there's
there's no no solar
solar eclipse
eclipse today,
today, II
won't
won't see
see aa total
total solar
solar eclipse.”
eclipse.”
Question:
Question:How
Howwould
wouldyou
youexpress
expressthis
this
statement
statementin
inpropositional
propositionallogic?
logic?
Respond
Respondat
atpollev.com/cs103
pollev.com/cs103
“p, but q”
translates to
p∧q
The Takeaway Point
●
When translating into or out of
propositional logic, be very careful not to
get tripped up by nuances of the English
language.
●
In fact, this is one of the reasons we have a
symbolic notation in the frst place!
●
Many prepositional phrases lead to
counterintuitive translations; make sure
to double-check yourself!
Propositional Equivalences
Quick Question:
●
Thus p → q is equivalent to ¬p ∨ q
Proofwriting Workshop
An Incorrect Set Theory Proof
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Why
Why isis this
this bad?
bad?
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
A
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
A B
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
A B
A∪B
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Recall
Recall the
the intuition
intuition of
of aa
subset
subset being
being “something
“something
II can
can circle”
circle”
A B
A∪B
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Recall
Recall the
the intuition
intuition of
of aa So CC ⊆
So ⊆ AA would
would mean
mean
subset
subset being
being “something that
“something that CC isis something
something II
II can
can circle” can
circle” can circle
circle inin this
this region.
region.
A
C
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Recall the intuition of a Likewise, CC ⊆
Likewise, ⊆BB would
would
Recall the intuition of a
mean
mean that
that CC isis
subset
subset being
being “something
“something
something
something II can
can circle
circle
II can
can circle”
circle”
inin this
this region.
region.
B
C
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
A∪B
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
But
But when
when II look
look at
at A∪B,
A∪B, II can
can
draw
draw CC as
as aa circle
circle containing
containing
elements
elements from
from both
both AA and
and B!
B!
A∪B
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
But
But when
when II look
look at
at A∪B,
A∪B, II can
can
draw
draw CC as
as aa circle
circle containing
containing
elements
elements from
from both
both AA and
and B!
B!
DoDo you
you see see why
why this
this
circle
circle isis inin neither
neither AA
nor
nor B?
B?
C
A∪B
Let’s Draw Some Pictures!
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Using
Usingthis
thisvisual
visualintuition,
intuition,come
comeupupwith
with
aachoice
choiceof
ofsets
setsA,
A,B,
B,and
andCCthat
thatshow
showthis
this
claim
claimisisfalse.
false.
Respond
Respondat
atpollev.com/cs103
pollev.com/cs103
A∪B
Proofs vs. Disproofs
●
A proof is an argument that explains why
some theorem is true.
●
A disproof is an argument that explains
why some claim is false.
●
You’ve seen lots of examples of proofs.
What does a disproof look like?
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B.
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B. Consider the
sets A = {1}
1
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B. Consider the
sets A = {1}, B = {2}
A B
1 2
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B. Consider the
sets A = {1}, B = {2}, and C = {1, 2}.
A B
1 2
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B. Consider the
sets A = {1}, B = {2}, and C = {1, 2}. Now notice that
{1, 2} ⊆ A ∪ B so C ⊆ A ∪ B
A B
1 2
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B. Consider the
sets A = {1}, B = {2}, and C = {1, 2}. Now notice that
{1, 2} ⊆ A ∪ B so C ⊆ A ∪ B, but C ⊆⊈ A because 2 ∈ C
but 2 ∉ A
A B
1 2
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B. Consider the
sets A = {1}, B = {2}, and C = {1, 2}. Now notice that
{1, 2} ⊆ A ∪ B so C ⊆ A ∪ B, but C ⊆⊈ A because 2 ∈ C
but 2 ∉ A, and C ⊆⊈ B because 1 ∈ C but 1 ∉ B.
A B
1 2
Claim: If A, B, and C are sets and C ⊆ A ∪ B, then C ⊆ A
or C ⊆ B.
Disproof: We will show that there are sets A, B, and C
where C ⊆ A ∪ B, but C ⊆⊈ A and C ⊆⊈ B. Consider the
sets A = {1}, B = {2}, and C = {1, 2}. Now notice that
{1, 2} ⊆ A ∪ B so C ⊆ A ∪ B, but C ⊈⊈ A because 2 ∈ C
but 2 ∉ A, and C ⊆⊈ B because 1 ∈ C but 1 ∉ B.
Thus we’ve found a set C which is a subset of A ∪ B but
is not a subset of either A or B, which is what we needed
to show. ■
Proofwriting Advice
●
Be very wary of proofs that speak generally
about “all objects” of a particular type.
●
As you’ve just seen, it’s easy to
accidentally prove a false statement at
this level of detail.
●
Making broad, high-level claims often
indicates deeper logic errors or
conceptual misunderstanding (like code
smell but for proofs!)
Proofwriting Advice
A Very Good Idea: After you’ve
written a draft of a proof, run through
all of the points on the Proofwriting
Checklist.
●
This is a great exercise that you can
do with a partner!
Proofs on Subsets
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Hold
Hold on,
on, isn’t
isn’t this
this the
the claim
claim we
we just
just disproved?
disproved?
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Notice
Notice that
that that’s
that’s an
an intersection,
intersection, not not aa union!
union! It
It
turns
turns out
out that
that this
this claim
claim isis actually
actually true.
true.
Let’s Draw Some Pictures!
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Let’s Draw Some Pictures!
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
A
Let’s Draw Some Pictures!
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
A B
Let’s Draw Some Pictures!
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
A B
A ∩ B
Let’s Draw Some Pictures!
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Recall
Recall the
the intuition
intuition of
of aa
subset
subset being
being “something
“something
II can
can circle”
circle”
A B
A ∩ B
Let’s Draw Some Pictures!
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
When
When II look at AA∩
look at ∩B,
B, any
any circle
circle II
Recall can
can draw
draw inin this
this region
region can
can be
Recall the
the intuition
intuition of
of aa be
subset found
found inin both
both AA and
and B.
subset being
being “something
“something B.
II can
can circle”
circle”
A B
A ∩ B
Let’s Draw Some Pictures!
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
This
This isis aa great
great visual
visual
intuition
intuition to to see
see why
why the
the
theorem
theorem isis true.
true. Now
Now we
we
have
have to
to drill
drill down
down to
to the
the
A B level
level of
of individual
individual
elements
elements toto write
write the
the
proof.
proof.
C
A ∩ B
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
When
When confronted
confronted with with aa theorem
theorem to
to prove,
prove, the
the frst
frst
step
step isis to
to make
make sure
sure you
you understand
understand where
where you’re
you’re
starting
starting and
and where
where you’re
you’re going.
going.
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
AA great
great proofwriting
proofwriting strategy
strategy
to write
isis to writedown
downrelevant
relevant
de6nitions
de6nitions.. This
This gives
gives you
you aa
better
better sense
sense of
of what
what you
you need
need
to
to prove
prove and
and what
what tools
tools you
you
have
have at
at hand.
hand.
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
Before
Before we
we start:
start:
-- What
What isis the
the defnition
defnition of
of subset?
subset?
-- How
How do
do you
you prove
prove that
that one
one set
set isis aa subset
subset of
of
another?
another?
-- If
If you
you know
know that
that one
one set
set isis aa subset
subset of
of
another,
another, what
what can
can you
you conclude?
conclude?
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
De6nition:
De6nition:IfIfSSand
andTTare
aresets,
sets,then
thenSS⊆⊆TTwhen
when
for
forevery
everyxx∈∈S,
S,we
wehave
havexx∈∈T.T.
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
De6nition:
De6nition:IfIfSSandandTTare
aresets,
sets,then
thenSS⊆⊆TTwhen
when
for
forevery
everyxx∈∈S,S,we
wehave
havexx∈∈T.T.
To
Toprove
provethat
thatSS⊆ ⊆T:T:
Pick
Pickananarbitrary
arbitraryxx∈∈S,S,then
thenprove
provexx∈∈T.
T.
If
Ifyou
youknow
knowthat
thatSS⊆ ⊆T:
T:
IfIfyou
youhave
haveananxx∈∈S,
S,you
youcan
canconclude
concludexx∈∈T.T.
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
De6nition:
De6nition:IfIfSSandandTTare
aresets,
sets,then
thenSS⊆⊆TTwhen
when
for
forevery
everyxx∈∈S,S,we
wehave
havexx∈∈T.T.
To
Toprove
provethat
thatSS⊆ ⊆T:T:
Pick
Pickananarbitrary
arbitraryxx∈∈S,S,then
thenprove
provexx∈∈T.
T.
If
Ifyou
youknow
knowthat
thatSS⊆ ⊆T:
T:
IfIfyou
youhave
haveananxx∈∈S,
S,you
youcan
canconclude
concludexx∈∈T.T.
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
De6nition:
De6nition:IfIfSSandandTTare
aresets,
sets,then
thenSS⊆⊆TTwhen
when
for
forevery
everyxx∈∈S,S,we
wehave
havexx∈∈T.T.
To
Toprove
provethat
thatSS⊆ ⊆T:T:
Pick
Pickananarbitrary
arbitraryxx∈∈S,S,then
thenprove
provexx∈∈T.
T.
If
Ifyou
youknow
knowthat
thatSS⊆ ⊆T:
T:
IfIfyou
youhave
haveananxx∈∈S,
S,you
youcan
canconclude
concludexx∈∈T.T.
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
Our Tools
●
In general to show that S ⊆ T,
pick an arbitrary x ∈ S, show
that x ∈ T
In general to show that S ⊆ T,
pick an arbitrary x ∈ S, show
that x ∈ T
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
● C ⊆ A∩B
Our Tools
How
How can
can we
we apply
apply this
this
●
In general to show that S ⊆ T, general
general template
template to
to our
our
pick an arbitrary x ∈ S, show specifc
specifc problem?
problem?
that x ∈ T
In general to show that S ⊆ T,
pick an arbitrary x ∈ S, show
that x ∈ T
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
●
In general to show that
● Assume C ⊆ A ∩ B S ⊆ T, pick an arbitrary
x ∈ S, show that x ∈ T
Proving C ⊆ A
●
If you know that S ⊆ T and
Pick an x ∈ C you have an x ∈ S, you can
conclude x ∈ T.
x∈A∩B
●
If you know that x ∈ S ∩ T,
x ∈ A and x ∈ B we can conclude that x ∈ S
and x ∈ T. that S ⊆ T, pick
Conclude x ∈ A an arbitrary x ∈ S
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
●
In general to show that
● Assume C ⊆ A ∩ B S ⊆ T, pick an arbitrary
x ∈ S, show that x ∈ T
● Proving C ⊆ A
●
If you know that S ⊆ T and
● Pick an x ∈ C you have an x ∈ S, you can
conclude x ∈ T.
x∈A∩B
●
If you know that x ∈ S ∩ T,
x ∈ A and x ∈ B we can conclude that x ∈ S
and x ∈ T. that S ⊆ T, pick
● Conclude x ∈ A an arbitrary x ∈ S
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
●
In general to show that
● Assume C ⊆ A ∩ B S ⊆ T, pick an arbitrary
x ∈ S, show that x ∈ T
● Proving C ⊆ A
●
If you know that S ⊆ T and
● Pick an x ∈ C you have an x ∈ S, you can
conclude x ∈ T.
x∈A∩B
What
What goes
goes here?
here?
●
If you know that x ∈ S ∩ T,
x ∈ A and x ∈ B we can conclude that x ∈ S
and x ∈ T. that S ⊆ T, pick
● Conclude x ∈ A an arbitrary x ∈ S
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
●
In general to show that
● Assume C ⊆ A ∩ B S ⊆ T, pick an arbitrary
x ∈ S, show that x ∈ T
● Proving C ⊆ A
●
If you know that S ⊆ T and
● Pick an x ∈ C you have an x ∈ S, you can
conclude x ∈ T.
● x∈A∩B
●
If you know that x ∈ S ∩ T,
x ∈ A and x ∈ B we can conclude that x ∈ S
and x ∈ T. that S ⊆ T, pick
● Conclude x ∈ A an arbitrary x ∈ S
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
●
In general to show that
● Assume C ⊆ A ∩ B S ⊆ T, pick an arbitrary
x ∈ S, show that x ∈ T
● Proving C ⊆ A
●
If you know that S ⊆ T and
● Pick an x ∈ C you have an x ∈ S, you can
conclude x ∈ T.
● x∈A∩B
●
If you know that x ∈ S ∩ T,
x ∈ A and x ∈ B we can conclude that x ∈ S
and x ∈ T. that S ⊆ T, pick
● Conclude x ∈ A an arbitrary x ∈ S
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
●
In general to show that
● Assume C ⊆ A ∩ B S ⊆ T, pick an arbitrary
x ∈ S, show that x ∈ T
● Proving C ⊆ A
●
If you know that S ⊆ T and
● Pick an x ∈ C you have an x ∈ S, you can
conclude x ∈ T.
● x∈A∩B
●
If you know that x ∈ S ∩ T,
● x ∈ A and x ∈ B we can conclude that x ∈ S
and x ∈ T. that S ⊆ T, pick
● Conclude x ∈ A an arbitrary x ∈ S
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
●
In general to show that
● Assume C ⊆ A ∩ B S ⊆ T, pick an arbitrary
x ∈ S, show that x ∈ T
● Proving C ⊆ A
●
If you know that S ⊆ T and
● Pick an x ∈ C you have an x ∈ S, you can
conclude x ∈ T.
● x∈A∩B
●
If you know that x ∈ S ∩ T,
● x ∈ A and x ∈ B we can conclude that x ∈ S
and x ∈ T. that S ⊆ T, pick
● Conclude x ∈ A an arbitrary x ∈ S
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Rough Outline
● Assume C ⊆ A ∩ B
● Proving C ⊆ A
● Pick an x ∈ C
● x∈A∩B
● x ∈ A and x ∈ B
● Conclude x ∈ A
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Rough Outline
We
We also
also need
need to
to prove
prove that
● Assume C ⊆ A ∩ B that
CC⊆⊆B.
B.
● Proving C ⊆ A
Notice
Notice that
that if
if you
you take
take the
the
● Pick an x ∈ C outline
outline here
here and
and literally
literally
swap
swap the
the variable
variable AA for
for the
the
● x∈A∩B variable
variable B,
B, you
you get
get aa
working
working proof.
● x ∈ A and x ∈ B proof.
● Conclude x ∈ A
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Rough Outline
● Assume C ⊆ B ∩ A In
In aa case
case like
like this
this where
where
your
your proof
proof would
would have
have two
two
● Proving C ⊆ B completely
completely symmetric
symmetric
branches,
branches, it’s
it’s fne
fne to
to write
write
● Pick an x ∈ C
up
up just
just one
one and
and say
say
● x∈B∩A “by symmetry,, [the
“bysymmetry [the other
other
branch]
branch] isis also
also true.”
true.”
● x ∈ B and x ∈ A
● Conclude x ∈ B
Theorem: If A, B, and C are sets and C ⊆ A ∩ B, then
C ⊆ A and C ⊆ B.
Rough Outline
● Assume C ⊆ A ∩ B
● Proving C ⊆ A
Try
Tryitityourself:
yourself:Take
Takeaafew
few
Pick an x ∈ C minutes
minutesand andwrite
writeup
upaaproof
proofof
●
of
the
thetheorem
theoremusing
usingthis
thisoutline.
outline.
● x∈A∩B
Then
Thenshare
shareyour
yourproof
proofwith
withyour
your
● x ∈ A and x ∈ B
neighbors
neighborsand
andcritique
critiqueeach
each
● Conclude x ∈ A other!
other!
Respond
Respondat
atpollev.com/cs103
pollev.com/cs103
Next Time
●
First-Order Logic
●
Reasoning about groups of objects.
●
First-Order Translations
●
Expressing yourself in symbolic math!