## Introduction

Just like the concept of propositions is fundamental to propositional calculus, — in fact even to predicate calculus — the concept of predicates is fundamental to predicate calculus. The whole system of predicate logic revolves around predicates.

So, in order to get the hang of predicate logic, we ought to first get the hang of predicates. Let's see what exactly are they...

## What is a predicate?

Before defining what exactly is a predicate formally, let's consider a couple of examples first.

Take a look at the following sentences:

'Python is easy.'
'JavaScript is object-oriented.'
'C++ is quite difficult.'
'Alex loves cats.'

Do you notice any similarity in all these sentences?

Well there is one. Each sentence makes an assertion regarding a given subject. In each sentence, we specify a property, a characteristic for the given subject.

Let's see some other sentences.

'Python influenced JavaScript.'
'Time is money.'
'Cake requires flour.'
'Success isn't easy.'

Now, in these sentences, we specify two objects and a relation between them. To be precise, we have a subject and an object and a propety of both of them.

In either way, there is some claim made in the sentences regarding the subject/object.

We call such a segment, of a sentence, a predicate.

A predicate is a part of a sentence that makes an assertion regarding the subject.

In other words, a predicate can be thought of as a property — an attribute — of the subject.

So coming back to all the sentences, we saw above, can you now spot the predicates in them?

Well, let's find them together. The predicates are given in blue below each sentence:

'Python is easy.'
'is easy'

'JavaScript is object-oriented.'
'is object-oriented'

'C++ is quite difficult.'
'is quite difficult'

'Alex loves cats.'
'loves cats'

This is exactly what predicates are in predicate logic.

Predicate logic views sentences in terms of assertions made regarding a subject. The assertions are referred to as predicates. The subject is also of significance, and is treated separately, as we shall see next.

In each of the sentences above, if we exclude the predicate, we are mainly left with the subject. The subject in each sentence refers to a specific entity. Note that the entity might be fictitious,but it doesn't really matter as to what is it. What matters is that we refer to specific entity.

In predicate logic, subjects that refer to specific entities are known as constants (or sometimes as inidividuals, or individual constants).

Let's suppose you have to symbolically show the following sentences.

'Python is easy.'
'Java is easy.'
'C++ is easy.'
'Ruby is easy.'
'Swift is easy.'

One straightforward way is that, for each sentence, we assign it to a separate propositional variable, as follows:

$p$:  'Python is easy.'
$q$:  'Java is easy.'
$r$:  'C++ is easy.'
$s$:  'Ruby is easy.'
$t$:  'Swift is easy.'

However, realise on important thing here...

The predicate in all the sentences is the same. Technically, we could reuse this predicate, keeping it the same, while just changing the subject, instead of denoting each one with a different propositional variable.

This is where the concept of a predicate function, or a propositional function comes to the play.

A propositional function takes a value and joins a predicate to it. Its output is a proposition.

A propositional function follows the conventional notation to denote a function in maths, i.e. $f(x)$.

Let's define a propositional function that could be used to represent each of the sentences above.

$\text{Easy(}x\text{): }$ $x$ is easy

This function is simply saying that whatever is passed to $\text{Easy}$ is used in place of $x$ in the sentence '$x$ is easy'.

So for instance, passing 'Python' into the function $\text{Easy}$, which is denoted as $\text{Easy(Python)}$ represents the statment 'Python is easy.'

The $x$ in the propositional function above is called something very familiar to all of us — a variable. On its own, the variable doesn't refer to any specific entity. In fact, it refers to nothing!

This means that $\text{Easy(}x\text{)}$ where $x$ is a variable, as is, is NOT a proposition. This is because it has no truth value. However, when we assign a value to $x$, it gets one of the truth values and hence becomes a proposition.

With all this in place, let's now symbolically define all the sentences shown above.

Although, these symbolic representation are longer than using propositional variablex, as we did before, we have however reused the predicate and prevented repetition.

As we shall see later on, this could be very useful in creating compound propositions using simpler sentences with similar predicates.

## Unary, binary and n-ary predicates

Let's reconsider one of the sentences, we saw above.

We know that Python is the subject of the sentence and 'is easy' is the predicate.

Now, precisely speaking, how many things are discussed in this sentence? In other words, how many things does the predicate talk about? Well, in this case, it just talks about one thing i.e. Python. The predicate makes a claim about just Python, that's it.

'Python is easier than Java.'

Now the predicate 'is easier than' makes claims regarding two things: Python and Java. If we suppose that our predicate is 'easier than Java' the the predicate makes a claim regarding just one thing and that is 'Python', and vice versa.

Hence, it turns out that a predicate may make a claim regarding just one thing or regarding multiple things. This distinction is useful.

A predicate that makes claim regarding one thing is called unary predicate. On the same lines, a predicate that makes a claim regarding two things is called a binary predicate. Beyond this, we call it an n-ary predicate, or an n-place predicate.

Notationally, a predicate $P$ that operates on a list of arguments ($x_1$, $x_2$, $\dots$, $x_n$) is called an n-ary, or an n-place predicate.

Some examples are shown below:

Note that we've used pretty descriptive names for the predicate function. However, you could also use a simple letter such as $P$. It is convention to represent propositional functions with uppercase letters, as opposed to representing atomic propositions using lowercase letters.

## Moving on

At this point, we are completely familiar with the notion of predicates in predicate calculus. They are properties/attributes of given subjects.

In predicate logic, we could use propositional functions to join predicates with given subjects and thus form propositions. Together, these concepts pave the foundation for first-order logic.