4 ms·
There's an interesting branch of math called "synthetic topology" where you study computational questions topologically. https://ncatlab.org/nlab/show/synthetic
by kmill 5y ago
There's an interesting branch of math called "synthetic topology" where you study computational questions topologically. https://ncatlab.org/nlab/show/synthetic+topology https://ncatlab.org/nlab/show/synthetic+topology
Given a set X of things that can be encoded for a Turing machine, consider the semidecidable subsets (those subsets of things for which a there's a Turing machine that will halt if and only if it's given one of them). This forms a basis for a topology; it has finite intersections because you can run two Turing machines in parallel. So, a subset S of X is considered to be open if every element p in S has a Turing machine that halts for p, and whenever it halts for any other element, that element is in S.
Given this topology, what does it mean to be compact? It means whenever you have a collection of Turing machines (possibly infinite!) such that for every element of X there's a Turing machine that halts for it, then there's some finite sub-collection of Turing machines with the same property.
The space of binary streams can be encoded as plain old Turing machine tapes (maybe give it to the Turing machine as a second tape for convenience). If a Turing machine halts given a tape, then it only looked at some prefix of the stream to make the decision, so it will also halt if you change anything outside that prefix. This corresponds to the usual product topology, with the basic Turing machines being "check that the stream has this fixed prefix." The space is a product of finite sets, so by the Tychonoff theorem it's compact.
An application of this is the following. Suppose you have a computable function f : binary streams -> bool. That is, you have a Turing machine that halts for every binary stream, resulting in either True or False. You can think of this as being two Turing machines, one that recognizes when f returns True (otherwise it artificially goes into an infinite loop), and similarly another that recognizes when f returns False (otherwise loops). Both of these Turing machines define open subsets of the space of binary streams, the union of which is the whole space of binary streams. Since they are open, they are all unions of all the basis sets of the product topology (recall: sets of all binary sequences with a common prefix). Since the space is compact, you only need finitely many of these basis sets -- let n be the longest prefix. Hence, there is a Turing machine for f that makes its decision by looking at only a prefix of a fixed length n of the binary stream!
- thomasahle 5y agoI'm trying to follow you last example. It seems you are proving that for any computable function `f`, there is a number `n` such that f can be computed by never looking at more than the first `n` bits of the input? I thought that would fail for a simple function like "Does the stream include a 1", which takes finite time for any stream that includes a "1", but doesn't use a bounded prefix. I guess restricting the input this way somehow makes the set not open?
- kmill 5y agoIndeed, computable functions on binary streams have a uniform bound on how much of a stream they'll look at! "Does this stream include a 1" is not computable, since it won't halt on 00000.... The subset of streams that include a 1 is open, though. If you restrict to the subset of streams that include a 1, then computable functions might look at some unbounded amount of the input (example: is the value after the first 1 a zero? this is computable but takes unbounded time). This doesn't contradict anything because this subset is not compact. Here's another interesting application (not fully fleshed out here). An arbiter is a computable function that watches a stream of messages produced by a distributed system and decides whether the consensus reached is A or B. Suppose each process only sends messages from a finite set (they're TCP packets or something). The space of message streams is compact, so by the same argument the arbiter makes its decision within a fixed amount of time, independent of the message stream. If messages can be delayed or lost and there are at least two processes, then the arbiter has to always answer only A or B, since otherwise it would be possible to construct two message streams that have the same prefix, but impossibly the arbiter answers A for one and B for the other.