Complex formulas
We are now in the position to give truth-values to our more complex formulas, based on the values of the atomic formulas. Again, everything is relativized to a certain structure, since that is how we can assign truth-values to the atomic ones.
In particular, this is done by invoking the concept of a truth-function. A truth-function is just a function that takes one or more truth-values, and outputs a single truth-value. The meaning of our connectives are truth-functions in this sense. They operate on the values of their constituent formulas, and output another truth-value.
There are several ways to formulate this idea. First, one may specify these truth-values in terms of truth () and falsity (), and a function for any formula , , like this:
-
if, and only if, ;
-
if, and only if, and ;
-
if, and only if, or (or both);
-
if, and only if, if , then .
Now usually, these are represented in truth-tables, which are really just tables representing the above truth-function, , by listing all its input-output pairs one by one. In particular:
You should read these as follows: in any structure , if is true in and is true in , then is true in . If is true in and is false in , then is is false in , and so on, for each line of each truth-table.
There are other ways to specify these same truth-functions. One is to arithmetize the relation between the input(s) and the output using for true and for false. This looks nice for some connectives, but less nice for others. Thus:
-
;
-
;
-
;
-
.
Remark 4.1. In the above, means the function that outputs the minimum value of two values, and is the function that outputs the maximum value of two values. In terms of this, the meaning of our connectives is simple, since the value of is just the maximum function on and , and the value of the minimum. However, as demonstrated, you do not need to invoke these functions to define .
We can check if the four tables in Figure 4.2 match our tables in Figure 4.1 by computing the right side with our equations. And indeed, they do match!
Finally, we can put the above ideas in line with our previous results, and specify it as such:
-
if, and only if, ;
-
if, and only if, and ;
-
if, and only if, or (or both);
-
if, and only if, if , then .
Here is some helpful information as to how to read the above specifications. On the left hand side of the โif, and only ifโ connective, you always find more complex formulas, while on the right hand side, you always find less complex formulas. Reading from left to right, you can determine what the truth-value of the less complex formula must be if the more complex formula is true. For example, must be false in a structure if is true in that structure. Reading from right to left, you can determine the value of the more complex formula if the conditions on the right side hold for less complex ones. So if and are both true in , will also be true.
It is important that these specifications allow one to determine both truth and falsity for any complex formula depending on the truth or falsity of some simpler formulas, and vice versa, though this may not be apparent at first.
Suppose , i.e., it is false in . Now it is specified what simpler formulas need to be true in order for to be true. So how do we determine what needs to happen for it to be false in ? Well, all we have to do is negate the right hand side, and see whatโs left. In particular:
if, and only if, it is not the case that [ or (or both)].
Now this states that if neither nor is true in , since all three other possibilities would make it true. And indeed, this is just what the truth-table says!
Similarly, but from the other way around, suppose and . Well, since if, and only if, and , we have:
if, and only if, it is not the case that [ and ].
If it is not the case that [ and ], then either or or both are false in . So in particular, if and , then .
One way to think about this is by simply noting that is just the negation of . So if the definition specifies when something is modeled, then it will not be modeled precisely when that specification is not met. That is, once the left side of the biconditional is negated, the right side needs to be too. This is very much akin to multiplying by in an equation. It is a very fundamental fact that goes for every biconditional; if you negate both sides of a true biconditional, you get a true biconditional.
From now on, we will be using this type of specification to talk about the values of complex formulas. At times, we may refer back to truth-tables as a helpful reference for those who already know how truth-tables work. Donโt worry if you are not familar with truth-tables. They do not give any more information than what can already be found in our style of specification.
Computing with complex formulas
Letโs turn back the wheel of time to the beginning of this book, where we specified the language of arithmetic expressions . You may remember how we emphasized that the syntactic trees for those expressions give you an order of computation, based on how the parentheses are configured in the formula. If you forgot, go back to Part 1 to refresh your memory. In fact, the situation is the same with the expressions of , except instead of , and , we have our connectives, and instead of numbers, we have atomic formulas which themselves require computation. And formulas are either true or false. But itโs the same.
Once again, take a structure with the domain , and an interpretation function such that:
-
, , ;
-
-
;
-
;
-
.
-
We already know a bunch about what truth-values various formulas get in the structure . Now, we can go on to talk about the values of more complex formulas, built out of our connectives.
Suppose you want to find out whether is true in . Letโs quickly draw up a syntax tree for this formula:
As with the example regarding , we start from the leaves of our tree (remember that it is upside down). Now in general, you would first have to compute whether , , and are true in , but we will not revisit this issue, since this was already done above.
We had the following facts:
-
;
-
;
-
.
We can substitute these values for the relevant formulas in our tree. Thus:
Now given how the connective was defined above, we can compute from the value , since if , even if . So we have:
Substituting again, we have: Invoking the rule for the connective , we get as the final value, so
Note that this is a handy way to compute the values of formulas, but you should not confuse things like for formulas of the language, since they are not. In general, what we are doing in this computation is systematically replacing our formulas with their values in . In other words, it is just a compact representation of something more verbose (see immediately below).
There are several ways of going about computing the values of formulas. In presentation, it may look something like this:
Take the formula . By our previous results, , , and . By definition of , , since . Then, by definition of , , since , and . This is what we wanted to show.
In fact, if you really want to go wild, you can use the equations above, and produce something like this:
Now , , so we get , which is , which we subtract from , which gets us , which we multiply by to get . Or true.
This is not a thing we will be doing going further.
Exercise 4.7. Take the structure exactly as specified above. Determine the truth-value of the following formula, giving a detailed explanation, including how the atomic formulas get their truth-value.
Remark 4.2. In this exercise, you are essentially asked to combine two types of explanations, from the values of predicates and constants to the values of atomic formulas, and then from values of formulas to values of formulas. The latter was just demonstrated. For the former, some proofs were already provided, and some make up Exercise 4.3.
Computing from formulas up
We do not always have to consider how exactly the atomic formulas are specified in each case. Instead, we can talk more abstractly about assigning some truth-value to some specific formula of the language, and some other truth-value to some specific formula of the language (and so on), and then see what truth-values one gets in a structure if we combine them in various ways. Indeed, doing this is equivalent to doing propositional or sentential logic, and specifically, drawing up more general truth-tables. Again, this you may already be familiar with.
For example, suppose is any formula, and is any formula, and consider the formula . We do not know what these variables stand for (other than that they are formulas), so we cannot specify an exact structure for them, in which they may be true or false. But what we can do is assume that there is a certain structure in which, say is true and is false, and then consider whether is true or false as a result in a structure.
Actually, what we are considering here is not just one structure but many; all those in which is true and is false (for each possible choice of formula for the variables and ). But by abstracting away from the specifics, we do not need to worry about this.
Now the question is: is true if is true and is false in a structure? You might already see that in such a case, is, in fact, true. Here is how it would go:
Suppose there is a structure such that but . By the above definition, provided , so . Then, again, by definition, , provided and , which we already know, so
This reasoning is the exact same as the following vertical fragment of a generalized truth-table:
Exercise 4.8. Determine the truth-value and construct detailed explanations (as opposed to truth-tables) for the following formulas, assuming , , and :
-
;
-
;
-
;
-
;
-
;
-
.
Putting it all together
We are now in the position to formulate our whole semantics in one fell swoop. This is usually done in more advanced works at the very beginning (or not at all). You shall now be able to read those definitions with confidence.
Definition 4.6. A structure is a pair , where is any set, and is a function from the constants and predicates of (i.e., ) such that:
-
if is any constant of , , and;
-
if is any predicate of arity of , , where .
For any formulas of :
-
if is of form , if, and only if, ;
-
if is of form , if, and only if, ;
-
if is of form , if, and only if, and ;
-
if is of form , if, and only if, or (or both);
-
if is of form , if , then .
If , we say models , or is a model of . Alternatively, we say is true in .
Congratulations, this concludes the semantics of .