Predicates

Learn about predicates and how they are different from propositions.

A predicate in English is everything except the subject in a declarative sentence. For example, if we take the sentence:

Smith is more than six feet tall.

The statement “is more than six feet tall” is a predicate. It does not become a complete sentence until we specify a subject. Once we have identified a subject, this declarative sentence might or might not be true. Therefore, a predicate describes a property that a subject may or may not possess.

Luckily, in mathematics, we can use variables to denote unspecified subjects. Using variables becomes a powerful way of expressing many ideas precisely: this is the basis of first-order logic. As we’ll see, this logic is so powerful that we can state several open problems in mathematics (and other areas) using first-order logic.

What is a predicate?

In mathematical logic, predicates are propositions containing one or more variables. We can view these variables as placeholders. These variables are allowed to take any value from a set called their domain. The predicate asserts some property the elements of the domain may or may not possess. For a statement to qualify as a bona fide predicate, the predicate must become a proposition each time we substitute any value from the domain.

To see a concrete example, consider three students, Jane, Jim, and Zain, who took a discrete maths course. Let’s assume we want to know which students have secured an A in the course. We can craft the following sentence with a variable xx:

  • A(x)A(x): xx has secured an A in discrete math.

The statement “has secured an A in discrete math” is a predicate. The variable xx allows us to use this predicate in a complete sentence. A(x)A(x) is not a proposition because it has a variable. But if we substitute xx with some specific value, that is, the name of a student in the class, it will become a proposition. It will have a definite truth value. In this case, we say that we are instantiating the predicate. What is important is that each instantiation of the variable from the domain should yield a proposition.

The domain should always be clear. If there is any possible ambiguity, we must mention the domain explicitly. For the A(x)A(x), the domain of xx is the students registered in the discrete maths class. To be concrete, let’s define the domain to be D={D = \{ Jim, Jane, Zain }.\}.

We can instantiate this predicate by substituting a value for xx for any value from DD. Instantiating A(x)A(x) will turn it into a proposition with a definite truth value. For example, when we substitute Jim for xx, we get the proposition,

  • A(A(Jim)): Jim has secured an A in discrete math.

We can also visualize a predicate as a row of truth values. The columns are labeled values given in the domain. So, for example, if Jim is the only student who did not get an AA in the course, then A(A(Jane)) = true, A(A(Jim)) = false, A(A(Zain)) = true, we can view A(x)A(x) as the following table:

Jane Jim Zain
T F T

In this table, T represents true and F represents false.

Let’s define another predicate with the same domain DD. Let,

  • F(x)F(x): xx scored at least 90%90\% on the final.

For F(x)F(x), we notice that:

  • xx is a variable.
  • The domain of xx is once again DD.
  • The predicate captures a property of the elements in the subject.

If only Zain scored at least 90%90\% on the final, then P(P(Zain)=)= true and PP(Jane))=P() = P(Smith)=)= false . Once again, we can visualize the truth values of this predicate using the following table:

Jane Jim Zain
F F T

Let,

  • P(x)P(x): x>7, \:\:\:\:\:\:\:\: Where, xx is an integer.

What are the truth values of P(4),P(3),P(0),P(7),P(14),P\left(4\right), P\left(-3\right),P\left(0\right),P\left(7\right),P\left(14\right), and P(517)P\left(517\right)?

These are worked out in the following table:

Proposition Truth-value Reason
P(4)P\left(4\right) F 474 \ngtr 7
P(3)P\left(-3\right) F 37-3 \ngtr 7
P(0)P\left(0\right) F 070 \ngtr 7
P(7)P\left(7\right) F 777 \ngtr 7
P(14)P\left(14\right) T 14 > 7
P(517)P\left(517\right) T 517 > 7

In this case, the above table is not complete. We have only determined the truth values for a subset of the domain. The entire truth table will have infinitely many entries, one for each integer.

Let’s look at an example involving more than one variable.


Consider the following predicate:

  • P(x,y,z)P\left(x,y,z\right): 5x+2y=3z,5x + 2y = 3z,\:\:\:\:\:\:\:\: Where, x,y,x,y, and zz are integers.

Let’s look at a few possibilities for values of variables.

P(x,y,z)P\left(x,y,z\right) Property Evaluation Truth-value Reason
P(1,2,1)P\left(1,2,1\right) 5×1+2×2=3×15\times 1+2\times 2=3\times 1 F 939\neq3
P(1,2,3)P\left(1,2,3\right) 5×1+2×2=3×35\times 1+2\times 2=3\times 3 T 9=99=9
P(0,3,2)P\left(0,3,2\right) 5×0+2×3=3×25\times 0+2\times 3=3\times 2 T 6=66=6
P(6,3,8)P\left(6,-3,8\right) 5×6+2×(3)=3×85\times 6+2\times \left(-3\right)=3\times 8 T 24=2424=24
P(1,1,1)P\left(1,-1,1\right) 5×1+2×(1)=3×15\times 1+2\times \left(-1\right)=3\times 1 T 3=33=3
P(1,2,4)P\left(-1,-2,-4\right) 5×(1)+2×(2)=3×(4)5\times\left(-1\right)+2\times \left(-2\right)=3\times \left(-4\right) F 912-9\ne -12

Predicate code example

In computer programs, we use predicates in conditional statements. As an example, look at the following Python code. Run this code to know the truth value of the resulting proposition from the predicate for different x variable values. The predicate is P(x):x<7.

> Note: We can change the values in the domain to experiment with different values of x.

Press + to interact
domain = {14,3,12,-1,0,7}
for x in domain:
if x < 7:
print("P("+ str(x) +") is true.")
else:
print("P("+ str(x) +") is false.")

Explanation

  • Line 1: This line specifies the domain for the x variable.

  • Line 2: We will look at the predicate for each value of the x variable.

  • Line 3: The if statement has the predicate P(x)P(x): x<7x<7.

  • Line 4: This line will execute when the predicate is true.

  • Line 6: This line will execute when the predicate is false.

Leap year code example

In the following program, the truth value of L(y)L(y) is computed for different values of yy. The predicate LL is as follows:

L(y):y is a leap year.L(y):y \text{ is a leap year.}

The year is a leap year if it is divisible by 44 and not by 100100 or if it is divisible by 400400.

Note: We can change the values in the domain to experiment with different values of y and check if a year is a leap year or not.

Press + to interact
domain = {2014, 2103, 1208, 2087, 1604, 714, 1700, 1800, 1900, 2100, 2200, 2000}
for y in domain:
if (y % 4 == 0 and y % 100 != 0) or (y % 400 == 0):
print("L("+ str(y) +") is true because "+ str(y) +" is a leap year.")
else:
print("L("+ str(y) +") is false because "+ str(y) +" is not a leap year.")

Explanation

  • Line 1: Notice that this line specifies the domain containing different values for the y variable.

  • Line 2: We will check for the leap year for each value of the y variable from the domain.

  • Line 3: The if statement has the predicate L(y):yL(y): y is leap year.

  • Line 4: This line will execute when the predicate is true.

  • Line 6: This line will execute when the predicate is false.

Quiz

Test your understanding of predicates.

1

Which option is a predicate?

A)

Jack is two years older than Harry.

B)

x>yx > y.

C)

Where is my jacket?

D)

7+8=157+8 =15.

Question 1 of 20 attempted