Maths - Predicate Logic

Predicate Logic (or also called Predicate Calculus) is the term for a formal and symbolic system of logic like first-order logic, second-order logic and so on.

It is defined over some (possibly infinite) set. It requires some form of assignment or relationship of the elements of the set to give true or false values.

Predicate Logic

From site here :

A predicate is an expression of one or more variables defined on some specific domain. A predicate with variables can be made a proposition by either assigning a value to the variable or by quantifying the variable.

The following are examples of predicates :

Examples

Examples that depend on one parameter:

isEven : Nat -> Bool diagram
isLessThan4 : Nat -> Bool diagram

Examples that depend on two parameters:

equals : (Nat,Nat) -> Bool

Typically relations depend on two parameters.

diagram
evenAndLess4 : (Nat,Nat) -> Bool diagram

Morphisms Between Predicates

Say we have two predicates which depend on one parameter T:

T -> Bool

and we want to investigate a product of them:

( T -> Bool ) × ( T -> Bool )

In order to investigate this we can represent T -> Bool as an exponent: BoolT so we have: BoolT × BoolT.

The identity: (B × C)A = BA × CA works for types (up to isomorphism) so we have:

BoolT × BoolT = (Bool × Bool)T

where Bool × Bool is a logic table.

So translating back from exponential notation we have:

( T -> Bool ) × ( T -> Bool ) = ( T -> Bool×Bool )

If we have an operation Bool×Bool->Bool (such as 'and' or 'or') then we have a binary operation for predicates:

( T -> Bool ) × ( T -> Bool ) = ( T -> Bool )

Note: we can generalise this from Boolean values to 'truth objects' Ω - see topos theory.

Logic Language

Terms

Constants

Values have two values ether true of false, we may use alternative names as follows:

true
1
T  
false
0
_|_  

Variables

A variable is a letter or symbol used to represent a value (an object, not a proposition). A predicate containing variables can be made into a valid proposition if the variables are either:

Functions

Composite terms are formed by applying function symbols to other terms. Each function symbol has an 'arity' that is it takes in 'n' parameters and returns 'm' parameters.

Quantifiers

universal quantifier: for all for all
existential quantifier: there exists there exists (for some)

For universal quantifier we will use the notationfor allx:σ.A(x) which is true if A(x) is true for every 'x' in type 'σ', where:

So,

for allx:σ.A(x) = A(a) /\ A(b) /\ ...

where a:σ, b:σ ... are all objects in discourse.

Simarly for existential quantifier we will use the notationthere existsx:σ.A(x) which is true if A(x) is true for at least one 'x' in type 'σ'

there existsx:σ.A(x) = A(a) \/ A(b) \/ ...

where a:σ, b:σ ... are all objects in discourse.

Introduction Rules

for all there exists
A
for allx.A
(for allI) x not free in A
A[t/x]
there existsx.A
(there existsI)

Elimination Rules

for all there exists
for allx.A(x)
A[x/t]
(for allE)
 

[A]

...

there existsx.A B
B
(there existsE) x not free in B

Formulas

If x1, … ,xn are elements of the set and P is an n-place predicate symbol, then

P(x1, … ,xn) is an elementry formula

If A and B are formulas, then

are also formulas.

Connectives

Commonly used logical connectives include:

Programming

Formation Rules

for all there exists
 

[x:A]

...

A is a type P is a type
(for allx:A).P
(for allF) P is a type on the assumption that x is a variable of type A
 

[x:A]

...

A is a type P is a type
(there existsx:A).P
(there existsF) P is a type on the assumption that x is a variable of type A

Introduction Rules

for all there exists

[x:A]

...

.p:P
(λ x:A).p : (for allx:A).P
(for allI) x not free in A
a:A p:P[a/x]
(a,p):there exists(x:A).P
(there existsI)

Elimination Rules

for all there exists
a:A f: (for allx:A).P
f a:P[a/x]
(for allE)
p:there exists(x:A).P
fst p:A
p:there exists(x:A).P
snd p: P[fst p/x]
(there existsE) projections

Computation Rules

for all there exists
((λ x:A).p a -> p[a/x] fst (p,q) -> p
snd (p,q) -> q

 


metadata block
see also:

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Modern Graph Theory (Graduate Texts in Mathematics, 184)

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.