Discrete Mathematics
[TOC]
Propositions

Propositional Logic
Propositional Connectives


Logical Equivalences


Propositional Logic Inference

Predicate Logic Equivalences


Note:
- Contraction or expansion can only be performed with disjunction or conjunction; implication must be converted to disjunction using the implication equivalence.
- Universal quantifier distributes over conjunction.
- Existential quantifier distributes over disjunction.
- Merging can be done freely, but distribution cannot be done freely.
Eliminating Quantifiers Using the Domain of Discourse

When eliminating, first eliminate the quantifier closest to the predicate.
Common Inference Laws

The last two expressions demonstrate the impact of using different quantifiers (universal quantifier ∀ and existential quantifier ∃) on logical propositions in logical inference.
- First expression:
This expression states: if for all x, proposition A(x) implies proposition B(x), then if all x satisfy A(x), then all x satisfy B(x). In other words, if A(x) implies B(x) for every instance of x, then when A(x) holds for all x, B(x) also holds for all x.
- Second expression: This expression states: if for all x, proposition A(x) implies proposition B(x), then if there exists some x satisfying A(x), then there exists some x satisfying B(x). In other words, if A(x) implies B(x) for every instance of x, then if at least one x makes A(x) hold, at least one x makes B(x) hold.
The difference between these two expressions lies in the quantifiers in the conclusion:
- The conclusion of the first expression involves the universal quantifier ∀, meaning all x must satisfy a certain condition.
- The conclusion of the second expression involves the existential quantifier ∃, meaning at least one x satisfies a certain condition.
Although these two expressions have the same premise, the different quantifiers in the conclusion lead to different meanings. In logical inference, changes in quantifiers significantly affect the meaning and inference process of propositions.
Quantifier Elimination and Introduction

Existential Elimination
The existential elimination rule allows us to derive a quantifier-free proposition from an existentially quantified proposition. Formally, if we know that ∃x P(x) is true, then we can introduce a new constant c such that P(c) is true.
Rule form:
Notes:
- The constant c must be a new symbol, i.e., it has not appeared before in the current inference process.
Example: Suppose we know ∃x (x > 0), then we can introduce a new constant c such that c > 0.
Existential Introduction
The existential introduction rule allows us to derive an existentially quantified proposition from a specific proposition. Formally, if we know P(c) is true, then we can derive ∃x P(x).
Rule form:
Notes:
- The constant c can be any constant, not necessarily a new symbol.
Example: Suppose we know c > 0, then we can derive ∃x (x > 0).
Universal Elimination
The universal elimination rule allows us to derive a specific proposition from a universally quantified proposition. Formally, if we know ∀x P(x) is true, then for any object a, P(a) is also true.
Rule form:
Notes:
- The object a can be any object, including variables, constants, or function terms.
Example: Suppose we know ∀x (x ≥ 0), then for any a, we can derive a ≥ 0.
Universal Introduction
The universal introduction rule allows us to derive a universally quantified proposition from a specific proposition. Formally, if for any object a, P(a) is true, then we can derive ∀x P(x).
Rule form:
Notes:
- The object a must be arbitrary, meaning it cannot have any specific properties or restrictions in the inference process.
Example: Suppose we can prove that for any a, a² ≥ 0, then we can derive ∀x (x² ≥ 0).



Additional Premise Introduction

Sets



The empty set explicitly written in a set can be treated as just a symbol.
Set Operations

Inclusion-Exclusion Principle

Set Identities



Binary Relations

The Cartesian product does not satisfy the commutative property.


Binary Relations


Operations on Relations


Properties of Relations

What is the transitive closure of ?
Given the relation , we need to find its transitive closure. The transitive closure is obtained by adding all relation pairs that can be derived through transitivity, making the relation transitive.
The transitive closure R⁺ is defined as: if (x, y) ∈ R⁺ and (y, z) ∈ R⁺, then (x, z) ∈ R⁺.
First, the elements in the original relation R are:
Next, check for relation pairs obtainable through transitivity:
- (a, b) ∈ R and (b, c) ∈ R, so by transitivity (a, c) must also be in the transitive closure.
Therefore, the transitive closure R⁺ is:
So, the transitive closure of relation is:
Let set A have 3 elements. The number of equivalence relations that can be defined on A is ( ).
An equivalence relation partitions a set into several disjoint subsets. The number of equivalence relations equals the number of all possible partitions of set A, known as the Bell number.
For set , calculate its Bell number.
We examine all possible partitions of set in order:
- One subset:
- Two subsets: , ,
- Three subsets:
The specific calculation method is as follows:
- B₁ = 1 (a set with 1 element has only one partition)
- B₂ = 2 (a set with 2 elements has two partitions: one set or two singleton sets)
- B₃ is what needs to be calculated.
Using the Bell number recurrence formula:
Specifically calculating B₃:
Calculation process:
Therefore, the number of equivalence relations that can be defined on set A is 5.
Answer: 5
In mathematics, ceiling and floor functions use different symbols.
-
Ceiling function:
- Symbol: ⌈x⌉
- Meaning: Rounds the value x up to the nearest integer. If x is already an integer, the result is x itself. For example: ⌈3.2⌉ = 4, ⌈-2.7⌉ = -2.
-
Floor function:
- Symbol: ⌊x⌋
- Meaning: Rounds the value x down to the nearest integer. If x is already an integer, the result is x itself. For example: ⌊3.8⌋ = 3, ⌊-2.3⌋ = -3.
These two symbols are used to represent rounding up or down and are widely used in mathematics and computer science.





Note
Maxima and minima are searched within the given set.
Bounds are searched within the entire Hasse diagram.
Incomparable elements do not have maxima/minima, but may have maximal/minimal elements.
Both concepts include "greater than or equal to" and "less than or equal to" — never forget "equal to."
Functions


Graphs
Handshaking Theorem

Degree Sum Theorem
First, we need to understand some basic concepts:
- Degree of a vertex: The degree of a vertex is the number of edges connected to that vertex.
- Degree sum of a graph: The sum of the degrees of all vertices in a graph equals twice the number of edges in the graph.
The degree sum theorem can be stated as:
where deg(v) represents the degree of vertex v, V is the vertex set, and E is the edge set.
Properties of Odd and Even Numbers
- Odd plus odd equals even.
- Odd plus even equals odd.
- Even plus even equals even.
Proving the Number of Odd-Degree Vertices Is Even
According to the degree sum theorem, the sum of all vertex degrees in a graph is an even number 2|E|.
Now, consider dividing all vertex degrees into two categories: odd-degree vertices and even-degree vertices.
Let the graph have k odd-degree vertices. Since the sum of degrees of even-degree vertices is obviously even, we can use S_odd and S_even to denote the sum of degrees of odd-degree and even-degree vertices respectively. Then:
where S_even is even (because the sum of an even number of even numbers is even), and 2|E| is also even.
Therefore, S_odd must also be even, because even minus even is still even.
Considering that the sum of odd numbers is odd only when an odd number of odd numbers are added, and even when an even number of odd numbers are added, S_odd being even means the number of odd-degree vertices k must be even.
Conclusion
The number of odd-degree vertices in any graph is always even. This is because the sum of all vertex degrees in a graph is even, and only the sum of an even number of odd numbers is even, so an odd number of odd numbers cannot sum to an even number.
Degree Sequence

Method to Determine if a Sequence Can Be a Degree Sequence
The total degree must be even.
The number of odd-degree vertices must be even.
The maximum degree must be less than n-1; in a simple undirected graph, a vertex can be connected to at most n-1 other vertices.
Complete Undirected Graph

Connectivity
If there exists a path from u to v, then u is reachable from v. Note that the existence of a path is sufficient.

Matrix Representation of Undirected Graphs
The number of rows equals the number of vertices, and the number of columns equals the number of edges.

Matrix Representation of Directed Graphs

Adjacency Matrix
Mathematical Induction
Steps of Mathematical Induction
-
Base Step:
- Prove that the proposition holds for the first value (usually n=1).
-
Inductive Step:
- Assume the proposition holds for some value k, i.e., assume the proposition is true for n=k.
- Under this assumption, prove that the proposition also holds for n=k+1.
If both steps are completed, then by mathematical induction, the proposition holds for all positive integers n.
Summary of Problem-Solving Steps
- Base Step: Verify whether the proposition holds when n=1.
- Inductive Hypothesis: Assume the proposition holds when n=k.
- Inductive Step: Under the inductive hypothesis, prove that the proposition also holds when n=k+1.
Example: Prove 1 + 2 + 3 + ... + n = n(n+1)/2
Base Step
We first prove that the proposition holds when n=1.
Left side: 1
Right side: 1(1+1)/2 = 2/2 = 1
The left side equals the right side, so the proposition holds when n=1.
Inductive Step
Assume the proposition holds when n=k, i.e., assume:
Under this assumption, we need to prove that the proposition also holds when n=k+1. That is, we need to prove:
By the inductive hypothesis, the left side can be written as:
Let's simplify the right side: