ABSOLUTELY NO FREE LUNCHES! GORDON BELOT Abstract. This paper is concerned with learners who aim to learn patterns in infinite binary sequences: shown longer and longer initial segments of a binary sequence, they either attempt to predict whether the next bit will be a 0 or will be a 1 or they issue forecast probabilities for these events. Several variants of this problem are considered. In each case, a no-free-lunch result of the following form is established: the problem of learning is a formidably difficult one, in that no matter what method is pursued, failure is incomparably more common that success; and difficult choices must be faced in choosing a method of learning, since no approach dominates all others in its range of success. In the simplest case, the comparison of the set of situations in which a method fails and the set of situations in which it succeeds is a matter of cardinality (countable vs. uncountable); in other cases, it is a topological matter (meagre vs. co-meagre) or a hybrid computational-topological matter (effectively meagre vs. effectively co-meagre). 1. Introduction The various no-free-lunch theorems of statistical, computational, and formal learning theory offer ways to make precise the basic insight that there can be no optimal general-purpose approach to learning. These theorems come in two main forms. Some show that there are contexts in which certain approaches to learning succeed in each salient situation, but that each such approach has the same expected performance across those possible situations.1 Results of this kind are measure-relative: in order for expectations to be defined, a measure must be imposed on the space of situations that a learner might face-and the results in question only hold relative to some of the measures that one might impose [6]. Results of a second kind are absolute in the sense that they do not rely upon the choice of a measure on the space of envisaged situations. Here are descriptions of two paradigmatic results of this kind. Maybe there exists some kind of universal learner, that is, a learner who has no prior knowledge about a certain task and is ready to be challenged by any task? . . . The no-free-lunch theorem states that no such universal learner exists. To be more precise, the theorem states that for binary classification prediction tasks, for every learner there exists a distribution on which it fails. . . . In other words, the theorem states that no learner can succeed on all learnable tasks-every learner has tasks on which it fails while other learners succeed.2 Key words and phrases. Induction, Learning, Extrapolation, Forecasting, No-Free-Lunch Theorems. For helpful comments and discussion, thanks to: an anonymous referee, Josh Hunt, Thomas Icard, Mikayla Kelley, Tom Sterkenburg, and Bas van Fraassen, and Francesca Zaffora Blando. 1For results of this kind, see [1–3]. For further discussion, see [4] and [5]. 2Shalev–Shwartz and Ben–David [7, p. 36]. Forthcoming in Theoretical Computer Science. Let T be any learning machine. . . . [W]e will defeat the machine T. That is, we will have constructed a regularity, depending on T, which is beyond the power of T to extrapolate. However . . . it is always possible to build another machine which can extrapolate every regularity that T can extrapolate and also extrapolate the one that T can't extrapolate. Thus, there cannot exist a cleverest learning machine: for, for every learning machine T, there exists a machine T1 which can learn everything that T can learn and more besides.3 We can think of such results as encapsulating two facts about the predicament of learners situated in certain contexts. (a) They face a daunting problem: no approach they might adopt succeeds across all envisaged situations. (b) Difficult choices must be made: different approaches succeed in different situations, with no approach dominating all others in its range of success. Here we assemble some more or less elementary results, some already well-known, that combine to give no-free-lunch results of the second, absolute variety, applicable to agents attempting to learn patterns in binary data streams.4 Nature presents our agents with oneway infinite binary sequences one bit at a time and after each bit is revealed each agent is asked to make a prediction about the next bit. We will consider five models of learning, differing from one another as to what sort of predictions our agents are required to make or as to the criterion of success. And for each model, we will consider variants in which neither the agent nor Nature is required to follow a computable strategy, in which the agent is required to follow a computable strategy but Nature is not, and in which both the agent and Nature are required to follow computable strategies. For each variant of each model, we establish both elements required for a no-free-lunch result. (i) Difficult choices must be faced in selecting a method of learning: we will show that no approach dominates all of its rivals, either by showing that for each method there is another that succeeds in a disjoint set of situations (evil twin results) or by showing that for every method there is another that succeeds in a strictly larger family of situations (better-but-no-best results). (ii) We also show our learners face a formidably difficult problem: for each of the problems we consider, there is a sense in which for any method of addressing that problem, the situations in which it fails are incomparably more common than the situations in which it succeeds.5 Following some preliminaries in Section 2, we investigate in Section 3 the predicament of learners who must attempt to guess, before each bit is revealed, whether it will be a 0 or a 1.6 We will consider two criteria of success for such next-value learners: when facing a given data stream they should eventually predict each new bit correctly (NV-learning); or the should predict each new bit correctly, except for a family of errors that has vanishing asymptotic density (weak NV-learning).7 In Section 3.1 we will see that for NV-learning of arbitrary sequences, failure is incomparably more common than success in the sense that any method for predicting bits succeeds for a countable family of binary sequences and fails for an 3Putnam [8, pp. 6 f.]. As noted by Case and Smith [9, p. 208]: "This appears to be the earliest result indicating that there may be some difficulty with the mechanization of science." See also [10, Theorem I.5]. 4A problem that, according to Li and Vitányi [11, p. 6], "constitutes, perhaps, the central task of inductive reasoning and artificial intelligence." 5So here we go beyond the paradigm results mentioned above, which show only that for each method, there exists a situation in which it fails. For other results of the sort developed here, see [12]. 6For early investigations of such agents, see the papers of Putnam [8, 13] and Gold [10]. 7The notion of NV-learning is due to Bārzdiņš [14] (see also Blum and Blum [15]). The notion of weak NV-learning is due to Podnieks and Kinber [16, pp. 80 f.]. 2 uncountable family of binary sequences. In Section 3.2 we will see that for weak NV-learning of arbitrary sequences, any method succeeds for an uncountable set of sequences and fails for an uncountable set of sequences, but the successes are always incomparably less common than the failures in a topological sense, forming a meagre set. In Section 3.3, we restrict attention to computable methods for the next-value learning of computable sequences and find that for any method, the sets of success and failures are equivalent both from the point of view of cardinality and the point of view of topology-but that the successes are nonetheless incomparably less common than the failures in the hybrid topological-computational sense (due to Mehlhorn [17]) that they form an effectively meagre set.8 Along the way we will see that the notion of weak NV-learning, while strictly weaker than the notion of NV-learning, is neither weaker nor stronger than two other variants of NV-learning, NV 1-learning (due to Bārzdiņš [18]) and NV 2-learning (due to Podnieks [16]). In Section 4 we turn to agents who face a data stream sampled from a probability measure chosen by Nature and who are required to issue forecast probabilities for the next bit's being a 0 or a 1 just before it is revealed.9 We consider three criteria of success for agents engaged in such next chance prediction: we can ask that for any event, the probabilities that our agents assign to that event converge almost certainly to the true probability as they see larger and larger data sets (strong NC-learning); we can ask that their forecast probabilities for the next bit become arbitrarily accurate, almost certainly, in the limit of large data sets (NC-learning); or we can ask that they meet the last-mentioned standard modulo a set of missteps of vanishing asymptotic density (weak NC-learning).10 For the problem of next-chance learning in the face of a data stream generated by an arbitrary measure, we see in Sections 4.1 and 4.2 that for any of our criteria of success, each method fails for an uncountable set of measures that Nature might have chosen and succeeds for an uncountable set of such measures-but that the former set is always incomparably smaller than the latter, being meagre. In 4.3, we restrict attention to computable strategies for next-chance learning in contexts in which the data stream is generated by a computable measure and find, for each of our three criteria of success, that the set of learnable measures is an effectively meagre subset of the family of computable measures. Section 5 provides a few concluding remarks. 2. Preliminaries 2.1. The Main Characters We will be concerned below with a number of topological spaces. (i) The space of bits, B :" t0, 1u, equipped with the discrete topology (so every subset of B is open). (ii) Finite products of B with itself: for each n P N, the space of n-bit strings, Bn, equipped with the discrete topology (we count 0 as a natural number and use ∅ to denote either the empty string of zero bits that is the sole member of B0 or the empty set, depending on context). We will think of elements of Bn as strings (concatenations of symbols) rather than as n-tuples. For w P Bn and m ď n we write wpmq for the mth bit of w 8In the case of NV-learning, this result is due to Fortnow et al. [12]. 9This model of learning appears in Solomonoff [19]. 10These criteria of success were introduced by Blackwell and Dubins [20], Kalai and Lehrer [21], and Lehrer and Smorodinsky [22]. The criteria of success employed in the literature on Solomonoff induction differ in focussing on average or expected performance in the long run-on the relation between those notions and the notion of NC-learning, see [23]. 3 and write wrms for the m-bit initial segment of w. For m,n P N with m ď n, we have the natural projection map πnm : w P Bn ÞÑ wrms P Bm. (iii) The space of binary strings, B  :" Ť8 n"0 Bn, also equipped with the discrete topology. If v and w are binary strings we write v.w for the string that results from concatenating v and w (in that order) and write v.w2 for the results of concatenating v with w and with w, etc. We write |w| for the number of bits in binary string w. (iv) Cantor space, C, the set of all infinite binary sequences equipped with the product topology (we take sequences to be indexed by positive natural numbers). We can characterize this topology as follows: if w is an n-bit string, then we use Bw to denote the set of sequences whose first n bits are given by w; the set of all such Bw (as w ranges over B ) is a basis for the product topology and we call the Bw basic open sets. Illustration: the set of sequences that have 0 as their second bit is an open set because it is the union of the basic open sets B00 and B10. For σ P C we write σpmq for the mth bit of σ and write σrms for the m-bit string formed by concatenating the first m bits of σ. For each n P N we have the natural projection map πn : σ P C ÞÑ σrns P Bn. A sequence of points σ1, σ2, σ3, . . . in Cantor space converges to σ P C if and only if for each k, there exists an N so that for n ě N, σnpkq " σpkq. We use B to denote the σ-algebra of Borel subsets of C. We use C to denote the subspace of C consisting of computable sequences (i.e., the σ such that the map k P N ÞÑ σrks is computable). (v) For each k P N, the space Pk of Borel probability measures on Bk. Since |Bk| " 2k, we can identify any μ P Pk with a 2k-tuple of real numbers in the closed unit interval that sum to one. We take Pk to be equipped with the topology that it inherits from being embedded in this way as a closed subset of R2k (which we take to be equipped with its standard topology). We call μ P Pm and ν P Pn with m ď n consistent if for each subset A of Bm we have μpAq " νpπ 1nmpAqq. (vi) The space P of Borel probability measures on C equipped with the weak topology, which can be characterized as follows.11 For each binary string w and each pair of numbers p and q in the closed unit interval with p ă q, let Sw,p,q :" tμ P P : p ă μpBwq ă qu. The set of all such Sw,p,q forms a sub-basis for the weak topology on C: the open sets of the weak topology are arbitrary unions of finite intersections of these sub-basic sets. Under the weak topology, a sequence tμku of measures in P converges to μ P P if and only if limkÑ8 μkpBwq " μpBwq for each w P B .12 Below, in order to simplify notation, for μ a measure in P and w a binary string, we will write μpwq in place of μpBwq. Using this notation, the Carathéodory Extension Theorem tells us that any map ν : B  Ñ r0, 1s such that νp∅q " 1 and such that 11For the weak topology on spaces of measures on metric spaces, see [24, Chapter II] and [25, §1.2]. For the special case of P, see [26, Chapter 17] and [27, §2.5]. Since we can specify a Borel probability measure on C by specifying the weight that it assigns to each binary string, by fixing an enumeration of the binary strings we can identify each μ P P with a sequence of numbers in the closed unit interval that sum to one. In this way we identify P with a closed subset of the Hilbert cube (" r0, 1sω equipped with the product topology). The weak topology is the topology that P inherits from this embedding. 12Each Bw is a clopen subset of C and so is a continuity set for any measure in P. So the Portmanteau Theorem implies that the above condition is necessary for weak convergence. And it is also sufficient, since the Bw form a countable basis for C closed under finite intersections. See, e.g., [25, Theorems 2.1 and 2.2]. 4 νpwq " νpw.0q ` νpw.1q for each w P B  induces a unique ν P P such that νpwq " νpwq for all w P B  (see, e.g., [28, §1.9]). As usual, we consider ν P P to be computable if and only if there exists a computable F : B   NÑ Q such that |νpwq   F pw, nq| ă 2 n for all w P B  and n P N. We use P to denote subspace of P consisting of computable measures. Remark 2.1. B , C, P , each of the Bk, and each of the Pk are compact, separable and completely metrizable. In B, the other Bn, and in B  each point is isolated (i.e., for any point, the singleton set containing that point is open). There are no isolated points in C, the Pk (k ą 0), or P . Remark 2.2. C and the Pk (k ą 0) of course have cardinality c (the cardinality of the continuum). So does P : since P is non-empty, compact, and metrizable there is a continuous map from C onto P ; since P is a non-empty, separable, and completely metrizable space without isolated points, there is an embedding of C into P [26, Theorems 4.18 and 6.2]. 2.2. The Meagre & the Co-Meagre We are going to be interested in making comparisons of size for certain subsets of C and P . The most straightforward standard of comparison is cardinality: it natural to say that any uncountable set is incomparably larger than any countable set. Below we will see examples where the set of learnable sequences or measures and the set of unlearnable sequences or measures have the same cardinality-but in which it is intuitively natural to say that the unlearnable sequences or measures are incomparably more common than the learnable sequences or measures. The intuitive notions of size in play here correspond nicely with the topologists' notions of meagre and co-meagre subsets of a topological space. Recall that a nowhere dense subset of a topological space is one whose closure has empty interior-or, equivalently, a subset A of a topological space X is nowhere dense if and only if for any non-empty open set U Ă X, there exists a non-empty open set U  Ă U with A Ş U  " ∅. And recall that a meagre subset of a topological space is one that can be written as a countable union of nowhere dense sets while a co-meagre subset is one that is the complement of a meagre set. For any topological space X, the class of meagre subsets of X is closed under the operations of taking subsets and taking countable unions. The Baire Category Theorem tells us that in a completely metrizable space, no non-empty open set is meagre. So, in particular, no nonempty completely metrizable space has any subsets that are both meagre and co-meagre.13 The results just mentioned motivate the standard practice in topology, analysis, and related mathematical fields of considering the elements of a meagre subset of a completely metrizable space to be extremely rare and the elements of the complement of such a set to be exceedingly common-so that objects that form a co-meagre set are often referred to as being typical. Illustration: one says that typical continuous functions on the unit interval are nowhere differentiable because the nowhere differentiable functions form a co-meagre subset of the space of continuous functions under the uniform topology. Remark 2.3 (The Banach–Mazur Game.). Here is an additional compelling rationale for this practice. Fix a subset S of C. An infinite two-player game is to be played. In the first round, Player I selects a non-empty binary string v1, then Player II selects a non-empty binary string 13If A Ă X were both meagre and co-meagre, then so would be its complement. But then X could be written as a union of two meagre sets-which is impossible if no non-empty open subset of X is meagre. 5 w1; and similarly in each subsequent round, Player I selects a non-empty binary string vk, then Player II selects a non-empty binary string wk. Player I wins the game if the infinite binary sequence v1.w1.v2.w2. . . . is in S, otherwise Player II wins. Intuitively, if Player I has a winning strategy for the the Banach–Mazur game for S, then S must be overwhelmingly large as a subset of X, while if Player II has a winning strategy, then S must be nigh ignorably small as a subset of X. The intuitive notions of small and large subsets appealed to here correspond precisely to the notions of meagre and co-meagre subsets: Player I has a winning strategy if and only if S is co-meagre in some open subset of C; Player II has a winning strategy if and only if S is meagre as a subset of C.14 3. Extrapolation Think of Nature as having chosen a binary sequence, which is now being revealed to a learning agent one bit at a time. After each new bit is presented, the agent attempts to predict what the next value will be on the basis of the data seen so far. The agent succeeds in this task if from a certain point onwards, the predictions made match reality (almost perfectly). Definition 3.1 (Extrapolators). An extrapolator is a function m : B  Ñ B. We denote the set of extrapolators by E . Definition 3.2 (Extrapolating Machines). An extrapolating machine is a computable extrapolator-i.e., a computable function m : w P B  ÞÑ mpwq P B. We denote the set of extrapolating machines by E. Definition 3.3 (NV-Learning). Let m be a extrapolator and σ a binary sequence. We say that m NV-learns σ (or that σ is NV-learnable by m) if there is an N such that for all n ą N, mpσrnsq " σpn` 1q.15 Definition 3.4 (Weak NV-Learning). We say that m P E weakly NV-learns σ P C (or that σ is weakly NV-learnable by m) if: lim nÑ8 |tk ď n : mpσrksq " σpk ` 1qu| n " 1. (i.e., incorrect guesses by m have vanishing limiting relative frequency). Remark 3.1. Weak NV-learning is a special case (corresponding to r " 1) of the notion of NV(r)-learning introduced by Podnieks (in collaboration with Kinber) [16, pp. 80 f.] in the computable setting: for r P p0, 1s, we say that m P E NV(r)-learns σ if the correct predictions made by m in processing σ have relative frequency at least r.16 For expository simplicity, we focus on the special case. But the proofs of the propositions below concerning 14Here we have described a special version of the game adapted to C. A more general version makes sense in any topological space X and we always have the connection between meagreness and winning strategies for Player II; the connection between co-meagreness and winning strategies for Player I requires some additional hypotheses in the general setting. See [29] and [26, §§8H and 21.C]. 15The notion of NV-learning for extrapolating machines is due to Bārzdiņš [14]; see also Blum and Blum [15]. NV-learning is the subject of an extensive literature-see the canonical surveys on inductive learning, [9, 30–33]. 16The notion of NV(r)-learning appears to have been largely neglected in the subsequent literature (but see [34, 35]). In particular, it is absent from the surveys cited in fn. 15. 6 weak NV-learning can all be adapted to cover NV(r) learning for any r P p0, 1s (except for Proposition 3.8, which requires the restriction r ą 1{2). For m an extrapolator and σ a binary sequence, we say that according to m, σpnq a good bit of σ if mpσrn   1sq " σpnq and corresponds to a nasty bit of σ if mpσrn   1sq ‰ σpnq. To say that m NV-learns σ is to say that according to m, σ eventually consists of nothing but good bits. To say that m weakly NV-learns σ is to say that according to m, although σ may contain infinitely many nasty bits, these have vanishing limiting relative frequency. We will consider each of these two criteria of learning in turn. Remark 3.2. In the context of computable learners facing computable data streams, one can set the task of identification (rather than extrapolation): require learners to output a natural number after each bit is revealed, aiming to guess the code number of a program that outputs the data stream they are seeing. We won't discuss this approach extensively here, but will occasionally presume familarity with the literature on identification problems as surveyed in [9, 30–33, 36]. 3.1. NV-Learning Officially, the job of an extrapolator is to predict the next bit on the basis of the current data set. But we can also think of an extrapolator m as a means of guessing the entire data sequence on the basis of any initial segment.17 Definition 3.5. For m P E and w P Bn, we use σwm to denote the sequence defined as follows: – For k " 1, . . . , n, σwmpkq " wpkq (i.e., σ w mrns " w). – σwmpn` 1q " mpwq; – σwmpn` `q " mpw.σ w mpn` 1q. . . . .σ w mpn` `  1qq (` " 2, 3, . . .). We say that m guesses σwm on input w. Note that if m P E then for any w P B , σwm P C: on any input, an extrapolating machine guesses a computable sequence. Trivially, there is an equivalence between the sequences NV-learned by an extrapolator and the sequences guessed by it.18 Proposition 3.1. Extrapolator m NV-learns sequence σ if and only if σ " σwm for some w P B . Proof. Suppose that m NV-learns σ. Then there is an n0 such that for all n ě n0, mpσrnsq " σpn ` 1q. So m guesses σ on input w " σrn0s. Suppose, on the other hand, there is an n0 such that m guesses σ on input w " σrn0s. Then m NV-learns σ, since for all n ą n0, mpσrnsq " σpn` 1q.  So asking that m eventually correctly predict next bits is equivalent to asking that m eventually be able to answer correctly all questions about the data stream. Proposition 3.2. For any extrapolator m, the sequences NV-learnable by m form a countably infinite set dense in C while the sequences not NV-learnable by m form a dense subset of C of cardinality c. 17On this point, see [31, §4.2.1]. 18This is related to the deeper fact that NV " PEX [9, Theorem 2.19]. 7 Proof. On the one hand, B  is a countable set and the preceding proposition tells us that the map w P B  ÞÑ σwm has as its range the set of sequences NV-learnable by m. So this set is countable. And since for any w P B , σwm P Bw the set of NV-learnable sequences is dense in C (and is therefore infinite). On the other hand, each Bw has cardinality c but contains only countably many binary sequences NV-learnable by m.  Corollary 3.1. The set tσ P C | Dm P E such that m NV-learns σu is countable. As usual, we call a sequence tσiuiPN of elements of C uniformly computable in i if there is a computable f : N NÑ B such that fpi, jq " σipjq, for all i, j P N. Proposition 3.3. (a) Let m P E and S be a countable subset of C. Then there is an m  P E that NV-learns every σ P S as well as everything NV-learned by m. (b) Let m P E and let S " tσiuiPN be a family of elements of C uniformly computable in i. Then there is an m   P E that NV-learns every σ P S as well as everything NV-learned by m. Proof. We present the argument for (b)-essentially the same argument works for (a). Define m P E as follows: on input of w P Bn, m finds K " tk P N | 1 ď k ď n, σkrns " wu; if K ‰ ∅, then mpwq " σ`pn` 1q, where ` is the least element of K; otherwise, mpwq " mpwq. Define m  as follows: m  has a counter that keeps tally of how many incorrect prediction have been made in the course of processing a given data stream; in processing input w P B , m  simulates m if an even number of incorrect predictions have been made and simulates m if an odd number have been made. Clearly, m  is an extrapolating machine. Suppose that m  is shown a data stream σ that it does not NV-learn. Then m  must make infinitely many incorrect predictions in processing σ. So σ cannot be a sequence NV-learned by m: any such sequence is guessed by m when it sees sufficiently long initial segments. Similarly, σ cannot be any of the σk, since each of these is guessed by m when it sees sufficiently long initial segments.  Proposition 3.4. Let m be an extrapolator and let S Ă C be the set of sequences that it NVlearns. Then there is an extrapolator m: such that the set S: of sequences that it NV-learns is disjoint from S-and where m: is in E if m is. Proof. Define m: by setting m:pwq " 1 mpwq for each w P B .  So we have both elements required for the sort of no-free-lunch result we seek. The problem of NV-learning is a formidably difficult one: each (computable) extrapolator fails to NV-learn incomparably more sequences that it NV-learns: the set on which it succeeds is countable (and hence meagre), so the set on which it fails is uncountable (indeed, co-meagre). And there are hard choices to be made: for any (computable) extrapolator, there is another that NV-learns sequences that the first cannot NV-learn. There is no optimal method of extrapolation. 3.2. Weak NV-Learning If an extrapolator NV-learns a sequence, then it also weakly NV-learns it. But the converse is not true. Example 3.1. Consider the extrapolating machine m1 that outputs 1 on any input. This machine NV-learns all and only sequences that are eventually all 1's-a countably infinite set. But m1 weakly NV-learns continuum-many sequences. For, let σ be an arbitrary binary sequence and let σ be the sequence defined as follows: for n " 1, 2, . . . , if k " 10n, then 8 σpkq " σpnq; otherwise, σpkq " 1. According to m1, the nasty bits of σ have vanishing asymptotic density, so m1 weakly NV-learns σ. And there are continuum-many σ we could use as input for this construction, each determining a distinct sequence weakly NV-learned by m. Note that there is no input on which m1 guesses a sequence that contains infinitely many 0's, although it weakly NV-learns uncountably many sequences with this feature. Note also that although m1 is computable, it weakly NV-learns uncountably many uncomputable sequences and weakly NV-learns sequences of arbitrary Turing degree. Proposition 3.5. Each extrapolator weakly NV-learns a dense set of sequences of cardinality c and fails to weakly NV-learn a dense set of sequences of cardinality c. Proof. Let m be an extrapolator, w an n-bit binary string, and σ an arbitrary sequence. We construct sequences σ  and σ: as follows: – For k " 1, . . . , n, σ pkq " σ:pkq " wpkq. – For k " n` 10` (` " 1, 2, . . .), σ pkq " σ:pkq " σp`q. – For all other k, σ pkq " mpσ p1q.σ p2q. . . . .σ pk   1qq and σ:pkq " 1  σ pkq. According to m, any nasty (good) bits in σ  (σ:) occur with indices of the form n` 10`. So m weakly NV-learns σ  and fails to weakly NV-learn σ:. By varying w, we obtain weakly NV-learnable and not weakly NV-learnable sequences in each basic open set of C. And by varying σ we obtain continuum-many sequences of each type.  So for any extrapolator, there are continuum-many sequences that it can weakly NV-learn and continuum-many sequences that it cannot weakly NV-learn. But, intuitively, there is a sense in which it is much more difficult to construct a sequence weakly NV-learnable by a given extrapolator than it is to construct a sequence that is not weakly NV-learnable by that extrapolator. Consider again the extrapolator m1 that outputs 1 on any input. In order to construct a sequence that this extrapolator weakly NV-learns, you begin with the all 1's sequence, then sprinkle in some 0's, subject to the constraint that the set of indices of the slots containing 0's has vanishing asymptotic density in N. In order to construct a sequence that this extrapolator can't weakly NV-learn, you begin with the all 1's sequence and sprinkle in as many 0's as you like, just being careful to make sure that the set of indices of the slots containing 0's doesn't have vanishing asymptotic density. The latter task, is intuitively, easier: e.g., because there are a lot more densities not equal to zero than equal to zero. This intuition is borne out by the following result. Proposition 3.6. Let m be any extrapolator. The sequences weakly NV-learnable by m form a meagre subset of C. Proof. Let us say that binary string w is wicked according to m if at least half of the bits of w are nasty according to m. For each n P N, let An be the set of sequences that do not have at least n initial segments that are wicked according to m. We claim that each An is nowhere dense. To establish this, it suffices to show that for any binary string w, there is another, w , depending on n and w, such that w  extends w and Bw  Ş An " ∅. To this end, let w be a string and let w  be the result of extending w by |w| bits that are nasty according to m, then tacking on n more nasty bits. Every sequence in Bw  then has at least n initial segments that are wicked according to m. So A :" Ť8 n"1An is a meagre subset of C. And any sequence σ weakly NV-learnable by m must be in A-for otherwise, σ would have the feature that for each k, it contained at least k initial segments wicked according to m, which would mean that the asymptotic density of 9 nasty bits in σ could not vanish. So the set of sequences weakly NV-learnable by m, being a subset of a meagre set, is meagre.  Corollary 3.2. The set tσ P C | Dm P E such that m weakly NV-learns σu is meagre in C.19 So the problem of weakly NV-learning sequences is formidably difficult. And difficult choices must be made in the face of this intractability-there can be no optimal extrapolator for weak NV-learning. We have the following better-but-no-best result.20 Proposition 3.7. (a) Let m P E and let S be a countable subset of C. Then there is an m  P E that NV-learns every σ P S and also weakly NV-learns everything that m does. (b) Let m P E and let S " tσiuiPN be a family of elements of C that is uniformly computable in i. Then there is an m  P E that NV-learns every σ P S and also weakly NV-learns everything that m does. Proof. We present the argument for (b)-essentially the same argument works for (a). Define m  as follows: on input of w P Bn, m  finds K " tk P N | 1 ď k ď log2 n, σkrns " wu; if K ‰ ∅, then m pwq " σ`pn`1q, where ` is the least element of K; otherwise, m pwq " mpwq. Clearly, m  is an extrapolating machine and NV-learns each σk (m   guesses σk whenever shown sufficiently long initial segments). And if σ P C is weakly NV-learned by m then it is also weakly NV-learned by m : in processing the first 2n bits of σ, m  can disagree with m at most n times; so the asymptotic density of bits on which m  and m disagree in processing σ is zero.  We also have the usual sort of evil-twin result. Proposition 3.8. Let m be an extrapolator and let S Ă C be the set of sequences that it weakly NV-learns. Then there is an extrapolator m: such that the set S: of sequences that it weakly NV-learns is disjoint from S-and where m: is in E of m is. Proof. Define m: by setting m:pwq " 1  mpwq for each w P B . According to either m or m:, in any sequence that the other weakly NV-learns, the good bits have asymptotic density zero.  3.3. Extrapolation of Computable Sequences While it is plausible that every method of learning implementable by a natural or artificial learning agent is computable, the data streams that our agents face may or may not be computable.21 Still, there are many settings in which we can be confident that our agents face computable data streams. So let us specialize to the setting in which computable extrapolators attempt to (weakly) NV-learn computable sequences and see how the landscape surveyed above is transformed. As usual, for m P E, we denote by NVpmq the set of computable sequences that are NV-learned by m. We use NV to denote: tS Ă C | Dm P E with S Ď NVpmqu. 19Remark 3.7 below will show that this strengthens the observation of Jockusch and Schupp [37, p. 438] that the set of coarsely computable sequences is meagre in C. 20Thanks here to Tom Sterkenburg and to an anonymous referee for helpful suggestions. 21Unless, that is, physical reality itself is fundamentally computational in nature-for a range of views of this topic, see the papers collected in [38]. 10 We likewise use NVwpmq to denote the set of computable sequences weakly NV-learned by an extrapolating machine m and use NVw to denote: tS Ă C | Dm P E with S Ď NVwpmqu. Proposition 3.9 (Podnieks [16]). NV is a proper subset of NVw. Proof. Clearly NV Ď NVw. We give an example of a set in NVw  NV . Consider again the extrapolating machine m1 of Example 3.1 above that outputs 1 on every input. Let U " NVwpm1q, the set of computable binary sequences in which 0's have vanishing asymptotic density. We are going to show that U is not in NV . Suppose that there is an extrapolating machine m that NV-learns each sequence in U. Notice that for any w P B , the sequence w.1ω is in U-so for sufficiently large ` P N, we must have mpw.1`q " 1. Let σ P C be the sequence of the form 1n1 .0.1n2 .0.1n3 .0 . . . where each nj is chosen to be the smallest n larger than 2 j such that mp1n1 .0.1n2 .0. . . . .1nj 1 .0.1nq " 1. Clearly, m does not NV-learn σ (σ contains infinitely many 0's, each of which m predicts will be a 1). But σ P U : since m is computable, so is σ; and by construction, 0's occur with vanishing asymptotic density in σ. This contradicts our assumption that m NV-learns every σ P U.  Remark 3.3. We mention two of the most fundamental variations on NV . A partial extrapolating machine is a partial computable function m : B  Ñ B. Following Bārzdiņš [18], we say that a partial extrapolating machine m NV 1-extrapolates σ P C if: (i) mpσrksq is defined for all k P N; and (ii) DN P N such that for all n ą N, mpσrnsq " σpn ` 1q. We write NV 1 for the set of S Ă C such that there is a partial extrapolating machine that NV 1-extrapolates each σ P S. Following Podnieks [16], we say that a partial extrapolating machine m NV2-extrapolates σ P C if: DN P N such that for all n ą N, mpσrnsq is defined and equal to σpn ` 1q. We write NV 2 for the set of S Ă C such that there is a partial extrapolating machine that NV2-extrapolates each σ P S. Obviously, NV Ď NV 1 Ď NV 2. In fact, NV Ă NV 1 Ă NV 2.22 The proof of Proposition 3.9 above carries over essentially unchanged (except that dove-tailing is required) to show that NVw is not contained in NV 2 (let alone in NV 1). We will see below in Remark 3.6 that NVw does not contain NV 1 (let alone NV 2). Remark 3.4. Having introduced, for r P p0, 1s, the notion of NV(r) learning (see Remark 3.1 above), Podnieks (in collaboration with Kinber) [16, 34] introduces the classes NVprq, NV 1prq, and NV 2prq in the obvious way. Podnieks goes on [16, 34] to establish a number of facts about the containment relations involving these classes. For present purposes, the most notable are: if r1 ă r2, then NVpr2q is a proper subset of NVpr1q; and C P NV 2p1q (from which it follows that NV 2 is properly contained in NV 2p1q). It is also possible to introduce up-to-exceptions-of-density-r variants of standard identification classes. Podnieks [16] generalizes BC by considering learners who aim to output at each time (modulo permitted exceptions) a code number for a program that generates the data stream they see. Pitt [39] generalizes EX by considering learners who aim to converge (modulo 22That NV Ă NV 1 is due to Bārzdiņš [18]; that NV 1 Ă NV 2 is due to Podnieks [16]. See [9, Corollary 2.29, Corollary 2.31, Theorem 3.1, and Theorem 3.5]. 11 permitted exceptions) to a single such code number.23 Royer [36, 40] generalizes EX in a different direction, considering learners who aim to converge to a single code number that (modulo permitted exceptions) outputs the data stream they are seeing. Jain [41] investigates the problem of identification of a function from data streams that are accurate only modulo errors of given asymptotic density. Via Propositions 3.1 and 3.2, we know that every extrapolating machine NV-learns a countably infinite subset of C. But there there can be no best extrapolating machine: Propositions 3.4 and 3.8 tell us each extrapolation machine has an evil twin that (weakly) NV-learns a disjoint set of computable sequences; and Propositions 3.3(b) and 3.7(b) tell us that each extrapolating machine is dominated by another that (weakly) NV-learns everything it can while also NV-learning every member of a uniformly computable family of elements of C. In this setting, what comparative judgements can we make about the sets of computable sequences that a given extrapolating machine (weakly) NV-learns and doesn't (weakly) NVlearn? Proposition 3.10. For any m P E, following are dense subsets of C: (a) the set of computable sequences NV-learnable by m; (b) the set of computable sequences not NV-learnable by m; (c) the set of computable sequences weakly NV-learnable by m; (d) the set of computable sequences not weakly NV-learnable by m. Straightforward adaptations of the proofs of Propositions 3.2 and 3.5 yield that (a) and (d) are dense. And (b) and (c) are super-sets of (d) and of (a), respectively.  It follows that the set of computable sequences (weakly) NV-learned by an extrapolating machine m and the set of computable sequences not (weakly) NV-learned by an extrapolating machine m are both countably infinite subsets of C-so we have parity at the level of cardinality. A classical result implies that we also have parity at the level of topology. Proposition 3.11 (Sierpiński). Any two countable dense subsets of C are homeomorphic. Proof. See, e.g., [42, Chapter 17].  So we can say: for any computable method of extrapolating computable sequences, failure and success are equally common-and difficult choices must be made in selecting a computable method of extrapolation, since no method dominates all its rivals in its range of success. But, intuitively, we ought to be able to say something stronger. After all, Bārzdiņš [18] showed that if S is a set of computable functions, then following are equivalent: (i) each member of S is NV-learnable; (ii) S is a subclass of a computably enumerable set of computable functions; (iii) S is a subclass of an abstract complexity class.24 So only very special subsets of C are NV-learnable-which means that generic subsets should not be in NV . 23Both these notions turn out to be closely related by identification by probabilistic learners to identification by teams of learners [33, 39]. We do not have the same close association between the corresponding notions in the extrapolation case 24See also Blum and Blum [15, p. 127], who attribute the complexity-theoretic condition independently to Adleman. As Blum and Blum remark, this result shows "in essence, that the extrapolable sequences are the ones that can be computed rapidly." 12 Indeed, there is a natural hybrid computational-topological notion of that underwrites the conclusion that failure is incomparably more common than success for computable extrapolation of computable sequences. Mehlhorn [17] introduced the important notion of an effectively meagre subset of the set of computable functions. We specialize this apparatus to C. By way of motivation, note that in any topological space X with basis of open sets W , a subset A is nowhere dense if and only if for every non-empty U P W there is a non-empty U  PW with U  Ă U such that A Ş U  " ∅. So a subset A Ă C is nowhere dense if and only if there is a function f : B  Ñ B  such that for each binary string w: (i) fpwq extends w; and (ii) A Ş Bfpwq " ∅. And A Ă C is meagre if and only if there is a function F : N B  Ñ B  such that: (i) for each n P N there is an An Ă C such that fn " F pn,  q is a witness to the fact that An is nowhere dense in C; and (ii) A " Ť nPNAn. Definition 3.6 (Mehlhorn [17]). Let A be a subset of C and let f : B  Ñ B  be a computable function. Then A is effectively nowhere dense via f if for each w P B : i) fpwq extends w; ii) A Ş Bfpwq " ∅. Definition 3.7 (Mehlhorn [17]). A subset A of C is effectively meagre if there is a computable function F : N B  Ñ B  such that: i) for each n P N, there is an An Ă C such that An is effectively nowhere dense via fn " F pn,  q; ii) A Ť nPNAn. The complement in C of an effectively meagre subset of C is called effectively co-meagre. Proposition 3.12 (Mehlhorn [17]). The family of effectively meagre subsets of C is closed under the following operations: a) taking subsets; b) taking finite unions; c) taking effective unions. Proof. The first claim is immediate from the definition and the second follows from the third. So suppose that that M is a subset of C such that there exist a computable H : NNB  and a decomposition M " Ť Ni, such that for each k P N, Hpk,  ,  q is a witness to the fact that Nk is effectively meagre. There exists, then, for each i P N, a decomposition Ni " Ť Nij such that each Nij is effectively nowhere dense in virtue of Hpi, j,  q. Fix a computable bijection π : N  N Ñ N and let p1 and p2 be the computable components of the inverse of π (so that πpp1pkq, p2pkqq " k for all k P N). Set Mk :" Np1pkq,p2pkq and for each w P B , set F pk, tq :" Hpp1pkq, p2pkq, wq. Then F : N  B  is computable, M " Ť Mk, and each Mk is effectively nowhere dense in virtue of F pk,  q. So M is effectively meagre.  Crucially, the set of effectively meagre subsets of C is not closed under arbitrary countable unions due to an effective analog of the Baire Category Theorem. Proposition 3.13 (Mehlhorn [17]). Let w be a binary string. Then Bw Ş C is not effectively meagre. Proof. Let M " Ť Mk be an effectively meagre set with witness F : N  B . We construct strings w0, w1, . . . inductively: w0 :" w; and wk`1 " F pk, wkq.0. By construction, each wk 13 is a proper initial segment of wk`1. Let σ " limnÑ8wn. Then σ P Bw Ş C. But for each k, σ RMk (since σ begins with wk`1), so σ RM.  In light of these results, it is natural to think of elements of effectively meagre subsets of C as being incomparably less common than elements of effectively co-meagre subsets of C, even when the meagre and co-meagre sets in question are both dense as subsets of C. Remark 3.5. A further reason (due to Lisagor [43]) for this standard practice: a subset S of C is effectively meagre if and only if when the Banach–Mazur game (described in Remark 2.3 above) is played for S, Player II has a winning strategy that is computable. Another reason (due, again, to Mehlhorn [17]): each abstract complexity class is effectively meagre as a subset of the family of computable functions. Example 3.2 (Self-Describing Sequences). Fix an enumeration M1, M2, . . . of the Turing machines, with associated acceptable programming system φ1, φ2, . . . (so that φk is the partial computable function computed by Mk). Following Blum and Blum [15], we call a sequence σ P C self-describing if σ has an initial segment of the form 1k0 and is computed by Mk. As Blum and Blum note, the set S1 of self-describing sequences is non-trivial: it follows from the Recursion Theorem that each computable binary sequence is a finite variant of a self-describing sequence-so there are arbitrarily complex sequences in S1. Fortnow et al. [12] observe that S1 is not effectively meagre. For, consider any computable strategy β : Bn Ñ Bn that Player II could use to play the Banach–Mazur game for S1. For each k P N, let αk be the following strategy that Player I might adopt: on the first turn, play 1k0; on all subsequent turns, play 0. The assumption that Player I plays strategy αk and Player II plays strategy β determines a unique sequence σk P C. The map F : pk, `q P N2 ÞÑ σkp`q P B  is computable. So by the Recursion Theorem, there is a k0 P N such that σk0 is computed by Mk0 . That is: there exists a strategy (namely, αk0) via which Player I can defeat β. So S1 is not in effectively meagre. Proposition 3.14. Let m be an extrapolating machine. NVwpmq (the set of computable sequences weakly NV-learnable by m) is an effectively meagre subset of C. Proof. A straightforward adaptation of the proof of Proposition 3.6, appealing to the fact that when m is computable, the map pn,wq ÞÑ w  R An used there is computable.  Corollary 3.3 (Fortnow et al. [12]). Let m be an extrapolating machine. NVpmq (the set of computable sequences NV-learnable by m) is an effectively meagre subset of C. So there is a natural sense in which, for any computable extrapolator m, among computable sequences, those (weakly) NV-learnable by m are incomparably less common than those not (weakly) NV-learnable by m. The problem of (weakly) NV-learning computable sequences is formidably difficult. Corollary 3.4. No extrapolating machine can (weakly) NV-learn each self-describing sequence. Remark 3.6. It is illuminating to situate these results with respect to a couple of results that Fortnow et al. [12] establish concerning the identification problem for binary sequences. i) They show via an effective Banach–Mazur argument, that any S P PEX is effectively meagre. 14 ii) They observe that the set of self-describing functions (see Example 3.2 above) is in EX 0.25 So any identification class that contains EX 0 has members that are not effectively meagre. They remark: "Since virtually every inference class is either a subset of PEX or a superset of EX 0 the results here settle virtually all open questions that could be raised" [12, p. 145]. Contact can be made with the present approach by recalling that PEX " NV and that EX 0 Ă NV 1.26 So the first result of Fortnow et al. [12] noted above is our Corollary 3.3: the set of sequences NV-learnable by an extrapolating machine is effectively meagre. And since every set in NVw is effectively meagre, neither NV 1 nor NV 2 is a subset of NVw. In NVw we have an example of a natural inference class that is neither a subset of PEX nor a superset of EX 0. In the present setting, in which computable extrapolators (i.e., extrapolating machines) attempt to learn computable sequences, we find that generalizing our basic model by allowing merely partially defined extrapolating machines allows us to crash through a size barrier in a way that loosening our criterion of success by allowing infinitely many errors in the sense of weak NV-learning does not-since every set in NV or in NVw is effectively meagre, whereas this is not the case for every set in NV 1 or NV 2. This is the reverse of what we find if we challenge (possibly computable) extrapolators to NV-learn arbitrary sequences. In that setting, in the basic model every learner masters only countably many sequences. And this is unchanged if we countenance merely partially defined learners.27 But if we loosen our criterion of success to weak NV-learnability we crash through a cardinality barrier, as each learner weakly NV-learns uncountably many sequences. Remark 3.7 (Coarse Computability). Jockusch and Schupp [37, p. 472] remark that "In recent years, there has been a general realization that worst-case complexity measures, such as P, NP, exponential time, and just being computable, often do not give a good overall picture of the difficulty of a problem." As an example, they observe that although there exist finitely presented groups with unsolvable word problems, in every such group the words expressing the identity have vanishing asymptotic density, when words are enumerated in lexicographic order. So the linear-time algorithm that on the input of any word guesses that that word does not express the identity would make a negligible set of errors if fed all words in lexicographic order. If we demand perfection, then the word problem is impossibly hard- but if we can live with making mistakes a negligible fraction of the time, it is as easy as could be. This motivates Jockusch and Schupp to introduce a generalization of the notion of computability: a sequence is coarsely computable if it differs from some computable sequence in a set of bits of vanishing asymptotic density. Coarse computability implies computable weak NV-learnability: if σ P C differs from σ  P C only in bits of vanishing asymptotic density, then the extrapolating machine that assumes it is being shown σ  on any input weakly NV-learns σ. But weak NV-learnability does not imply coarse computability. Let σ0 be uncomputable. Construct a sequence σ1 as follows: begin with two copies of the first bit of σ0, followed by four copies of the second bit of σ0, . . . followed by 2 k copies of the kth bit of σ0, . . . . Suppose that σ1 is coarsely computable. Then there must be a computable sequence σ2 that differs 25Consider a learner who is silent until a data set of the form 1k0 is seen and who from then on assumes that the data stream is being generated by Mk. 26See Case and Smith [9]: that PEX " NV is their Theorem 2.19 (attributed to private communications from van Leeuwen and Bārzdiņš); that EX 0 Ă NV 1 is their Theorem 2.28. 27Thanks to an anonymous referee for pointing this out. 15 from σ1 only in a set of bits of vanishing asymptotic density. Define a new sequence σ3 as follows: make the first bit of σ3 a 0 if at least one of the first two bits of σ2 is a 0, otherwise make it a 1; make the second bit of σ3 a 0 if at least two of the next four bits of σ2 are 0, otherwise make it a 1; . . . ; make the kth bit of σ3 a 0 if at least 2 k 1 of the next 2k bits of σ2 are 0, otherwise make it a 1; . . . . Since σ2 is computable (by assumption), so is σ3. But σ3 is a finite variant of σ0 and so must be uncomputable. So there can be no such σ2: σ1 is not coarsely computable. But σ1 is weakly NV-learned by the extrapolating machine that predicts the first bit will be a 1 then subsequently predicts that each bit will be the same as the last bit seen. 4. Forecasting So far we have set our learners the problem of recognizing which binary sequence is being revealed in the data stream-where such recognition consists in becoming good at predicting future bits. In effect, we have been picturing that in generating new bits, Nature simply consults a lookup table chosen in advance and that the learner's job is to attempt to guess which of the possible such tables is being used (or, in the case of weak learning, to attempt to come close to guessing the right table, in a certain sense). We might instead picture a different sort of procedure. Suppose that what Nature has chosen in advance is not a sequence but, rather, a measure λ P P (i.e., a Borel probability measure on C) and that the learner's data stream is randomly sampled from λ. So we now picture Nature as being equipped with a complete set of biased coins and an instruction manual that says which coin to toss to generate the next bit, given the bits that have been generated so far. To mention just some of the tamest possibilities: Nature may have chosen a Bernoulli measure, in which case the instruction will be to use the same coin to generate each new bit; or Nature may have chosen a measure corresponding to a Markov chain, in which case the coin chosen to generate a new bit will depend only on some fixed finite number of immediately preceding bits; or Nature could have chosen a delta-function measure concentrated on a single sequence, in which case only a maximally biased coin will ever be used. Definition 4.1 (Sources). A source is a Borel probability measure on C. In what follows, we will think of Nature as having chosen a source λ P P from which our learner's data stream is sampled. Recall for w P B , we write λpwq in place of λpBwq. Similarly, for s " 0, 1 and w P Bn, we will write λps |wq for the conditional probability λ gives for the pn` 1qst bit to be s given that the first n bits were given by w. How should a learner proceed in the setting where the data stream is given by a probabilistic source? In the setting of Section 3, where we were thinking of new bits as being generated by a deterministic process, we asked learners to choose an extrapolator that would allow them to definitively predict at each stage what the next bit would be, given the data seen so far. That approach would be suboptimal in the present setting: if Nature is using the fair coin measure (the Bernoulli measure of bias .5) to generate the data stream, then (with probability one) no extrapolator will do better (or worse) than random in its predictions of the next bit-but the fact that Nature is using this procedure seems like a paradigm example of the sort of thing that we ought to be able to learn by looking at data. Such learning will be possible if we ask agents to choose a forecasting procedure that allows them to issue a forecast probability before each bit is revealed, rather than choosing an extrapolator that at each stage issues definitive predictions regarding the next bit. 16 A natural way to encode such a strategy for learning would be via a confirmation function: a map μ : B  B  Ñ p0, 1q with the feature that for all w P B , μp1 |wq ` μp0 |wq " 1. In fact, it is more convenient to employ a slightly different representation. Note that any μ of the above form induces, for each n, a probability measure μn on Bn. Further, for any such μ and m ď n, μm and μn are consistent. 28 So by the Kolmogorov Consistency Theorem, μ induces a measure μ on C (with μ computable if and only if μ is).29 Example 4.1. Define μ : B  B  Ñ p0, 1q as follows: if w P Bn contains k 1's, then μp1 |wq " k`1 n`2 and μp0 |wq " n k`1 n`2 . This map satisfies the condition that for all w P B , μpw, 1q ` μpw, 0q " 1. The corresponding measure is the Laplace–Bayes prior (the Lebesgue–uniform mixture of the Bernoulli measures). Not all measures in P correspond in this way to such μ: μ P P corresponds to a μ of the above form if and only if it is a measure of full support (i.e., it assigns positive weight to each open set-or, equivalently, to each basic open set Bw). Definition 4.2 (Forecasters). A forecaster is a Borel probability measure on C of full support. We denote the family of forecasters by F . Definition 4.3 (Forecasting Machines). A forecasting machine is a computable Borel probability measure on C of full support. We denote the family of forecasting machines by F. We are going to distinguish three criteria for successful next-chance learning.30 The most restrictive one, due to Blackwell and Dubins [20], requires that the forecaster eventually offer answers arbitrarily similar to those of the source concerning any (measurable) question that might be asked about the data stream.31 The intermediate one, due to Kalai and Lehrer [21], requires that the forecaster's probabilisitic predictions concerning the next bit eventually approach the true values arbitrarily closely.32 The least restrictive one, due to Lehrer and Smorodinsky [22], relaxes this last requirement by allowing errors, so long as they eventually become arbitrarily rare. Definition 4.4 (Strong NC-Learning). We say that forecaster μ strongly NC-learns source λ (or that λ is strongly NC-learnable by μ) if with λ-probability 1 the data stream σ P C satisfies: lim nÑ8 sup APB |μpA |σrnsq   λpA |σrnsq| " 0 (recall that B denotes the family of Borel subsets of C). Definition 4.5 (NC-Learning). We say that forecaster μ NC-learns source λ (or that λ is NC-learnable by μ) if with λ-probability 1 the data stream σ P C satisfies lim nÑ8 μps |σrnsq   λps |σrnsq " 0 s " 0, 1. 28See item (v) of Section 2.1 for the relevant notion of consistency. 29For a treatment of the the Kolmogorov Consistency Theorem for the special case of measures on C, see [44]. For a general treatment, see, e.g., [24, Chapter V]. 30Investigation of inductive learning as next-chance learning traces back to Solomonoff [19]. Several criteria of success are prevalent in the literature on Solomonoff induction [11, 45, 46]. But these differ from those considered below in their focus on average or expected performance. 31Note that in the deterministic setting of Section 3 above, the distinction between eventually becoming good at answering all questions and eventually becoming good at predicting the next bit collapsed-recall Proposition 3.1 above. 32For relations between this criterion of success and those alluded to in fn. 30 above, see [23]. 17 Definition 4.6 (Weak NC-Learning). We say that forecaster μ weakly NC-learns source λ (or that λ is weakly NC-learnable by μ) if with λ-probability 1, the data stream σ P C satisfies lim nPKÑ8 μps |σrnsq   λps |σrnsq " 0 s " 0, 1 for some K Ă N with asymptotic density one. Remark 4.1 (Weaker Variants of Weak NC-Learning.). In parallel with the definition of NV(r)-learning (see Remark 3.1 above), we could introduce, for each r P p0, 1s a notion of NC(r)-learning, by altering the definition of weak NC-learning to require K to have asymptotic density at least r. All of the propositions below continue to hold if 'weak NC-learning' is replaced by 'NC(r)-learning' for any r P p0, 1s (except Proposition 4.10, which requires the restriction r ą 1{2). Example 4.2. If μ is a forecaster, then μ is also a source and it is immediate that μ strongly NC-learns, NC-learns, and weakly NC-learns μ. Proposition 4.1 (Kalai, Lehrer, and Smorodinsky [21, 22]). For any source λ and any forecaster μ, strong NC-learnability of λ by μ implies NC-learnability (but not conversely) and NC-learnability of λ by μ implies weak NC-learnability (but not conversely). Proof. Strong NC-learnability implies NC-learnability: in the definition of strong NC-learnability, for each n take A to be the event of the pn` 1qst bit being a 1. To see that the converse is not true, consider the family tλp | p P p0, 1qu of (non-extreme) Bernoulli measures and let μ be the Laplace–Bayes prior. It is a basic fact about μ that it is statistically consistent for the problem of identifying the bias of a coin from knowledge of outcomes of a sequence of tosses [47]. It follows that the forecaster μ NC-learns each λp. But μ does not strongly NC-learn any λp: let Ep be the event that the limiting relative frequency of 1's in the data stream is p; then λppEpq " 1 but μpEpq " 0; so for any w P B , |μpEp |wq   λppEp |wq| " 1. Clearly, NC-learnability implies weak NC-learnability. To see that the converse is not true, take μ to be the fair coin measure and take λ to be the source that generates bits s1, s2, . . . as follows: for k " 10m, sk is the mth bit in the binary expansion of π; all other sj are generated by flipping a fair coin. The forecaster μ weakly NC-learns this λ but does not NC-learn it, since there are large discrepancies between the forecast probabilities and the true probabilities at arbitrarily late times.  We are going to see that relative to each of these three criteria, the problem of next-chance learning is formidably difficult and involves hard choices. 4.1. Strong NC-learning A famous result and its converse give a necessary and sufficient condition for a source to be strongly NC-learnable by a forecaster. Proposition 4.2 (Blackwell and Dubins [20]). If source λ is absolutely continuous with respect to forecaster μ (i.e., λpAq ą 0 implies μpAq ą 0 for all A P B), then μ strongly NC-learns λ. Proposition 4.3 (Lehrer and Smorodinsky [22]). If forecaster μ strongly NC-learns source λ, then λ is absolutely continuous with respect to μ. Proposition 4.4. Let μ be a forecaster. The sources strongly NC-learnable by μ form a dense subset of P of cardinality c. 18 Proof. Let w1, . . . , wn be binary strings such that C is a disjoint union of the Bwk . And let p1, . . . pn P p0, 1q with řn k"1 pk " 1. Since the Bwk partition C, each w P B is either one of the wk, or a proper prefix of some of the wk, or a proper extension of one of the wk. We define a map λ : B  Ñ r0, 1s as follows: (a) If w " wk for some k, then λpwq " pk. (b) If w is a prefix of wj1 , . . . , wj` , then λpwq " ř` k"1 pjk . (c) If w is of the form wk.v for some binary string v, then λpwq " pk   μpv |wkq. It is immediate that λp∅q " 1 and that λpwq " λpw.0q ` λpw.1q for each w P B . So by the Carathéodory Extension Theorem, λ extends uniquely to a measure λ P C such that λpwq " λpwq for each w P B . The source λ is strongly NC-learnable by μ. For suppose that A is a Borel subset of C with λpAq ą 0. Given the law of total probability, λpAq " n ÿ k"1 λpA |wkqλpwkq, there must be some 1 ď ` ď n such that λpA |w`q ą 0. It follows that μpA |w`q ą 0. And since μpw`q is also positive (μ being a forecaster) we find that μpAq ą 0 (by the law of total probability, again). So λ is absolutely continuous with respect to μ and Proposition 4.2 tells us that μ strongly NC-learns λ. And since the wk and the pk can be chosen arbitrarily, we construct in this way continuum-many such sources in any finite intersection of sub-basic open sets of P .  The next result follows from the stronger Proposition 4.9 below, but we include it here in order to indicate an independent route to establishing it. Proposition 4.5 (Noguchi [48]). For any μ P F , the set Sμ Ă P of sources strongly NC-learned by μ is meagre in P . Proof. A classical result tells us that for any measure in P , there is some meagre subset of C to which it assigns probability 1.33 And Proposition 1 of [52] tells us that for any meagre subset of C, the set of probability measures that assign it positive probability is meagre in P .34 So let A be a meagre subset of C such that μpAq " 1 and let PA Ă P be the, necessarily meagre, set of measures that assigns A positive probability. By Proposition 4.3, if λ P Sμ, then λ P PA. So Sμ, being a subset of a meagre set, is meagre.  Corollary 4.1. The set tλ P P | Dμ P F such that μ strongly NC-learns λu is meagre in P . Proposition 4.6. For any μ P F , the set Jμ of forecasters that fail to strongly NC-learn any sources strongly NC-learned by μ is co-meagre in P . Proof. Let Nμ be the set of ν P P such that there is no λ P P that is absolutely continuous with respect to both μ and ν. By Propositions 4.2 and 4.3, Jμ Ď Nμ Ş F . So it suffices to show that Nμ and F are both co-meagre subsets of P . Nμ is co-meagre. Let A and PA be as in the proof of the preceding proposition. Suppose 33Szpilrajn [49] shows that any non-atomic Borel probability measure on a separable metric space assigns measure 0 to some co-meagre set. Marczewski (=Szpilrajn) and Sikorski [50] observe that this result implies that in a separable metric space without isolated points, every Borel probability measure assigns probability 0 to some co-meagre set. In fact, the hypothesis of separability can be dropped [51, Corollary 3.7]. 34This is a special case of a result of Koumoullis [53]. 19 that ν P P is not in Nμ. So there is a λ P P absolutely continuous with respect to both μ and ν. So λ must assign the complement of A zero probability (since μ does), which means that ν must assign A positive probability (since λ does)-so λ is in the complement of the co-meagre set PA. So the complement of Nμ is meagre, being a subset of the meagre set PA. F is co-meagre. The forecasters form a dense Gδ subset of P [54, §3.13]. And in any completely metrizable space (such as P), any dense Gδ subset is co-meagre [55, Theorem 9.2].  Corollary 4.2. For any forecaster, there is another, such that the sets of sources strongly NC-learned by the two forecasters are disjoint. As usual, we call a sequence tλiuiPN of elements of P uniformly computable in i if there is a computable F : N B   NÑ Q such that |λipwq   F pi, w, nq| ď 2 n, for all i, n P N and w P B . Proposition 4.7. (a) Let μ P F and let S be a countable subset of P . Then there is a μ  P F that strongly NC-learns every source in S as well as every source strongly NC-learned by μ. (b) Let μ P F and let S " tλiuiPN be a sequence of measures in P that is uniformly computable in i. Then there is a μ  P F that strongly NC-learns every source in S as well as every source strongly NC-learned by μ. Proof. For part (a), enumerate the members of S: λ1, λ2, . . . and set μ  " 1 2 μ` 1 2 8 ÿ k"1 1 2k λk. Each λk is absolutely continuous with respect to μ  , so by Proposition 4.2, μ  strongly NClearns every source in S. And if ν is a source strongly NC-learned by μ, then by Proposition 4.3, ν must be absolutely continuous with respect to μ and hence also with respect to μ -so by Proposition 4.2, μ  strongly NC-learns ν. For part (b), we can proceed in the same way. The only thing to check is that if μ P P is computable and tλiu Ă P is uniformly computable in i, then the measure μ   as defined above is also computable. To this end, suppose that F0 : B NÑ Q and F : NB NÑ Q are computable, with |μpwq   F0pw, nq| ď 2  n and |λipwq   F pi, w, nq| ď 2  n, for all w P B  and i, n P N. We define F   : B   NÑ Q as follows: F  pn,wq :" 1 2 F0pw, n` 1q ` 1 2 n`1 ÿ k"1 1 2k F pk, w, 2nq Then for any given w P B  and n P N, we define α, β, γ P R: α :" 1 2 pμpwq   F0pw, n` 1qq β :" n`1 ÿ k"1 1 2k`1 pλkpwq   F pk, w, 2nqq γ :" 8 ÿ k"n`2 1 2k`1 λkpwq. 20 Note that each of |α|, |β|, and |γ| is no greater than 2 pn`2q. In the case of |α|, this follows from what we know about F0. For |β|, we have: |β| ď n`1 ÿ k"1 1 2k`1 |λkpwq   F pk, w, 2nq| ď n`1 ÿ k"1 1 4 |λkpwq   F pk, w, 2nq| ď n`1 ÿ k"1 1 4 2 2n " n` 1 2n 2 pn`2q, and for any n ě 1 we have that n` 1 ď 2n. And since for each k we have 0 ď λkpwq ď 1, we have that |γ| ď ř8 k"n`2 1 2k`1 . Now, F   is computable and we have: |μ pwq   F  pw, nq| " |α ` β ` γ| ď |α| ` |β| ` |γ| ă 2 n. So μ  is computable.  Thus we have a no-free-lunch result for strong NC-learning: the set of sources strongly NC-learned by any forecaster is uncountable and dense but meagre; for every (computable) forecaster there is another (computable) forecaster that strongly NC-learns everything it does, plus a further countably infinite set of sources; and for every forecaster there is another that strongly NC-learns a disjoint set of sources (indeed, typical forecasters have this feature). 4.2. NC-Learning and Weak NC-Learning Proposition 4.5 above tells us that each forecaster strongly NC-learns a dense and uncountable but meagre set of sources. This implies that the sets of sources NC-learned and weakly NClearned by any forecaster are also dense and uncountable. Strong NC-learning is, intuitively, a much more restrictive notion than NC-learning: being able to accurately answer all questions about the data stream, including questions about the infinite future, is much a much more demanding standard than being able to accurately estimate the chances for the next bit.35 Similarly, NC-learning is, intuitively, a much more restrictive notion than weak NC-learning: we saw in Section 3 above that weakening NV-learning by allowing an infinite number of errors (so long as they were of asymptotic density zero) made a marked difference to the size of the set of sequences that a given extrapolator could learn-any extrapolator NV-learns a countable set of sequences but weakly NV-learns an uncountable set of sequences. So it is not obvious that the set of sources (weakly) NC-learned by a given forecaster should always be meagre.36 Not obvious-but, as we will see, nonetheless true. 35Indeed, there is a sense in which strong NC-learning implies rapid NC-learning, and a sense in which the converse implication holds [56, Propositions 2 and 3 ]. 36Noguchi [48, p. 433], after discussing the results cited above in fn. 35, remarks that: "These results lead us to conjecture that, in general, a merged set (of probability measures) [i.e., a set of sources strongly NClearned by a given forecaster] may be much smaller than a weakly merged set [i.e, a set of sources NC-learned 21 We begin by introducing a basis W for the weak topology on P . First, for each k P N, we fix a metric on Pk compatible with its topology: we take the distance between λ, μ P Pk to be given by: dpμ, λq :" max wPBk |μpwq   λpwq|. In terms of our identification of Pk with a closed subset of R2 k , this is the metric induced by the `8 norm on R2k . For μ P Pk and ε ą 0, we write Bpμ, εq for the open metric ball of radius ε centred at μ: Bpμ, εq :" tλ P Pk | dpμ, λq ă εu. We call Bpμ, εq Ă Pk rational if ε P Q and μpwq P Q for each w P Bk. For each k P N, let Πk : P Ñ Pk be the restriction map: for μ P P , Πkpμq is the measure in Pk such that Πkpμqpwq " μpwq for each w P Bk. We now take W to comprise the inverse images under the Πk of the rational open metric balls in the various Pk: W :" tW " Π 1k pBpμ, εqq | k P N, μ P Pk, μpwq P Q @w P B k, ε ą 0, ε P Qu. Proposition 4.8. W is a basis for the weak topology on P . Proof. It suffices to show: (i) that each W P W is open; and (ii) that for any non-empty open set U Ă P and for any ν P U, there is a W PW with ν P W Ă U. (i) Fix W PW of the form W " Π 1k pBpμ, εqq. Let w1, . . . , w2k be an enumeration of the k-bit strings. And for each 1 ď j ď 2k, let pj :" maxt0, μpwjq   εu and qj :" mint1, μpwjq ` εu. Then we have: W " ! λ P P | max 1ďjď2k |μpwjq   λpwjq| ă ε ) " 2k č j"1 Swj ,pj ,qj , where each Swj ,pj ,qj is a sub-basic open subset of P (as in item (vi) of Section 2.1 above). So W is an open subset of P . (ii) It suffices to consider a non-empty open set U Ă P that is a finite intersection of sub-basic open sets. Let Sw1,p1,q1 , . . . , Swn,pn,qn be arbitrary sub-basic open subsets of P and suppose that U :" Şn k"1 Swk,pk,qk ‰ ∅. Let N " maxt|w1|, . . . , |wn|u and let ν P U. Note that each ΠNpSwj ,pj ,qjq is an open subset of PN : each condition of the form pj ă ΠNpμqpwjq ă qj just imposes an inequality on (sums of) differences of coordinate relative to our identification of PN with a subset of R2 N . So we can find a rational open metric ball B contained in ΠNpUq with Πnpνq P B. Letting W :" Π  1 N pBq PW , we have ν P W Ă U.  Proposition 4.9. Let μ be a forecaster. The sources weakly NC-learnable by μ form a meagre subset of P . Proof. For any source λ and k P N, let us say that pμ, λq considers k bad if for each w P Bk we have |μps |wq   λps |wq| ě 1 5 s " 0, 1. by a given forecaster]." He then goes on to observe that each forecaster strongly NC-learns a meagre set of sources-so it is natural to read him as conjecturing that the set of sources NC-learned by a forecaster need not be meagre. 22 And let us say that pμ, λq considers k super-bad if pμ, λq considers more than half of the j ď k to be bad. And, by extension, for any subset S Ă P , let us say that pμ, Sq considers k P N (super-)bad if pμ, λq does for each λ P S. For each n P N, let Fn be the set of λ P P such that pμ, λq considers at least n natural numbers to be super-bad. And let An be the complement of Fn in P . Note that μ cannot NC-learn λ if there are infinitely many k P N that pμ, λq considers bad and that μ cannot weakly NC-learn λ if there are infinitely many k P N that pμ, λq considers super-bad. So if μ weakly NC-learns λ, then pμ, λq can consider only finitely many natural numbers to be super-bad, which means that there will be an N such that λ R FN , which implies that λ P A :" Ť nPNAn. So in order to establish our proposition, it suffices to show that each An is nowhere dense in P . The first step is to suppose that we are given a set W P W of the form Π 1k pBpλ, εqq and to show how to find W1 P W of the form W1 " Π 1k`1pBpλ1, ε1qq, such that W1 Ă W and pμ,W1q considers k ` 1 to be bad. First, we select λ1. For each w P Bk, if μpw.0q ě μpw.1q, we set λ1pw.0q " 1 10   λpwq and λ1pw.1q " 9 10   λpwq; otherwise we set λ1pw.0q " 9 10   λpwq and λ1pw.1q " 1 10   λpwq. This gives us a well-defined λ1 P Pk`1 that assigns rational values to each string in Bk`1. We now select ε1 ą 0 as follows: we choose m large enough so that ε1 " 10  m is small enough so that for any λ1 in Bpλ1, ε1q, for each w P Bk, if μpw.0q ě μpw.1q, then λ1pw.1q ą 8 10   λpwq, and if μpw.0q ă μpw.1q then, λ1pw.0q ą 8 10   λpwq. This process can be iterated. In particular, if we are given W PW of the form Π 1k pBpλ, εqq, we can run the process once to construct W1 PW with W1 Ă W such that pμ,W1q considers k ` 1 bad; applying the process again (now with W1 if place of W ) yields a W2 P W with W2 Ă W1 such that pμ,W2q considers k ` 2 bad and so on. So if we are given W PW of the form Π 1k pBpλ, εqq, we can run the process k`n times to yield W   :" Wk`n P W such that W   Ă W and pμ,W  q considers at least n numbers to be super-bad, so that W   Ş An " ∅. So An is nowhere dense in P .  Corollary 4.3. The set tλ P P | Dμ P F such that μ weakly NC-learns λu is meagre in P . It of course follows that the set of sources (strongly) NC-learnable by a given forecaster are likewise meagre-and that set of all sources collectively (strongly) learnable by forecasting machines are likewise meagre. Remark 4.2. The set of sources not even weakly NC-learnable by a given forecaster μ is a co-meagre subset of P , and so is uncountable. A variant on the proof of the above proposition shows that even if the continuum hypothesis fails, this set has the cardinality of the continuum. Fix a metric on P compatible with the weak topology, such as the Prokhorov 23 metric.37 And let us amend the iterative procedure of the proof of the preceding proposition so that the diameter of Wk`1 relative to this metric is no more than half of the diameter of Wk. Then if we are given W P W and repeatedly apply our revised iterative procedure, we will construct a sequence W1, W2, . . . of nested W-sets such that Ş8 k"1Wk contains a single source, which is not even weakly NC-learnable by μ. There are continuum-many distinct W we could use to initiate this procedure-these determine continuum-many distinct sources not even weakly NC-learnable by μ. Proposition 4.10. Let μ be a forecaster. Then there is a second forecaster μ: such that the sets of sources weakly NC-learned by μ and by μ: are disjoint. If μ is computable, we can take μ: to be likewise computable. Proof. Let μ be given. We construct a map ν : B  Ñ r0, 1s inductively as follows: a) νp∅q " 1; b) Supposing that νpwq is given, we define νpw.0q and νpw.1q as follows: i) if μp0 |wq ď μp1 |wq, then νpw.0q " 9{10   νpwq and νpw.1q " 1{10   νpwq; ii) if μp0 |wq ą μp1 |wq, then νpw.0q " 1{10   νpwq and νpw.1q " 9{10   νpwq. Clearly, for any w P B , νpwq " νpw.0q`νpw.1q. So by the Carathéodory Extension Theorem, ν extends to a unique Borel probability measure on C, which we take as our μ:. For any non-empty w P B , |μp1 |wq   μ:p1 |wq| ě 2 5 . So for any λ P P , any σ P C, and n P N we have: maxt|μp1 |σrnsq   λp1 |σrnsq|, |μ:p1 |σrnsq   λp1 |σrnsq|u ě 1 5 . So there can be no λ P P such that for every σ in a set of λ-measure one, there is a set K of natural numbers of asymptotic density 1, such that for sufficiently large n P K, μp1 |σrnsq and μ:p1 |σrnsq are both arbitrarily close to λp1 |σrnsq-i.e., there is no source λ that is weakly NC-learned by both μ and μ:.  Of course, it follows that μ and μ: also (strongly) NC-learn disjoint sets of sources. So we have no-free-lunch theorems for (weak) NC-learning: each forecaster, computable or not, (weakly) NC-learns an uncountable and dense but meagre set of sources; and for each (computable) forecaster there is another that (weakly) NC-learns a disjoint set of sources. Remark 4.3. Lehrer and Smorodinsky [22] show that if μ P F NC-learns λ P P , then any nontrivial mixture of μ with any ν P P weakly NC-learns λ. Ryabko and Hutter [23, Proposition 10] show that this result is sharp: they given an example of of measures μ, ν, and λ where μ NC-learns λ but any non-trivial mixture of μ and ν merely weakly NC-learns λ. So there is no prospect of using the strategy of the proof of Proposition 4.7 above to prove an analogous result for NC-learning. 4.3. Forecasting of Computable Sources Let us now specialize to problem of (strong, weak) NC-learning for computable forecasters facing data streams generated by computable sources.38 37For details see, e.g., [25, pp. 72 f.]. 38Vitányi and Chater [57] introduce a model of learning in which agents facing a data stream generated by a computable source attempt to guess a code number for that source (so this model of learning stands to next chance learning as identification stands to extrapolation). See also [58, 59]. 24 For μ P F, we denote by NCpμq the set of computable sources that are NC-learned by μ. We use NC to denote: tS Ă P | Dμ P F with S Ď NCpμqu. Let us likewise use NCspμq and NCwpμq to denote the set of computable sources strongly NC-learned and weakly NC-learned by the forecasting machine μ and use NCs and NCw to denote the class of subsets of P that can be strongly/weakly NC-learned by some forecasting machine. It is immediate from the definitions that NCs Ď NC and that NC Ď NCw. A variant on the proof of Proposition 3.9 shows that the latter containment is proper. Proposition 4.11. NC Ă NCw. Proof. Let V be the subset of P consisting of δ-function measures concentrated on computable binary sequences in which 0's have vanishing asymptotic density. Let μ P F be the measure that on input of any w P Bn, considers the chance of seeing a 0 next to be 2 n. We have V P NCwpμq. But suppose that V Ď NCpνq for some ν P F . We define σ P C as follows: σ is of the form 1n1 .0.1n2 .0.1n3 .0 . . . where where each nj is chosen to be the smallest n larger than 2j such that νp1n1 .0.1n2 .0. . . . .1nj 1 .01nq ą .9 (such nj must exist, since by assumption ν NC-learns each delta-function measure concentrated on a sequence containing only finitely many 0's). The delta-function measure concentrated on σ is in V. But σ R NCpνq, since when fed σ, there are infinitely many occasions on which ν issues forecast probabilities for seeing a 0 next of less than .1, when the true chance is 1.  Proposition 4.12. For any μ P F, the following are dense subsets of P : (a) NCspμq. (b) The complement of NCspμq in P. (c) NCpμq. (d) The complement of NCpμq in P. (e) NCwpμq. (f) The complement of NCwpμq in P. Proof. The claim concerning (a) follows via straightforward adaptation of the proof of Proposition 4.4, while that of (f) follows from Proposition 4.15 below. The other sets listed are supersets of (a) or (f).  For any of our senses of probabilistic learning, for any computable forecaster, that forecaster succeeds in learning a countable infinity of computable sources and fails to learn a countable infinity of computable sources. So we have parity between the learnable and the unlearnable at the level of cardinality. And this parity persists at the level of topology: a version of Sierpiński's Theorem tells us that, up to homeomorphism, there is only one countable metrizable topological space without isolated points [60, §2]. But it is straightforward to extend Mehlhorn's notion of an effectively meagre set to the context of P, with the elements of the basis W for P of Section 4.2 playing the role that the basic open sets Bw played in our discussion of effectively meagre subsets of C in Section 3.3 above. And, as in the case of next-value learning, we find that the for our species of next-chance learning, this notion allows us to isolate a sense in which failure is incomparably more common than success. Recall that elements of W are specified by specifying a natural number k, a rational-valued measure μ P Pk (which is determined in turn by specifying the values that it assigns each 25 w P Bk), and a rational ε ą 0. So the elements of W can be effectively represented by binary strings. In the following definition we take such a coding scheme to be fixed. Definition 4.7. Let A be a subset of P. Let f : W ÑW be a computable function. Then A is effectively nowhere dense via f if for each W PW : i) fpW q Ă W ; ii) A Ş fpW q " ∅. Definition 4.8. A subset A of P effectively nowhere dense if there is a computable F : NW ÑW such that: i) for each n P N there is an An that is effectively nowhere dense via F pn,  q : W ÑW ; ii) A " Ť An. The complement of an effectively meagre subset of P is effectively co-meagre. The proofs of Propositions 3.12 and 3.13 are easily adapted to yield: Proposition 4.13. The set of effectively meagre subsets of P is closed under the following operations: (i) taking subsets; (ii) taking finite unions; (iii) taking effective unions. Proposition 4.14. For any W PW , the set W Ş P is not effectively meagre. So it is again natural to consider the elements of effectively meagre subsets of P to be incomparably less common than the elements of effectively co-meagre subsets of P. Proposition 4.15. For any μ P F, NCwpμq is an effectively meagre subset of P. Proof. A straightforward adaptation of the proof of Proposition 4.9, appealing to the fact that when μ is computable, the map pn,W q ÞÑ W   R An used there is computable.  So there is a natural sense in which, for any computable forecaster μ, among computable sources, those weakly NC-learnable by μ are incomparably less common than those not NCweakly learnable by μ. And, a fortiori, those computable sources (strongly) NC-learnable by μ are incomparably less common than those not (strongly) NC-learnable by μ. Learning in this setting is formidably difficult. And hard choices must be made: the proof of Proposition 4.10 above shows that each μ P F has an evil twin μ: P F such that the two weakly NC-learn disjoint sets of measures. Remark 4.4 (Partial Forecasting Machines.). In Remark 3.6 above, we saw above that liberalizing our notion of NV-learning of computable sequences by allowing merely partial computable extrapolating machines made an interesting difference: while every set in NV is effectively meagre, this is not true of every set in NV 1 (let alone NV 2). What is the 'partial' analog of NC-learning? Recall that a semi-measure on C is a map μ : B  Ñ r0, 1s satisfying μp∅q ď 1 and μpwq ě μpw.0q`μpw.1q for all w P B  (with equality of course being required for measures). Such a μ is lower semi-computable if there exists a partial computable φ : B NÑ r0, 1s with μpwq " lim`Ñ8 φpw, `q and φpw, kq ď φpw, k`1q, for all w P B  and k P N. According to the approach deriving from [19] and [61], as computable functions stand to partial computable functions, 26 computable measures stand to lower semi-computable semi-measures.39 This approach leads to a stunning result: there exists a lower semi-computable semi-measure μS that next-chance learns (in various natural senses) every computable measure (there are many such learners, in fact). But this feat is less impressive than it might at first appear [62, 63]: while μS is lower semi-computable, the corresponding conditional probability function μSp1 |wq-i.e., the thing we need to calculate in order to make predictions-is merely limit computable (the problem being that the quotient of two lower semi-computable numbers need not be lower semi-computable). Here is an alternative approach.40 A confirmation function is a map μ : B  B  Ñ p0, 1q such that μp1 |wq`μp0 |wq " 1 (as noted above, the Kolmogorov Consistency Theorem tells us that specifying a confirmation function is the same thing as specifying a forecaster). A semi-confirmation function is a map μ : B  B  Ñ p0, 1q such that μp1 |wq ` μp0 |wq ď 1. We say that a semi-confirmation function μ is lower semi-computable if there is a partial computable φ : B  B   N Ñ r0, 1s such that or each s P B, w P B , and k P N we have: (a) μps |wq " lim`Ñ8 φps, w, `q; and (b) φps, w, kq ď φps, w, k ` 1q. We call a lowersemi computable semi-confirmation function a partial forecasting machine. We say that the partial forecasting machine μ NC 1-learns the computable source λ if with λ-probability one, when μ is fed a data stream σ generated by λ, we have: (i) μp1 |σrksq ` μp0 |σrksq " 1 for each k; and μp1 |σrksq converges to λp1 |σrksq as k Ñ 8. We say that μ NC 2-learns λ if the previous definition holds with clause (i) weakened to allow finitely many exceptions. We define the classes NC 1 and NC 2 in the obvious way. It is straightforward to show that if a partial extrapolating machine m NV-/NV1-/NV2-learns each sequence in a set S0 of computable sequences, then there is a partial forecasting machine μ that NC-/NC1-/NC2learns each delta-function measure corresponding to an element of S0: for w P Bn, and k P N, set φp1, w, kq " φp0, w, kq " 0 unless simulating the computation of m on w for k steps shows that mpwq " s, in which case set φps, w, kq " 1   2 n and set φp1   s, w, kq " 2 n. Further, if a partial forecasting machine μ NC-/NC1-/NC2-learns each member of a set S1 of computable delta-function measures, then there is a partial forecasting machine m that NV-/NV1-/NV2-learns each sequence that is the support of one of the measures in S1: for w P Bn, compute the conditional probabilities μps |wq until one of them is at least a half and take the corresponding bit to be mpwq. So from the fact that NV Ă NV 1 Ă NV 2 it follows that NC Ă NC 1 Ă NC 2. Since there are sets in NV 1 that are not effectively meagre in C, it is natural to expect that there are sets in NC 1 that are not effectively meagre in P. It is known, however, that P R NC 2 [63]. 5. Discussion Over the course of the last century, it became widely accepted that successful inductive learning is possible only against a background of biases that favour some hypotheses over others (see, e.g., [64–67]).41 No-free-lunch results substantiate this insight. If we don't presuppose anything about the binary sequence being revealed to us, then we face a formidably difficult learning problem: no matter what approach to learning we adopt, the situations that we might face, those in which we fail are incomparably more common than those in which we succeed. And no approach dominates all rivals in its range of success: for any 39For full details and motivation see [11]. 40In what follows, I am indebted to discussions with Tom Sterkenburg. 41Arguably, this theme can be found already in Leibniz-see Item 6 in [68]. 27 approach, there are others that succeed in situations in which the given one fails; indeed, for any approach, there is another that succeeds in a disjoint set of situations. To adopt an approach to learning is to make a bet about what the world is like. No-free-lunch results place upper bounds on our reasonable ambitions.42 Suppose that one is interested in the question: Why should someone interested in arriving at the truth proceed inductively (expecting the future to be like the past) rather than counter-inductively? Consider how this question looks in the simplest of our contexts, in which an agent being shown a binary sequence bit by bit aims to eventually be able to correctly predict each new bit on the basis of the bits seen so far. Here each method of learning succeeds on a countable dense subspace of the space of binary sequences. And all such subspaces are isomorphic (Sierpiński's Theorem again). So unless we impose more structure on our problem, we have parity between the set of possibilities in which a inductive extrapolator m is successful and the set of possibilities in which counter-inductive extrapolator m: is successful.43 The results developed above presuppose that we are operating in an austere setting-one in which we countenance arbitrary (computable) data streams or data streams generated by sampling from arbitrary (computable) probability measures. In more tightly constrained settings, learning becomes tractable-e.g., if one knows that the data stream is generated by a Bernoulli measure, then it is a straightforward task to use the data to successfully estimate the relevant parameter. But this observation illustrates rather than undercuts the perspective of the preceding paragraphs, making the point that although a universal learning algorithm is an impossibility, learning becomes possible when sufficiently strong presuppositions are in play. Of course, one would ultimately like to know more about where the boundaries lie of the class of learning problems in which failure is typical and of the class of learning problems in which success is typically achievable.44 The results developed above are absolute in the sense that they do not presuppose the choice of a privileged measure on Cantor space or on the space of probability measures on Cantor space. But most of them do depend on the choice of topology. For the results concerning (weak) learning of sequences by extrapolators, this is not very worrying. In the vast majority of applications in statistics, economics, and computer science, the space of binary sequences is equipped with the product topology. And with good reason: this topology can be thought of as the topology of point-wise convergence and motivated by thinking of binary sequences as encoding real numbers in the usual way. The situation is not quite as straightforward with the space of probability measures on Cantor space. Certainly, the weak topology is extremely natural-but it is only one of several natural options. So it is natural to wonder whether the intractability of our learning problems would hold under other reasonable choices of topology. 42That is one of their uses. Of the results canvassed in Section 1 above, Putnam's was designed to expose a serious flaw in objective Bayesian approaches in the tradition of [69] while that of Shalev–Shwartz and Ben–David was devised to provide an elegant motivation for the definition of VC-dimension. 43Some formal learning theorists take the view that learning strategies prone to mind-changes are to be eschewed and establish, in some contexts, a link between counter-inductive behaviour and mind changes- see, e.g., [70] and [71]. 44See [12] for some results of this kind for the problem of identification of sequences. 28 References [1] D. Wolpert, W. Macready, No free lunch theorems for optimization, IEEE Transactions on Evolutionary Computation 1 (1997) 67–82. [2] D. Wolpert, The supervised learning no-free-lunch theorems, in: R. Roy, M. Köppen, S. Ovaska, T. Furuhashi, F. Hoffmann (Eds.), Soft Computing and Industry, Springer, 2002, pp. 25–42. [3] Y.-C. Ho, D. Pepyne, Simple explanation of the no-free-lunch theorem and its implications, Journal of Optimization Theory and Applications 115 (2002) 549–570. [4] U. von Luxburg, B. Schölkopf, Statistical learning theory: Models, concepts, and results, in: D. Gabbay, S. Hartmann, J. Woods (Eds.), Inductive Logic, Elsevier, 2011, pp. 651– 706. [5] T. Sterkenburg, The no-free-lunch theorems of supervised learning, Unpublished (2020). [6] B. Rao, D. Gordon, W. Spears, For every generalization action, is there really an equal and opposite reaction? Analysis of the conservation law for generalization performance, in: A. Prieditis, S. Russell (Eds.), ICML '95: Proceedings of the 12th International Conference on Machine Learning, Morgan Kaufmann, 1995, pp. 471–479. [7] S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014. [8] H. Putnam, Probability and Confirmation, US Information Agency, 1963. [9] J. Case, C. Smith, Comparison of identification criteria for machine inductive inference, Theoretical Computer Science 25 (1983) 193–220. [10] E. M. Gold, Language identification in the limit, Information and Control 10 (1967) 447–474. [11] M. Li, P. Vitányi, An Introduction to Kolmogorov Complexity and its Applications, 4th Edition, Springer, 2019. [12] L. Fortnow, R. Freivalds, W. Gasarch, M. Kummer, S. Kurtz, C. Smith, F. Stephan, On the relative sizes of learnable sets, Theoretical Computer Science 197 (1998) 139–156. [13] H. Putnam, 'Degree of confirmation' and inductive logic, in: P. Schilpp (Ed.), The Philosophy of Rudolf Carnap, Open Court, 1963, pp. 761–783. [14] J. Bārzdiņš, Prognostication of automata and functions, in: C. Frieman (Ed.), Information Processing '71, Vol. 1, North–Holland, 1972, pp. 81–84. [15] L. Blum, M. Blum, Toward a mathematical theory of inductive inference, Information and Control 28 (1975) 125–155. [16] K. Podnieks, Comparing various concepts of function prediction. I, Scientific Proceedings of Latvia State University 210 (1974) 68–81 (in Russian). [17] K. Mehlhorn, On the size of sets of computable functions, in: R. Book, A. Borodin, F. Lewis, A. Mukhopadhyay, A. Rosenberg, R. Strong, J. Ullman (Eds.), 14th Annual Symposium on Switching and Automata Theory, IEEE Computer Society Publications Office, 1973, pp. 190–196. [18] J. Bārzdiņš, R. Freivalds, On the prediction of general recursive functions, Soviet Mathematics Doklady 13 (1972) 1224–1228. [19] R. Solomonoff, A formal theory of inductive inference. I, Information and Control 7 (1964) 1–22. [20] D. Blackwell, L. Dubins, Merging of opinions with increasing information, The Annals of Mathematical Statistics 33 (1962) 882–886. 29 [21] E. Kalai, E. Lehrer, Weak and strong merging of opinions, Journal of Mathematical Economics 23 (1994) 73–86. [22] E. Lehrer, R. Smorodinsky, Merging and learning, in: T. Ferguson, L. Shapley, J. MacQueen (Eds.), Statistics, Probability and Game Theory: Papers in honor of David Blackwell., Institute of Mathematical Statistics, 1996, pp. 147–168. [23] D. Ryabko, M. Hutter, On sequence prediction for arbitrary measures, in: 2007 IEEE International Symposium on Information Theory, IEEE, 2007, pp. 2346–2350. [24] K. Parthasarathy, Probability Measures on Metric Spaces, Academic Press, 1967. [25] P. Billingsley, Convergence of Probability Measures, 2nd Edition, Wiley, 1999. [26] A. Kechris, Classical Descriptive Set Theory, Springer, 1995. [27] J. Reimann, Effectively closed sets of measures and randomness, Annals of Pure and Applied Logic 156 (2008) 170–182. [28] A. Nies, Computability and Randomness, Oxford University Press, 2009. [29] J. Oxtoby, The Banach-Mazur game and Banach category theorem, in: M. Dresher, A. Tucker, P. Wolfe (Eds.), Contributions to the Theory of Games, Vol. III, Princeton University Press, 1957, pp. 159–163. [30] R. Klette, R. Wiehagen, Research in the theory of inductive inference by GDR mathematicians-a survey, Information Sciences 22 (1980) 149–169. [31] D. Angluin, C. Smith, Inductive inference: Theory and methods, ACM Computing Surveys 15 (1983) 237–269. [32] P. Odifreddi, Classical Recursion Theory, Vol. II, Elsevier, 1999. [33] T. Zeugmann, S. Zilles, Learning recursive functions: A survey, Theoretical Computer Science 397 (2008) 4–56. [34] K. Podnieks, Comparing various concepts of function prediction. II, Scientific Proceedings of Latvia State University 233 (1975) 35–44 (in Russian). [35] Z. Szabó, Stratified inductive hypothesis generation, in: K. Jantke (Ed.), Analogical and Inductive Inference, Springer, 1987, pp. 177–195. [36] S. Jain, D. Osherson, J. Royer, A. Sharma, Systems that Learn: An Introduction to Learning Theory, 2nd Edition, MIT press, 1999. [37] C. Jockusch, P. Schupp, Generic computability, Turing degrees, and asymptotic density, Journal of the London Mathematical Society 85 (2012) 472–490. [38] H. Zenil (Ed.), A Computable Universe: Understanding and Exploring Nature as Computation, World Scientific, 2013. [39] L. Pitt, Probabilistic inductive inference, Journal of the ACM 36 (1989) 383–433. [40] J. Royer, Inductive inference of approximations, Information and Control 70 (1986) 156–178. [41] S. Jain, Program synthesis in the presence of infinite number of inaccuracies, Journal of Computer and System Sciences 53 (1996) 583–591. [42] A. Dasgupta, Set Theory: With an Introduction to Real Point Sets, Springer, 2014. [43] L. Lisagor, The Banach-Mazur game, Mathematics of the USSR-Sbornik 38 (1981) 201– 216. [44] L. Báez-Duarte, CpXq  and Kolmogorov's consistency theorem for Cantor spaces, Studies in Applied Mathematics 49 (4) (1970) 401–403. [45] R. Solomonoff, Complexity-based induction systems: Comparisons and convergence theorems, IEEE Transactions on Information Theory 24 (1978) 422–432. 30 [46] M. Hutter, On universal prediction and Bayesian confirmation, Theoretical Computer Science 384 (2007) 33–48. [47] D. Freedman, On the asymptotic behavior of Bayes' estimates in the discrete case, The Annals of Mathematical Statistics 34 (1963) 1386–1403. [48] Y. Noguchi, Merging with a set of probability measures: A characterization, Theoretical Economics 10 (2015) 411–444. [49] E. Szpilrajn, Remarques sur les fonctions complètement additives d'ensemble et sur les ensembles jouissant de la propriété de Baire, Fundamenta Mathematicae 22 (1934) 303– 311. [50] E. Marczewski, R. Sikorski, Remarks on measure and category, Colloquium Mathematicum 2 (1949) 13–19. [51] O. Zindulka, Killing residual measures, Journal of Applied Analysis 5 (1999) 223–238. [52] E. Dekel, Y. Feinberg, Non-Bayesian testing of a stochastic prediction, The Review of Economic Studies 73 (2006) 893–906. [53] G. Koumoullis, Baire category in spaces of measures, Advances in Mathematics 124 (1996) 1–24. [54] L. Dubins, D. Freedman, Measurable sets of measures, Pacific Journal of Mathematics 14 (1964) 1211–1222. [55] J. Oxtoby, Measure and Category: A Survey of the Analogies between Topological and Measure Spaces, 2nd Edition, Springer, 1980. [56] A. Sandroni, R. Smorodinsky, The speed of rational learning, International Journal of Game Theory 28 (1999) 199–210. [57] P. Vitányi, N. Chater, Identification of probabilities, Journal of Mathematical Psychology 76 (2017) 13–24. [58] L. Bienvenu, S. Figueira, B. Monin, A. Shen, Algorithmic identification of probabilities is hard, Journal of Computer and System Sciences 95 (2018) 98–108. [59] G. Barmpalias, N. Fang, F. Stephan, Equivalences between learning of data and probability distributions, and their applications, Information and Computation 262 (2018) 123–140. [60] P. Neumann, Automorphisms of the rational world, Journal of the London Mathematical Society 2 (1985) 439–448. [61] L. Levin, V. V'yugin, Invariant properties of informational bulks, in: J. Gruska (Ed.), Mathematical Foundations of Computer Science 1977, Springer, 1977, pp. 359–364. [62] J. Leike, M. Hutter, On the computability of Solomonoff induction and knowledgeseeking, in: K. Chaudhuri, C. Gentile, S. Zilles (Eds.), International Conference on Algorithmic Learning Theory, Springer, 2015, pp. 364–378. [63] T. Sterkenburg, Putnam's diagonal argument and the impossibility of a universal learning machine, Erkenntnis 84 (2019) 633–656. [64] H. Jeffreys, Probability, statistics, and the theory of errors, Proceedings of the Royal Society of London. Series A 140 (1933) 523–535. [65] T. S. Kuhn, The Structure of Scientific Revolutions, University of Chicago Press, 1963. [66] N. Chomsky, Aspects of the Theory of Syntax, MIT Press, 1965. [67] C. G. Hempel, Philosophy of Natural Science, Prentice–Hall, 1966. [68] L. Loemker (Ed.), Gottfried Wilhelm Leibniz: Philosophical Papers and Letters, 2nd Edition, D. Reidel, 1969. [69] R. Carnap, On inductive logic, Philosophy of Science 12 (1945) 72–97. 31 [70] K. Kelly, Simplicity, truth, and probability, in: P. Bandyopadhyay, M. Forster (Eds.), Philosophy of Statistics, Elsevier, 2011, pp. 983–1024. [71] H. Lin, Modes of convergence to the truth: Steps toward a better epistemology of induction, Forthcoming in The Review of Symbolic Logic. (2018). Department of Philosophy, University of Michigan belot@umich.edu