15. Rules of Inference

15.1 Definition: rule of inference

Let $P_{1}, P_{2}, \ldots P_{n}$ and $Q$ be predicates. An expression of the form

$$P_{1},\ldots,P_{n}\vdash Q$$

is a rule of inference. Such a rule of inference is valid if whenever $P_{1}$, $P_{2}\ldots$ and $P_{n}$ are all true then $Q$ must be true as well.

15.1.1 Example If you are in the middle of proving something and you discover that $P \wedge Q$ is true, then you are entitled to conclude that (for example) $P$ is true, if that will help you proceed with your proof. Hence

$$P \wedge Q \vdash P \tag{15.1}$$

is a valid rule of inference.

That is not true for ‘$\vee$’, for example: If $P \vee Q$ is true, you know that at least one of $P$ and $Q$ are true, but you don’t know which one. Thus the purported rule of inference “$P \vee Q \vdash P$” is invalid.

15.1.2 Usage The symbol ‘$\vdash$’ is called the “turnstile”. In this context, it can be read “yields”.

15.1.3 Example The basic rules of inference for “or” are

$$P \vdash P \vee Q \quad\text{and}\quad Q \vdash P \vee Q \tag{15.2}$$

These say that if you know $P$, you know $P \vee Q$, and if you know $Q$, you know $P \vee Q$.

15.1.4 Example Another rule of inference for “and” is

$$P,Q \vdash P \wedge Q \tag{15.3}$$

15.1.5 Exercise Give at least two nontrivial rules of inference for XOR. The rules should involve only propositional variables and XOR and other logical connectives.

15.1.6 Exercise Same instructions as for Exercise 15.1.5 for each of the connectives defined by these truth tables:

$$\begin{array}{ccc c ccc c ccc} P & Q & P*Q & & P & Q & P\ \text{NAND}\ Q & & P & Q & P\ \text{NOR}\ Q \\ \cline{1-3}\cline{5-7}\cline{9-11} \text{T} & \text{T} & \text{F} & & \text{T} & \text{T} & \text{F} & & \text{T} & \text{T} & \text{F} \\ \text{T} & \text{F} & \text{F} & & \text{T} & \text{F} & \text{T} & & \text{T} & \text{F} & \text{F} \\ \text{F} & \text{T} & \text{T} & & \text{F} & \text{T} & \text{T} & & \text{F} & \text{T} & \text{F} \\ \text{F} & \text{F} & \text{F} & & \text{F} & \text{F} & \text{T} & & \text{F} & \text{F} & \text{T} \\ & \text{(a)} & & & & \text{(b)} & & & & \text{(c)} & \end{array}$$

15.2 Definitions and Theorems give rules of inference

What Method 3.1.1 (page 4) says informally can be stated more formally this way: Every definition gives a rule of inference.

Similarly, any Theorem gives a rule of inference.

15.2.1 Example The rule of inference corresponding to Definition 4.1, page 4, is that for $m, n$ and $q$ integers,

$$m =qn \vdash n|m$$

One point which is important in this example is that it must be clear in the rule of inference what the types of the variables are. In this case, we required that the variables be of type integer. Although $14=(7/2)\times 4$, you cannot conclude that $4|14$, because $7/2$ is not an integer.

15.2.2 Worked Exercise State Theorem 5.4, page 8, as a rule of inference. Answer $k|m, k|n \vdash k|m+n$.

15.2.3 Exercise (discussion) What is the truth table for the English word “but”?

Pages 24–25 of the book (PDF).