23.1 Introduction

At first sight, logic can be confusing. A lot of this is because it can be quite abstract (well, at least it can feel abstract compared to things such as algebra 11 1 Not abstract algebra!). The key thing (in my view) to understand is that logic is well-defined; there is a strict set of rules according to which logical expressions can be manipulated, much like there is with "normal" algebra.

For example, consider this well-known fact about any xx\in\mathbb{R} and addition

x+0=xx+0=x (23.1)

There are some analogous rules for logical expressions. However, instead of a whole series of numbers, in logic every value is in the set 𝔹={T,F}\mathbb{B}=\{T,F\} - i.e. it is either \saytrue or \sayfalse. We can define an "operator" (i.e. something which takes two values and outputs a new one, just like the familiar addition operator). For example, let us create a new operator \land. We can define the result of ABA\land B by considering what happens in every case

  • If both values are true, i.e. TTT\land T, then the output is also true.

  • If one value is true and the other is false, i.e. TFT\land F or FTF\land T then the output is false.

  • In the other case (i.e. FFF\land F) then the output is false.

Based on this definition (which corresponds to a logical operator known as \saylogical and, so named because the output is true whenever both inputs are TT and false in every other case) we can determine a similar relationship. Specifically,

TAAT\land A\equiv A (23.2)

Hopefully this makes intuitive sense, but first we need to define AA! It’s a variable, just like xx was above - i.e. it can be anything we want, so long as it is a boolean (whereas xx can be anything we want, so long as it is a real number). If AA is true, then as TT=TT\land T=T TA=AT\land A=A in this case, and if AA is false, then as TF=FT\land F=F for this case TA=AT\land A=A.

This is logic which is generally useful in other areas of mathematics.