"

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 (TT) and falsity (FF), and a function v:๐–ฅ๐–ฎ๐–ฑ๐–ฌโ„’0โ†’{T,F}v: \mathsf{FORM}_{\mathcal{L}_0} \to \{T, F\} for any formula XX, YY, like this:

  1. v(ยฌX)=Tv(\neg X)=T if, and only if, v(X)=Fv(X)=F;

  2. v(XโˆงY)=Tv(X \wedge Y)=T if, and only if, v(X)=Tv(X)=T and v(Y)=Tv(Y)=T;

  3. v(XโˆจY)=Tv(X \vee Y)=T if, and only if, v(X)=Tv(X)=T or v(Y)=Tv(Y)=T (or both);

  4. v(Xโ†’Y)=Tv(X \rightarrow Y)=T if, and only if, if v(X)=Tv(X)=T, then v(Y)=Tv(Y)=T.

Now usually, these are represented in truth-tables, which are really just tables representing the above truth-function, vv, by listing all its input-output pairs one by one. In particular:

XX YY XโˆงYX \wedge Y
TT TT TT
TT FF FF
FF TT FF
FF FF FF
Truth-table for
XX YY XโˆจYX \vee Y
TT TT TT
TT FF TT
FF TT TT
FF FF FF
Truth-table for
XX YY Xโ†’YX \rightarrow Y
TT TT TT
TT FF FF
FF TT TT
FF FF TT
Truth-table for
XX ยฌX\neg X
TT FF
FF TT
Truth-table for ¬

You should read these as follows: in any structure ๐’\mathbf{S}, if XX is true in ๐’\mathbf{S} and YY is true in ๐’\mathbf{S}, then XโˆงYX \wedge Y is true in ๐’\mathbf{S}. If XX is true in ๐’\mathbf{S} and YY is false in ๐’\mathbf{S}, then XโˆงYX \wedge Y is is false in ๐’\mathbf{S}, 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 11 for true and 00 for false. This looks nice for some connectives, but less nice for others. Thus:

  1. vโ€ฒ(ยฌX)=1โˆ’vโ€ฒ(X)v'(\neg X)=1-v'(X);

  2. vโ€ฒ(XโˆงY)=vโ€ฒ(X)ร—vโ€ฒ(Y)=MAX(vโ€ฒ(X),vโ€ฒ(Y))v'(X \wedge Y)=v'(X)\times v'(Y)=\text{MAX}(v'(X),v'(Y));

  3. vโ€ฒ(XโˆจY)=1โˆ’((1โˆ’vโ€ฒ(X))ร—(1โˆ’vโ€ฒ(Y)))=MIN(vโ€ฒ(X),vโ€ฒ(Y))v'(X \vee Y)=1-((1-v'(X)) \times (1-v'(Y)))=\text{MIN}(v'(X), v'(Y));

  4. vโ€ฒ(Xโ†’Y)=1โˆ’(vโ€ฒ(X)ร—(1โˆ’vโ€ฒ(Y))v'(X \rightarrow Y)=1 – (v'(X) \times (1-v'(Y)).

Remark 4.1. In the above, MIN\text{MIN} means the function that outputs the minimum value of two values, and MAX\text{MAX} 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 โˆง\wedge is just the maximum function on 11 and 00, and the value of โˆจ\vee the minimum. However, as demonstrated, you do not need to invoke these functions to define vโ€ฒv'.

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!

XX YY XโˆงYX \wedge Y
11 11 1ร—1=11\times 1=1
11 00 1ร—0=01 \times 0=0
00 11 0ร—1=00 \times 1=0
00 00 0ร—0=00\times 0=0
Truth-table for
XX YY XโˆจYX \vee Y
11 11 1โˆ’((1โˆ’1)ร—(1โˆ’1))=11-((1-1) \times (1-1))=1
11 00 1โˆ’((1โˆ’1)ร—(1โˆ’0))=11-((1-1) \times (1-0))=1
00 11 1โˆ’((1โˆ’0)ร—(1โˆ’1))=11-((1-0) \times (1-1))=1
00 00 1โˆ’((1โˆ’0)ร—(1โˆ’0))=01-((1-0) \times (1-0))=0
Truth-table for
XX YY Xโ†’YX \rightarrow Y
11 11 1โˆ’(1ร—(1โˆ’1))=11-(1 \times (1-1))=1
11 00 1โˆ’(1ร—(1โˆ’0))=01-(1 \times (1-0))=0
00 11 1โˆ’(0ร—(1โˆ’1))=11-(0 \times (1-1))=1
00 00 1โˆ’(0ร—(1โˆ’0))=11-(0 \times (1-0))=1
Truth-table for
XX ยฌX\neg X
11 1โˆ’1=01-1=0
00 1โˆ’0=11-0=1
Truth-table for ¬

Finally, we can put the above ideas in line with our previous results, and specify it as such:

  1. ๐’โŠจยฌX\mathbf{S} \models \neg X if, and only if, ๐’โŠจฬธX\mathbf{S} \not\models X;

  2. ๐’โŠจ(XโˆงY)\mathbf{S} \models (X \wedge Y) if, and only if, ๐’โŠจX\mathbf{S} \models X and ๐’โŠจY\mathbf{S}\models Y;

  3. ๐’โŠจ(XโˆจY)\mathbf{S} \models (X \vee Y) if, and only if, ๐’โŠจX\mathbf{S} \models X or ๐’โŠจY\mathbf{S}\models Y (or both);

  4. ๐’โŠจ(Xโ†’Y)\mathbf{S} \models (X \rightarrow Y) if, and only if, if ๐’โŠจX\mathbf{S} \models X, then ๐’โŠจY\mathbf{S} \models Y.

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, XX must be false in a structure if ยฌX\neg X 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 XX and YY are both true in ๐’\mathbf{S}, XโˆงYX \wedge Y 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 ๐’โŠจฬธXโˆจY\mathbf{S} \not\models X \vee Y, i.e., it is false in ๐’\mathbf{S}. Now it is specified what simpler formulas need to be true in order for XโˆจYX \vee Y to be true. So how do we determine what needs to happen for it to be false in ๐’\mathbf{S}? Well, all we have to do is negate the right hand side, and see whatโ€™s left. In particular:

๐’โŠจฬธXโˆจY\mathbf{S} \not\models X \vee Y if, and only if, it is not the case that [๐’โŠจX\mathbf{S} \models X or ๐’โŠจY\mathbf{S}\models Y (or both)].

Now this states that ๐’โŠจฬธXโˆจY\mathbf{S} \not\models X \vee Y if neither XX nor YY is true in ๐’\mathbf{S}, 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 ๐’โŠจฬธX\mathbf{S} \not\models X and ๐’โŠจY\mathbf{S} \models Y. Well, since ๐’โŠจXโˆงY\mathbf{S} \models X \wedge Y if, and only if, ๐’โŠจX\mathbf{S} \models X and ๐’โŠจY\mathbf{S} \models Y, we have:

๐’โŠจฬธXโˆงY\mathbf{S} \not\models X \wedge Y if, and only if, it is not the case that [๐’โŠจX\mathbf{S} \models X and ๐’โŠจY\mathbf{S} \models Y].

If it is not the case that [๐’โŠจX\mathbf{S} \models X and ๐’โŠจY\mathbf{S} \models Y], then either XX or YY or both are false in ๐’\mathbf{S}. So in particular, if ๐’โŠจฬธX\mathbf{S} \not\models X and ๐’โŠจY\mathbf{S} \models Y, then ๐’โŠจฬธXโˆงY\mathbf{S} \not\models X \wedge Y.

One way to think about this is by simply noting that โŠจฬธ\not\models is just the negation of โŠจ\models. 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 โˆ’1-1 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 โ„’AE\mathcal{L}_{AE}. 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 โ„’0\mathcal{L}_0, except instead of ++, โˆ’ and ร—\times, 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 ๐’=โŸจ๐ƒ,IโŸฉ\mathbf{S}=\langle\mathbf{D}, I\rangle with the domain ๐ƒ={๐š,๐›,๐œ,๐}\mathbf{D}=\{\mathbf{a}, \mathbf{b}, \mathbf{c}, \mathbf{d}\}, and an interpretation function II such that:

  1. I(a)=๐šI(a)=\mathbf{a}, I(b)=๐›I(b)=\mathbf{b}, I(c)=๐œI(c)=\mathbf{c};

    1. I(P)={๐š,๐}I(P)=\{\mathbf{a}, \mathbf{d}\};

    2. I(Q)={โŸจ๐š,๐œโŸฉ,โŸจ๐,๐šโŸฉ,โŸจ๐š,๐โŸฉ}I(Q)=\{\langle\mathbf{a}, \mathbf{c}\rangle, \langle\mathbf{d}, \mathbf{a}\rangle, \langle\mathbf{a}, \mathbf{d}\rangle\};

    3. I(R)={โŸจ๐š,๐›,๐œโŸฉ,โŸจ๐›,๐œ,๐›โŸฉ,โŸจ๐›,๐›,๐›โŸฉ}I(R)=\{\langle\mathbf{a}, \mathbf{b}, \mathbf{c}\rangle, \langle\mathbf{b}, \mathbf{c}, \mathbf{b}\rangle, \langle\mathbf{b}, \mathbf{b}, \mathbf{b}\rangle\}.

We already know a bunch about what truth-values various formulas get in the structure ๐’\mathbf{S}. 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 (P(a)โˆจP(c))โˆงQ(a,c)(P(a) \vee P(c)) \wedge Q(a, c) is true in ๐’\mathbf{S}. Letโ€™s quickly draw up a syntax tree for this formula:

image

As with the example regarding โ„’AE\mathcal{L}_{AE}, we start from the leaves of our tree (remember that it is upside down). Now in general, you would first have to compute whether P(a)P(a), P(c)P(c), and Q(a,c)Q(a, c) are true in ๐’\mathbf{S}, but we will not revisit this issue, since this was already done above.

We had the following facts:

  1. ๐’โŠจP(a)\mathbf{S} \models P(a);

  2. ๐’โŠจฬธP(c)\mathbf{S} \not\models P(c);

  3. ๐’โŠจQ(a,c)\mathbf{S} \models Q(a, c).

We can substitute these values for the relevant formulas in our tree. Thus:

image

Now given how the connective โˆจ\vee was defined above, we can compute from TโˆจFT \vee F the value TT, since ๐’โŠจXโˆจY\mathbf{S} \models X \vee Y if ๐’โŠจX\mathbf{S} \models X, even if ๐’โŠจฬธY\mathbf{S} \not\models Y. So we have:

image

Substituting again, we have: TโˆงTT \wedge T Invoking the rule for the connective โˆง\wedge, we get TT as the final value, so ๐’โŠจ(P(a)โˆจP(c))โˆงQ(a,c).\mathbf{S} \models (P(a) \vee P(c)) \wedge Q(a, c).

Note that this is a handy way to compute the values of formulas, but you should not confuse things like TโˆจFT \vee F 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 ๐’\mathbf{S}. 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 (P(a)โˆจP(c))โˆงQ(a,c)(P(a) \vee P(c)) \wedge Q(a, c). By our previous results, ๐’โŠจP(a)\mathbf{S} \models P(a), ๐’โŠจฬธP(c)\mathbf{S} \not\models P(c), and ๐’โŠจQ(a,c)\mathbf{S}\models Q(a, c). By definition of โˆจ\vee, ๐’โŠจP(a)โˆจP(c)\mathbf{S} \models P(a) \vee P(c), since ๐’โŠจP(a)\mathbf{S} \models P(a). Then, by definition of โˆง\wedge, ๐’โŠจ(P(a)โˆจP(c))โˆงQ(a,c)\mathbf{S} \models (P(a) \vee P(c)) \wedge Q(a, c), since ๐’โŠจP(a)โˆจP(c)\mathbf{S} \models P(a) \vee P(c), and ๐’โŠจQ(a,c)\mathbf{S} \models Q(a,c). 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: (1โˆ’((1โˆ’1)ร—(1โˆ’0)))ร—1=1(1 -((1-1) \times (1-0))) \times 1=1

Now 1โˆ’1=01-1=0, 1โˆ’0=11-0=1, so we get 0ร—10 \times 1, which is 00, which we subtract from 11, which gets us 11, which we multiply by 11 to get 11. Or true.

This is not a thing we will be doing going further.

Exercise 4.7. Take the structure ๐’=โŸจ๐ƒ,IโŸฉ\mathbf{S}=\langle \mathbf{D}, I\rangle 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.

(Q(a,c)โˆจยฌR(a,b,c))โ†’ยฌR(a,c,b)(Q(a, c) \vee \neg R(a, b, c)) \rightarrow \neg R(a, c, b)

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 XX of the language, and some other truth-value to some specific formula YY 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 XX is any formula, and YY is any formula, and consider the formula XโˆงยฌYX \wedge \neg Y. 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 XX is true and YY is false, and then consider whether XโˆงยฌYX \wedge \neg Y 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 XX is true and YY is false (for each possible choice of formula for the variables XX and YY). But by abstracting away from the specifics, we do not need to worry about this.

Now the question is: is XโˆงยฌYX \wedge \neg Y true if XX is true and YY is false in a structure? You might already see that in such a case, XโˆงยฌYX \wedge \neg Y is, in fact, true. Here is how it would go:

Suppose there is a structure ๐’\mathbf{S} such that ๐’โŠจX\mathbf{S} \models X but ๐’โŠจฬธY\mathbf{S} \not\models Y. By the above definition, ๐’โŠจยฌY\mathbf{S} \models \neg Y provided ๐’โŠจฬธY\mathbf{S} \not\models Y, so ๐’โŠจยฌY\mathbf{S} \models \neg Y. Then, again, by definition, ๐’โŠจXโˆงยฌY\mathbf{S} \models X \wedge \neg Y, provided ๐’โŠจX\mathbf{S} \models X and ๐’โŠจยฌY\mathbf{S} \models \neg Y, which we already know, so ๐’โŠจXโˆงยฌY\mathbf{S} \models X \wedge \neg Y

This reasoning is the exact same as the following vertical fragment of a generalized truth-table:

XX YY ยฌY\neg Y XโˆงยฌYX \wedge \neg Y
TT FF TT TT

Exercise 4.8. Determine the truth-value and construct detailed explanations (as opposed to truth-tables) for the following formulas, assuming ๐’โŠจX\mathbf{S} \models X, ๐’โŠจฬธY\mathbf{S} \not\models Y, and ๐’โŠจZ\mathbf{S} \models Z:

  1. ยฌ(XโˆจY)โ†’Z\neg (X \vee Y) \rightarrow Z;

  2. (ยฌXโˆงY)โˆจยฌZ(\neg X \wedge Y) \vee \neg Z;

  3. Zโ†’(XโˆงยฌX)Z \rightarrow (X \wedge \neg X);

  4. Yโ†’(ZโˆจยฌZ)Y \rightarrow (Z \vee \neg Z);

  5. ยฌ(XโˆงZ)โ†’(ยฌXโˆจยฌZ)\neg (X \wedge Z) \rightarrow (\neg X \vee \neg Z);

  6. (Zโ†’Y)โ†’(ยฌZโˆจY)(Z \rightarrow Y) \rightarrow (\neg Z \vee Y).

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 ๐’\mathbf{S} is a pair โŸจ๐ƒ,IโŸฉ\langle\mathbf{D}, I\rangle, where ๐ƒ\mathbf{D} is any set, and II is a function from the constants and predicates of โ„’0\mathcal{L}_0 (i.e., ๐–ข๐–ฎ๐–ญโ„’0โˆช๐–ฏ๐–ฑ๐–ค๐–ฃโ„’0\mathsf{CON}_{\mathcal{L}_0} \cup \mathsf{PRED}_{\mathcal{L}_0}) such that:

  1. if cc is any constant of โ„’0\mathcal{L}_0, I(c)โˆˆ๐ƒI(c) \in \mathbf{D}, and;

  2. if PnP^n is any predicate of arity nn of โ„’0\mathcal{L}_0, I(Pn)=๐‘I(P^n)=\mathbf{R}, where ๐‘โІ๐ƒn\mathbf{R} \subseteq \mathbf{D}^n.

For any formulas X,Y,ZX, Y, Z of โ„’0\mathcal{L}_0:

  1. if XX is of form Pn(c1,...,cn)P^n(c_1, …, c_n), ๐’โŠจPn(c1,...,cn)\mathbf{S} \models P^n(c_1, …, c_n) if, and only if, โŸจc1,...,cnโŸฉโˆˆI(Pn)\langle c_1, …, c_n\rangle \in I(P^n);

  2. if XX is of form ยฌY\neg Y, ๐’โŠจยฌY\mathbf{S} \models \neg Y if, and only if, ๐’โŠจฬธY\mathbf{S} \not\models Y;

  3. if XX is of form YโˆงZY \wedge Z, ๐’โŠจYโˆงZ\mathbf{S} \models Y \wedge Z if, and only if, ๐’โŠจY\mathbf{S} \models Y and ๐’โŠจZ\mathbf{S}\models Z;

  4. if XX is of form YโˆจZY \vee Z, ๐’โŠจYโˆจZ\mathbf{S} \models Y \vee Z if, and only if, ๐’โŠจZ\mathbf{S} \models Z or ๐’โŠจY\mathbf{S}\models Y (or both);

  5. if XX is of form Yโ†’ZY \rightarrow Z, if ๐’โŠจY\mathbf{S} \models Y, then ๐’โŠจZ\mathbf{S} \models Z.

If ๐’โŠจP(c1,...,cn)\mathbf{S} \models P(c_1, …, c_n), we say ๐’\mathbf{S} models P(c1,...,cn)P(c_1, …, c_n), or is a model of P(c1,...,cn)P(c_1, …, c_n). Alternatively, we say P(c1,...,cn)P(c_1, …, c_n) is true in ๐’\mathbf{S}.

Congratulations, this concludes the semantics of โ„’0\mathcal{L}_0.

From now on, we will omit writing out โ€˜if, and only ifโ€™ each and every time. Instead, we will opt for the abbreviation โ€˜iffโ€™ (in italics).

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Learning Logic Backwards Copyright © by Peter Susanszky is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.