Proposition: a declarative sentence that is T or F (not both) Propositional variable (sentential): variables that represent propositions, denoted as letters p,q,r. Atomic proposition: propositions that cannot be expressed in terms of simpler propositions. Compound proposition: new propositions formed from
existing propositions using logical operators.
Logical Operators (Propositional Connectives):
Negation (NOT): ¬p or ∼p
Conjunction (AND): p∧q
Disjunction (OR): p∨q
Exclusive (XOR): p⊕q
(DNF) Disjunctive normal form: OR of ANDs. (CNF) Conjunctive normal form: AND of ORs.
Conditional Proposition
Conditional Statement (Implication): If p, then q, denoted by p→q. p is hypothesis,
and q is conclusion.
pTTFFqTFTFp→qTFTT
Contrapositive: ¬q→¬p
Converse: q→p
Inverse: ¬p→¬q
The original and contrapositive are equivalent; The converse and inverse are equivalent. (logically equivalent)
Biconditional Statement (Bi-implications): p if and only if q, denoted by p↔q
p≡q denotes logical equivalence if p↔q is a tautology.
De Morgan's Laws
¬(p∧q)≡¬p∨¬q
¬(p∨q)≡¬p∧¬q
Conditional Disjunction Equivalence: p→q≡¬p∨q
Logical Equivalence Table:
Law
∨-Version
∧-Version
Idempotent laws
p∨p≡p
p∧p≡p
Associative laws
(p∨q)∨r≡p∨(q∨r)
(p∧q)∧r≡p∧(q∧r)
Commutative laws
p∨q≡q∨p
p∧q≡q∧p
Distributive laws
p∨(q∧r)≡(p∨q)∧(p∨r)
p∧(q∨r)≡(p∧q)∨(p∧r)
Identity laws
p∨F≡p
p∧T≡p
Domination laws
p∨T≡T
p∧F≡F
Double negation
¬¬p≡p
¬¬p≡p
Complement laws
p∨¬p≡T ¬F≡T
p∧¬p≡F ¬T≡F
De Morgan’s laws
¬(p∨q)≡¬p∧¬q
¬(p∧q)≡¬p∨¬q
Absorption laws
p∨(p∧q)≡p
p∧(p∨q)≡p
Conditional identities
p→q≡¬p∨q
p↔q≡(p→q)∧(q→p)
Expression
Equivalent Form
p→q
¬p∨q
p→q
¬q→¬p
p∨q
¬p→q
p∧q
¬(p→¬q)
¬(p→q)
p∧¬q
(p→q)∧(p→r)
p→(q∧r)
(p→r)∧(q→r)
(p∨q)→r
(p→q)∨(p→r)
p→(q∨r)
(p→r)∨(q→r)
(p∧q)→r
Expression
Equivalent Form
p↔q
(p→q)∧(q→p)
p↔q
¬p↔¬q
p↔q
(p∧q)∨(¬p∧¬q)
¬(p↔q)
p↔¬q
Set
Definition: unordered collection of elements.
Set Equality: A=B if they contain exactly the same elements.
Subset: A⊆B if every element of A is also an element of B. ∀x(x∈A→x∈B).
Proper Subset: A⊊B, if A⊆B and A=B.
Empty Set: The set with no elements, denoted {} or ∅.
Roster method: list elements explicitly.
Set-builder notation: describe elements via properties.
Recursion: basis and recursive step.
Concatenation: A∘B={ab∣a∈A and b∈B}
Cardinality of Sets
A set A is finite if ∣A∣=n for some n∈N.
A set A is countably infinite if there is a bijection f:N→A or ∣A∣=∣N∣.
Uncountable: cannot be put in bijection with N.
Set
Notation
Cardinality
Integers
Z
countably infinite
Positive integers
Z+
countably infinite
Nonnegative integers
N
countably infinite
Rational numbers
Q
countably infinite
Real numbers
R
uncountable
Sum and Product Rules
Sum Rule (Disjoint Union): If A and B are disjoint finite sets, then ∣A∪B∣=∣A∣+∣B∣.
Union of Non-Disjoint Sets: If A,B are finite (possibly overlapping), ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣.
Product Rule (Cartesian Product): If A and B are finite, then ∣A×B∣=∣A∣×∣B∣.
Corollary:∣A2∣=∣A∣2 for any finite set A.
Power Sets
Definition: The power set P(S) is the set of all subsets of S.
If ∣S∣=n, then ∣P(S)∣=2n.
For any set S, ∣S∣<∣P(S)∣
Example: If S={1,2,3}, P(S)={∅,{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}.
Predicate and Quantification
Predicate
Predicate (propositional function): a function P(x) from a given domain to {T,F}
Can be represented by: input-output table, rule or condition, truth set (elements where P(x) is true)
For a predicate P with domain X1×⋯×Xn, write P(x1,…,xn) to mean P((x1,…,xn)).
Quantifier
Quantification: to create a proposition from a propositional function.
Highest precedence over all other logical operators
Universal Quantification∀xP(x) : P(x) for all values of x in the domain. An element where P(x)=F is a counterexample.
Existential Quantification∃xP(x) : There exists an element x in the domain such that P(x). An element where P(x)=T is a witness.
Uniqueness Quantification∃!xP(x) or ∃1xP(x) : There exists a unique x such that P(x). (uniqueness quantifier).
DeMorgan's Laws for Quantifiers:
¬∀xP(x)≡∃x¬P(x)¬∃xP(x)≡∀x¬P(x)
Nested Quantifiers: order matters, read left to right.
Arguments and Validity
An argument in propositional logic is a sequence of propositions. All but the final proposition in the argument are called premises and the final proposition is called the conclusion. An argument is valid if the truth of all its premises implies that the conclusion is true. An argument form in propositional logic is a sequence of compound propositions involving propositional variables. An argument form is valid if no matter which particular propositions are substituted for the propositional variables in its premises, the conclusion is true if the premises are all true.
Rules of Inference
Rule of Inference
Tautology
Name
pp→q∴q
(p∧(p→q))→q
Modus ponens
¬qp→q∴¬p
(¬q∧(p→q))→¬p
Modus tollens
p→qq→r∴p→r
((p→q)∧(q→r))→(p→r)
Hypothetical syllogism
p∨q¬p∴q
((p∨q)∧¬p)→q
Disjunctive syllogism
p∴p∨q
p→(p∨q)
Addition
p∧q∴p
(p∧q)→p
Simplification
pq∴p∧q
((p)∧(q))→(p∧q)
Conjunction
p∨q¬p∨r∴q∨r
((p∨q)∧(¬p∨r))→(q∨r)
Resolution
Rules of Inference for Quantified Statements
Universal Instantiation: If ∀xP(x) is true, then P(c) is true for any element c in the domain.
Universal Generalization: If P(c) is true for an arbitrary element c, then ∀xP(x) is true.
Existential Instantiation: If ∃xP(x) is true, then there exists some element c such that P(c) is true.
Existential Generalization: If P(c) is true for some element c, then ∃xP(x) is true.
Proof
Terms
Proposition: A statement that is true and can be proven, usually less significant than a theorem.
Theorem: A major proven statement based on axioms, definitions, and previously established theorems.
Axiom: A foundational assumption accepted without proof.
Proof: A logical argument establishing the truth of a mathematical statement.
Lemma: A helping theorem used in the proof of a more important result.
Corollary: A statement that follows directly from a theorem.
Conjecture: An unproven statement believed to be true, often awaiting a proof or counterexample.
Techniques
Basic Proof
Direct Proof: Prove a statement by logical steps from known truths.
Proof by Contrapositive: Instead of proving p→q, prove ¬q→¬p.
Vacuous Proof: When p is always false, so the implication is trivially true.
Trivial Proof: When q is always true regardless of p.
Proof by Contradiction: Assume the negation of the statement, which is ¬(p→q)≡p∧¬q, and derive a contradiction.
Case-Based Proof
Exhaustive Proof: Check all possible cases individually.
Proof by Cases: Break the problem into a finite number of scenarios and prove each one.
Without Loss of Generality: Simplify a proof by assuming a specific case that can be generalized.
Existence Proof
Constructive Proof: Provide a specific example (witness) that satisfies the condition.
Non-constructive Proof: Show something exists by contradiction or logical argument, without exhibiting it.
Uniqueness Proof: assume two elements x and y both satisfy the property, then show x=y.
Reasoning Strategies
Forward Reasoning: Start from what you know and derive the conclusion step by step.
Backward Reasoning: Start from what you want to prove and figure out what needs to be true.
Adapting Existing Proofs: Modify or reuse the structure of known proofs for similar problems.
Looking for Counterexamples: Search for examples that disprove a statement (especially useful in testing conjectures).
Universal Generalization: Prove a property for an arbitrary element, and then conclude it holds for all.
Mathematical Induction
Mathematical Induction
To prove ∀n≥b,P(n):
Base Step: Prove P(b).
Inductive Step: Assume P(n) holds for some n≥b, prove P(n+1).
Strong Induction
To prove ∀n≥b,P(n):
Base Step: Prove P(b),P(b+1),…,P(b+j).
Inductive Step: Assume P(b),…,P(n), prove P(n+1).
Structural Induction
To prove ∀x∈S,P(x) when S is recursively defined.
Basis Step: Show P(b) for each base element b.
Recursive Step: Assume P holds for all smaller ("already constructed") elements; then show it holds for any element formed by the recursive rule.
Number Theory
Base-b Expansion
decimal (10), binary (2), octal (8), hexadecimal (16). Base b Expansion: (ak−1…a0)b.
Every positive integer n has a unique expansion n=ak−1bk−1+ak−2bk−2+⋯+a1b+a0,0≤ai<b,ak−1=0.
Divisibility
a∣b: adividesb and b is divisible by a; a is afactor or divisor of b, b is a multiple of a. ~ a ∤ b
Let a=0 and a,b,c be integers:
If a∣b and a∣c, then a∣(b+c)
If a∣b, then a∣bc for all integers c
If a∣b and b∣c, then a∣c
If a∣b and a∣c, then a∣(sb+tc) for all integers s,t
The Division Algorithm
Let a be an integer and d a positive integer. Then there are unique integers q and r, with 0≤r<d, such that a=dq+r
Congruence: a is congruent to b modulo m, m is modulus. a≡b(modm) is equivalent to
m∣(a−b)
(amodm)=(bmodm)
a=b+km
Theorems:
If a≡b(modm) and c≡d(modm), then
a±c≡b±d(modm)
ac≡bd(modm)
an≡bn(modm)
Properties:
(a+b)modm=((amodm)+(bmodm))modm
(ab)modm=((amodm)(bmodm))modm.
Zm={0,1,…,m−1}
a+mb=(a+b)modm
a⋅mb=(a⋅b)modm
Multiplicative Inverse
If a and m are relatively prime (gcd(a,m)=1) and m>1, then there exists a unique integer a−1
with 1≤a−1<m such that aa−1≡1(modm).
Solve for aa−1−tm=1
Extended Euclidean Algorithm
Purpose: Compute integers s,t such that sx+ty=gcd(x,y)
When gcd(x,n)=1, the coefficient s(modn) is the inverse of x.
Run Euclid's algorithm while recording quotients.
Back-substitute to express gcd(x,y) as a linear combination.
Primes and Common Divisors
Prime and Composite
Fundamental Theorem of Arithmetic: Every integer n>1 can be written uniquely as a product of primes: n=p1c1p2c2⋯prcr
If n is a composite integer, then there exists a prime p such that p∣n and p≤n.
Greatest Common Divisor (gcd)
For integers a, b (not both zero), the greatest common divisorgcd(a,b) is the largest positive integer d such that d∣a and d∣b.
If a=i∏pici,b=i∏pidi, then gcd(a,b)=i∏pimin(ci,di).
The integers a and b are relatively prime if gcd(a,b)=1.
Least Common Multiple (lcm)
The least common multiplelcm(a,b) is the smallest positive integer divisible by both a and b.
If a=i∏pici,b=i∏pidi, then lcm(a,b)=i∏pimax(ci,di).
ab=gcd(a,b)lcm(a,b)
Euclid's Algorithm for gcd
gcd(a,b)=gcd(a−b,b) gcd(a,b)=gcd(b,amodb)
Bezout's Theorem: If a and b are positive integers, then there exist integers s and t such that gcd(a,b)=sa+tb
If a,b,c are positive integers such that gcd(a,b)=1 and a∣bc, then a∣c.
Let m be a positive integer and let a,b,c be integers. If ac≡bc(modm) and gcd(c,m)=1, then a≡b(modm)
Functions
Precondition: statements that describe valid input. Postcondition: conditions that output should satisfy.
A functionf:A→B is well-defined if assigns exactly one element of B to each element of A. We write f(a)=b if b
is the unique element of B that f assigns to a∈A.
The domain of f is A.
The codomain of f is B.
b is the image of a, and a is a preimage of b.
The range (or image) of f is the set {f(a):a∈A}.
Relations:
One-to-one (Injective): if and only if f(a)=f(b)⟹a=b. ∣A∣≤∣B∣ no bigger than
Onto (Surjective): if and only if ∀b∈B∃a∈Af(a)=b. ∣A∣≥∣B∣ no smaller than
Bijection: f is both injective and surjective.
∣A∣=∣B∣
Cantor-Schroder-Bernstein Theorem: ∣A∣=∣B∣ if and only if ∣A∣≤∣B∣ and ∣B∣≤∣A∣.
Cantor's Diagonalization (Uncountability of P(N))
Goal: Show no bijection f:N→P(N) exists.
Assume an arbitrary function f:N→P(N).
Construct Df={n∈N∣n∈/f(n)}.
Claim:Df∈P(N) but Df=f(a) for every a∈N.
If a∈Df, then by definition a∈/f(a). Thus f(a)=Df.
If a∈/Df, then a∈f(a). Again f(a)=Df.
Conclusion:f is not onto, so ∣N∣=∣P(N)∣.
Hence P(N) is uncountable.
Counting
Permutations and Combinations
Permutation: An ordered arrangement of all elements of a set of size n.
Number of permutations: P(n,n)=n!.
r-Permutation: An ordered arrangement of r distinct elements chosen from n. P(n,r)=n×(n−1)×⋯×(n−r+1)=(n−r)!n!.
Combination: An unordered selection of r elements from n. (rn)=r!(n−r)!n!.
Binomial Theorem
For x,y and integer n≥0,
(x+y)n=r=0∑n(rn)xn−ryr.
Binary Relations
A binary relationRfromAtoB is any subset R⊆A×B. aRb denote (a,b)∈R. If (a,b)∈R, then a is related to b by R.
R⊆A×B and S⊆B×C, then the composite of R and S, S∘R is the relation consisting of all ordered pairs (a,c), where a∈A, c∈C, and there exists an element b∈B such that (a,b)∈R and (b,c)∈S.
If R is a relation on A, Rn+1=Rn∘R
Equivalence Relations and Partitions
Equivalence Relation
A relation R⊆A×A is an equivalence relation if it is reflexive, symmetric, and transitive.
a∼b denotes a and b are equivalent elements with respect to a particular equivalence relation.
Equivalence Class
For a∈A, the equivalence class of a with respect to R is [a]R={x∈A:(a,x)∈R}
Every equivalence class is nonempty (since a∈[a]R)
If b∈[a]R, then b is a representative of this equivalence class.
Partition Induced by an Equivalence Relation
When R is an equivalence relation on A, the collection {[a]R:a∈A}
is a partition of A; that is,
Each [a]R=∅.
If (a,b)∈R, then [a]R=[b]R.
If (a,b)∈/R, then [a]R∩[b]R=∅.
a∈A⋃[a]R=A
Let R be an equivalence relation on a set S. Then the equivalence classes of R form a partition of S.
Conversely, given a partition {Ai∣i∈I} of the set S, there is an equivalence relation R that has the
sets Ai, i∈I, as its equivalence classes.
From Equivalence Relation to Partition: R↦{[a]R:a∈A}.
From Partition to Equivalence Relation:
Given a partition {A1,…,Ak} of A, define R={(x,y)∈A×A:∃i,x∈Ai∧y∈Ai}.
Partial Order
A relation R⊆A×A is a partial order if it is reflexive, antisymmetric, transitive. (A,R) is a partially ordered set, or poset. Members of A are elements of the poset.
Hasse Diagram
For a finite partially ordered set (A,R), the Hasse diagram is drawn by:
Omitting self-loops (a,a).
Omitting edges implied by transitivity: if (a,c) follows from (a,b) and (b,c), do not draw (a,c).
Placing elements as nodes in the plane so that if (a,b)∈R (and a=b), then b is "above" a. Draw an undirected edge between a and b.