Jump to content

Gödel numbering: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Lack of uniqueness: trying to avoid ambiguity on G. numbering vs. G. number, cf. Talk:Gödel_numbering#Uniqueness_–_or_not?
No edit summary
Tags: Mobile edit Mobile app edit iOS app edit App section source
 
(43 intermediate revisions by 26 users not shown)
Line 1: Line 1:
{{short description|Function in mathematical logic}}
{{Short description|Function in mathematical logic}}
{{For|numberings of the set of computable functions|Numbering (computability theory)}}
{{For|numberings of the set of computable functions|Numbering (computability theory)}}
{{more footnotes|date=April 2021}}


In [[mathematical logic]], a '''Gödel numbering''' is a [[function (mathematics)|function]] that assigns to each symbol and [[well-formed formula]] of some [[formal language]] a unique [[natural number]], called its '''Gödel number'''. The concept was used by [[Kurt Gödel]] for the proof of his [[Gödel's incompleteness theorems|incompleteness theorems]]. ({{harvnb|Gödel|1931}})
In [[mathematical logic]], a '''Gödel numbering''' is a [[function (mathematics)|function]] that assigns to each symbol and [[well-formed formula]] of some [[formal language]] a unique [[natural number]], called its '''Gödel number'''. [[Kurt Gödel]] developed the concept for the proof of his [[Gödel's incompleteness theorems|incompleteness theorems]]. ({{harvnb|Gödel|1931}})


A Gödel numbering can be interpreted as an [[Semantics encoding|encoding]] in which a number is assigned to each [[symbol]] of a [[mathematical notation]], after which a sequence of [[natural number]]s can then represent a sequence of symbols. These sequences of natural numbers can again be represented by single natural numbers, facilitating their manipulation in formal theories of arithmetic.
A Gödel numbering can be interpreted as an [[Semantics encoding|encoding]] in which a number is assigned to each [[symbol]] of a [[mathematical notation]], after which a sequence of [[natural number]]s can then represent a sequence of symbols. These sequences of natural numbers can again be represented by single natural numbers, facilitating their manipulation in formal theories of arithmetic.
Line 9: Line 10:


== Simplified overview ==
== Simplified overview ==
Gödel noted that statements within a system can be represented by natural numbers. The significance of this was that properties of statements - such as their truth and falsehood - would be equivalent to determining whether their Gödel numbers had certain properties. The numbers involved might be very long indeed (in terms of number of digits), but this is not a barrier; all that matters is that we can show such numbers can be constructed.
Gödel noted that each statement within a system can be represented by a natural number (its ''Gödel number''). The significance of this was that properties of a statement—such as its truth or falsehood—would be equivalent to determining whether its Gödel number had certain properties. The numbers involved might be very large indeed, but this is not a barrier; all that matters is that such numbers can be constructed.


In simple terms, we devise a method by which every formula or statement that can be formulated in our system gets a unique number, in such a way that we can mechanically convert back and forth between formulas and Gödel numbers. Clearly there are many ways this can be done. Given any statement, the number it is converted to is known as its Gödel number. A simple example is the way in which English is stored as a sequence of numbers in computers using [[ASCII]] or [[Unicode]]:
In simple terms, Gödel devised a method by which every formula or statement that can be formulated in the system gets a unique number, in such a way that formulas and Gödel numbers can be mechanically converted back and forth. There are many ways to do this. A simple example is the way in which English is stored as a sequence of numbers in computers using [[ASCII]]. Since ASCII codes are in the range 0 to 127, it is sufficient to pad them to 3 decimal digits and then to concatenate them:
:* The word '''<tt>HELLO</tt>''' is represented by 72-69-76-76-79 using decimal [[ASCII]].
* The word '''{{mono|1=foxy}}''' is represented by {{value|102111120121}}.
:* The logical statement '''<tt>x=y => y=x</tt>''' is represented by 120-61-121-32-61-62-32-121-61-120 using decimal ASCII.
* The logical formula '''{{code|1=x=y => y=x}}''' is represented by {{value|120061121032061062032121061120}}.


== Gödel's encoding ==
== Gödel's encoding ==
Line 19: Line 20:
|-
|-
| COLSPAN=8 |
| COLSPAN=8 |
| COLSPAN=4 | number variables
! COLSPAN=4 | number variables
| COLSPAN=3 | property variables
! COLSPAN=3 | property variables
| ...
| ...
|-
|-
Line 56: Line 57:
| 529
| 529
| ...
| ...
|+ Gödel's original encoding<ref>See Gödel 1931, p.179; Gödel's notation (see p.176) has been adapted to modern notation.</ref>
|+Gödel's original encoding<ref>See Gödel 1931, p. 179; Gödel's notation (see p. 176) has been adapted to modern notation.</ref>
|}
|}
Gödel used a system based on [[prime factorization]]. He first assigned a unique natural number to each basic symbol in the formal language of arithmetic with which he was dealing.
Gödel used a system based on [[prime factorization]]. He first assigned a unique natural number to each basic symbol in the formal language of arithmetic with which he was dealing.
Line 66: Line 67:
According to the [[fundamental theorem of arithmetic]], any number (and, in particular, a number obtained in this way) can be uniquely factored into [[prime factor]]s, so it is possible to recover the original sequence from its Gödel number (for any given number n of symbols to be encoded).
According to the [[fundamental theorem of arithmetic]], any number (and, in particular, a number obtained in this way) can be uniquely factored into [[prime factor]]s, so it is possible to recover the original sequence from its Gödel number (for any given number n of symbols to be encoded).


Gödel specifically used this scheme at two levels: first, to encode sequences of symbols representing formulas, and second, to encode sequences of formulas representing proofs. This allowed him to show a correspondence between statements about natural numbers and statements about the provability of theorems about natural numbers, the key observation of the proof.
Gödel specifically used this scheme at two levels: first, to encode sequences of symbols representing formulas, and second, to encode sequences of formulas representing proofs. This allowed him to show a correspondence between statements about natural numbers and statements about the provability of theorems about natural numbers, the proof's key observation ({{harvnb|Gödel|1931}}).


There are more sophisticated (and more concise) ways to construct a [[Gödel numbering for sequences]].
There are more sophisticated (and more concise) ways to construct a [[Gödel numbering for sequences]].


=== Example ===
=== Example ===
In the specific Gödel numbering used by Nagel and Newman, the Gödel number for the symbol "0" is 6 and the Gödel number for the symbol "=" is 5. Thus, in their system, the Gödel number of the formula "0 = 0" is 2<sup>6</sup> × 3<sup>5</sup> × 5<sup>6</sup> = 243,000,000.

In the specific Gödel numbering used by Nagel and Newman, the Gödel number for the symbol "0" is 6 and the Gödel number for the symbol "=" is 5. Thus, in their system, the Gödel number of the formula "0 = 0" is 2<sup>6</sup> × 3<sup>5</sup> × 5<sup>6</sup> = 243,000,000.


== Lack of uniqueness ==
== Lack of uniqueness ==


Infinitely many different Gödel numberings are possible. For example, supposing there are ''K'' basic symbols, an alternative Gödel numbering could be constructed by invertibly mapping this set of symbols (through, say, an [[invertible function]] ''h'') to the set of digits of a [[Bijective numeration|bijective base-''K'' numeral system]]. A formula consisting of a string of ''n'' symbols <math> s_1 s_2 s_3 \dots s_n</math> would then be mapped to the number
Infinitely many different Gödel numberings are possible.
For example, supposing there are ''K'' basic symbols, an alternative Gödel numbering could be constructed by invertibly mapping this set of symbols (through, say, an [[invertible function]] ''h'') to the set of digits of a [[Bijective numeration|bijective base-''K'' numeral system]]. A formula consisting of a string of ''n'' symbols <math> s_1 s_2 s_3 \dots s_n</math> would then be mapped to the number


:<math> h(s_1) \times K^{(n-1)} + h(s_2) \times K^{(n-2)} + \cdots + h(s_{n-1}) \times K^1 + h(s_n) \times K^0 .</math>
:<math> h(s_1) \times K^{(n-1)} + h(s_2) \times K^{(n-2)} + \cdots + h(s_{n-1}) \times K^1 + h(s_n) \times K^0 .</math>


In other words, by placing the set of ''K'' basic symbols in some fixed order, such that the ''i''<sup>''th''</sup> symbol corresponds uniquely to the ''i''<sup>''th''</sup> digit of a bijective base-''K'' numeral system, ''each formula may serve just as the very numeral of its own Gödel number.''
In other words, by placing the set of ''K'' basic symbols in some fixed order, such that the <math>i</math>-th symbol corresponds uniquely to the <math>i</math>-th digit of a bijective base-''K'' numeral system, ''each formula may serve just as the very numeral of its own Gödel number.''


For example, the numbering described [[Proof sketch for Gödel's first incompleteness theorem#G.C3.B6del numbering|here]] has K=10000.
For example, the numbering described [[Proof sketch for Gödel's first incompleteness theorem#G.C3.B6del numbering|here]] has K=1000.{{efn-lr|name=fn1}}


== Application to formal arithmetic ==
== Application to formal arithmetic ==


===Recursion===
===Recursion===
{{main|Course-of-values recursion}}
{{Main|Course-of-values recursion}}
One may use Gödel numbering to show how functions defined by [[course-of-values recursion]] are in fact [[primitive recursive function]]s.
One may use Gödel numbering to show how functions defined by [[course-of-values recursion]] are in fact [[primitive recursive function]]s.


===Expressing statements and proofs by numbers===
===Expressing statements and proofs by numbers===
{{main|Proof sketch for Gödel's first incompleteness theorem}}
{{Main|Proof sketch for Gödel's first incompleteness theorem}}
Once a Gödel numbering for a formal theory is established, each [[rule of inference|inference rule]] of the theory can be expressed as a function on the natural numbers. If ''f'' is the Gödel mapping and ''r'' is an inference rule, then there should be some [[arithmetical function]] ''g<sub>r</sub>'' of natural numbers such that if formula ''C'' is derived from formulas ''A'' and ''B'' through an inference rule ''r'', i.e.
Once a Gödel numbering for a formal theory is established, each [[rule of inference|inference rule]] of the theory can be expressed as a function on the natural numbers. If ''f'' is the Gödel mapping and ''r'' is an inference rule, then there should be some [[arithmetical function]] ''g<sub>r</sub>'' of natural numbers such that if formula ''C'' is derived from formulas ''A'' and ''B'' through an inference rule ''r'', i.e.
:<math> A, B \vdash_r C, </math>
:<math> A, B \vdash_r C, </math>
Line 104: Line 103:


In [[computability theory]], the term "Gödel numbering" is used in settings more general than the one described above. It can refer to:
In [[computability theory]], the term "Gödel numbering" is used in settings more general than the one described above. It can refer to:
#Any assignment of the elements of a [[formal language]] to natural numbers in such a way that the numbers can be manipulated by an [[algorithm]] to simulate manipulation of elements of the formal language.{{cn|date=February 2020}}
#Any assignment of the elements of a [[formal language]] to natural numbers in such a way that the numbers can be manipulated by an [[algorithm]] to simulate manipulation of elements of the formal language.{{Citation needed|date=February 2020}}
#More generally, an assignment of elements from a countable mathematical object, such as a countable [[group (mathematics)|group]], to natural numbers to allow algorithmic manipulation of the mathematical object.{{cn|date=February 2020}}
#More generally, an assignment of elements from a countable mathematical object, such as a countable [[group (mathematics)|group]], to natural numbers to allow algorithmic manipulation of the mathematical object.{{Citation needed|date=February 2020}}


Also, the term Gödel numbering is sometimes used when the assigned "numbers" are actually strings, which is necessary when considering models of computation such as [[Turing machine]]s that manipulate strings rather than numbers.{{cn|date=February 2020}}
Also, the term Gödel numbering is sometimes used when the assigned "numbers" are actually strings, which is necessary when considering models of computation such as [[Turing machine]]s that manipulate strings rather than numbers.{{Citation needed|date=February 2020}}
<!--
<!--
There is a very different meaning of the term Gödel numbering relating to
There is a very different meaning of the term Gödel numbering relating to
Line 121: Line 120:
* [[Gödel's incompleteness theorems]]
* [[Gödel's incompleteness theorems]]
* [[Kolmogorov complexity#Chaitin.27s incompleteness theorem|Chaitin's incompleteness theorem]]
* [[Kolmogorov complexity#Chaitin.27s incompleteness theorem|Chaitin's incompleteness theorem]]

== Notes ==
{{notelist-lr|refs=
{{efn-lr|name=fn1|For another, perhaps-more-intuitive example, suppose you have three symbols to encode, and choose bijective base-10 for familiarity (so enumeration starts at 1, 10 is represented by a symbol e.g. ''A,'' and place-value carries at 11 rather than 10: decimal ''19'' will still be ''19,'' and so with ''21;'' but decimal ''20'' will be ''1A''). Using <math> h(s_n) = n</math> and the formula above:
{{pb}}
<math>(1 \times 10^{(3-1)} + 2 \times 10^{(3-2)} + 3 \times 10^{(3-3)}) = (1 \times 10^{2} + 2 \times 10^{1} + 3 \times 10^{0}) = (100 + 20 + 3)</math>{{efn-lr|name=fn2}}
{{pb}}
...we arrive at '''<math>123</math>''' as our numbering—a neat feature.}}
{{efn-lr|name=fn2|(or, in bijective base-10 form: <math>9A + 1A + 3</math>)}}}}


== References ==
== References ==


* {{Citation|last=Gödel|first=Kurt|title=Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I|journal=[[Monatshefte für Mathematik und Physik]]|volume=38|year=1931|pages=173&ndash;198|url=http://www.w-k-essler.de/pdfs/goedel.pdf|access-date=2013-12-07|archive-url=https://web.archive.org/web/20180411113347/http://www.w-k-essler.de/pdfs/goedel.pdf|archive-date=2018-04-11|url-status=dead}}.
* {{Citation|last=Gödel|first=Kurt|title=Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I|journal=[[Monatshefte für Mathematik und Physik]]|volume=38|year=1931|pages=173&ndash;198|doi=10.1007/BF01700692|s2cid=197663120|url=http://www.w-k-essler.de/pdfs/goedel.pdf|access-date=2013-12-07|archive-url=https://web.archive.org/web/20180411113347/http://www.w-k-essler.de/pdfs/goedel.pdf|archive-date=2018-04-11|url-status=dead}}.
*''Gödel's Proof'' by [[Ernest Nagel]] and [[James R. Newman]] (1959). This book provides a good introduction and summary of the proof, with a large section dedicated to Gödel's numbering.
*''Gödel's Proof'' by [[Ernest Nagel]] and [[James R. Newman]] (1959). This book provides a good introduction and summary of the proof, with a large section dedicated to Gödel's numbering.


{{reflist}}
{{Reflist}}


== Further reading ==
== Further reading ==
* ''[[Gödel, Escher, Bach|Gödel, Escher, Bach: an Eternal Golden Braid]]'', by [[Douglas Hofstadter]]. This book defines and uses an alternative Gödel numbering.
* ''[[Gödel, Escher, Bach|Gödel, Escher, Bach: an Eternal Golden Braid]]'', by [[Douglas Hofstadter]]. This book defines and uses an alternative Gödel numbering.
*''[[I Am a Strange Loop]]'' by [[Douglas Hofstadter]]. This is a newer book by Hofstadter that includes the history of Gödel's numbering.
*''[[I Am a Strange Loop]]'' by [[Douglas Hofstadter]]. This is a newer book by Hofstadter that includes the history of Gödel's numbering.
* [http://blog.theincredibleholk.org/TarpitGazer/jot-visualization.pdf Visualizing the Turing Tarpit]. Uses Gödel numbering to encode programs.<!-- DOI and ref data can be found here: http://dl.acm.org/citation.cfm?id=2505348 -->
* ''[https://web.archive.org/web/2017/https://blog.theincredibleholk.org/TarpitGazer/jot-visualization.pdf Visualizing the Turing Tarpit]'' by Jason Hemann and Eric Holk. Uses Gödel numbering to encode programs.<!-- DOI and ref data can be found here: http://dl.acm.org/citation.cfm?id=2505348 -->

{{Mathematical logic}}
{{Authority control}}


{{DEFAULTSORT:Godel numbering}}
{{DEFAULTSORT:Godel numbering}}

Latest revision as of 05:05, 17 November 2024

In mathematical logic, a Gödel numbering is a function that assigns to each symbol and well-formed formula of some formal language a unique natural number, called its Gödel number. Kurt Gödel developed the concept for the proof of his incompleteness theorems. (Gödel 1931)

A Gödel numbering can be interpreted as an encoding in which a number is assigned to each symbol of a mathematical notation, after which a sequence of natural numbers can then represent a sequence of symbols. These sequences of natural numbers can again be represented by single natural numbers, facilitating their manipulation in formal theories of arithmetic.

Since the publishing of Gödel's paper in 1931, the term "Gödel numbering" or "Gödel code" has been used to refer to more general assignments of natural numbers to mathematical objects.

Simplified overview

[edit]

Gödel noted that each statement within a system can be represented by a natural number (its Gödel number). The significance of this was that properties of a statement—such as its truth or falsehood—would be equivalent to determining whether its Gödel number had certain properties. The numbers involved might be very large indeed, but this is not a barrier; all that matters is that such numbers can be constructed.

In simple terms, Gödel devised a method by which every formula or statement that can be formulated in the system gets a unique number, in such a way that formulas and Gödel numbers can be mechanically converted back and forth. There are many ways to do this. A simple example is the way in which English is stored as a sequence of numbers in computers using ASCII. Since ASCII codes are in the range 0 to 127, it is sufficient to pad them to 3 decimal digits and then to concatenate them:

  • The word foxy is represented by 102111120121.
  • The logical formula x=y => y=x is represented by 120061121032061062032121061120.

Gödel's encoding

[edit]
number variables property variables ...
Symbol 0 s ¬ ( ) x1 x2 x3 ... P1 P2 P3 ...
Number 1 3 5 7 9 11 13 17 19 23 ... 289 361 529 ...
Gödel's original encoding[1]

Gödel used a system based on prime factorization. He first assigned a unique natural number to each basic symbol in the formal language of arithmetic with which he was dealing.

To encode an entire formula, which is a sequence of symbols, Gödel used the following system. Given a sequence of positive integers, the Gödel encoding of the sequence is the product of the first n primes raised to their corresponding values in the sequence:

According to the fundamental theorem of arithmetic, any number (and, in particular, a number obtained in this way) can be uniquely factored into prime factors, so it is possible to recover the original sequence from its Gödel number (for any given number n of symbols to be encoded).

Gödel specifically used this scheme at two levels: first, to encode sequences of symbols representing formulas, and second, to encode sequences of formulas representing proofs. This allowed him to show a correspondence between statements about natural numbers and statements about the provability of theorems about natural numbers, the proof's key observation (Gödel 1931).

There are more sophisticated (and more concise) ways to construct a Gödel numbering for sequences.

Example

[edit]

In the specific Gödel numbering used by Nagel and Newman, the Gödel number for the symbol "0" is 6 and the Gödel number for the symbol "=" is 5. Thus, in their system, the Gödel number of the formula "0 = 0" is 26 × 35 × 56 = 243,000,000.

Lack of uniqueness

[edit]

Infinitely many different Gödel numberings are possible. For example, supposing there are K basic symbols, an alternative Gödel numbering could be constructed by invertibly mapping this set of symbols (through, say, an invertible function h) to the set of digits of a bijective base-K numeral system. A formula consisting of a string of n symbols would then be mapped to the number

In other words, by placing the set of K basic symbols in some fixed order, such that the -th symbol corresponds uniquely to the -th digit of a bijective base-K numeral system, each formula may serve just as the very numeral of its own Gödel number.

For example, the numbering described here has K=1000.[i]

Application to formal arithmetic

[edit]

Recursion

[edit]

One may use Gödel numbering to show how functions defined by course-of-values recursion are in fact primitive recursive functions.

Expressing statements and proofs by numbers

[edit]

Once a Gödel numbering for a formal theory is established, each inference rule of the theory can be expressed as a function on the natural numbers. If f is the Gödel mapping and r is an inference rule, then there should be some arithmetical function gr of natural numbers such that if formula C is derived from formulas A and B through an inference rule r, i.e.

then

This is true for the numbering Gödel used, and for any other numbering where the encoded formula can be arithmetically recovered from its Gödel number.

Thus, in a formal theory such as Peano arithmetic in which one can make statements about numbers and their arithmetical relationships to each other, one can use a Gödel numbering to indirectly make statements about the theory itself. This technique allowed Gödel to prove results about the consistency and completeness properties of formal systems.

Generalizations

[edit]

In computability theory, the term "Gödel numbering" is used in settings more general than the one described above. It can refer to:

  1. Any assignment of the elements of a formal language to natural numbers in such a way that the numbers can be manipulated by an algorithm to simulate manipulation of elements of the formal language.[citation needed]
  2. More generally, an assignment of elements from a countable mathematical object, such as a countable group, to natural numbers to allow algorithmic manipulation of the mathematical object.[citation needed]

Also, the term Gödel numbering is sometimes used when the assigned "numbers" are actually strings, which is necessary when considering models of computation such as Turing machines that manipulate strings rather than numbers.[citation needed]

Gödel sets

[edit]

Gödel sets are sometimes used in set theory to encode formulas, and are similar to Gödel numbers, except that one uses sets rather than numbers to do the encoding. In simple cases when one uses a hereditarily finite set to encode formulas this is essentially equivalent to the use of Gödel numbers, but somewhat easier to define because the tree structure of formulas can be modeled by the tree structure of sets. Gödel sets can also be used to encode formulas in infinitary languages.

See also

[edit]

Notes

[edit]
  1. ^ For another, perhaps-more-intuitive example, suppose you have three symbols to encode, and choose bijective base-10 for familiarity (so enumeration starts at 1, 10 is represented by a symbol e.g. A, and place-value carries at 11 rather than 10: decimal 19 will still be 19, and so with 21; but decimal 20 will be 1A). Using and the formula above:

    [ii]

    ...we arrive at as our numbering—a neat feature.

  2. ^ (or, in bijective base-10 form: )

References

[edit]
  • Gödel, Kurt (1931), "Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I" (PDF), Monatshefte für Mathematik und Physik, 38: 173–198, doi:10.1007/BF01700692, S2CID 197663120, archived from the original (PDF) on 2018-04-11, retrieved 2013-12-07.
  • Gödel's Proof by Ernest Nagel and James R. Newman (1959). This book provides a good introduction and summary of the proof, with a large section dedicated to Gödel's numbering.
  1. ^ See Gödel 1931, p. 179; Gödel's notation (see p. 176) has been adapted to modern notation.

Further reading

[edit]