Classes of measures which can be embedded in the Simple Symmetric Random Walk

We characterize the possible distributions of a stopped simple symmetric random walk X τ , where τ is a stopping time relative to the natural ﬁltration of ( X n ). We prove that any probability measure on Z can be achieved as the law of X τ where τ is a minimal stopping time, but the set of measures obtained under the further assumption that ( X n ∧ τ : n ≥ 0) is a uniformly integrable martingale is a fractal subset of the set of all centered probability measures on Z . This is in sharp contrast to the well-studied Brownian motion setting. We also investigate the discrete counterparts of the Chacon-Walsh [4] and Az´ema-Yor [1] embeddings and show that they lead to yet smaller sets of achievable measures. Finally, we solve explicitly the Skorokhod embedding problem constructing, for a given measure µ , a minimal stopping time τ which embeds µ and which further is uniformly integrable whenever a uniformly integrable embedding of µ exists. fractal, uniform integrability.


Introduction
We study distributions which can be achieved as the law of X τ , where (X n ) n≥0 is a simple symmetric random walk and τ is a stopping time relative to the natural filtration of (X n ). We find that when we consider different classes of stopping times, the set of achievable measures varies dramatically, with natural classes resulting in both M, the set of all probability measures on Z, and some complex fractal subsets of M. This is very different to the continuous-time situation, which provides the motivation and background for the present study, and which we briefly now describe.
The problem of representing measures as stopped process, called the Skorokhod embedding problem, was first posed (and solved) in Skorokhod [23]. Since then, the problem has been an active field of research and has found numerous solutions. We refer the reader to Ob lój [14] for a comprehensive survey paper. Simply stated the problem is the following: given a probability measure µ and a stochastic process (X t ) t≥0 find a stopping time T which embeds µ in X, i.e. such that the law of X T is µ: X T ∼ µ. The most commonly considered case is when (X t ) t≥0 is a 1-dimensional Brownian motion, which we denote (B t ). However, in this context we have a trivial solution (usually attributed to Doob): for any probability measure µ, define the distribution function F µ (x) = µ((−∞, x]) with F −1 µ its right-continuous inverse, and let Φ denote the distribution function of a standard Normal variable. Then the stopping time Thus it is clear that interest lies in the properties of the stopping time T .
In the example above we always have E T = ∞. Skorokhod [23] imposed E T < ∞ which then implies that µ is centered with finite second moment and that the process (B t∧T : t ≥ 0) is a uniformly integrable martingale, where t ∧ T = min{t, T }. Numerous authors (e.g. Root [19], Azéma and Yor [1], Perkins [17], Jacka [11]) relaxed the assumption of finite second moment and presented constructions which, for any centered probability measure µ, give a stopping time T such that B T ∼ µ and (B t∧T : t ≥ 0) is a uniformly integrable martingale. We shall call stopping times for which the latter property is verified UI stopping times. These constructions work in the setting of continuous local martingales and some can be extended to specific discontinuous setups (cf. Ob lój and Yor [16]).
When the target measure µ is not centered the process (B t∧T : t ≥ 0) cannot be a uniformly integrable martingale. Hence, a more general criterion for deciding when the stopping time T is reasonably small is needed and such criterion is provided by notion of minimality introduced by Monroe [13], and considered more recently by Cox and Hobson [6]. We say that a stopping time T is minimal if whenever S ≤ T is a stopping time such that B S ∼ B T then S = T a.s.. Imposing the minimality requirement on the solutions to the Skorokhod embedding problem is justified by a result of Monroe [13] which asserts that a stopping time T which embeds a centered distribution in a Brownian motion is minimal if and only if T is a UI stopping time. Recently Cox and Hobson [6] and Cox [5] provided a description of minimality for general starting and target measures. Although it is not possible for the stopped process to be uniformly integrable in general, the conditions are closely related to uniform integrability in the Brownian setting. We can thus say that the notion of minimality for Brownian motion is well understood and is a feasible criterion.
Once we understand the equivalence between minimal and UI stopping times for Brownian motion (and via time-change arguments for all continuous local martingales) a natural question is then to ask: what is the situation for other martingales? More precisely, as we note below, uniform integrability always implies minimality, so the question is when, and 'how much', is the former more restrictive? On a more abstract level, one would like to discover the 'correct' interpretation of small for embeddings, and determine when the different definitions agree and disagree. This becomes an increasingly hard question in the discontinuous setup, and one has to work even to prove minimality of relatively simple stopping times (cf. Ob lój and Pistorius [15]).
The present work answers the above questions for the simple symmetric random walk, relative to its natural filtration. The Skorokhod embedding problem for Markov processes in discrete time has previously been considered by Rost [20;21], and Dinges [7] using techniques from potential theory, however without the restriction to the natural filtration; as a consequence, their results mirror closely the continuous-time setting. Indeed, we can make the following connection with the Brownian case: given a random walk and sufficient independent randomisation, we are able to construct a standard Brownian motion (B t ) by generating the intermediate paths, conditional on the start and end points, and further conditional on the end point being the first hitting time of a suitable integer. We then have X n = B Tn for an increasing sequence of stopping times T n relative to the natural filtration (F t ) of the constructed Brownian motion B. Now, given a stopping time T for the Brownian motion, which embeds µ on Z, we can construct a stopping time τ for the random walk (in an enlarged filtration) by considering the filtrationF n for the random walk generated by (F Tn , {T < T n+1 }) -note that the martingale property ensures that X n remains a random walk in this filtration -and defining τ by τ = n on {T n ≤ T < T n+1 }. In particular, X τ = B T a.s.. It is clear that the stopping time T is UI if and only if τ is since e.g. sup t≤T B t and sup n≤τ X n differ by at most 1.
The restriction to the natural filtration of the random walk alters the problem sufficiently to provide interesting differences. In Section 2 we prove that any probability measure on Z can be achieved by means of a minimal stopping time and we give a simple example of a centred measure which cannot be achieved with a UI stopping time. Then in Section 3 we examine the Azéma-Yor [1] and Chacon-Walsh [4] constructions in the random walk setting, the latter of which can be considered as the set of stopping times which are the composition of first exit times from intervals. We find that when using the Azéma-Yor stopping times the set of achievable measures is strictly smaller than when using the Chacon-Walsh stopping times, which in turn is a strict subset of M U I 0 , the set of measures embeddable via UI stopping times. In Section 4, which constitutes the main part of this work, we study the set M U I 0 . We show that measures in M U I 0 with support in [−N, N ] form a fractal subset of all centered probability measures on Z ∩[−N, N ], which we characterise as an iterated function system. The whole set M U I 0 is then characterised both intrinsically and via taking suitable closures. Finally, in Section 5 we construct an explicit minimal embedding of any µ ∈ M, which is also UI whenever µ ∈ M U I 0 . Section 6 concludes.
In the sequel we deal mainly with processes in discrete time where time is indexed by n = 0, 1, 2, . . . . When we refer to the continuous time setting time will be denoted by t ∈ [0, ∞). Stopping times in the discrete setting are denoted with Greek letters (typically τ ) and in continuous time with capital Latin letters (typically T ).
2 The Skorokhod embedding for random walks: general remarks In this section we prove the existence of a minimal stopping time which solves the Skorokhod embedding problem for random walk, and make some simple observations which show that the discrete time setting is quite different to the continuous time setting. From now on (X n : n ≥ 0) denotes a standard random walk, i.e. X 0 = 0, X n = n k=1 ξ k , n ≥ 1, where (ξ k ) is a sequence of i.i.d. variables, P(ξ k = −1) = P(ξ k = 1) = 1 2 . The maximum is denoted by X n = max k≤n X k . As stressed in the Introduction, of importance here is the fact that we are considering stopping times τ with respect to the natural filtration of the discrete process. Under the assumption that we have additional information, we note that one can give a simple explicit randomised embedding which just requires an independent two-dimensional random variable. This can be done mimicking Hall's solution [10] (cf. Ob lój [14,Sec. 3.4]): for µ a centered probability distribution on Z, k≥0 kµ({k}) = m < ∞, let (U, V ) be an independent variable with P(U = Recall that M is the set of probability measures on Z, M 0 the subset of centered probability measures on Z and M U I 0 the set of probability measures µ on Z such that there exists a stopping time τ (in the natural filtration of X) such that X τ ∼ µ and (X n∧τ : n ≥ 0) is a uniformly integrable martingale. Naturally, as the mean of a UI martingale is constant, we have M U I 0 ⊆ M 0 . However, unlike in the setup of Brownian motion, the inclusion is strict: Proof. To see this consider a centred probability measure µ = 1 3 (δ −1 + δ 0 + δ 1 ), where δ x denotes Dirac's mass in {x}. Suppose τ is a UI stopping time which embeds µ, i.e. X τ ∼ µ and (X n∧τ : n ≥ 0) is a uniformly integrable martingale. Then, by an argument to be given below, τ ≤ inf{n : |X n | = 1} = 1. As the initial sigma-field is trivial, we have τ = 0 or τ = 1 which contradicts X τ ∼ µ. We conclude that µ ∈ M 0 \ M U I 0 . We now argue that τ ≤ 1. Actually, for later use, we argue the following general fact: if τ is a UI stopping time with X τ ∼ ν and ν([−N, N ]) = 1 then τ ≤ η N := inf{n : |X n | = N }. Indeed, suppose to the contrary that P(τ > η N ) = p > 0. Then, as It is a general fact, which holds for any real-valued martingale, that a UI embedding is minimal 1 . The reverse is true in the Brownian motion setup with centered target laws, but not in general. It is thus natural to ask in the random walk setting: what measures can we embed in a minimal way? The answer is given in the following theorem.
Theorem 2. For any probability measure µ on Z there exists a minimal stopping time τ with respect to the natural filtration of (X n ) such that X τ ∼ µ. Theorem 2 will follow from Theorem 10 where we present an explicit construction of τ . However, for completeness, we outline a shorter proof. It suffices to see that there exists a stopping time τ with X τ ∼ µ, since standard reasoning (cf. Monroe [13]) then implies the existence of a minimal τ because the set of stopping times {τ : X τ ∼ µ} is nonempty and it is naturally partially ordered (by , where S T if and only if S ≤ T a.s.; see also Cox and Hobson [6]). We construct a stopping time τ with X τ ∼ µ which can be seen as a discrete analogue of Doob's stopping time is known at an a.s. finite stopping time ρ and we can define τ = inf{n > ρ : X n = k N (U ) }. Due to the recurrence of the random walk τ < ∞ a.s. and X τ ∼ µ as P(X τ = k i ) = P(N (U ) = i) = a i .

Embeddings via potential theory
One-dimensional potential theory, as used by Chacon and Walsh [4], proved a very useful tool for developing solutions to the Skorokhod embedding problem (cf. Ob lój [14]). We apply it here in the framework of a random walk. In this section we suppose the measure µ on Z is integrable: Define the potential of µ on Z by This is a continuous, piece-wise linear function breaking at atoms of µ. We have u µ (x) ≤ −|x − nµ({n})| with equality as |x| → ∞. The potential function determines uniquely the measure and vice-versa. Furthermore, the pointwise convergence of potentials corresponds to the weak convergence of measures. The crucial property for us lies in the fact that changes in the potential of the distribution of a random walk resulting from stopping at first exit times are easy to characterise. More precisely, let τ be a stopping time with E |X τ | < ∞ and ρ τ a,b = inf{n ≥ τ : X n / ∈ (a, b)} for a, b ∈ Z. Denote u 1 and u 2 the potentials of the distributions of X τ and X ρ τ a,b respectively. Then u 2 ≤ u 1 , u 1 (x) = u 2 (x) for x / ∈ (a, b) and u 2 is linear on [a, b] . In other words, u 2 = min{u 1 , l} where l is the line that goes through (a, u 1 (a)) and (b, u 1 (b)) (cf. Chacon [3], Cox [5], Ob lój [14, Sec. 2.2] for the details). We deduce the following fact. Lemma 3. If there exists a sequence of affine functions f k with |f ′ k | < 1 such that u µ = lim u k , where u 0 (x) = −|x|, u k = min{u k−1 , f k } and u k is differentiable on R \ Z then there exists a UI stopping time τ such that X τ ∼ µ.
Proof. The conditions in the lemma imply u µ ≤ u 0 and thus µ is centered. The stopping time τ is simply a superposition of first exit times. More precisely, consider a subsequence of (u k ), which we still denote (u k ), such that for every k there exists x k such that u k (x k ) < u k−1 (x k ). Define a k = inf{x : f k < u k−1 } and b k = sup{x : f k < u k−1 } and τ k = inf{n ≥ τ k−1 : X n / ∈ [a k , b k ]} with τ 0 = 0. Note that with our assumptions, a k , b k ∈ Z. Then u k is the potential of the law of X τ k and τ k ր τ as k → ∞. From the convergence of the potentials we deduce that τ is finite a.s. and X τ ∼ µ. The uniform integrability follows from standard arguments (cf. Chacon [3, Lemma 5.1]).
We will call stopping times obtained in the above manner Chacon-Walsh stopping times and the class of probability measures which can be embedded using these stopping times is denoted M CHW , and is probably best seen graphically. It follows from the fact that u µ (0) = − 11 8 , while when composing first exit times we cannot have the value of the potential at 0 in (− 3 2 Related to the Chacon-Walsh construction in the Brownian setting is the solution of Azéma and Yor [1]. For a centered probability measure µ on R define the Hardy-Littlewood or barycenter function via Then the stopping time With this in mind, we can consider a special case of the Chacon-Walsh construction in which the lines f n are tangential to u µ and take them in a given order: from left to right. Then the sequences (a k ) and (b k ) are increasing and therefore τ is the first time we go below a certain level which is a function of the present maximum X (which basically tells us which of the b k we have hit so far). This corresponds to the solution of Azéma and Yor as observed by Meilijson [12]. 2 We have thus the following result 3 . Proposition 4. Let µ be a centered probability measure on Z. The Azéma-Yor stopping time τ µ AY = inf{n : X n ≥ Ψ µ (X n )} embeds µ if and only if Ψ µ , displayed in (2), satisfies Ψ µ (x) ∈ N. Then, (X n∧τ µ AY : n ≥ 0) is a uniformly integrable martingale.
Proof. Sufficiency of the condition was argued above, cf. Ob lój [14,Sec. 4]. To see that it is also necessary recall (cf. Revuz and Yor [18, p. 271]) the one to one correspondence, given by µ → Ψ µ , between centered probability measures µ on R and positive, left-continuous, non- Note that Ψ µ is constant outside the support of µ, so in particular when µ(Z) = 1 then Ψ µ is constant on every interval (k, k + 1]. Then let µ be a probability measure on Z such that there exists k ∈ Z with Ψ µ (k) / ∈ N. Possibly choosing a different k we can suppose that Ψ µ (k) < Ψ µ (k + 1) or equivalently that µ({k}) > 0. Let l ∈ N be such that l < Ψ µ (k) < l + 1. Then we either have Ψ µ (k + 1) ≤ l + 1 or Ψ µ (k + 1) > l + 1. In the first case the process will never stop in k, P(X τ µ AY = k) = 0, which shows that X τ µ AY ≁ µ. In the second case, changing the value of Ψ µ (k) to any other value between (Ψ µ (k − 1) ∨ l, l + 1) will not affect the stopping time, where a ∨ b = max{a, b}. We thus obtain a continuity of functions Ψ, each corresponding to a different measure on Z, which all yield the same stopping time and thus the same law ν of the stopped process. We deduce that Ψ ν (k) = l + 1 and thus µ = ν.
We denote the class of measures which can be embedded using Azéma-Yor's stopping times with . Moreover, unlike in the continuous-time setup of Brownian motion, the inclusion is strict. To see this we recall an example given in Ob lój [14,Sec. 4]: consider µ = 2 9 δ −3 + 4 Gathering the results described so far we conclude that which is in sharp comparison with the continuous-time setup of Brownian motion 4 where all the sets are equal.

Characterisation of UI embeddings
We now study the set M U I 0 and its elements.

UI embeddings: case studies
We shall begin our study of the set M U I 0 by first restricting our attention to measures µ with µ([−2, 2]) = 1. The reason for this initial restriction is twofold: firstly, by considering a simple case, we can build intuition and develop techniques that will later be used in the general case, and secondly, we find that we can provide a more explicit characterisation of the relevant measures in this specific case. As a trivial initial statement, we note that since τ ≤ η 2 , we cannot stop at zero with a probability in ( 1 2 , 1) -either we stop at time 0, with probability 1, or else the first time we could stop will be at time 2, however with probability 1 2 we will hit {−2, 2} before returning to 0.
We begin by concentrating on the case where the stopped distribution µ is supported on {−2, 0, 2}. As µ is a centered probability measure, it is uniquely determined by µ({0}). The analysis will depend on counting the number of possible paths after 2n steps. After 2n steps, there are 2 2n possible paths, each occurring with equal probability, however only 2 n of these paths will not have hit {−2, 2}, and all of these paths will be at 0 at time 2n. Consider a UI stopping time τ with P(X τ ∈ {−2, 0, 2}) = 1. Then τ ≤ η 2 and all the paths hitting {−2, 2} were stopped. Since the stopping time τ is adapted to the natural filtration of X, if a path is stopped at 0 at time 2n, all paths which look identical up to time 2n must also stop at 2n. Consequently, given the stopping time τ , we can encode its properties in terms of the number of paths it will stop at time 2n; we do this using the sequence (a 0 , a 1 , a 2 , . . .), so that a n is the number of different (up to time 2n) paths which are stopped by τ at 0 at time 2n. Note that P(X τ = 0) = n≥0 4 −n a n . We can also reverse the process, so that given a suitable sequence (a 0 , a 1 , a 2 , . . .) we define a stopping time τ which stops at 0 (according to some algorithm) a n different paths at time 2n. The stopping time τ is not uniquely determined by (a n ) but the law of X τ is. Of course, not all sequences will necessarily allow such a stopping time to be defined, and the exact criteria are given in the following theorem.
if and only if p can be written as a base-4 fraction of the form a 0 .a 1 a 2 a 3 . . . with a n ∈ {0, 1, 2, 3}, where for n ≥ 1, or equivalently Furthermore, the set S of admissible values of p = µ({0}) is the unique fixed point of the mapping f operating on the closed subsets of [0, 1] given by Proof. Suppose that we have a probability p = a 0 .a 1 a 2 . . . satisfying (3); as remarked above, we can convert the sequence into a stopping time, however we must ensure that at each time 2n, there exist sufficiently many different paths arriving to be able to stop a n paths. Suppose at time 2n there are k n paths, then we require a n ≤ k n . Assuming this is true, there will then be 2(k n − a n ) different paths at 0 at time 2(n + 1), so by a similar reasoning, we must therefore have a n+1 ≤ k n+1 = 2(k n − a n ). Noting that k 0 = 1, we can iterate this procedure to deduce (3).
Conversely, given a stopping time τ , we can derive a sequence (a 0 , a 1 , . . .) corresponding to the number of paths stopped at each stage. By the above argument, these a n satisfy (3); what is not necessarily true is that each a n ∈ {0, 1, 2, 3}. However the probability of stopping at 0 is still given by i≥0 4 −i a i , and we can form a new sequence (ã 0 ,ã 1 ,ã 2 , . . .) such thatã i ∈ {0, 1, 2, 3} and i≥0 4 −iã i = i≥0 4 −i a i . Where necessary we will work with a sequence which terminates in a string of zeros rather than a string of threes. However for such a sequence, it is then clear that (replacing a 4 in the i th position with a 1 in the (i − 1) th position always reduces the value, and the total value of the sum is bounded above by 1, and below by 0), so that the result holds in general.
For convenience, when dealing with singletons {p} we write simply We first show that f (S) ⊂ S. To see this we simply check that if p ∈ S then f i (p) ∈ S for i = 1, 2 and that [0, 1 8 ] ∪ {1} ⊂ S. Consider for example f 1 . The case p = 1 is trivial. Let p ∈ S, p < 1, and write it in base-4 expansion as 0.a 1 a 2 . . . . Then f 1 (p) = 0.1a 1 a 2 . . . and (4) holds: so by the first part of the theorem f 1 (p) ∈ S. We proceed likewise for f 2 . Finally, to prove [0, 1 8 ] ⊂ S, take any 0 < p < 1 8 and write its base-4 expansion which shows that p ∈ S. It remains to see the converse, namely that S ⊂ f (S). Let p ∈ S and write its base-4 expansion p = a 0 .a 1 a 2 a 3 . . . . We will analyse various cases and use implicitly the criterion (4). The case p = 1 is trivial we can therefore suppose a 0 = 0. If a 1 = 2 then p = 1/2 and we have p = f 1 (1).
. . and we check again that q ∈ S. Finally if a 2 ≤ 1 then p < 1/8 and is thus in the image of f 4 . We obtain finally that f (S) = S and thus S is the fixed point of the contraction mapping f which ends the proof of the theorem.
We want to comment the rather surprising nature of the set S. It is in fact a self-similar structure, or fractal. In particular, following the characterisation of [2] (see also Falconer [8,Chap. 9]), we can say that S is an iterated function system with a condensation set generated by the system (6). From the representation (5) it is easy to deduce that the one-dimensional Lebesgue measure of S is equal to 1 4 . An alternative representation of the set can also be given in which the set is the fixed point of a standard iterated function system; that is, we can drop the condensation set, in exchange for a larger set of functions. We replace the function f 3 by function(s) g which map S into S and [0, 1/8] onto [0, 1/8]. To this end define g k (x) = 1 4 x + k 64 . Note that g 8 = f 2 and g 16 = f 1 . We claim that the set S is the unique fixed point of the mapping It is immediate . It remains to see that if p ∈ S then g k (p) ∈ S for k = 0, 2, 4, 6 which is easily checked with (4).
To deduce some more information about the structure of S, observe that g 8 We have thus x * = 1/6 which has 0.022222 . . . base-4 expansion and corresponds to stopping 2 trajectories every second step of the random walk starting with the 4 th step.
Another natural question to ask concerns the dimension of the set. It is clear that the presence of the interval [0, 1/8] forces the dimension of the whole set to be 1, however is this also true locally? It turns out that the local dimension of any point in the set is either 0 or 1. This can be seen relatively easily: consider a point x ∈ S; either the base-4 expansion of this point is terminating (that is, can be written with a finite number of non-zero a n ) or it is not. In the latter case, given r > 0, we can find n such that 4 −n ≤ r < 4 −n+1 . Since the sequence we choose is not terminating, the value k n+2 defined in the previous theorem is at least 1; further, by defining a new set of points which agree with x up to a n+1 , and have a n+2 = a n+3 = 0 we may take any other terminating sequence beyond this point. This interval of points therefore has Lebesgue measure at least 4 −n−4 , and is also contained in the ball of radius 4 −n−1 about x. More specifically, (writing B(x, r) for the ball with centre x and radius r) we have |B(x, r) ∩ S| ≥ r4 −4 and lim inf r→0 log(|B(x, r) ∩ S|) log r ≥ 1.
Since our set is a subset of R, the local dimension at a point cannot exceed one. For a point x ∈ S with terminating base-4 expansion there are two possibilities: either the k n s are zero for sufficiently large n, in which case the point is isolated (there is clearly a small interval above the point which is empty, and it can similarly be checked that there is a small interval below the point), or the k n 's increase after the final non-zero a n , but in this case it is clear that there is a small interval of points above x. In consequence, as claimed, a point in S is either isolated, or has a local dimension of 1.
where a i , b i , c i ∈ {0, 1, 2, 3} and the sequences satisfy: Furthermore, the set S Proof. We have a picture similar to the one described before Theorem 5. As before, our approach will be to count the number of 'different' paths, however we now need to consider stopping at all the points −1, 0, 1, and the corresponding constraints on the system. As before, a n will be identified with the number of paths which are stopped at 0 after 2n steps, and we also now introduce the sequences (b n ) n≥1 and (c n ) n≥1 which will correspond to the stopping behaviour, after (2n − 1) steps, at the points −1 and 1 respectively. Implicitly, any path arriving in {−2, 2} is stopped which preserves the uniform integrability. n the number of paths still arriving at 0 after 2n steps, where in the first (2n − 1) steps we were successfully realizing the stopping rule prescribed by p. We drop the superscript (p) when p is fixed. Then we have to require that a n ≤ k n and b n+1 ≤ k n − a n , c n+1 ≤ k n − a n . Using induction we can prove that Then the condition a n ≤ k n , for all n ≥ 0, can be rewritten under equivalent form (9). Note that it also contains the necessary condition on (b n + c n ), namely that b n+1 + c n+1 ≤ 2(k n − a n ). However, (9) does not encode the restriction b n+1 ∨ c n+1 ≤ k n − a n , which is (10). We recall the notation b ∨ c = max{b, c}.
Conversely, given a UI stopping time τ with X τ ∈ {−2, −1, 0, 1, 2} we can derive the sequence (b n , a n , c n ) of paths stopped respectively in (−1, 0, 1) after (2n − 1, 2n, 2n − 1) steps. By the arguments above (b n , a n , c n ) satisfy (8), (9) and (10) but it is not necessarily true that a n , b n , c n ∈ {0, 1, 2, 3}. Suppose then that the sequence (b n , a n , c n ) is terminating (i.e. there exists n 0 such that a n = b n = c n = 0 for n ≥ n 0 ), and for some j ≥ 3 we have b j ∨ c j ≥ 4. Let j = min{n : b n ∨ c n ≥ 4} and define a new sequence (b n , a n ,c n ) viab n = b n ,c n = c n for n different from j and (j − 1), and withb j− The new sequence obviously satisfies (9). To see that it also satisfies (10) note that b j ∨ c j ≥ 4 implies k j−1 ≥ 4 and as b j−1 ∨ c j−1 ≤ 3 it follows that k j−2 − a j−2 − (b j−1 ∨ c j−1 ) ≥ 1. The new sequence thus encodes a stopping timeτ and by (8) X τ ∼ Xτ . Iterating this argument we can assume that the sequence (b n , a n ,c n ) satisfies b n ,c n ∈ {0, 1, 2, 3}. Now we define an analogous transformation of the sequence (a n ), i.e. if there is n > 0 with a n ≥ 4, we put j = min{n : a n ≥ 4} and defineã n viaã n = a n for n different from j and (j − 1) andã j−1 = a j−1 + 1 andã j = a j − 4. Condition (9) for the sequence (b n ,ã n ,c n ) is immediate and (10) follows as a j ≥ 4 implies k j ≥ 4 and thus k j−1 − a j−1 − (b j ∨c j ) ≥ 1.
It remains now to show that the same can be said for a general sequence (b n , a n , c n ). Let p = (p −1 , p 0 , p 1 ) be the associated point in S (3) and (b n ,ã n ,c n ) the base-4 expansion of ( p −1 2 , p 0 , p 1 2 ). More precisely, if two expansions (finite and infinite) of p 0 exist then we take the finite one if and only if the original sequence (a n ) is terminating, and likewise for p −1 2 and p 1 2 . First note that as (9)-(10) hold for (b n , a n , c n ), they will also hold for the truncated sequences (b j n , a j n , c j n ), where the j denotes a j j+1 = b j j+1 = c j j+1 = a j j+2 = . . . = 0, and therefore, by the argument above, also for their base-4 expansions (b j n ,ã j n ,c j n ) (here we take the finite expansion). We will now argue that for any fixed m, for j big enough, the sequences (b j n ,ã j n ,c j n ) and (b n ,ã n ,c n ) coincide for n ≤ m, which will imply that the latter sequence also satisfies (9)-(10). More precisely, we need to show that ∀m ∃j m ∀j ≥ j m , (b j n ,ã j n ,c j n ) = (b n ,ã n ,c n ) for n < m.
The argument is the same for all three sequences, so we present it for the sequence (b n ). If it is terminating then clearly for j larger than its length (b n ) = (b j n ). Suppose (b n ) is not terminating and recall that we then choose (b n ) also not terminating. Let The last inequality together with the obvious inequality imply that base-4 expansions of p j −1 2 and of p −1 2 coincide up to m th place, that isb i =b j i for all i ≤ m. The same argument applies to (ã n ) and (c n ). This proves (12) and consequently that the sequence (b n ,ã n ,c n ) satisfies (10), which ends the proof of the first part of the theorem.
We now move to the second part of the theorem. We could do an analysis as in Theorem 5 however this would be very involved in the present setup. Instead, we generalise the technique used to arrive at (7); as a consequence, we do not have a neat description of the functions, but rather an algorithm for obtaining them. The following observation proves to be crucial: if some k (p) n is large enough then any sequence of (b i , a i , c i ) i≥n is admissible. More precisely as a n , b n , c n ≤ 3 we have k We will reason according to the value of k (p) 5 . Suppose that k (p) 5 ≥ 16, which means that the stopping strategy encoded by p stops (in the first 9 steps of the random walk) less than 16 out of the 32 paths which come back to zero after 10 steps. Thus 'this part' of p is an element of Q: = 32 and thus k (4(p−q)) 4 = 16 which as we know is enough to support any sequence of (b n , a n , c n ) onwards.
Thus p ∈ f q (S (3) ). Finally, suppose that k (p) 5 < 16, that is p stops (in the first 9 steps of the random walk) more than 16 out of the 32 paths which come back to zero after 10 steps. Then there exists a q ∈ Q (possibly many of them) which encodes the way p stops 16 paths, that is there exists q ∈ Q such that k (p−q) 5 = k (p) 5 +16. In consequence, (p−q) does not stop descendants of one of the two paths originating from zero after two steps, which means that 4(p − q) ∈ S (3) or equivalently p ∈ f q (S (3) ).
The set Q arising in the proof would appear to be rather large 7 and a careful analysis could probably bring down its size considerable yielding a significantly smaller iterated function set describing S Let (a i n ) −N ≤i≤N,n≥0 be an infinite matrix of integers. Its entries will correspond to number of stopped paths: a 2i+1 n , a 2i n will represent number of paths stopped respectively in (2i + 1) after (2n − 1) steps and in 2i after 2n steps. With respect to the notation used in Theorem 6 we have b n = a −1 n and c n = a 1 n . Define the matrix (k i n ) i∈Z,n≥0 via   where a ±(N +1) n = k ±(N +1) n and a i n = 0 for |i| > N + 1.
7 Numerical computation indicate Q has about 10260 elements. We think of k 2i n (resp. k 2i+1 n ) as the number of distinct paths arriving at 2i (resp. 2i + 1) after 2n (resp. 2n − 1) steps. We note that if all a i n = 0 then (k i n ), n ≤ N/2, form the first N rows of Pascal's triangle (for a given n we have rows k 2i+1 n : −n ≤ i ≤ n − 1 and k 2i n : −n ≤ i ≤ n). We say that a stopping time τ encodes (or corresponds to) a matrix (a i n ) if it stops the number of paths prescribed by (a i n ), i.e. P X τ = i, τ = 2n − (i mod 2) = 2 (i mod 2) 4 −n a i n , where i mod 2 = 0 or 1 when i is even or odd respectively. Naturally given a stopping time τ we can write its corresponding matrix, and vice-versa: given a matrix (a i n ) with a i n ≤ k i n , we can easily construct a stopping time which encodes it. For the properties considered in this work, the particular choice of τ proves irrelevant. Observe for example that condition a ±(N +1) n = k ±(N +1) n in (14) implies that τ ≤ η N +1 so that τ is a UI stopping time.

Remarks:
The most surprising aspect of this theorem is the second part which shows that for any N the set S (2N +1) has a complex self-similar structure.
We did not present a canonical choice of (a i n ) embedding a given µ. This is due to the fact that, in contrast with the results of Section 4.1, we cannot assume that a i n ∈ {0, 1, 2, 3}. To convince herself, we invite the reader to consider the measure µ = 3 4 δ 0 + 1 8 (δ −4 + δ 4 ) which has the associated (unique) matrix (a i n ) given by a i n = 0 for i = 0 and a 0 0 = 0, a 0 1 = 2, a 0 n = 2 n−1 , n ≥ 2, and which encodes the stopping time inf{n > 0 : X n ∈ {−4, 0, 4}}. However, there is a natural choice of (a i n ) which we discuss in Section 5. We observe that equations (13) and (16) are not in a closed form as before but rather have a recursive structure. Possibly a closed form may be derived but for practical verification and implementation the recursive form seems more suitable.
Proof. The theorem is a generalised version of our earlier detailed studies presented in Theorems 5 and 6. The first part of the theorem follows from our description of possible stopping times in the natural filtration of (X n ). Integers (a i n ) and (k i n ) have the interpretation indicated above and the condition a i n ≤ k i n ensures that there are enough paths arriving at i after 2n (2n − 1 for i odd) steps to realise the prescribed stopping strategy. Note that in particular, as a i n ≥ 0 and k i 0 = 0 for i = 0 we have that a i n = k i n = 0 for n < i/2. Condition (14) completes the definition of τ ensuring τ ≤ η N +1 . There are two paths which come back to zero after 2 steps. Define W as the set of these points in S (2N +1) which never stop descendants of at least one of these two paths: W = {p ∈ S (2N +1) : p + (0,...,0, 1 4 ,0,...,0) ∈ S (2N +1) }. The difference with the set Q defined in the proof of Theorem 6 is that there we considered only p with base-4 expansions terminating after 5 digits. Observe that for any p ∈ S (2N +1) and q ∈ W, f q (p) = p/4 + q ∈ S (2N +1) (this is simply because one path originating from zero after the second step suffices to ensure the stopping strategy prescribed by p/4). Conversely, for any p ∈ S (2N +1) \ g(S (2N +1) ) we can find q = q(p) ∈ W such that p ∈ f q (S (2N +1) ), or equivalently 4(p − q) ∈ S (2N +1) . To see this, let (a i n ) be the matrix associated to p by the first part of the theorem. Note that as p / ∈ g(S (2N +1) ) we have a 0 0 = 0 and a 1 1 + a −1 1 ≤ 1. Suppose for example that a 1 1 = 1. Then we have p ∈ f q (S (2N +1) ) for q = (0,...,0,0, 1 2 ,...,0). We assume from now that a 0 0 = a 1 1 = a −1 1 = 0. Equivalently, the stopping time τ described by (a i n ) satisfies P(τ ≥ 2) = 1, which we can yet rephrase to say that two paths arrive in zero after two steps. We now try and construct a matrix (ã i n ) to correspond to an embedding of 4p -although this will not be strictly possible, it will determine the value of q we will need so that 4(p − q) ∈ S (2N +1) . More precisely, definek i 0 = 0 for all i,k i 1 = 0 for all i = 0,k 0 1 = 1, and letã i n = max{a i n ,k i n } where Putp i = 2 (i mod 2) ∞ j=0 4 −jãi j and q = p −p. Bothp and q are elements of S (2N +1) and their associated matrices are respectively (ã i n ) and (a i n −ã i n ). Furthermore, by construction, 4p ∈ S (2N +1) since we put explicitlyk 0 1 = 1, i.e.p only stops descendants of one path originating at zero after two steps. In consequence, q = p −p does not stop descendants of this path so that q ∈ W. We conclude that We would like to conclude that f is a contraction and S (2N +1) is its unique fixed point. To this end we need to show that S (2N +1) and W are closed and thus compact (since both are bounded). Indeed, as Minkowski's sum of two compact sets is again compact, the mapping f defined via f (A) = (A/4 + W) ∪ g(A) is then a contraction on closed subsets of [0, 1] 2N +1 and S (2N +1) is its unique fixed point. We show first that S (2N +1) is closed. Consider a sequence p j → p, as j → ∞, with p j ∈ S (2N +1) . With each p j we have the associated matrix (a i n (p j )), |i| ≤ N , n ≥ 0. For a point q ∈ S (2N +1) and its associated matrix (a i n (q)) we obviously have ∞ n=0 a i n (q)4 −n ≤ 1 so that a i n (q) ≤ 4 n . In consequence, for any fixed depth m ≥ 1, the set of matrices {(a i n (q)) : |i| ≤ N, n ≤ m, q ∈ S (2N +1) } is finite. We can therefore choose a subsequence p g j → p with the same matrix representation up to the depth m: We can then iterate the procedure. We can choose again a subsequence of the sequence p g j , such that (18) is verified for all n ≤ 2m, then for n ≤ 4m and so on. By a diagonal argument, we obtain a sequence q j → p, subsequence of (p j ), such that for any d ≥ 1, a i n = a i n (q j ) for all |i| ≤ N , n ≤ d and j ≥ d. In particular, the matrix (a i n ) satisfies a i n ≤ k i n with (k i n ) defined via (13). Furthermore, we have Finally, W is clearly closed by its definition and the fact that S (2N +1) is closed.
We can consider stopping times which stop maximally 3 paths in a given point at a given step. Then the reasoning presented in the proof of Theorem 6 applies: it suffices to ensure that at least 12 paths arrive in a given point to secure feasibility of any subsequent stopping strategy in that point. We see thus that (suppose N ≥ 3) any point p with p i ≤ 4 −|i|−1 ∧ 4 −3 belongs to S (2N +1) . In particular, S (2N +1) has positive (2N + 1)-dimensional Lebesgue measure.

Two characterisations of M U I 0
To understand entirely the set M U I 0 it rests to describe its elements with unbounded support. To this end consider first µ ∈ M any probability measure on Z. Theorem 2, or Theorem 10 below, imply existence of a minimal stopping time τ such that X τ ∼ µ. Let τ N = τ ∧ η N . Naturally τ N → τ as N → ∞ and thus X τ N → X τ a.s.. Furthermore, as (X τ N ∧n : n ≥ 0) is a UI martingale, the measure µ N , the law of X τ N , is an element of S (2N +1) . Thus if we consider the set of all measures with bounded support which can be embedded via UI stopping times where the closure is taken in the topology of weak convergence. In order to study closures in different topologies, we identify for the rest of this section sets of measures with sets of random variables, so that S ∞ = {X τ : ∃N τ ≤ η N }, with τ a stopping time, and likewise for M U I 0 , M 0 and M. Furthermore, introduce the L p subsets of the set M U I 0 : Then the following proposition holds.
Proposition 8. For any p ≥ 1, M U I,p 0 is the closure of S ∞ in the L p norm: Proof. We prove first the inclusion "⊂". Suppose that a sequence X ρ N in S ∞ converges in L p , p ≥ 1, to some variable X. We can then replace ρ N with τ N = min{ρ K : K ≥ N } which is an increasing sequence of stopping times, which thus converges to a stopping time: τ N ր τ a.s.. Further, since is a martingale, we have Noting that the left hand side is bounded since τ N ≤ ρ N and therefore E |X τ N | ≤ E |X ρ N |, we obtain and from the recurrence of the random walk we can deduce that τ < ∞ a.s. 8 In particular, we can now make sense of X τ . Therefore X τ N → X τ a.s. and in L p as N → ∞, and so a fortiori X τ = X a.s. In consequence, (X τ N : N ≥ 1) is a uniformly integrable martingale. Furthermore, for every N ≥ 1, (X τ N ∧n : n ≥ 0) is also a UI martingale. We have thus and taking the limit as N → ∞ we see that This proves that X = X τ ∈ M U I,p 0 . The converse is easier. Let X τ ∈ M U I,p 0 and put τ N = τ ∧η N . Then X τ N = E[X τ |F τ N ] converges a.s. and in L 1 to X τ as N → ∞. The convergence actually holds in L p as sup N E |X τ N | p = E |X τ | p < ∞ (cf. Revuz and Yor [18,Thm II.3.1]). Naturally, X τ N ∈ S ∞ and thus X τ ∈ S ∞ L p .
In Proposition 8 we characterised the set M U I,p in terms of closures. It would be of interest to have a more direct way of deciding if a given µ ∈ M 0 is in fact an element on M U I,p or not.
We give now the relevant criterion which provides an intrinsic characterisation of the set M U I 0 .
Theorem 9. Suppose µ ∈ M 0 satisfies i∈Z |i| p µ({i}) < ∞ for some p ≥ 1. Then µ ∈ M U I,p 0 iff there exists (a i n ) i∈Z,n≥0 , a i n ∈ Z + , such that and a i n ≤ k i n , where k i n are given by and Proof. We begin by assuming there exists (a i n ) i∈Z,n≥0 as above, and show that the distribution µ is indeed in M U I,p and note that a i,N n = a i n = k i n = 0 for |i| > 2n. It follows that (a i,N n ) satisfy the conditions of Theorem 7. We can construct a UI stopping time τ N which encodes (a i,N n ), X τ N ∈ S ∞ . Furthermore, choosing the stopped paths in a consistent way, we may assume that In consequence, we can define a stopping time τ = lim N →∞ τ N . It follows that τ encodes (a i n ) via (15). In particular P(X τ = i, τ < ∞) = µ({i}) by (22), which means that τ is a.s. finite and embeds µ. We have: The first term on the right hand side converges to zero by the dominated convergence theorem and the second term converges to zero by (24). In consequence we get convergence of X τ N to X τ in L p , concluding that X τ in S ∞ L p . By Proposition 8, this is the required assertion.
Now consider the converse: let µ ∈ M U I,p 0 . Let τ be a UI embedding of µ and (a i n ) its matrix encoded via (15). Define (k i n ) via (23). Take i ∈ 2Z for example and write and similarly a i n ≤ k i n for odd i. It remains to check (24). Let τ N = τ ∧ 2N and (a i,N n ) its associated matrix, which then satisfies (25) above. Furthermore, as τ is UI, it follows that X τ N → X τ a.s. and in L p , as We can rewrite the last convergence explicitly as and as µ ∈ L p , |X τ | p 1 τ >2N converges to zero a.s. and in L 1 , so that the above convergence is equivalent to j∈2Z |j| p 4 −N k j N → 0, as N → ∞.

An explicit UI and minimal embedding
In this section, we solve the Skorokhod embedding problem for the simple symmetric random walk. Given a measure µ ∈ M we construct explicitly a stopping time τ embedding µ, which is minimal and which is also UI whenever µ ∈ M U I 0 . Note however that we do not provide a characterisation of the latter occurrence beyond the condition given in Theorem 9. More precisely, we construct the matrix (a i n ) which prescribes how many paths, when and where the stopping time τ has to stop. The particular choice of paths which are stopped turns out to be irrelevant. As noted before, different matrices (a i n ) with a i n ≤ k i n in (23) can embed the same measure µ via (22).
where (k i n ) are given by (23) and ⌊x⌋ denotes the integer part of x. Note that (a i n ) is well defined. Actually, the idea behind (26) is very simple: when we have a path arriving at a point x we stop it if we can, that is if the total mass stopped so far at x won't exceed the threshold µ({x}). We call this construction greedy, the matrix (a i n ) in (26) is called the greedy matrix associated to µ and any stopping time which encodes (a i n ) is called greedy. Note that by definition a i n ≤ k i n so that we can always construct a stopping time which encodes (a i n ) via (15). The greedy matrix of µ = δ 0 is any matrix with a 0 0 = 1 and the corresponding stopping time is τ ≡ 0. The algorithm we describe here can be considered to be similar in spirit to the filling scheme of Rost [21; 22] (see also Dinges [7]), although with suitable corrections to allow for the restrictions we impose on the filtration. The importance of the construction follows from the following theorem. Proof. If µ = δ 0 , τ ≡ 0 and the statement is true. We assume for the rest of the proof that µ = δ 0 . We first prove that τ < ∞. Let ν ∼ X τ 1 τ <∞ . By definition (26) of the greedy construction we have Suppose that P(τ = ∞) > 0. Then ν(Z) < 1 and there exists i 0 ∈ Z such that q = µ({i 0 }) − ν({i 0 }) > 0. Let n 0 = ⌊log 4 (1/q)⌋ + 1, which is such that any additional path arriving in i 0 after n 0 could be stopped preserving ν({i 0 }) ≤ µ({i 0 }). Definition (26) then implies that we have to have a i 0 n = k i 0 n for all n > n 0 . The recurrence of the random walk on the other hand yields P(∃ n > n 0 : X n = i 0 |τ = ∞) = 1 i.e. there exists n > n 0 with k i 0 n > a i 0 n which gives the desired contradiction.
We argue that τ is minimal. Suppose to the contrary and let ρ ≤ τ with X ρ ∼ µ and P(ρ < τ ) > 0. Write (a i n (τ )) for the greedy matrix given by (26), (a i n (ρ)) for the matrix of number of stopped paths encoded by ρ, and (k i n (τ )) and (k i n (ρ)) for their respective system of arriving paths defined via (23). It follows that there exists i ∈ Z, n ≥ 1 such that a i n (ρ) > a i n (τ ) and for all 0 ≤ m < n, j ∈ Z we had a j m (ρ) = a j m (τ ) (and additionally, if (n mod 2) = 0, a j n (ρ) = a j n (τ ) for all j ∈ (2Z + 1)). In particular, we have k i n (ρ) = k i n (τ ) so that a i n (τ ) < k i n (τ ). Using the definition of a i n (τ ) we see that contradicting X ρ ∼ µ.
It remains to see that τ is UI if µ ∈ M U I 0 , the reverse being immediate. First observe that the uniform integrability of (X τ ∧n : n ≥ 0) depends only on the one-dimensional marginals X τ ∧n and these are given via the matrix (a i n ). In consequence, the uniform integrability of τ is in fact a property of the matrix (a i n ) which τ encodes. This shows that the choice of a particular greedy stopping time τ is irrelevant.
Let ρ be a UI stopping time with X ρ ∼ µ and (a i n (ρ)) its associated matrix as usual. We will show that if ρ is not greedy then we can constructρ which is "more greedy" than ρ, remains UI and embeds µ. An iteration of the argument will then induce uniform integrability of τ . Pick a site i (supposed even for simplicity of notation) and a time 2n at which a path is not stopped in i, but where there is sufficient probability to stop, i.e. P(X ρ = i, ρ > 2n) ≥ 4 −n , and a i n (ρ) < k i n (ρ).
Let σ = (0, σ 1 , . . . , σ 2n = i) be a path arriving in i after 2n steps which is not stopped by ρ and put Γ σ = {(X m ) 0≤m≤2n = σ}. Let ν = L(X ρ |Γ σ ) and ξ be the stopping mechanism which stops descendants of σ, i.e. X 2n+ξ = X ρ on Γ σ . Note that ξ stops all the paths originating from i in a uniformly integrable way. More precisely, from the uniform integrability of (X N ∧ρ ) we deduce that lim where E i denotes the expectation under X 0 = i. This will allow us to apply ξ to a subset of paths, or even iterate it, preserving the uniform integrability. Note also that ν({i}) < 1 and ξ ≥ 1.
By (27) we can choose a set of paths A of total mass 4 −n which ρ stops in i after more than 2n steps. Suppose that ν({i}) = 0. Then A contains no descendants of σ. Defineρ via the following properties: • up to time 2n, ρ andρ are identical; • at time 2n,ρ stops in addition the path σ; • after 2n, on Ω \ Γ σ it behaves as ρ + ξ • ρ1 Xρ∈A , that is it behaves as ρ except the paths in A, which are continued according to the mechanism ξ instead of being stopped in i.
It is easy to see thatρ is a stopping time, Xρ ∼ X ρ . To see thatρ is UI, assuming implicitly K > |i|, N > 2n, and using (28), write as for N > 2n, X N ∧ρ is either equal to X N ∧ρ , or to i, or is of the form X M ∧ξ for some M , and the latter happens on the set of probability at most 4 −n .
The argument when p := ν({i}) > 0 is more involved. We can still choose a set A of paths which ρ stops in i after more than 2n steps and which does not contain descendants of σ, but we can only assert that the total mass of paths in A is greater than or equal to 4 −n (1 − p). As each of the paths in A has probability of 4 −n−m , for some m > 0, if the total mass of A is greater than 4 −n we can chose a subset of the size 4 −n . Thus, we can assume that the total mass of paths in A isq 0 with 4 −n (1 − p) ≤q 0 ≤ 4 −n .
We put q 0 := 4 −n . Our aim now is to defineρ as previously but continuing and stopping paths in A is such a way that they embed q 0 (1 − p)ν |Z\{i} and the rest of mass in i, preserving the uniform integrability. Say we apply ξ to all paths in A once. In this way we embed q 0 (1 − p)ν |Z\{i} and the remaining paths of total massq 1 :=q 0 p return to i. Ifq 0 = q 0 we're done, if not then it remains to embed q 1 (1 − p)ν |Z\{i} outside of i, where q 1 = q 0 −q 0 . If we keep repeating the procedure, applying ξ to all paths which return to i, after m iterations we havẽ q m−1 p =q 0 p m paths returning to i and it remains to embed q m (1 − p)ν |Z\{i} outside of i, where q m = q m−1 −q m−1 = q 0 −q 0 (1 + p + . . . + p m−1 ). We are now ready to describeρ according to two possible situations.
•q 0 = q 0 (1 − p). Then we repeat the above procedure ad infinitum, i.e.ρ applies ξ to all paths in A, then applies ξ again to all the paths which return to i etc. Doing so we embed in Z \ {i}, according to ν, a total mass of as required.
•q 0 > q 0 (1 − p). Ifq 0 = q 0 it suffices to apply ξ once as argued above, so assumeq 0 < q 0 . Then there exists m 0 ≥ 1 such that which we can rewrite as:q m 0 −1 < q m 0 −1 andq m 0 ≥ q m 0 . The sumq 0 (1 + p + . . . + p m 0 ) is precisely the total mass of paths in A plus the total mass of their descendants, after application of ξ, which return to i, and their descendants up to the m th 0 generation. Each of these paths has a probability 4 −n−j for some j so that we can write their total mass as 4 −n ∞ j=1 c j 4 −j ≥ q 0 = 4 −n . We can thus choose j 0 ≤ ∞ andc j 0 ≤ c j 0 such that, putting c j = c j for j < j 0 , 4 −n j 0 j=1c j 4 −j = 4 −n .
The left hand side represents a subset C of m 0 first generations of descendants of A of the total mass equal to 4 −n . Note that A ⊂ C. It is important to observe that if a path is in C, then all the paths of greater probability are also in C. In other words, if a path is in C all the parents (previous generations) of this path are also in C (recall that ξ makes at least one step). We can thus define a stopping timeρ which applies ξ to all the paths in C and stops (in i) all the remaining paths originating from A.
It follows thatρ is a stopping which embeds µ. The uniform integrability ofρ is deduced exactly as in (29). So far, we have shown that if ρ is a UI embedding of µ then we can modify ρ toρ which is more greedy and is still a UI embedding of µ. Note that the procedure, when applied to a path at time n will only alter the stopping time on that one path at time n, and more generally at later times; consequently, we can apply the procedure to a stopping time which we know to be greedy before time n and to a path at time n, knowing that we will not introduce new non-greedy points earlier than time n + 1. We may therefore iterate the procedure to obtain a sequence ρ m of stopping times which are UI embeddings of µ, and which are greedy in the first 2m steps -i.e. the matrix (a i n (ρ m )) of stopped paths associated to ρ m satisfies a i n (ρ m ) = a i n for all n ≤ m, i ∈ Z, where (a i n ) is the greedy matrix (26). Furthermore, ρ m = ρ l on {ρ m ≤ 2m} = {ρ l ≤ 2m} for all l > m. We can thus define τ := lim m→∞ ρ m and it follows that τ is a greedy embedding of µ, i.e. it encodes (a i n ). We claim that X τ ∧ρm converge a.s. and in L 1 to X τ . Observe that A m := {τ > 2m} = {ρ m > 2m} and X τ 1 Am ∼ X ρm 1 Am . We have by the dominated convergence as A m → 0 a.s. and E |X τ | < ∞. The uniform integrability of τ follows as in (21) from the uniform integrability of ρ m .

Conclusions and Further problems
We have studied the Skorokhod embedding problem for the simple symmetric random walk and the relations between notable classes of stopping times. In particular, we have seen that -unlike the Brownian motion setting -for centred target laws, the classes of uniformly integrable and minimal stopping times are not equal. The latter allows us to construct an embedding for any centered target measure; the former restricts the class of admissible measures, and in fact we have shown that the set of measures with bounded support and which may be embedded with a UI stopping time has a complex fractal structure.
We characterised the set of all probability measures which may be embedded with a UI stopping time both intrinsically and as an appropriate closure of measures with bounded support which can also be embedded with a UI stopping time. We have given a construction of a stopping time which embeds any probability measure on Z, which is minimal and which is furthermore UI whenever µ may be embedded with a UI stopping time.
We feel we have therefore solved the problems which motivated our study in a relatively complete way. However, some new detailed questions arise naturally: in particular it would be interesting to calculate the Lebesgue measure of S (2N +1) and to study further its structure; we have not considered the local dimension of the sets in higher dimensions. We would also like to understand the relationship (e.g. as projections) between the sets for different values of N .
Finally, we have not investigated the meaning of minimality of stopping times for the random walk, in terms of the stopped process. We show that the situation is very different from the continuous martingale setup but we have not devised any criterion, given in terms of the stopped process, to decide whether a given stopping time is minimal. Understanding better the minimality of stopping times and extending the results to arbitrary discontinuous martingales appeal as challenging directions for future research.