First-order logic, also called predicate logic, predicate calculus, or quantificational logic, is a collection of
formal system
A formal system is an abstract structure and formalization of an axiomatic system used for deducing, using rules of inference, theorems from axioms.
In 1921, David Hilbert proposed to use formal systems as the foundation of knowledge in ma ...
s used in
mathematics
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
,
philosophy
Philosophy ('love of wisdom' in Ancient Greek) is a systematic study of general and fundamental questions concerning topics like existence, reason, knowledge, Value (ethics and social sciences), value, mind, and language. It is a rational an ...
,
linguistics
Linguistics is the scientific study of language. The areas of linguistic analysis are syntax (rules governing the structure of sentences), semantics (meaning), Morphology (linguistics), morphology (structure of words), phonetics (speech sounds ...
, and
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
. First-order logic uses
quantified variables over non-logical objects, and allows the use of sentences that contain variables. Rather than propositions such as "all humans are mortal", in first-order logic one can have expressions in the form "for all ''x'', if ''x'' is a human, then ''x'' is mortal", where "for all ''x"'' is a quantifier, ''x'' is a variable, and "... ''is a human''" and "... ''is mortal''" are predicates. This distinguishes it from
propositional logic
The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. Sometimes, it is called ''first-order'' propositional logic to contra ...
, which does not use quantifiers or
relation
Relation or relations may refer to:
General uses
* International relations, the study of interconnection of politics, economics, and law on a global level
* Interpersonal relationship, association or acquaintance between two or more people
* ...
s; in this sense, propositional logic is the foundation of first-order logic.
A theory about a topic, such as
set theory
Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory – as a branch of mathema ...
, a theory for groups,
[A. Tarski, ''Undecidable Theories'' (1953), p. 77. Studies in Logic and the Foundation of Mathematics, North-Holland] or a formal theory of
arithmetic
Arithmetic is an elementary branch of mathematics that deals with numerical operations like addition, subtraction, multiplication, and division. In a wider sense, it also includes exponentiation, extraction of roots, and taking logarithms.
...
, is usually a first-order logic together with a specified
domain of discourse
In the formal sciences, the domain of discourse or universe of discourse (borrowing from the mathematical concept of ''universe'') is the set of entities over which certain variables of interest in some formal treatment may range.
It is also ...
(over which the quantified variables range), finitely many functions from that domain to itself, finitely many
predicates defined on that domain, and a set of axioms believed to hold about them. "Theory" is sometimes understood in a more formal sense as just a set of sentences in first-order logic.
The term "first-order" distinguishes first-order logic from
higher-order logic
In mathematics and logic, a higher-order logic (abbreviated HOL) is a form of logic that is distinguished from first-order logic by additional quantifiers and, sometimes, stronger semantics. Higher-order logics with their standard semantics are m ...
, in which there are predicates having predicates or functions as arguments, or in which quantification over predicates, functions, or both, are permitted. In first-order theories, predicates are often associated with sets. In interpreted higher-order theories, predicates may be interpreted as sets of sets.
There are many
deductive system
A formal system is an abstract structure and formalization of an axiomatic system used for deducing, using rules of inference, theorems from axioms.
In 1921, David Hilbert proposed to use formal systems as the foundation of knowledge in math ...
s for first-order logic which are both
sound
In physics, sound is a vibration that propagates as an acoustic wave through a transmission medium such as a gas, liquid or solid.
In human physiology and psychology, sound is the ''reception'' of such waves and their ''perception'' by the br ...
, i.e. all provable statements are true in all models; and
complete
Complete may refer to:
Logic
* Completeness (logic)
* Completeness of a theory, the property of a theory that every formula in the theory's language or its negation is provable
Mathematics
* The completeness of the real numbers, which implies t ...
, i.e. all statements which are true in all models are provable. Although the
logical consequence
Logical consequence (also entailment or logical implication) is a fundamental concept in logic which describes the relationship between statement (logic), statements that hold true when one statement logically ''follows from'' one or more stat ...
relation is only
semidecidable, much progress has been made in
automated theorem proving
Automated theorem proving (also known as ATP or automated deduction) is a subfield of automated reasoning and mathematical logic dealing with proving mathematical theorems by computer programs. Automated reasoning over mathematical proof was a majo ...
in first-order logic. First-order logic also satisfies several
metalogical theorems that make it amenable to analysis in
proof theory
Proof theory is a major branchAccording to , proof theory is one of four domains mathematical logic, together with model theory, axiomatic set theory, and recursion theory. consists of four corresponding parts, with part D being about "Proof The ...
, such as the
Löwenheim–Skolem theorem
In mathematical logic, the Löwenheim–Skolem theorem is a theorem on the existence and cardinality of models, named after Leopold Löwenheim and Thoralf Skolem.
The precise formulation is given below. It implies that if a countable first-order ...
and the
compactness theorem
In mathematical logic, the compactness theorem states that a set of first-order sentences has a model if and only if every finite subset of it has a model. This theorem is an important tool in model theory, as it provides a useful (but generall ...
.
First-order logic is the standard for the formalization of mathematics into
axioms
An axiom, postulate, or assumption is a statement that is taken to be true, to serve as a premise or starting point for further reasoning and arguments. The word comes from the Ancient Greek word (), meaning 'that which is thought worthy or f ...
, and is studied in the
foundations of mathematics
Foundations of mathematics are the mathematical logic, logical and mathematics, mathematical framework that allows the development of mathematics without generating consistency, self-contradictory theories, and to have reliable concepts of theo ...
.
Peano arithmetic
In mathematical logic, the Peano axioms (, ), also known as the Dedekind–Peano axioms or the Peano postulates, are axioms for the natural numbers presented by the 19th-century Italian mathematician Giuseppe Peano. These axioms have been used nea ...
and
Zermelo–Fraenkel set theory
In set theory, Zermelo–Fraenkel set theory, named after mathematicians Ernst Zermelo and Abraham Fraenkel, is an axiomatic system that was proposed in the early twentieth century in order to formulate a theory of sets free of paradoxes suc ...
are axiomatizations of
number theory
Number theory is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers as well as the properties of mathematical objects constructed from integers (for example ...
and set theory, respectively, into first-order logic. No first-order theory, however, has the strength to uniquely describe a structure with an infinite domain, such as the
natural number
In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
s or the
real line
A number line is a graphical representation of a straight line that serves as spatial representation of numbers, usually graduated like a ruler with a particular origin (geometry), origin point representing the number zero and evenly spaced mark ...
. Axiom systems that do fully describe these two structures, i.e.
categorical axiom systems, can be obtained in stronger logics such as
second-order logic
In logic and mathematics, second-order logic is an extension of first-order logic, which itself is an extension of propositional logic. Second-order logic is in turn extended by higher-order logic and type theory.
First-order logic quantifies on ...
.
The foundations of first-order logic were developed independently by
Gottlob Frege
Friedrich Ludwig Gottlob Frege (; ; 8 November 1848 – 26 July 1925) was a German philosopher, logician, and mathematician. He was a mathematics professor at the University of Jena, and is understood by many to be the father of analytic philos ...
and
Charles Sanders Peirce
Charles Sanders Peirce ( ; September 10, 1839 – April 19, 1914) was an American scientist, mathematician, logician, and philosopher who is sometimes known as "the father of pragmatism". According to philosopher Paul Weiss (philosopher), Paul ...
. For a history of first-order logic and how it came to dominate formal logic, see José Ferreirós (2001).
Introduction
While
propositional logic
The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. Sometimes, it is called ''first-order'' propositional logic to contra ...
deals with simple declarative propositions, first-order logic additionally covers
predicate
Predicate or predication may refer to:
* Predicate (grammar), in linguistics
* Predication (philosophy)
* several closely related uses in mathematics and formal logic:
**Predicate (mathematical logic)
**Propositional function
**Finitary relation, o ...
s and
quantification. A predicate evaluates to
true
True most commonly refers to truth, the state of being in congruence with fact or reality.
True may also refer to:
Places
* True, West Virginia, an unincorporated community in the United States
* True, Wisconsin, a town in the United States
* ...
or
false for an entity or entities in the
domain of discourse
In the formal sciences, the domain of discourse or universe of discourse (borrowing from the mathematical concept of ''universe'') is the set of entities over which certain variables of interest in some formal treatment may range.
It is also ...
.
Consider the two sentences "
Socrates
Socrates (; ; – 399 BC) was a Ancient Greek philosophy, Greek philosopher from Classical Athens, Athens who is credited as the founder of Western philosophy and as among the first moral philosophers of the Ethics, ethical tradition ...
is a philosopher" and "
Plato
Plato ( ; Greek language, Greek: , ; born BC, died 348/347 BC) was an ancient Greek philosopher of the Classical Greece, Classical period who is considered a foundational thinker in Western philosophy and an innovator of the writte ...
is a philosopher". In
propositional logic
The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. Sometimes, it is called ''first-order'' propositional logic to contra ...
, these sentences themselves are viewed as the individuals of study, and might be denoted, for example, by variables such as ''p'' and ''q''. They are not viewed as an application of a predicate, such as
, to any particular objects in the domain of discourse, instead viewing them as purely an utterance which is either true or false. However, in first-order logic, these two sentences may be framed as statements that a certain individual or non-logical object has a property. In this example, both sentences happen to have the common form
for some individual
, in the first sentence the value of the variable ''x'' is "Socrates", and in the second sentence it is "Plato". Due to the ability to speak about non-logical individuals along with the original logical connectives, first-order logic includes propositional logic.
The truth of a formula such as "''x'' is a philosopher" depends on which object is denoted by ''x'' and on the interpretation of the predicate "is a philosopher". Consequently, "''x'' is a philosopher" alone does not have a definite truth value of true or false, and is akin to a sentence fragment.
Relationships between predicates can be stated using
logical connective
In logic, a logical connective (also called a logical operator, sentential connective, or sentential operator) is a logical constant. Connectives can be used to connect logical formulas. For instance in the syntax of propositional logic, the ...
s. For example, the first-order formula "if ''x'' is a philosopher, then ''x'' is a scholar", is a
conditional statement with "''x'' is a philosopher" as its hypothesis, and "''x'' is a scholar" as its conclusion, which again needs specification of ''x'' in order to have a definite truth value.
Quantifiers can be applied to variables in a formula. The variable ''x'' in the previous formula can be universally quantified, for instance, with the first-order sentence "For every ''x'', if ''x'' is a philosopher, then ''x'' is a scholar". The
universal quantifier
In mathematical logic, a universal quantification is a type of quantifier, a logical constant which is interpreted as "given any", "for all", "for every", or "given an arbitrary element". It expresses that a predicate can be satisfied by e ...
"for every" in this sentence expresses the idea that the claim "if ''x'' is a philosopher, then ''x'' is a scholar" holds for ''all'' choices of ''x''.
The ''
negation
In logic, negation, also called the logical not or logical complement, is an operation (mathematics), operation that takes a Proposition (mathematics), proposition P to another proposition "not P", written \neg P, \mathord P, P^\prime or \over ...
'' of the sentence "For every ''x'', if ''x'' is a philosopher, then ''x'' is a scholar" is logically equivalent to the sentence "There exists ''x'' such that ''x'' is a philosopher and ''x'' is not a scholar". The
existential quantifier
Existentialism is a family of philosophy, philosophical views and inquiry that explore the human individual's struggle to lead an Authenticity (philosophy), authentic life despite the apparent Absurdity#The Absurd, absurdity or incomprehensibili ...
"there exists" expresses the idea that the claim "''x'' is a philosopher and ''x'' is not a scholar" holds for ''some'' choice of ''x''.
The predicates "is a philosopher" and "is a scholar" each take a single variable. In general, predicates can take several variables. In the first-order sentence "Socrates is the teacher of Plato", the predicate "is the teacher of" takes two variables.
An interpretation (or model) of a first-order formula specifies what each predicate means, and the entities that can instantiate the variables. These entities form the
domain of discourse
In the formal sciences, the domain of discourse or universe of discourse (borrowing from the mathematical concept of ''universe'') is the set of entities over which certain variables of interest in some formal treatment may range.
It is also ...
or universe, which is usually required to be a nonempty set. For example, consider the sentence "There exists ''x'' such that ''x'' is a philosopher." This sentence is seen as being true in an interpretation such that the domain of discourse consists of all human beings, and that the predicate "is a philosopher" is understood as "was the author of the ''
Republic
A republic, based on the Latin phrase ''res publica'' ('public affair' or 'people's affair'), is a State (polity), state in which Power (social and political), political power rests with the public (people), typically through their Representat ...
''." It is true, as witnessed by Plato in that text.
There are two key parts of first-order logic. The
syntax
In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
determines which finite sequences of symbols are well-formed expressions in first-order logic, while the
semantics
Semantics is the study of linguistic Meaning (philosophy), meaning. It examines what meaning is, how words get their meaning, and how the meaning of a complex expression depends on its parts. Part of this process involves the distinction betwee ...
determines the meanings behind these expressions.
Syntax
Unlike natural languages, such as English, the language of first-order logic is completely formal, so that it can be mechanically determined whether a given expression is
well formed. There are two key types of well-formed expressions: ''terms'', which intuitively represent objects, and ''formulas'', which intuitively express statements that can be true or false. The terms and formulas of first-order logic are strings of ''
symbols
A symbol is a mark, sign, or word that indicates, signifies, or is understood as representing an idea, object, or relationship. Symbols allow people to go beyond what is known or seen by creating linkages between otherwise different concep ...
'', where all the symbols together form the ''
alphabet
An alphabet is a standard set of letter (alphabet), letters written to represent particular sounds in a spoken language. Specifically, letters largely correspond to phonemes as the smallest sound segments that can distinguish one word from a ...
'' of the language.
Alphabet
As with all
formal language
In logic, mathematics, computer science, and linguistics, a formal language is a set of strings whose symbols are taken from a set called "alphabet".
The alphabet of a formal language consists of symbols that concatenate into strings (also c ...
s, the nature of the symbols themselves is outside the scope of formal logic; they are often regarded simply as letters and punctuation symbols.
It is common to divide the symbols of the alphabet into ''logical symbols'', which always have the same meaning, and ''non-logical symbols'', whose meaning varies by interpretation. For example, the logical symbol
always represents "and"; it is never interpreted as "or", which is represented by the logical symbol
. However, a non-logical predicate symbol such as Phil(''x'') could be interpreted to mean "''x'' is a philosopher", "''x'' is a man named Philip", or any other unary predicate depending on the interpretation at hand.
Logical symbols
Logical symbols are a set of characters that vary by author, but usually include the following:
*
Quantifier symbols: for universal quantification, and for existential quantification
*
Logical connective
In logic, a logical connective (also called a logical operator, sentential connective, or sentential operator) is a logical constant. Connectives can be used to connect logical formulas. For instance in the syntax of propositional logic, the ...
s: for
conjunction, for
disjunction
In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is ...
, for
implication, for
biconditional
In logic and mathematics, the logical biconditional, also known as material biconditional or equivalence or bidirectional implication or biimplication or bientailment, is the logical connective used to conjoin two statements P and Q to form t ...
, for negation. Some authors use C''pq'' instead of and E''pq'' instead of , especially in contexts where is used for other purposes. Moreover, the horseshoe may replace ;
the triple-bar may replace ; a tilde (), N''p'', or F''p'' may replace ; a double bar
,
, or A''pq'' may replace ; and an ampersand , K''pq'', or the middle dot may replace , especially if these symbols are not available for technical reasons.
* Parentheses, brackets, and other punctuation symbols. The choice of such symbols varies depending on context.
* An infinite set of ''variables'', often denoted by lowercase letters at the end of the alphabet ''x'', ''y'', ''z'', ... . Subscripts are often used to distinguish variables:
* An ''equality symbol'' (sometimes, ''identity symbol'') (see below).
Not all of these symbols are required in first-order logic. Either one of the quantifiers along with negation, conjunction (or disjunction), variables, brackets, and equality suffices.
Other logical symbols include the following:
* Truth constants: T, or for "true" and F, or for "false". Without any such logical operators of valence 0, these two constants can only be expressed using quantifiers.
* Additional logical connectives such as the
Sheffer stroke
In Boolean functions and propositional calculus, the Sheffer stroke denotes a logical operation that is equivalent to the negation of the conjunction operation, expressed in ordinary language as "not both". It is also called non-conjunction, ...
, D''pq'' (NAND), and
exclusive or
Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (on ...
, J''pq''.
Non-logical symbols
Non-logical symbol
In logic, the formal languages used to create expressions consist of symbols, which can be broadly divided into constants and variables. The constants of a language can further be divided into logical symbols and non-logical symbols (sometimes a ...
s represent predicates (relations), functions and constants. It used to be standard practice to use a fixed, infinite set of non-logical symbols for all purposes:
* For every integer ''n'' ≥ 0, there is a collection of
''n''-''ary'', or ''n''-''place'', ''
predicate symbol
In mathematical logic, a predicate variable is a predicate letter which functions as a "placeholder" for a relation (between terms), but which has not been specifically assigned any particular relation (or meaning). Common symbols for denoting pr ...
s''. Because they represent
relations between ''n'' elements, they are also called ''relation symbols''. For each arity ''n'', there is an infinite supply of them:
*:''P''
''n''0, ''P''
''n''1, ''P''
''n''2, ''P''
''n''3, ...
* For every integer ''n'' ≥ 0, there are infinitely many ''n''-ary ''function symbols'':
*:''f
n''
0, ''f
n''
1, ''f
n''
2, ''f
n''
3, ...
When the arity of a predicate symbol or function symbol is clear from context, the superscript ''n'' is often omitted.
In this traditional approach, there is only one language of first-order logic. This approach is still common, especially in philosophically oriented books.
A more recent practice is to use different non-logical symbols according to the application one has in mind. Therefore, it has become necessary to name the set of all non-logical symbols used in a particular application. This choice is made via a ''
signature
A signature (; from , "to sign") is a depiction of someone's name, nickname, or even a simple "X" or other mark that a person writes on documents as a proof of identity and intent. Signatures are often, but not always, Handwriting, handwritt ...
''.
Typical signatures in mathematics are or just for
group
A group is a number of persons or things that are located, gathered, or classed together.
Groups of people
* Cultural group, a group whose members share the same cultural identity
* Ethnic group, a group whose members share the same ethnic iden ...
s,
or for
ordered field
In mathematics, an ordered field is a field together with a total ordering of its elements that is compatible with the field operations. Basic examples of ordered fields are the rational numbers and the real numbers, both with their standard ord ...
s. There are no restrictions on the number of non-logical symbols. The signature can be
empty, finite, infinite, or even
uncountable
In mathematics, an uncountable set, informally, is an infinite set that contains too many elements to be countable. The uncountability of a set is closely related to its cardinal number: a set is uncountable if its cardinal number is larger tha ...
. Uncountable signatures occur for example in modern proofs of the
Löwenheim–Skolem theorem
In mathematical logic, the Löwenheim–Skolem theorem is a theorem on the existence and cardinality of models, named after Leopold Löwenheim and Thoralf Skolem.
The precise formulation is given below. It implies that if a countable first-order ...
.
Though signatures might in some cases imply how non-logical symbols are to be interpreted,
interpretation of the non-logical symbols in the signature is separate (and not necessarily fixed). Signatures concern syntax rather than semantics.
In this approach, every non-logical symbol is of one of the following types:
* A ''predicate symbol'' (or ''relation symbol'') with some ''valence'' (or ''arity'', number of arguments) greater than or equal to 0. These are often denoted by uppercase letters such as ''P'', ''Q'' and ''R''. Examples:
** In ''P''(''x''), ''P'' is a predicate symbol of valence 1. One possible interpretation is "''x'' is a man".
** In ''Q''(''x'',''y''), ''Q'' is a predicate symbol of valence 2. Possible interpretations include "''x'' is greater than ''y''" and "''x'' is the father of ''y''".
** Relations of valence 0 can be identified with
propositional variable
In mathematical logic, a propositional variable (also called a sentence letter, sentential variable, or sentential letter) is an input variable (that can either be true or false) of a truth function. Propositional variables are the basic building ...
s, which can stand for any statement. One possible interpretation of ''R'' is "Socrates is a man".
* A ''function symbol'', with some valence greater than or equal to 0. These are often denoted by lowercase
roman letters such as ''f'', ''g'' and ''h''. Examples:
** ''f''(''x'') may be interpreted as "the father of ''x''". In
arithmetic
Arithmetic is an elementary branch of mathematics that deals with numerical operations like addition, subtraction, multiplication, and division. In a wider sense, it also includes exponentiation, extraction of roots, and taking logarithms.
...
, it may stand for "-x". In set theory, it may stand for "the
power set
In mathematics, the power set (or powerset) of a set is the set of all subsets of , including the empty set and itself. In axiomatic set theory (as developed, for example, in the ZFC axioms), the existence of the power set of any set is po ...
of x".
** In arithmetic, ''g''(''x'',''y'') may stand for "''x''+''y''". In set theory, it may stand for "the union of ''x'' and ''y''".
** Function symbols of valence 0 are called ''constant symbols'', and are often denoted by lowercase letters at the beginning of the alphabet such as ''a'', ''b'' and ''c''. The symbol ''a'' may stand for Socrates. In arithmetic, it may stand for 0. In set theory, it may stand for the
empty set
In mathematics, the empty set or void set is the unique Set (mathematics), set having no Element (mathematics), elements; its size or cardinality (count of elements in a set) is 0, zero. Some axiomatic set theories ensure that the empty set exi ...
.
The traditional approach can be recovered in the modern approach, by simply specifying the "custom" signature to consist of the traditional sequences of non-logical symbols.
Formation rules
The
formation rule
In mathematical logic, formation rules are rules for describing well-formed words over the alphabet of a formal language. These rules only address the location and manipulation of the strings of the language. It does not describe anything else a ...
s define the terms and formulas of first-order logic. When terms and formulas are represented as strings of symbols, these rules can be used to write a
formal grammar
A formal grammar is a set of Terminal and nonterminal symbols, symbols and the Production (computer science), production rules for rewriting some of them into every possible string of a formal language over an Alphabet (formal languages), alphabe ...
for terms and formulas. These rules are generally
context-free (each production has a single symbol on the left side), except that the set of symbols may be allowed to be infinite and there may be many start symbols, for example the variables in the case of
terms.
Terms
The set of ''
terms'' is
inductively defined by the following rules:
# ''Variables''. Any variable symbol is a term.
# ''Functions''. If ''f'' is an ''n''-ary function symbol, and ''t''
1, ..., ''t''
''n'' are terms, then ''f''(''t''
1,...,''t''
''n'') is a term. In particular, symbols denoting individual constants are nullary function symbols, and thus are terms.
Only expressions which can be obtained by finitely many applications of rules 1 and 2 are terms. For example, no expression involving a predicate symbol is a term.
Formulas
The set of ''
formulas
In science, a formula is a concise way of expressing information symbolically, as in a mathematical formula or a ''chemical formula''. The informal use of the term ''formula'' in science refers to the general construct of a relationship betwe ...
'' (also called ''
well-formed formulas
In mathematical logic, propositional logic and predicate logic, a well-formed formula, abbreviated WFF or wff, often simply formula, is a finite sequence of symbols from a given alphabet that is part of a formal language.
The abbreviation wff i ...
'' or ''WFFs'') is inductively defined by the following rules:
# ''Predicate symbols''. If ''P'' is an ''n''-ary predicate symbol and ''t''
1, ..., ''t''
''n'' are terms then ''P''(''t''
1,...,''t''
''n'') is a formula.
# ''
Equality
Equality generally refers to the fact of being equal, of having the same value.
In specific contexts, equality may refer to:
Society
* Egalitarianism, a trend of thought that favors equality for all people
** Political egalitarianism, in which ...
''. If the equality symbol is considered part of logic, and ''t''
1 and ''t''
2 are terms, then ''t''
1 = ''t''
2 is a formula.
# ''Negation''. If
is a formula, then
is a formula.
# ''Binary connectives''. If and are formulas, then (
) is a formula. Similar rules apply to other binary logical connectives.
# ''Quantifiers''. If
is a formula and ''x'' is a variable, then
(for all x,
holds) and
(there exists x such that
) are formulas.
Only expressions which can be obtained by finitely many applications of rules 1–5 are formulas. The formulas obtained from the first two rules are said to be ''
atomic formula
In mathematical logic, an atomic formula (also known as an atom or a prime formula) is a formula with no deeper propositional structure, that is, a formula that contains no logical connectives or equivalently a formula that has no strict subformu ...
s''.
For example:
:
is a formula, if ''f'' is a unary function symbol, ''P'' a unary predicate symbol, and Q a ternary predicate symbol. However,
is not a formula, although it is a string of symbols from the alphabet.
The role of the parentheses in the definition is to ensure that any formula can only be obtained in one way—by following the inductive definition (i.e., there is a unique
parse tree
A parse tree or parsing tree (also known as a derivation tree or concrete syntax tree) is an ordered, rooted tree that represents the syntactic structure of a string according to some context-free grammar. The term ''parse tree'' itself is use ...
for each formula). This property is known as ''unique readability'' of formulas. There are many conventions for where parentheses are used in formulas. For example, some authors use colons or full stops instead of parentheses, or change the places in which parentheses are inserted. Each author's particular definition must be accompanied by a proof of unique readability.
Notational conventions
For convenience, conventions have been developed about the precedence of the logical operators, to avoid the need to write parentheses in some cases. These rules are similar to the
order of operations
In mathematics and computer programming, the order of operations is a collection of rules that reflect conventions about which operations to perform first in order to evaluate a given mathematical expression.
These rules are formalized with a ...
in arithmetic. A common convention is:
*
is evaluated first
*
and
are evaluated next
* Quantifiers are evaluated next
*
is evaluated last.
Moreover, extra punctuation not required by the definition may be inserted—to make formulas easier to read. Thus the formula:
:
might be written as:
:
Free and bound variables
In a formula, a variable may occur ''free'' or ''bound'' (or both). One formalization of this notion is due to Quine, first the concept of a variable occurrence is defined, then whether a variable occurrence is free or bound, then whether a variable symbol overall is free or bound. In order to distinguish different occurrences of the identical symbol ''x'', each occurrence of a variable symbol ''x'' in a formula φ is identified with the initial substring of φ up to the point at which said instance of the symbol ''x'' appears.
W. V. O. Quine W. may refer to:
* SoHo (Australian TV channel) (previously W.), an Australian pay television channel
* ''W.'' (film), a 2008 American biographical drama film based on the life of George W. Bush
* "W.", the fifth track from Codeine's 1992 EP ''Bar ...
''Mathematical Logic''
(1981). Harvard University Press
Harvard University Press (HUP) is an academic publishing house established on January 13, 1913, as a division of Harvard University. It is a member of the Association of University Presses. Its director since 2017 is George Andreou.
The pres ...
, 0-674-55451-5.p.297 Then, an occurrence of ''x'' is said to be bound if that occurrence of ''x'' lies within the scope of at least one of either
or
. Finally, ''x'' is bound in φ if all occurrences of ''x'' in φ are bound.
pp.142--143
Intuitively, a variable symbol is free in a formula if at no point is it quantified:
pp.142--143 in , the sole occurrence of variable ''x'' is free while that of ''y'' is bound. The free and bound variable occurrences in a formula are defined inductively as follows.
; Atomic formulas : If ''φ'' is an atomic formula, then ''x'' occurs free in ''φ'' if and only if ''x'' occurs in ''φ''. Moreover, there are no bound variables in any atomic formula.
; Negation : ''x'' occurs free in ¬''φ'' if and only if ''x'' occurs free in ''φ''. ''x'' occurs bound in ¬''φ'' if and only if ''x'' occurs bound in ''φ''
; Binary connectives : ''x'' occurs free in (''φ'' → ''ψ'') if and only if ''x'' occurs free in either ''φ'' or ''ψ''. ''x'' occurs bound in (''φ'' → ''ψ'') if and only if ''x'' occurs bound in either ''φ'' or ''ψ''. The same rule applies to any other binary connective in place of →.
; Quantifiers : ''x'' occurs free in , if and only if x occurs free in ''φ'' and ''x'' is a different symbol from ''y''. Also, ''x'' occurs bound in , if and only if ''x'' is ''y'' or ''x'' occurs bound in ''φ''. The same rule holds with in place of .
For example, in , ''x'' and ''y'' occur only bound, ''z'' occurs only free, and ''w'' is neither because it does not occur in the formula.
Free and bound variables of a formula need not be disjoint sets: in the formula , the first occurrence of ''x'', as argument of ''P'', is free while the second one, as argument of ''Q'', is bound.
A formula in first-order logic with no free variable occurrences is called a ''first-order
sentence''. These are the formulas that will have well-defined
truth value
In logic and mathematics, a truth value, sometimes called a logical value, is a value indicating the relation of a proposition to truth, which in classical logic has only two possible values ('' true'' or '' false''). Truth values are used in ...
s under an interpretation. For example, whether a formula such as Phil(''x'') is true must depend on what ''x'' represents. But the sentence will be either true or false in a given interpretation.
Example: ordered abelian groups
In mathematics, the language of ordered
abelian group
In mathematics, an abelian group, also called a commutative group, is a group in which the result of applying the group operation to two group elements does not depend on the order in which they are written. That is, the group operation is commu ...
s has one constant symbol 0, one unary function symbol −, one binary function symbol +, and one binary relation symbol ≤. Then:
*The expressions +(''x'', ''y'') and +(''x'', +(''y'', −(''z''))) are ''terms''. These are usually written as ''x'' + ''y'' and ''x'' + ''y'' − ''z''.
*The expressions +(''x'', ''y'') = 0 and ≤(+(''x'', +(''y'', −(''z''))), +(''x'', ''y'')) are ''atomic formulas''. These are usually written as ''x'' + ''y'' = 0 and ''x'' + ''y'' − ''z'' ≤ ''x'' + ''y''.
*The expression