0% found this document useful (0 votes)
13 views11 pages

Harolds Logic Cheat Sheet

Harold's Logic Cheat Sheet outlines the seven basic logical symbols used in mathematical reasoning, including conjunction, disjunction, negation, conditional, biconditional, universal quantifier, and existential quantifier. It also details logical connective laws, operations on two variables, rules of inference, and the definitions of logical predicates and quantifiers. This comprehensive guide serves as a resource for understanding and applying logical principles in various contexts.

Uploaded by

yuchenpan10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views11 pages

Harolds Logic Cheat Sheet

Harold's Logic Cheat Sheet outlines the seven basic logical symbols used in mathematical reasoning, including conjunction, disjunction, negation, conditional, biconditional, universal quantifier, and existential quantifier. It also details logical connective laws, operations on two variables, rules of inference, and the definitions of logical predicates and quantifiers. This comprehensive guide serves as a resource for understanding and applying logical principles in various contexts.

Uploaded by

yuchenpan10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Harold’s Logic Cheat Sheet

4 November 2024

The Seven Basic Logical Symbols

Operator Symbol Example English


 Conjunction

∧, ∧, ∧, ⋀,
 p and q

p∧q
 p, but q
1) Intersection  despite the fact that p, q
∧  even though p, q
 although p, q
 overlap

∨, ∨, ∨, ⋁,
 Disjunction
p∨q
 p or q
2) Union
∨  inclusive or
 both combined
3) Negation ¬, ¬ ¬p  not p
 if p then q
 if p, q

→, →, →, ⟶,
 q if p

⇒, ⟹
 p implies q
4) Conditional p→q
 p only if q
 q in case that p
 p is sufficient for q
 q is necessary for p
 p iff q
↔, ⟷, ↔, ⇔,
p⟷q
 p if and only if q

5) Biconditional  p is necessary and sufficient for q
 if p then q, and conversely
 if not p then not q, and conversely

∀x ∀x p(x)
 for all
6) Universal
 for any
Quantifier
 for each
∃x ∃x p(x)
7) Existential  there exists
Quantifier  there is at least one
 is identical to

≡, ≡, ≡
 is equivalent to
expression1 ≡
Equivalence  is defined as
expression2
 the two expressions always have
the same truth value
 The structure of all mathematical statements can be understood using these symbols.
 All mathematical reasoning can be analyzed in terms of the proper use of these symbols.

Copyright © 2021 - 2024 by Harold Toomey, WyzAnt Tutor


1
Logical Connective Laws / Equivalences

Law Union Example Intersection Example


Identity Laws p∨F≡p p∧T≡p
p∨T≡T p∧F≡F
Domination, Null, or

p∨p≡p p∧p≡p
Universal Bound Laws
Idempotent Laws
Double Negations or
¬ ¬p ≡ p
p ∨ ¬p ≡ T p ∧ ¬p ≡ F
Involution Law
Negation, Complement, or

p∨q≡q∨p p∧q≡q∧p
Complementary Laws ¬F ≡ T ¬T ≡ F

(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
Commutative Laws

p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
Associative Laws

(p ∧ q) ∨ (p ∧ ¬q) ≡ p (p ∨ q) ∧ (p ∨ ¬q) ≡ p
Distributive Laws

p ∨ (p ∧ q) ≡ p p ∧ (p ∨ q) ≡ p
Uniting Laws

p ∨ q ≡ ¬(¬p ∧ ¬q)
Absorption Laws
p ∧ q ≡ ¬(¬p ∨ ¬q)
¬(p ∨ q) ≡ ¬p ∧ ¬q
¬(p ∧ q) ≡ ¬p ∨ ¬q
De Morgan’s Law
(p ∨ ¬q) → r ≡ ¬r → (¬p ∧ q)
(Propositional Logic)

(p ∨ q) ∧ (¬p ∨ r) ≡ (p ∧ q) ∨ (¬p ∧ r) ≡
(p ∧ r) ∨ (¬p ∧ q) (p ∨ r) ∧ (¬p ∨ q)
Multiplying and Factoring
Laws
(p ∧ q) ∨ (q ∧ r) ∨ (¬p ∧ r) ≡ (p ∨ q) ∧ (q ∨ r) ∧ (¬p ∨ r) ≡
(p ∧ q) ∨ (¬p ∧ r) (p ∨ q) ∧ (¬p ∨ r)
Consensus Laws

p ∨ (⊤) ≡ ⊤
p ∧ (⊤) ≡ p
p ∨ ¬p ≡ ⊤ (True)
¬(⊤) = ⊥
Tautology Laws (⊤)

p ∧ (⊥) ≡ ⊥
p ∨ (⊥) ≡ p
p ∧ ¬p ≡ ⊥ (False)
¬(⊥) ≡ ⊤
Contradiction Laws (⊥)

Exclusive Or Laws (⊕) p ⊕ q ≡ (p ∨ q) ∨ ¬(p ∧ q) p ⊕ q ≡ (¬p ∧ q) ∨ (p ∨ ¬q)

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 2


The Sixteen Logical Operations on Two Variables

# Venn Sym Logical Notation(s) Name(s)


0000 ⊥ 0 Contradiction; falsehood; antilogy; constant 0

0001 ∧ x ∧ y , xy , x∧ y Conjunction; AND

0010 ⊃ x ∧ y , x ⊅ y ,[ x > y ] , x ∸ y Nonimplication; difference; but not

0011 ∟ x Left projection

0100 ⊂ x ∧ y , x ⊄ y ,[x < y ], y ∸ x Converse nonimplication; not ... but

0101 𝖱 y Right projection

0110 ⨁ x ⨁ y ,x ≢ y , x
y
Exclusive disjunction; nonequivalence; XOR

0111 ∨ x ∨ y , x∨ y (Inclusive) disjunction; and/or; OR

1000 ⊽ x∧ y ,x ∨ y ,x ⊽ y , x↓ y Nondisjunction; joint denial; neither... NOR

1001 ≡ x≡ y ,x ⟷ y ,x ⇔ y Equivalence; if and only if; IFF

1010 R y , ¬ y ,! y , y Right complementation; NOT

1011 ⊂ x∨ y ,x ⊂ y ,x ⇐ y ,[x ≥ y ], x
y
Converse implication; IF

1100 ∟ x ,¬ x , ! x , x Left complementation; NOT

x ∨ y , x ⊃ y , x⇒
1101 ⊃ Implication; only if; if … then
y ,[x ≤ y], y
x

1110 ⊼ x ∨ y , x ∧ y , x ⊼ y , x∨ y Nonconjunction; not both … and; NAND

1111 ⊤ 1 Affirmation; validity; tautology; constant 1

Donald E. Knuth (1968). 7.1.1 Boolean Basics, The Art of Computer Programming, Pre-fascicle 0B: The
sixteen logical operations in two variables. See also Wikipedia, Truth function.

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 3


Logical Conditional Connective Laws

Law or Logical Is Equivalent To


Description
Statement Expression (≡)
¬p ∨ q
¬(p ∧ ¬q)

p ∨ q ≡ ¬p → q
Logical Equivalences:

p ∧ q ≡ ¬(p → ¬q)
Conditional, If ... Then,
¬(p → q) ≡ p ∧ ¬q
Conditional Laws p→q
Implication
(p → q) ∧ (p → r) ≡ p → (q ∧ r)
(p → q) ∨ (p → r) ≡ p → (q ∨ r)
(p → r) ∧ (q → r) ≡ (p ∧ q) → r
(p → r) ∨ (q → r) ≡ (p ∨ q) → r
(p → q) ∧ (q → p)
(p → q) ∧ (¬p → ¬q)
(p ∧ q) ∨ (¬p ∧ ¬q)
Biconditional Bi-conditional, If and only If, iff,
p↔q ¬p ↔ ¬q
Laws XNOR
Logical Equivalences:
¬(p ↔ q) ≡ p ↔ ¬q
Sufficient p is a sufficient
The truth of p suffices to guarantee the truth of q.
Condition condition for q
Necessary q is a necessary For p to be true, it is necessary for q to be true also.
Condition condition for p ¬q → ¬p
Is logically equivalent to (p ≡ ¬
p⟹q
p≡q
Equivalence p↔q ¬ p)
Is equivalent to

≢q→p
Contrapositive p→q ≡ ¬q → ¬p True

≢ ¬p → ¬q
Converse* p→q False
Inverse* p→q False

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 4


Rules of Inference with Propositions

Rule Name Rule Logic Example


Givens. It is raining today.
Hypothesis
First lines of a proof. You live in McKinney, Texas.

Therefore.
Therefore ∴
In conclusion.

p It is raining today.
Modus Ponens p→q If it is raining today, I will not ride my bike to school.
∴q Therefore, I will not ride my bike to school.

¬q If Sam studied for his test, then Sam passed his test.
Modus Tollens p→q Sam did not pass his test.
∴¬ p Therefore, Sam did not study for his test.

It is raining today.
Addition, p
Therefore, it is either It is raining today or snowing
Generalization ∴ p∨q
today or both.

Simplification, p∧q It is rainy today and it is windy today.


Specialization ∴p Therefore, it is rainy today.

Sam studied for his test.


p
Sam passed his test.
Conjunction q
Therefore, Sam studied for his test and Sam passed his
∴ p∧q
test.

p→q If you are mad then you will yell.


Hypothetical
q→r If you yell then you will wake the baby.
Syllogism, Transitivity
∴ p→r Therefore, if you are mad then you will wake the baby.

p∨q Sam studied for his test or Sam took a nap.


Disjunctive Syllogism,
¬p Sam did not study for his test.
Elimination
∴q Therefore, Sam took a nap.

p∨ q Your shirt is red or your pants are blue.


Resolution ¬ p ∨q Your shirt is not red or your pants are blue.
∴q∨r Therefore, your pants are blue or your shoes are white.

p ∨q It is raining or it is Monday.
Proof by Division into p→r It is raining so it is wet.
Cases q →r It is Monday so it is wet.
∴r It is wet.

¬ p→F If it is not raining is a false statement, then it is raining.


Contradiction Rule
∴p

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 5


Logical Predicates

Logical
Definition Is Equivalent To (≡) Description
Expression
 Universe of Discourse
Universe of All possible inputs in a given
U  Universal Set
Discourse range
 Universe
𝔻
Domain of All possible inputs in a given  Domain of Discourse
Discourse range  Universe of Discourse
 Must be True or False
Proposition or p: “Roxy is a
p  Cannot be a question
Logical Statement mammal”
 Cannot be a command
 A logical statement
whose truth value is a
function of one or more
P(x): “x is a variables
Predicate P(x)
mammal”  Truth depends upon the
input variable x
 P(x) ≠ a number
 P(5) is a proposition
q: ∀x ∈ 𝔻,
 Is either True or False
“For all x in the domain of  A quantified predicate
P(x): “x is a
Example discourse, P(x) is a mammal.” turns it into a logical
mammal”
Statements statement
Predicate with two input
T(x, y) “x is a twin of y.”
variables

T = {a ∈ A | P(a)}
T = {a | P(a)}
Truth Set The set of all values of x that
a ∈T
T = P(x)
(Single Free make the statement p(x) true
Variable)

{(a, b) ∈ A × B | P(a, b)}


Example: P(x1), P(x2), and P(x3) are True

(a, b) ∈ T
T = P(x, y) Cross product truth set
Truth Set {(p, n) ∈ P × ℕ | the person p has n children} = {(John, 2), …}

{(p, c, n) ∈ P × C × ℕ | the person p has lived in the city c for n


(Ordered Pair)
Examples:
years}

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 6


Logical Quantifiers

Logical
Definition Is Equivalent To (≡) English
Expression
 for all

∀x P(x)
“For all x in the domain, P(x) is true”  all elements

∀x ∈ P(x)
 for each member
∀x ∈ A P(x) ≡ ∀x (x ∈ A → P(x))
∀x ∈ 𝔻, P(x)
 any
Universal
 every
Quantifier

∀x, if x is in 𝔻
 everyone
(∀) For the finite set domain of discourse
 everybody

∀x P(x) ≡ P(a1) ∧ P(a2) ∧ … ∧ P(ak)


{a1, a2, …, ak},
then P(x)  everything
 x could be anything at
all
 there exists an x
“There exists x in the domain, such  there is
that P(x) is true”  some
∃x P(x)  someone
∃x ∈ P(x)
Existential
For the finite set domain of discourse  somebody
∃x ∈ 𝔻, P(x)
Quantifier
∃x P(x) ≡ P(a1) ∨ P(a2) ∨ … ∨ P(ak)
{a1, a2, …, ak},  at least one value of x
(∃)
 there is at least one x

P(x) ≠ ∅
 it is the case that

equal to ∅
 the truth set is not

there is a unique x in P(x) such that …  unique

∃x (P(x) ∧ ¬ y (P(y) ∧ y ≠ x))


 there is a unique x

∃!x P(x)
 there exists exactly
∃x (P(x) ∧ ∀y (P(y) → y = x))
Uniqueness
one
∃x ∀y (P(y) ↔ y = x)
Quantifier
(∃!)  there is exactly one x
such that P(x)
∃x P(x) ∧ ∀y ∀z((P(y) ∧ P(z)) → y = z)

¬ [∃x P(x)] ∀x ¬P(x)


 nobody
Negated
 no one
¬ [∀x P(x)] ∃x ¬P(x)
Existential
 not one
Quantifier
 there does not exist
PEMDAS for Logic: Applied Left to Right
1. Parenthesis ()

3. Quantifiers (∀, ∃) ∀x P(x) ∧ Q(x) ≡


2. Logical NOT (¬) Example :

(∀x P(x)) ∧ Q(x)


Order of
Precedence 4. Logical AND (∧)

6. Logical Conditional (→)


5. Logical OR (∨)

7. Logical Biconditional (↔)

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 7


Quantifier Laws

Is Equivalent Description / Example /


Definition Logical Expression
To (≡) • English
Abbreviation ∃x (x ∈ A ∧ ¬P(x)) ∃x ∈ A ¬P(x) Simplification
∀x ∈ A P(x) ∀x (x ∈ A → P(x))
Expanding
Complication
∀x ¬P(x)
Abbreviation
¬∃x P(x)  nobody’s perfect
∃x ¬P(x)
Quantifier Negation
 not everyone is perfect
Laws ¬∀x P(x)
x ∈ A → P(x) x ∉ A ∨ P(x) p → q ≡ ¬p ∨ q
 someone is imperfect
Conditional Law
x∈A ¬(x ∉ A) Swap ∈ with ∉, or vice versa
Subset Negation

¬∀x P(x) ≡ ∃x ¬P(x)


Law

¬∃x P(x) ≡ ∀x ¬P(x)

¬∀x ∀y P(x, y) ≡ ∃x ∃y ¬P(x, y)


De Morgan’s Law
De Morgan’s Law for single and
¬∀x ∃y P(x, y) ≡ ∃x ∀y ¬P(x, y)
(Quantifier
nested quantifiers
¬∃x ∀y P(x, y) ≡ ∀x ∃y ¬P(x, y)
Negation)

¬∃x ∃y P(x, y) ≡ ∀x ∀y ¬P(x, y)


∀x ∀y ∀y ∀x  for all objects x and y, …
∃x ∃y ∃y ∃x
 there are objects x and y
such that …

Counterexample for x, y ∈ ℤ:
Nested / Multiple- False
∀x ∃y P(x, y) ≢ ∃x ∀y P(x, y)
∀x ∃y (x + y = 0) ≡ True
Quantified

∃x ∀y (x + y = 0) ≡ False
Statements

¬(∀x ∃y P(x, y)) ∃x ∀y ¬P(x, y)


¬(∃x ∀y P(x, y)) ∀x ∃y ¬P(x, y)
Negation of multiply-quantified

∀x (P(x) → ∃y Q(x, y)) ≡


statements

∀x ∃y (P(x) → Q(x, y))


You can move a quantifier left
Moving Quantifiers
if the variable is not used yet

Quantifier Logic Examples

Action Logical Statement English


∀x ∀y P(x, y)  everyone <did something>
Everyone
∀x ∀y (x ≠ y) → P(x, y)
NOTE: includes (x = y) to everyone
 everyone <did something>
Everyone Else
∀x ∃y ((x ≠ y) ∧ P(x, y))
NOTE: excludes (x = y) to everyone else
 everyone <did something>
Someone Else
∃x (P(x) ∧ ∀y ((x ≠ y) → ¬P(y))) ≡
NOTE: excludes (x = y) to someone else

∃!x P(x)
 exactly one person <did
Exactly One
something>
No One ¬∃x (P(x)  no one <did something>

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 8


Valid Quantifier Formulas

A B
∀x (P(x) ∧ Q(x)) (∀x P(x) ∧ ∀x Q(x))
∃x (P(x) ∧ Q(x)) (∃x P(x) ∧ ∃x Q(x))

∀x (P(x) ∨ Q(x)) (∀x P(x) ∨ ∀x Q(x))


∃x (P(x) ∨ Q(x)) (∃x P(x) ∨ ∃x Q(x))


∀x (P(x) → Q(x)) (∃x P(x) → ∀x Q(x))


∃x (P(x) → Q(x)) (∀x P(x) → ∃x Q(x))


∀x ¬P(x)

∃x ¬P(x)
≡ ¬∃x P(x)

∀x ∃y T(x, y) ∃y ∀x T(x, y)
≡ ¬∀x P(x)

∀x ∀y T(x, y) ∀y ∀x T(x, y)

∃x ∃y T(x, y) ∃y ∃x T(x, y)

∀x (P(x) ∨ R) (∀x P(x) ∨ R)


∃x (P(x) ∧ R) (∃x P(x) ∧ R)


∀x (P(x) → R)

∃x (P(x) → R)
≡ (∃x P(x) → R)

∀x (R → Q(x)) (R → ∀x Q(x))
→ (∀x P(x) → R)

∃x (R → Q(x)) (R → ∃x Q(x))

∀x R

∃x R
← R
→ R

Note: The above formulas are valid in classical first-order logic assuming that x does not occur free in R.

Invalid Quantifier Formulas

A B Counterexample
∃x (P(x) ∧ Q(x)) (∃x P(x) ∧ ∃x Q(x))
∀x (P(x) ∨ Q(x)) (∀x P(x) ∨ ∀x Q(x))
← D = {a, b}, M = {P(a), Q(b)}

∀x (P(x) → Q(x)) (∃x P(x) → ∀x Q(x))


→ D = {a, b}, M = {P(a), Q(b)}

∀x ∃y T(x, y) ∃y ∀x T(x, y)
→ D = {a, b}, M = {P(a), Q(a)}

∃x (P(x) → R)
→ D = {a, b}, M = {T(a, b), T(b, a)}

∃x (R → Q(x)) (R → ∃x Q(x))
← (∀x P(x) → R) D = Ø, M = {R}

∀x R
← D = Ø, M = Ø

∃x R
→ R D = Ø, M = Ø
← R D = Ø, M = {R}

Note: if empty domains are not allowed, then the last four implications above are in fact valid.

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 9


Logical Truth Tables

⊼ ⊽ ⊻,⊕ ⊙
Conjunction NAND Disjunction NOR XOR XNOR Negation

∧ ∨
p q (and) (or) (not)
¬P
F F F T F T F T
F T F T T F T F T
T F F T T F T F F
T T T F T F F T

Material Implication Biconditional Tautology Contradiction

⊤ ⊥
p q (If … Then) (Iff) (True) (False)
→ ↔
F F T T T F
F T T F T F
T F F F T F
T T T T T F

Blank Truth Tables

Inputs Output Inputs Output


p q r s x y z p q r x y
F F F F F F F
F F F T F F T
F F T F F T F
F F T T F T T
F T F F T F F
F T F T T F T
F T T F T T F
F T T T T T T
T F F F
T F F T
T F T F Inputs Output
T F T T p q x
T T F F F F
T T F T F T
T T T F T F
T T T T T T

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 10


Sources

SNHU MAT 230 - Discrete Mathematics, zyBooks.

See also
 Harold’s Sets Cheat Sheet
 Harold’s Boolean Algebra Cheat Sheet
 Harold’s Proofs Cheat Sheet

https://byjus.com/maths/set-theory-symbols/

https://en.wikipedia.org/wiki/List_of_logic_symbols

https://en.wikipedia.org/wiki/Truth_function#Table_of_binary_truth_functions

https://nokyotsu.com/qscripts/2014/07/distribution-of-quantifiers-over-logic-connectives.html

Donald E. Knuth (1968). 7.1.1 Boolean Basics, The Art of Computer Programming, Pre-fascicle 0B: The
sixteen logical operations in two variables.

Copyright © 2021-2024 by Harold Toomey, WyzAnt Tutor 11

You might also like