- 3,096
- 1,168
https://en.wikipedia.org/wiki/Higher-order_logic
with some proper context, what tier will you get if you use higher-order logic ?
first order and second order logic
The distinction between first order logic and second-order logic is easiest to understand in elementary mathematics. Let us consider number theory. The objects of our study are the natural numbers 0, 1, 2,… and their arithmetic. With first order logic we can formulate statements about number theory by using atomic expressions x=y,x=y, x+y=zx+y=z and x×y=zx×y=z combined with the propositional operations ∧,∧, ¬,¬, ∨,∨, →→ and the quantifiers ∀x∀x and ∃x∃x. Here the variables x, y, z,… are thought to range over the natural numbers. With second-order logic we can express more: we have variables x, y, z,… as in first order logic for numbers. In addition we have variables X, Y, Z,… for properties of numbers and relations between numbers as well as quantifiers ∀X∀X and ∃X∃X for these variables. We have the atomic expressions of first order logic and also new atomic expressions of the form X(y1,…,yn)X(y1,…,yn).
An interesting and much studied question arises: what properties of natural numbers can be expressed in first order logic and what can be expressed in second-order logic? The question is equally interesting if “expressed” is replaced by “proved”, once a suitable proof system is given in both cases. We can replace natural numbers by some other mathematical context, for example real numbers, complex numbers, and so on.
With just the constant 00 and the unary function n↦n+n↦n+ (where n+n+ means n+1n+1) we can express in second-order logic the Induction Axiom
(1)∀X([X(0)∧∀y(X( y )→X(y+))]→∀yX( y )),(1)∀X([X(0)∧∀y(X( y )→X(y+))]→∀yX( y )),
of natural numbers. This, together with the axioms ∀x¬(x+=0)∀x¬(x+=0) and ∀x∀y(x+=y+→x=y)∀x∀y(x+=y+→x=y) characterizes the natural numbers with their successor operation up to isomorphism. In first order logic any theory which has a countably infinite model has also an uncountable model (by the Upward Löwenheim Skolem Theorem). Hence (11) cannot be expressed in first order logic. Another typical second-order expression is the Completeness Axiom of the linear order ≤≤ of the real numbers:
(2)∀X([∃yX( y )∧∃z∀y(X( y )→y≤z)]→∃z∀y(∃u(X(u)∧y≤u)∨z≤y)),(2)∀X([∃yX( y )∧∃z∀y(X( y )→y≤z)]→∃z∀y(∃u(X(u)∧y≤u)∨z≤y)),
This, together with the axioms of ordered fields characterizes the ordered field of real numbers up to isomorphism. In first order logic any countable theory which has an infinite model has also a countable model (by the Downward Löwenheim Skolem Theorem). Hence (22) cannot be expressed in first order logic.
Higher-order logic
There are many ways to further extend second-order logic. The most obvious is third, fourth, and so on order logic. The general principle, already recognized by Tarski (1933 [1956]), is that in higher order logic one can formalize the semantics—define truth—of lower order logic. Therefore one certainly gains expressive power by using higher order logic. Let us take number theory as an example. With first order logic we can express properties such as “n is a prime number” and propositions such as “there are infinitely many prime numbers”, Fermat’s Last Theorem and Goldbach’s Conjecture. First order properties of natural numbers fall into a natural hierarchy called the arithmetical hierarchy the levels of which are denoted Σ0nΣn0 and Π0nΠn0. With second-order logic we can talk about properties of sets of natural numbers, or in other words, properties of real numbers. In particular, we can define the rationals. A continuous function on the real numbers is determined by its values on rationals. Also, an open set is determined by which rational points it contains. Using these observations we can talk about continuous functions and open sets of reals. Basic facts in calculus, such as Bolzano’s Theorem stating that “If a continuous function has values of opposite sign inside an interval, then it has a root in that interval” are expressible in second-order logic over the structure (N,+,⋅)(N,+,⋅) of natural numbers. Second-order properties of natural numbers fall into a natural hierarchy called the analytical hierarchy and its levels are denoted Σ1nΣn1 and Π1nΠn1. With third order logic we can talk about sets of real numbers. We can write the Continuum Hypothesis in third order logic and ask the hard question, whether the model (N,+,⋅)(N,+,⋅) satisfies this sentence. Third order properties of natural numbers have again a natural hierarchy and its levels are denoted Σ2nΣn2 and Π2nΠn2.
It is obvious that if we keep a base model, such as (N,+,⋅)(N,+,⋅) fixed, and move to higher and higher order logic, we can express more and more complicated concepts and propositions. However, third order logic over
N1=(N,+,⋅)N1=(N,+,⋅)
is nothing more than second order logic over
N2=(P(N),E,N,+,⋅),N2=(P(N),E,N,+,⋅),
where E⊆N×P(N)E⊆N×P(N) is the relation nEr⟺n∈rnEr⟺n∈r, which again is nothing more than first order logic over
N3=(P(P(N))),E′,P(N),E,N,+,⋅),N3=(P(P(N))),E′,P(N),E,N,+,⋅),
where E′⊆P(N)×P(P(N)E′⊆P(N)×P(P(N) is the relation rE′X⟺r∈XrE′X⟺r∈X. Moreover, second-order logic over N1N1 is nothing more than first order logic over N2N2. When this line of thought is taken to its limit we can see that first order logic over the cumulative hierarchy of sets covers higher order logic over any individual level VαVα of the hierarchy. In a sense, first order logic over the cumulative hierarchy of sets is a very very high order logic over N1N1.
There is a marked similarity in the way N2N2 arises from N1N1 and in the way N3N3 arises from N2N2. In both cases we simply add a power set construction on top of what the model already has. Second-order logic alone is very good with power sets as we saw in §5.3. A consequence of this is that all the higher order logics (of any finite order and up to a point also of infinite order) from second-order on have Turing-equivalent decision problems and the same Hanf- and Löwenheim numbers (see §4). Thus, even though higher than second-order logics are strictly speaking stronger than second-order logic no difference can be seen by the usual criteria of strength of expressive power.
Type theory is a systematic approach to higher order logics. Variables are assigned types just as in second-order logic we have variables for individual type, relation type and function type. In a higher order logic it would make sense to have variables for relations between objects of any lower types as well as functions mapping objects of lower type to objects of lower type. In set theory objects have a rank. Elements of a set have a lower rank than the set itself. However, the difference between set-theoretical rank and typing in type theory is that in set theory the rank can be computed when the set is known while in type theory the type of an object can be seen from the type of the variable that the object is the value of. In a sense type theory imposes from the syntax a type for each object considered while in set theory a set has a rank given by the semantics. Arguably set theory gained dominance over type theory after the 1930s because of its simpler syntax and semantics. On the other hand type theory is used in computer science, especially in the theory of programming languages (see SEP entry on type theory).
with some proper context, what tier will you get if you use higher-order logic ?
Second-order and Higher-order Logic (Stanford Encyclopedia of Philosophy)
plato.stanford.edu
first order and second order logic
The distinction between first order logic and second-order logic is easiest to understand in elementary mathematics. Let us consider number theory. The objects of our study are the natural numbers 0, 1, 2,… and their arithmetic. With first order logic we can formulate statements about number theory by using atomic expressions x=y,x=y, x+y=zx+y=z and x×y=zx×y=z combined with the propositional operations ∧,∧, ¬,¬, ∨,∨, →→ and the quantifiers ∀x∀x and ∃x∃x. Here the variables x, y, z,… are thought to range over the natural numbers. With second-order logic we can express more: we have variables x, y, z,… as in first order logic for numbers. In addition we have variables X, Y, Z,… for properties of numbers and relations between numbers as well as quantifiers ∀X∀X and ∃X∃X for these variables. We have the atomic expressions of first order logic and also new atomic expressions of the form X(y1,…,yn)X(y1,…,yn).
An interesting and much studied question arises: what properties of natural numbers can be expressed in first order logic and what can be expressed in second-order logic? The question is equally interesting if “expressed” is replaced by “proved”, once a suitable proof system is given in both cases. We can replace natural numbers by some other mathematical context, for example real numbers, complex numbers, and so on.
With just the constant 00 and the unary function n↦n+n↦n+ (where n+n+ means n+1n+1) we can express in second-order logic the Induction Axiom
(1)∀X([X(0)∧∀y(X( y )→X(y+))]→∀yX( y )),(1)∀X([X(0)∧∀y(X( y )→X(y+))]→∀yX( y )),
of natural numbers. This, together with the axioms ∀x¬(x+=0)∀x¬(x+=0) and ∀x∀y(x+=y+→x=y)∀x∀y(x+=y+→x=y) characterizes the natural numbers with their successor operation up to isomorphism. In first order logic any theory which has a countably infinite model has also an uncountable model (by the Upward Löwenheim Skolem Theorem). Hence (11) cannot be expressed in first order logic. Another typical second-order expression is the Completeness Axiom of the linear order ≤≤ of the real numbers:
(2)∀X([∃yX( y )∧∃z∀y(X( y )→y≤z)]→∃z∀y(∃u(X(u)∧y≤u)∨z≤y)),(2)∀X([∃yX( y )∧∃z∀y(X( y )→y≤z)]→∃z∀y(∃u(X(u)∧y≤u)∨z≤y)),
This, together with the axioms of ordered fields characterizes the ordered field of real numbers up to isomorphism. In first order logic any countable theory which has an infinite model has also a countable model (by the Downward Löwenheim Skolem Theorem). Hence (22) cannot be expressed in first order logic.
Higher-order logic
There are many ways to further extend second-order logic. The most obvious is third, fourth, and so on order logic. The general principle, already recognized by Tarski (1933 [1956]), is that in higher order logic one can formalize the semantics—define truth—of lower order logic. Therefore one certainly gains expressive power by using higher order logic. Let us take number theory as an example. With first order logic we can express properties such as “n is a prime number” and propositions such as “there are infinitely many prime numbers”, Fermat’s Last Theorem and Goldbach’s Conjecture. First order properties of natural numbers fall into a natural hierarchy called the arithmetical hierarchy the levels of which are denoted Σ0nΣn0 and Π0nΠn0. With second-order logic we can talk about properties of sets of natural numbers, or in other words, properties of real numbers. In particular, we can define the rationals. A continuous function on the real numbers is determined by its values on rationals. Also, an open set is determined by which rational points it contains. Using these observations we can talk about continuous functions and open sets of reals. Basic facts in calculus, such as Bolzano’s Theorem stating that “If a continuous function has values of opposite sign inside an interval, then it has a root in that interval” are expressible in second-order logic over the structure (N,+,⋅)(N,+,⋅) of natural numbers. Second-order properties of natural numbers fall into a natural hierarchy called the analytical hierarchy and its levels are denoted Σ1nΣn1 and Π1nΠn1. With third order logic we can talk about sets of real numbers. We can write the Continuum Hypothesis in third order logic and ask the hard question, whether the model (N,+,⋅)(N,+,⋅) satisfies this sentence. Third order properties of natural numbers have again a natural hierarchy and its levels are denoted Σ2nΣn2 and Π2nΠn2.
It is obvious that if we keep a base model, such as (N,+,⋅)(N,+,⋅) fixed, and move to higher and higher order logic, we can express more and more complicated concepts and propositions. However, third order logic over
N1=(N,+,⋅)N1=(N,+,⋅)
is nothing more than second order logic over
N2=(P(N),E,N,+,⋅),N2=(P(N),E,N,+,⋅),
where E⊆N×P(N)E⊆N×P(N) is the relation nEr⟺n∈rnEr⟺n∈r, which again is nothing more than first order logic over
N3=(P(P(N))),E′,P(N),E,N,+,⋅),N3=(P(P(N))),E′,P(N),E,N,+,⋅),
where E′⊆P(N)×P(P(N)E′⊆P(N)×P(P(N) is the relation rE′X⟺r∈XrE′X⟺r∈X. Moreover, second-order logic over N1N1 is nothing more than first order logic over N2N2. When this line of thought is taken to its limit we can see that first order logic over the cumulative hierarchy of sets covers higher order logic over any individual level VαVα of the hierarchy. In a sense, first order logic over the cumulative hierarchy of sets is a very very high order logic over N1N1.
There is a marked similarity in the way N2N2 arises from N1N1 and in the way N3N3 arises from N2N2. In both cases we simply add a power set construction on top of what the model already has. Second-order logic alone is very good with power sets as we saw in §5.3. A consequence of this is that all the higher order logics (of any finite order and up to a point also of infinite order) from second-order on have Turing-equivalent decision problems and the same Hanf- and Löwenheim numbers (see §4). Thus, even though higher than second-order logics are strictly speaking stronger than second-order logic no difference can be seen by the usual criteria of strength of expressive power.
Type theory is a systematic approach to higher order logics. Variables are assigned types just as in second-order logic we have variables for individual type, relation type and function type. In a higher order logic it would make sense to have variables for relations between objects of any lower types as well as functions mapping objects of lower type to objects of lower type. In set theory objects have a rank. Elements of a set have a lower rank than the set itself. However, the difference between set-theoretical rank and typing in type theory is that in set theory the rank can be computed when the set is known while in type theory the type of an object can be seen from the type of the variable that the object is the value of. In a sense type theory imposes from the syntax a type for each object considered while in set theory a set has a rank given by the semantics. Arguably set theory gained dominance over type theory after the 1930s because of its simpler syntax and semantics. On the other hand type theory is used in computer science, especially in the theory of programming languages (see SEP entry on type theory).