The Basic Formal Logic (1)

    Mar 24, 2023

    Here are some basic mathematical logic definitions, theorems, and other notes.

    Proposition

    Generally speaking, a proposition is typically composed of a declarative sentence expressing a judgment. Propositions are classified into true and false propositions. Propositions can often be assigned to a symbol for expression, such as p,q,rp, q, r, where these symbols are called propositional variables. A simple proposition is the most basic form of a proposition that cannot be divided into sub-propositions.

    For convenience in operations, the truth or falsity of a proposition is represented using binary values p=0p=0 and p=1p=1, where they respectively indicate false and true propositions.

    Connectives

    These connectives are basic tools in formal logic, used to construct and analyze complex logical expressions that describe the combination of propositions.

    • Negation (Not), denoted as ¬\neg
    • Conjunction (And), denoted as \land
    • Disjunction (Or), denoted as \lor
    • Conditional (Implies, ImpliedBy), denoted as     \implies and     \impliedby
    • Biconditional (If and only if), denoted as     \iff

    Multiple simple propositions are combined into compound propositions using these connectives. The precedence of these connectives decreases from top to bottom.

    Their truth table is as follows:

    pq¬ppqpqp    qp    q0010011011011010001001101111\begin{array}{|c|c|c|c|c|c|c|} \hline p & q & \neg p & p \land q & p \lor q & p \implies q & p \iff q \\ \hline 0 & 0 & 1 & 0 & 0 & 1 & 1 \\ \hline 0 & 1 & 1 & 0 & 1 & 1 & 0 \\ \hline 1 & 0 & 0 & 0 & 1 & 0 & 0 \\ \hline 1 & 1 & 0 & 1 & 1 & 1 & 1 \\ \hline \end{array}

    Well-formed Formulas (WFF)

    1. A single propositional variable is a well-formed formula (WFF), also called an atomic proposition.
    2. If AA is a WFF, then (¬A)(\neg A) is a WFF.
    3. If AA and BB are WFFs, then (AB)(A \land B), (AB)(A \lor B), (A    B)(A \implies B), and (A    B)(A \iff B) are WFFs.
    4. A string of symbols formed by applying (1)~(3) a finite number of times is a WFF.

    WFFs are also called propositional formulas, or simply formulas. They are often represented as f(p1,p2,...,pn)f(p_{1}, p_{2}, ..., p_{n}).

    Formula Levels

    1. If the formula A=f(p)A = f(p) is a single propositional variable, then AA is called a level-0 formula.

    2. A formula AA is called a level-(n+1)(n+1) formula (for n0n \geq 0) if one of the following holds:

      • (a) A=¬BA = \neg B, where BB is a level-nn formula;
      • (b) A=BCA = B \land C, where BB and CC are formulas of levels ii and jj, and n=max(i,j)n = \max(i,j);
      • (c) A=BCA = B \lor C, where the levels of BB and CC and nn are as in (b);
      • (d) A=B    CA = B \implies C, where the levels of BB and CC and nn are as in (b);
      • (e) A=B    CA = B \iff C, where the levels of BB and CC are as in (b).
    3. If the level of formula AA is kk, then AA is called a level-kk formula.

    4. The formula f(p1,p2,...,pn)f(p_{1}, p_{2}, ..., p_{n}) is used to express a formula of level nn.

    Tautologies and Contradictions

    If pi{0,1}\forall p_{i} \in \{0,1\}, A=f(p1,p2,...,pn)1A = f(p_{1}, p_{2}, ..., p_{n}) \equiv 1, then AA is called a tautology, or a logically valid formula. Conversely, if pi{0,1}\forall p_{i} \in \{0,1\}, A=f(p1,p2,...,pn)0A = f(p_{1}, p_{2}, ..., p_{n}) \equiv 0, then AA is called a contradiction.

    If a formula is not a contradiction, it is also called a satisfiable formula.

    Dummy Variables

    A dummy variable (also known as a neutral element) refers to a special element that, under a certain operation, does not change the value of other elements.

    If the value of formula A=f(p1,p2,...,pn)A = f(p_{1}, p_{2}, ..., p_{n}) depends only on certain variables pi1,pi2,...,pinp_{i1}, p_{i2}, ..., p_{in}, then the remaining variables {iZ,i[1,n]{pi1,pi2,,pin}}\{i \in Z^{*}, i \in [1,n] \setminus \{p_{i_1}, p_{i_2}, \dots, p_{in}\}\} are called dummy variables. Changing the dummy variables does not affect the value of the formula.

    For example, in pq1p \land q \equiv 1, where q=1q = 1, the formula is always true regardless of the value of pp, making pp a dummy variable.

    Formula Equivalence

    If two formulas have the same number of variables and the same truth table (or logical behavior), then these two formulas are equivalent. In other words, if i{0,1,2,...,n}\forall i \in \{0,1,2,...,n\}, pi=qip_{i} = q_{i}, and f(p1,p2,...,pn)=g(q1,q2,...,qn)f(p_{1}, p_{2}, ..., p_{n}) = g(q_{1}, q_{2}, ..., q_{n}), then fgf \equiv g, and we can say that ff and gg are logically equivalent.

    Logical Equivalence Calculus

    Let formulas AA and BB share the same propositional variables, and AA or BB may contain dummy variables. If AA and BB have the same truth table, then A    BA \iff B is a tautology. This indicates that AA and BB are logically equivalent, denoted as A    BA \iff B.

    Below are some common identities, which can be used to perform more complex logical operations.

    Equivalence Identities

    1.1 Double Negation

    A    ¬¬AA \iff \neg \neg A

    1.2 Idempotent Laws

    AA    A,AA    AA \lor A \iff A, \quad A \land A \iff A

    1.3 Commutative Laws

    AB    BA,AB    BAA \lor B \iff B \lor A, \quad A \land B \iff B \land A

    1.4 Associative Laws

    (AB)C    A(BC),(AB)C    A(BC)(A \lor B) \lor C \iff A \lor (B \lor C),\\ (A \land B) \land C \iff A \land (B \land C)

    1.5 Distributive Laws

    A(BC)    (AB)(AC)A \lor (B \land C) \iff (A \lor B) \land (A \lor C)

    (Distributivity of \lor over \land)

    A(BC)    (AB)(AC)A \land (B \lor C) \iff (A \land B) \lor (A \land C)

    (Distributivity of \land over \lor)

    1.6 De Morgan's Laws

    ¬(AB)    ¬A¬B,¬(AB)    ¬A¬B\neg (A \lor B) \iff \neg A \land \neg B, \\ \neg (A \land B) \iff \neg A \lor \neg B

    1.7 Absorption Laws

    A(AB)    A,A(AB)    AA \lor (A \land B) \iff A, \\ A \land (A \lor B) \iff A

    1.8 Zero Laws

    A1    1,A0    0A \lor 1 \iff 1, \\ A \land 0 \iff 0

    1.9 Identity Laws

    A0    A,A1    AA \lor 0 \iff A, \\ A \land 1 \iff A

    1.10 Law of the Excluded Middle

    A¬A    1A \lor \neg A \iff 1

    1.11 Law of Non-Contradiction

    A¬A    0A \land \neg A \iff 0

    1.12 Implication Identity

    AB    ¬ABA \rightarrow B \iff \neg A \lor B

    1.13 Biconditional Identity

    AB    (AB)(BA)A \leftrightarrow B \iff (A \rightarrow B) \land (B \rightarrow A)

    1.14 Contrapositive

    AB    ¬B¬AA \rightarrow B \iff \neg B \rightarrow \neg A

    1.15 Biconditional Negation

    AB    ¬A¬BA \leftrightarrow B \iff \neg A \leftrightarrow \neg B

    1.16 Reductio ad Absurdum

    (AB)(A¬B)    ¬A(A \rightarrow B) \land (A \rightarrow \neg B) \iff \neg A

    The 16 equivalence identities presented above contain 24 important equivalences. The variables AA, BB, and CC in the equivalence patterns can be replaced by any propositional formulas, resulting in infinitely many specific equivalences of the same type.

    These are typical examples of equivalences derived from truth tables and form the foundational formulas of logical operations.