1  Well-formed formulas

Lecture 1 deals with the basic syntax of propositional logic. We define expressions called well-formed formulas, in two equivalent ways:

  1. Inductively, by listing all the ways to introduce such expressions.
  2. As a subset of a larger set of more general expressions.

1.1 Inductively

Definition 1.1 (Well-formed formulas) Well-formed formulas are defined inductively as follows:

  • We have so-called basic propositions \(P_0, P_1, P_2, \ldots\) and these are well-formed formulas.
  • If \(F\) and \(F'\) are well-formed formulas and \(\diamond\) is one of the symbols \(\Rightarrow\), \(\wedge\), \(\vee\), then \(F \diamond F'\) is a well-formed formula.
  • If \(F\) is a well-formed formula, then \(\neg F\) is a well-formed formula.

We will write \(F : \mathrm{Wff}\) to say that \(F\) is a well-formed formula. The above definition makes the functions \(P : \mathbb{N} \to \mathrm{Wff}\), \((\Rightarrow)\), \((\wedge)\) and \((\vee) : \mathrm{Wff} \times \mathrm{Wff} \to \mathrm{Wff}\) constructors for well-formed formulas. For instance, \((\Rightarrow) (F, F') := F \Rightarrow F'\). Note that the codomain of such a constructor is always \(\mathrm{Wff}\).

Remarks.

  • Here we have used Haskell syntax to distinguish between infix notation such as \(F \Rightarrow F'\) and prefix notation such as \((\Rightarrow) (F, F')\). This is just for convenience, but it also helps us realize that we need to use a different piece of notation for each syntax.
  • During the lecture, we also discussed informally the tree representation of a well-formed formula, as well as associativity rules for the binary constructors: by convention, \(F \Rightarrow F' \Rightarrow F''\) is parsed as \(F \Rightarrow (F' \Rightarrow F'')\), and is thus a well-formed formula, different from \((F \Rightarrow F') \Rightarrow F''\).
  • Similarly, an expression such as \(P_1 \wedge P_2 \vee P_3\) shoulb be parsed as \((P_1 \wedge P_2) \vee P_3\), not \(P_1 \wedge (P_2 \vee P_3)\) because, by convention, the binary operator \(\wedge\) has higher precedence than \(\vee\).

We can choose to add one more constructor \((\Leftrightarrow) : \mathrm{Wff} \times \mathrm{Wff} \to \mathrm{Wff}\). This simply says that if \(F\) and \(F'\) are well-formed formulas, then \(F \Leftrightarrow F'\) is a well-formed formula. At this stage, there is no relation between the well-formed formulas \(F \Leftrightarrow F'\) and \((F \Rightarrow F') \wedge (F' \Rightarrow F)\).

Note that our basic propositions are indexed by the natural numbers (the corresponding constructor is \(P : \mathbb{N} \to \mathrm{Wff}\)) but that \(\mathbb{N}\) could be replaced by an arbitrary set \(\text{atoms}\), possibly a finite one.

1.2 As a subset

Given a set of basic propositions \(\mathcal{B} := \{ P_0, P_1, P_2, \ldots \}\) and a set of logical connectives \(\mathcal{C} := \{\Rightarrow, \wedge, \vee, \Leftrightarrow, \neg\}\), we form the set \(\mathcal{V} := \mathcal{B} \cup \mathcal{C} \cup \{(\ , )\}\), called an alphabet, and the set \[ \mathcal{V}^* := \mathcal{V}^0 \cup \mathcal{V}^1 \cup \mathcal{V}^2 \cup \ldots \]

of lists of elements of \(\mathcal{V}\). Here, for all natural number \(n\), the set \(\mathcal{V}^n\) is the set of lists of elements of \(\mathcal{V}\) that have length \(n\). In particular, the set \(\mathcal{V}^0\) is a singleton, containing only the empty list: \(\mathcal{V}_0 = \{ [\ ] \}\). The set \(\mathcal{V}^*\) contains lists such as \((P_0 \Rightarrow \neg P_1)\), but also \(P_3 )) \Rightarrow \neg\), which is not an expression we want to include in our definition of a well-formed formula.

Definition 1.2 (Propositional formulas) We define the set \(\mathcal{F}(\mathcal{V})\) of propositional formulas based on the alphabet \(\mathcal{V}\) as the smallest subset \(\mathcal{W} \subset \mathcal{V}^*\) satisfying the following properties:

  1. \(\mathcal{B} \subset \mathcal{W}\).
  2. If \(F \in \mathcal{W}\) and \(F' \in\mathcal{W}\), then, for all \(\diamond \in \{\Rightarrow, \wedge, \vee, \Leftrightarrow \}\), \((F \diamond F') \in \mathcal{W}\).
  3. If \(F \in \mathcal{W}\) then \((\neg F) \in \mathcal{W}\).

Explicitly: \[ \mathcal{F}(\mathcal{V}) := \bigcap_{\mathcal{W} \subset \mathcal{V}^*\ |\ \mathcal{W}\ \text{satisfies 1, 2, 3}\ } \mathcal{W} \]

Note that \(\mathcal{V}^*\) satisfies Conditions 1, 2, 3, so the set \(\{ \mathcal{W} \subset \mathcal{V}^*\ |\ \mathcal{W}\ \text{satisfies 1, 2, 3} \}\) is non-empty. Moreover, \(\mathcal{B} \subset \mathcal{F}(\mathcal{V})\), so \(\mathcal{F}(\mathcal{V}) \not= \emptyset\).

Also note that the empty list \([\ ]\) (which is an element of \(\mathcal{V}^*\)) is not an element of \(\mathcal{F}(\mathcal{V})\). If it were, then \(\mathcal{F}(\mathcal{V}) \setminus \{[\ ]\}\) would also satisfy Conditions 1, 2 and 3 above, contradicting the minimality of \(\mathcal{F}(\mathcal{V})\).

1.3 Equivalence of the two constructions

We claim without proof that \(\mathcal{F}(\mathcal{V}) = \mathrm{Wff}\) as subsets of \(\mathcal{V}^*\), or more accurately that there exists a bijection between these two sets (because \(\mathrm{Wff}\) is not really a subset of \(\mathcal{V}^*\)).