Rice–Shapiro theorem

In computability theory, the Rice–Shapiro theorem is a generalization of Rice's theorem, named after Henry Gordon Rice and Norman Shapiro. It states that when a semi-decidable property of partial computable functions is true on a certain partial function, one can extract a finite subfunction such that the property is still true.

The informal idea of the theorem is that the "only general way" to obtain information on the behavior of a program is to run the program, and because a computation is finite, one can only try the program on a finite number of inputs.

A closely related theorem is the Kreisel-Lacombe-Shoenfield-Tseitin theorem, which was obtained independently by Georg Kreisel, Daniel Lacombe and Joseph R. Shoenfield [1], and by Grigori Tseitin[2].

Formal statement

Rice-Shapiro theorem.[3]: 482 [4][5] Let P be a set of partial computable functions such that the index set of P (i.e., the set of indices e such that φeP, for some fixed admissible numbering φ) is semi-decidable. Then for any partial computable function f, it holds that P contains f if and only if P contains a finite subfunction of f (i.e., a partial function defined in finitely many points, which takes the same values as f on those points).

Kreisel-Lacombe-Shoenfield-Tseitin theorem.[3]: 362 [1][2][6][7][8] Let P be a set of total computable functions such that the index set of P is decidable with a promise that the input is the index of a total computable function (i.e., there is a partial computable function D which, given an index e such that φe is total, returns 1 if φeP and 0 otherwise; D(e) need not be defined if φe is not total). We say that two total functions f, g "agree until n" if for all kn it holds that f(k) = g(k). Then for any total computable function f, there exists n such that for all total computable function g which agrees with f until n, fPgP.

Discussion

The two theorems are closely related, and also relate to Rice's theorem. Specifically:

  • Rice's theorem applies to decidable sets of partial computable functions, concluding that they must be trivial.
  • The Rice-Shapiro theorem applies to semi-decidable sets of partial computable functions, concluding that they can only recognize elements based on a finite number of values.
  • The Kreisel-Lacombe-Shoenfield-Tseitin theorem applies to decidable sets of total computable functions, with a conclusion similar to the Rice-Shapiro theorem.

Examples

By the Rice-Shapiro theorem, it is neither semi-decidable nor co-semi-decidable whether a given program:

  • Terminates on all inputs (universal halting problem);
  • Terminates on finitely many inputs;
  • Is equivalent to a fixed other program.

By the Kreisel-Lacombe-Shoenfield-Tseitin theorem, it is undecidable whether a given program which is assumed to always terminate:

  • Always returns an even number;
  • Is equivalent to a fixed other program that always terminates;
  • Always returns the same value.

Proof of the Rice-Shapiro theorem

Let P be a set of partial computable functions with semi-decidable index set.

Upward closedness

We first prove that P is an upward closed set, i.e., if fg and fP, then gP (here, fg means that f is a subfunction of g, i.e., the graph of f is contained in the graph of g). The proof uses a diagonal argument typical of theorems in computability.

Assume for contradiction that there are two functions f and g such that fP, gP and fg. We build a program p as follows. This program takes an input x. Using a standard dovetailing technique, p runs two tasks in parallel.

  • The first task executes a semi-algorithm that semi-decides P on p itself (p can get access to its own source code by Kleene's recursion theorem). If this eventually returns true, then this first task continues by executing a semi-algorithm that semi-computes g on x (the input to p), and if that terminates, then the task makes p as a whole return g(x).
  • The second task runs a semi-algorithm that semi-computes f on x. If this returns true, then the task makes p as a whole return f(x).

We distinguish two cases.

  • First case: φpP. The first task can never finish, therefore the result of p is entirely determined by the second task, thus φp is simply f, contradicting the assumption fP.
  • Second case: φpP. If f is not defined on x, then the second task can never finish, therefore p returns g(x), or loops if this is undefined. On the other hand, if f is defined on x, it is possible that the second task finishes and is the first to return. In that case, p returns f(x). However, since fg, we actually have f(x) = g(x). Thus, we see that φp is g. This contradicts the assumption gP.

Extracting a finite subfunction

Next, we prove that if P contains a partial computable function f, then it contains a finite subfunction of f. Let us fix a partial computable function f in P. We build a program p which takes input x and runs the following steps:

  • Run x computation steps of a semi-algorithm that semi-decides P, with p itself as input. If this returns true, then loop indefinitely.
  • Otherwise, semi-compute f on x, and if this terminates, return the result f(x).

Suppose that φpP. This implies that the semi-algorithm for semi-deciding P used in the first step never returns true. Then, p computes f, and this contradicts the assumption fP. Thus, we must have φpP, and the algorithm for semi-deciding P returns true on p after a certain number of steps n. The partial function φp can only be defined on inputs x such that xn, and it returns f(x) on such inputs, thus it is a finite subfunction of f that belongs to P.

Conclusion

It only remains to assemble the two parts of the proof. If P contains a partial computable function f, then it contains a finite subfunction of f by the second part, and conversely, if it contains a finite subfunction of f, then it contains f, because it is upward closed by the first part. Thus, the theorem is proved.

Proof of the Kreisel-Lacombe-Shoenfield-Tseitin theorem

Preliminaries

A total function is said to be ultimately zero if it always takes the value zero except for a finite number of points, i.e., there exists N such that for all nN, h(n) = 0. Note that such a function is always computable (it can be computed by simply checking if the input is in a certain predefined list, and otherwise returning zero).

We fix U a computable enumeration of all total functions which are ultimately zero, that is, U is such that:

  • For all k, φU(k) is ultimately zero;
  • For all total function h which is ultimately zero, there exists k such that φU(k) = h;
  • The function U is itself total computable.

We can build U by standard techniques (e.g., for increasing N, enumerate ultimately zero functions which are bounded by N and zero on inputs larger than N).

Approximating by ultimately zero functions

Let P be as in the statement of the theorem: a set of total computable functions such that there is an algorithm which, given an index e and a promise that φe is computable, decides whether φeP.

We first prove a lemma: For all total computable function f, and for all integer N, there exists an ultimately zero function h such that h agrees with f until N, and fPhP.

To prove this lemma, fix a total computable function f and an integer N, and let B be the boolean fP. Build a program p which takes input x and takes these steps:

  • If xN then return f(x);
  • Otherwise, run x computation steps of the algorithm that decides P on p, and if this returns B, then return zero;
  • Otherwise, return f(x).

Clearly, p always terminates, i.e., φp is total. Therefore, the promise to P run on p is fulfilled.

Suppose for contradiction that one of f and φp belongs to P and the other does not, i.e., (φpP) ≠ B. Then we see that p computes f, since P does not return B on p no matter the amount of steps. Thus, we have f = φp, contradicting the fact that one of f and φp belongs to P and the other does not. This argument proves that fPφpP. Then, the second step makes p return zero for sufficiently large x, thus φp is ultimately zero; and by construction (due to the first step), φp agrees with f until N. Therefore, we can take h = φp and the lemma is proved.

Main proof

With the previous lemma, we can now prove the Kreisel-Lacombe-Shoenfield-Tseitin theorem. Again, fix P as in the theorem statement, let f a total computable function and let B be the boolean "fP". Build the program p which takes input x and runs these steps:

  • Run x computation steps of the algorithm that decides P on p.
  • If this returns B in a certain number of steps n (which is at most x), then search in parallel for k such that U(k) agrees with f until n and (U(k) ∈ P) ≠ B. As soon as such a k is found, return U(k)(x).
  • Otherwise (if P did not return B on p in x steps), return f(x).

We first prove that P returns B on p. Suppose by contradiction that this is not the case (P returns ¬B, or P does not terminate). Then p actually computes f. In particular, φp is total, so the promise to P when run on p is fulfilled, and P returns the boolean φpP, which is fP, i.e., B, contradicting the assumption.

Let n be the number of steps that P takes to return B on p. We claim that n satisfies the conclusion of the theorem: for all total computable function g which agrees with f until n, it holds that fPgP. Assume by contradiction that there exists g total computable which agrees with f until n and such that (gP) ≠ B.

Applying the lemma again, there exists k such that U(k) agrees with g until n and gPU(k) ∈ P. For such k, U(k) agrees with g until n and g agrees with f until n, thus U(k) also agrees with f until n, and since (gP) ≠ B and gPU(k) ∈ P, we have (U(k) ∈ P) ≠ B. Therefore, U(k) satisfies the conditions of the parallel search step in the program p, namely: U(k) agrees with f until n and (U(k) ∈ P) ≠ B. This proves that the search in the second step always terminates. We fix k to be the value that it finds.

We observe that φp = U(k). Indeed, either the second step of p returns U(k)(x), or the third step returns f(x), but the latter case only happens for xn, and we know that U(k) agrees with f until n.

In particular, φp = U(k) is total. This makes the promise to P run on p fulfilled, therefore P returns φpP on p.

We have found a contradiction: one the one hand, the boolean φpP is the return value of P on p, which is B, and on the other hand, we have φp = U(k), and we know that (U(k) ∈ P) ≠ B.

Perspective from effective topology

For any finite unary function on integers, let denote the 'frustum' of all partial-recursive functions that are defined, and agree with , on 's domain.

Equip the set of all partial-recursive functions with the topology generated by these frusta as base. Note that for every frustum , the index set is recursively enumerable. More generally it holds for every set of partial-recursive functions:

is recursively enumerable iff is a recursively enumerable union of frusta.

Applications

The Kreisel-Lacombe-Shoenfield-Tseitin theorem has been applied to foundational problems in computational social choice (more broadly, algorithmic game theory). For instance, Kumabe and Mihara[9][10] apply this result to an investigation of the Nakamura numbers for simple games in cooperative game theory and social choice theory.

Notes

  1. ^ a b Kreisel, Georg; Lacombe, Daniel; Shoenfield, Joseph R. (1959). "Partial recursive functionals and effective operations". In Heyting, Arend (ed.). Constructivity in Mathematics. Studies in Logic and the Foundations of Mathematics. Amsterdam: North-Holland. pp. 290–297.
  2. ^ a b Tseitin, Grigori (1959). "Algorithmic operators in constructive complete separable metric spaces". Doklady Akademii Nauk. 128: 49-52.
  3. ^ a b Rogers Jr., Hartley (1987). Theory of Recursive Functions and Effective Computability. MIT Press. ISBN 0-262-68052-1.
  4. ^ Cutland, Nigel (1980). Computability: an introduction to recursive function theory. Cambridge University Press.; Theorem 7-2.16.
  5. ^ Odifreddi, Piergiorgio (1989). Classical Recursion Theory. North Holland.
  6. ^ Moschovakis, Yiannis N. (June 2010). "Kleene's amazing second recursion theorem" (PDF). The Bulletin of Symbolic Logic. 16 (2).
  7. ^ Royer, James S. (June 1997). "Semantics vs Syntax vs Computations: Machine Models for Type-2 Polynomial-Time Bounded Functionals". Journal of Computer and System Sciences. 54 (3): 424–436. doi:10.1006/jcss.1997.1487.
  8. ^ Longley, John; Normann, Dag (2015). Higher-Order Computability. Springer. p. 441. doi:10.1007/978-3-662-47992-6.
  9. ^ Kumabe, M.; Mihara, H. R. (2008). "The Nakamura numbers for computable simple games". Social Choice and Welfare. 31 (4): 621. arXiv:1107.0439. doi:10.1007/s00355-008-0300-5. S2CID 8106333.
  10. ^ Kumabe, M.; Mihara, H. R. (2008). "Computability of simple games: A characterization and application to the core". Journal of Mathematical Economics. 44 (3–4): 348–366. arXiv:0705.3227. doi:10.1016/j.jmateco.2007.05.012. S2CID 8618118.

Read other articles:

American football player (1935–2020) American football player Paul HornungHornung in 1961No. 5Position:Halfback KickerPersonal informationBorn:(1935-12-23)December 23, 1935Louisville, Kentucky, U.S.Died:November 13, 2020(2020-11-13) (aged 84)Louisville, Kentucky, U.S.Height:6 ft 2 in (1.88 m)Weight:215 lb (98 kg)Career informationHigh school:Flaget (Louisville, Kentucky)College:Notre Dame (1954–1956)NFL draft:1957 / Round: 1 / Pick: 1Career h…

Bryobiotina Ne doit pas être confondu avec Bryophyta. Bryobiotina Mousses de l'espèce Bryum argenteum sur un mur.Classification Catalogue of Life Règne Plantae Sous-règneBryobiotinaTrevis, 1876 Les Splachnaceae (en) vivent comme Tetraplodon (de)[Note 1] sur les excréments d'animaux herbivores ou de cadavres dans les milieux humides (tourbières, pâturages, forêts). Leurs sporophytes aux couleurs voyantes produisent comme certaines fleurs cadavres une odeur fécale pour attirer d…

Vera FarmigaVera Farmiga di San Diego Comic-Con tahun 2018LahirVera Ann Farmiga6 Agustus 1973 (umur 50)Essex County, New Jersey, Amerika SerikatPekerjaanAktrisTahun aktif1997–sekarangSuami/istriSebastian Roché (1997–2005) (cerai)Renn Hawkey (2008–sekarang) Vera Ann Farmiga (lahir 6 Agustus 1973) adalah aktris asal Amerika Serikat. Ia berperan dalam beberapa film seperti Running Scared, The Departed, Orphan dan Up in the Air. Ia pernah menjadi sutradara dalam film Higher Ground. …

本條目存在以下問題,請協助改善本條目或在討論頁針對議題發表看法。 此條目需要擴充。 (2013年1月1日)请協助改善这篇條目,更進一步的信息可能會在討論頁或扩充请求中找到。请在擴充條目後將此模板移除。 此條目需要补充更多来源。 (2013年1月1日)请协助補充多方面可靠来源以改善这篇条目,无法查证的内容可能會因為异议提出而被移除。致使用者:请搜索一下条目的标…

Public school district in Texas, USA Lone Oak High School Marching Band Lone Oak Independent School District is a public school district based in Lone Oak, Texas USA. Located in Hunt County, a small portion of the district extends into Rains County. It covers 98 square miles.[1] The district is managed by a seven-member board. The superintendent is Janeé Carter.[2] The district educates around 860 students, in four schools, and employs approximately 65 teachers.[3] Stand…

Autumn in the Brushy Mountains. The Brushy Mountains are a mountain range located in northwestern North Carolina. They are an isolated spur of the much larger Blue Ridge Mountains, separated from them by the Yadkin River valley.[1] A deeply eroded range, they move from the southwest to the northeast, and cross five counties in North Carolina: Caldwell, Alexander, Wilkes, Iredell, and Yadkin. The Brushy Mountains divide, for much of their courses, the waters of the Yadkin River and the Ca…

1986 United States Senate election in South Dakota ← 1980 November 4, 1986 1992 →   Nominee Tom Daschle James Abdnor Party Democratic Republican Popular vote 152,657 143,173 Percentage 51.60% 48.40% County resultsDaschle:      50–60%      60–70%      70–80%      80–90% Abdnor:      50–60%      60–70% …

Unión de Partidos LatinoamericanosPresidente Julián Obiglio (PRO)Vicepresidente 4 en el cargo[1]​[2]​ Andrea Ojeda (RN) Álvaro Arzú Escobar(PU) Guido Chiriboga High (CREO) Anibal Zapattini (MDR-PC) Director ejecutivo Nicolás Figari Víal[3]​[1]​Fundación 22 de noviembre de 1992[3]​[4]​Ideología Conservadurismo socialConservadurismo liberalSocialcristianismoEconomía social de mercado[4]​NacionalismoLiberalismo económicoPosición DerechaMiembro de…

  لمعانٍ أخرى، طالع باي باك (توضيح). باي باكPayback (بالإنجليزية) معلومات عامةالصنف الفني أكشنالمواضيع جريمة منظمة — انتقام تاريخ الصدور 2 فبراير 1999مدة العرض 100 دقيقةاللغة الأصلية الإنجليزيةمأخوذ عن كتاب ذا هانتر للمؤلف دونالد ويستلايكالبلد الولايات المتحدةموقع الويب paybac…

Ukrainian folk tale Cat and RoosterCat and RoosterFolk taleNameCat and RoosterAlso known asКотик і ПівникRegionUkraine Cat and Rooster  (Ukrainian: Котик і Півник) is a Ukrainian folk tale and fable about a friendship between a cat and a rooster, and a fox who wants to eat the rooster. Plot Cat (a cat) and Rooster (a rooster) were friends and lived together in the same house. Making music together, Cat played violin while Rooster sang. During the day, Cat would hunt …

British Army general, recipient of the Victoria Cross and equestrian Paul Aloysius KennaKenna by Christina BroomBorn16 August 1862Everton, LiverpoolDied30 August 1915 (aged 53)Suvla, Gallipoli, Ottoman TurkeyAllegiance United KingdomService/branch British ArmyYears of service1886–1915 †RankBrigadier-GeneralUnit21st Lancers3rd (Nottinghamshire and Derbyshire) Mounted Brigade[1]Battles/warsMahdist WarSecond Boer WarThird Somaliland ExpeditionWorld War IAwardsVic…

Lordship of Ireland in pink in around 1300; Areas outside of that remained independent kingdoms British rule in Ireland built upon the 12th century Anglo-Norman invasion of Ireland on behalf of the English king and eventually spanned several centuries that involved British control of parts, or entirety, of the island of Ireland. Most of Ireland gained independence from the United Kingdom following the Anglo-Irish War in the early 20th century. Initially formed as a Dominion called the Irish Free…

Narrow body of water Vivari Channel in Albania links Lake Butrint with the Straits of Corfu. In physical geography and hydrology, a channel is a landform on which a relatively narrow body of water is situated, such as a river, river delta or strait. While channel typically refers to a natural formation, the cognate term canal denotes a similar artificial structure. Channels are important for the functionality of ports and other bodies of water used for navigability for shipping. Naturally, chann…

Election in Missouri Main article: 1872 United States presidential election 1872 United States presidential election in Missouri ← 1868 November 5, 1872 1876 →   Nominee Horace Greeley Ulysses S. Grant Thomas A. Hendricks (Given electoral votes due to death of Greeley) Party Liberal Republican Republican Democratic Home state New York Illinois Indiana Running mate Benjamin G. Brown Henry Wilson Electoral vote 0 (8 invalidated[a] 0 6 Popular …

Funk rockTrapeze bubar pada tahun 1982, ketika Mel Galley – saat itu, satu-satunya anggota asli yang tersisa – bergabung dengan Whitesnake.Sumber aliranFunkrockpsychedelic soulSumber kebudayaanAkhir 1960-an – awal 1970-an, Amerika SerikatAlat musik yang biasa digunakanGitar basgitar elektrikdrummesin drumkiborvokalBentuk turunanNew waveSubgenreFunk metalVersi regionalMinneapolis soundTopik lainnya Daftar grup musik funk rock post-punk dance-punk manguebeat Funk rock adalah genre campuran y…

Process of undoing colonial influences on knowledge This article is about the undoing of colonial influences on knowledge. For the legacy of colonialism within the domain of knowledge, see Coloniality of knowledge. Removal of the statue of Cecil Rhodes from the campus of the University of Cape Town on 9 April 2015. Rhodes Must Fall movement is said to have been motivated by a desire to decolonize knowledge and education in South Africa.[1] Decolonization of knowledge (also epistemic deco…

Overview of urbanization in India This article needs to be updated. Please help update this article to reflect recent events or newly available information. (June 2016) Urbanization in Outskirts of Kolkata Urbanization in India began to accelerate after independence, due to the country's adoption of a mixed economy, which gave rise to the development of the private sector. The population residing in urban areas in India, according to the 1901 census, was 11.4%,[1] increasing to 28.53% by…

American politician (1821–1881) Rowland E. TrowbridgeCommissioner of Indian AffairsIn office1880–1881PresidentRutherford B. HayesPreceded byEzra A. HaytSucceeded byHiram PriceMember of the U.S. House of Representativesfrom Michigan's 4th districtIn officeMarch 4, 1861 – March 3, 1863Preceded byDe Witt C. LeachSucceeded byFrancis W. KelloggMember of the U.S. House of Representativesfrom Michigan's 5th districtIn officeMarch 4, 1865 – March 4, 1869…

حصن الأخيضرمعلومات عامةنوع المبنى قلعة المنطقة الإدارية محافظة كربلاء[1] البلد  العراق[2] الصفة التُّراثيَّة موقع اليونيسكو للتراث العالميالنوع موقع التراث العالمي المؤقت السنة 2000 المعايير (i) — (ii) معلومات أخرىالإحداثيات 32°27′31″N 43°35′59″E / 32.458501°N 43.599758°E…

1950 novel by C. S. Forester This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: Mr. Midshipman Hornblower – news · newspapers · books · scholar · JSTOR (December 2022) Mr. Midshipman Hornblower First edition coverAuthorC. S. ForesterLanguageEnglishSeriesHoratio HornblowerGenreHistorical novelsPublisherMi…