Distance bounds for high dimensional consistent digital rays and 2-D partially-consistent digital rays

We consider the problem of digitalizing Euclidean segments. Specifically, we look for a constructive method to connect any two points in $\mathbb{Z}^d$. The construction must be {\em consistent} (that is, satisfy the natural extension of the Euclidean axioms) while resembling them as much as possible. Previous work has shown asymptotically tight results in two dimensions with $\Theta(\log N)$ error, where resemblance between segments is measured with the Hausdorff distance, and $N$ is the $L_1$ distance between the two points. This construction was considered tight because of a $\Omega(\log N)$ lower bound that applies to any consistent construction in $\mathbb{Z}^2$. In this paper we observe that the lower bound does not directly extend to higher dimensions. We give an alternative argument showing that any consistent construction in $d$ dimensions must have $\Omega(\log^{1/(d-1)} N)$ error. We tie the error of a consistent construction in high dimensions to the error of similar {\em weak} constructions in two dimensions (constructions for which some points need not satisfy all the axioms). This not only opens the possibility for having constructions with $o(\log N)$ error in high dimensions, but also opens up an interesting line of research in the tradeoff between the number of axiom violations and the error of the construction. In order to show our lower bound, we also consider a colored variation of the concept of discrepancy of a set of points that we find of independent interest.


Introduction
Euclidean line segments are one of the most fundamental objects of geometry. Although often loosely referred to as the shortest path connecting the endpoints, segments have a clear and unique axiomatic definition out of which many interesting properties follow. For example, it is well known that the intersection of two segments is always a segment (that could possibly degenerate to a point or even become empty). The definition of other mathematical concepts heavily depends on the definition of segments (e.g., we say that a certain region P of the space is convex if for any two points p, q ∈ P, the line segment defined by p and q is in P).
The definition of segment works very well in a Euclidean or similar spaces with infinite precision. Digital representation (such as pixels in a screen) introduces imprecision. The most common approach used in practice is to somehow round the Euclidean segment into the digital space. The digital segments will look very similar to the Euclidean counterparts (that is, the error is very small). However, we cannot guarantee the useful properties and concepts that follow from the axiomatic definition of Euclidean segment (see Fig. 1).
In the aspect of the consistency of digital segments, we look for a deterministic method to construct digital segments in a way that (i) the analogous of Euclidean axioms are satisfied and (ii) the digital segments resemble the Euclidean ones as much as possible.

Preliminaries
Our aim is to construct a digital path dig( p, q) for any two points p, q ∈ Z d . Ideally, we want dig to be defined for any pairs of points in Z d (full list of requirements is described below), but sometimes we consider the case in which dig is only defined for a subset of Z d × Z d . Definition 1.1 For any S ⊆ Z d × Z d , let DS(S) be a set of digital segments such that dig( p, q) ∈ DS(S) for all ( p, q) ∈ S. We say that DS(S) forms a partial set of consistent digital segments on S (partial CDS for short) if for every pair ( p, q) ∈ S it satisfies the following five axioms: (S1) Grid path property: dig( p, q) is a path between p and q under the 2d-neighbor topology. 1 (S2) Symmetry property: if (q, p) ∈ S, dig( p, q) = dig(q, p). (S3) Subsegment property: for any r ∈ dig( p, q), dig( p, r ) ∈ DS(S) and dig( p, r ) ⊆ dig( p, q). (S4) Prolongation property: ∃ r ∈ Z d such that dig( p, r ) ∈ DS(S) and dig( p, q) ⊂ dig( p, r ). (S5) Monotonicity property: for all i ≤ d such that p i = q i , it holds that every point r ∈ dig( p, q) satisfies r i = p i = q i .
These axioms give nice properties of digital segments analogous to Euclidean line segments. For example, (S1) and (S3) imply that the intersection of two digital segments is another segment (that could degenerate to a single point or an empty set). (S5) implies that the intersection of a segment with an axis-aligned halfspace is a segment [and connected by (S1)], and so on.
A partial CDS for S = Z d × Z d is called a set of consistent digital segments (CDS for short). Although our final goal is to have such a construction that works for the case in which S = Z d × Z d , in this paper we consider subsets of the form S = {o} × Z d (where o is the origin or any fixed point in Z d ). We say that a partial CDS on such a set is a consistent digital ray system (CDR for short), as it contains all segments (or rays) from o to Z d . Note that the five axioms would imply that CDR is a tree connecting a fixed point o to any other point of Z d (see Fig. 2). If we have a consistent construction for such a tree rooted at every grid point, then we have a CDS (see Fig. 2).
Another property that we want from partial CDS is that they visually resemble the Euclidean segments. The resemblance between the digital segment dig( p, q) and the Euclidean counterpart pq is measured using the Hausdorff distance. The (that is, the largest error created between a digital segment and its Euclidean counterpart). This value is simply referred to as the error of the partial CDS construction. We are interested to see how the error grows as we enlarge our focus of interest. Thus, we limit the domain to the case in which both points are in the L 1 ball of radius N centered at the origin [i.e., G N = Z d ∩ B 1 (o, N )]. Rather than looking for the exact function, we are interested in the asymptotic behavior of the error as a function of N . For simplicity, we will actually restrict ourselves to the positive orthant G + N = G N ∩ i H i , where H i = {p ∈ Z d : p i ≥ 0} and p i is the ith coordinate of p (the results extend to other orthants by symmetry).

Previous Work
Research on the digital representation of line segments has been an active area of research for over half a century [13]. Many different approaches have been considered. Most common techniques look for methods that implicitly encode the properties we desire. For example, a popular approach is to consider a dynamic method to digitize line segments. In this setting, the way we transform a Euclidean segment into a digital one will depend on which other segments are present (and their specific coordinates). It is known that a grid of exponential size is needed if we want to preserve the combinatorial types [12]. Another workaround is known as snap rounding that represents line segments by polygonal chains: each segment is carefully rounded to avoid inconsistencies. Note that both of these ideas implicitly keep the error small while making sure that the intersection of two digital segments is a connected component. Although they work well in practice, they have the drawback that they cannot be used to define objects that are based on digital segments (such as digital starshapes or convex regions).
The first paper to explicitly look for an axiomatic approach was in 1987 by Luby [14]: in his work he introduced the concept of CDS (under the name of smooth geometries) and gave a method to construct CDSs in Z 2 based on a characterization of CDRs in Z 2 : any CDR can be uniquely identified by four total orders of the integers (and vice versa). By choosing a proper total order and using it for all points of Z 2 we obtain a CDS with O(log N ) error. Håstad 3 gave a matching lower bound for any such construction.
These results were rediscovered by Chun et al. [9] and Christ et al. [7]. They renewed interest in the topic and sparked other related research: Chowdhury and Gibson [5] gave necessary and sufficient conditions for a collection of CDRs to form a CDS. In a companion paper, the same authors [6] afterwards provided an alternative characterization together with a constructive algorithm; specifically, they gave an algorithm that, given a collection of segments in an N × N grid that satisfies the five axioms, computes a CDS that contains those segments. The algorithm runs in polynomial time of N .
Unfortunately, most of these results only work on the digital plane. Out of the previously mentioned results, only the CDR construction of Chun et al. [9] extends to three and higher dimensions. The construction has O(log N ) error regardless of the dimension. Chun et al. [9] also considered the case in which the monotonicity property (S5) is not preserved. They showed that if we remove (S5), we can obtain a CDR with O(1) error in any dimension. Although the error is small, the resulting segments are far from what we would consider similar to the Euclidean segments (because they loop around many times). Recently, Chiu and Korman [4] showed that the problem in higher dimensions behaves very differently from the two dimensional case. Specifically, they studied how to extend the CDS construction of Christ et al. [7] and showed that it is very limiting in three (and higher) dimensions. Their method can construct arbitrarily many CDRs [with Ω(log N ) error] and some of them could admit a CDS. However, whenever the construction yields a CDS, it will have Ω(N ) error.
Our interest in higher dimensions comes motivated by an application in image segmentation. Image segmentation is the act of separating an object from its background in an image (that is, determining which pixels are part of the background and which ones not). Chun et al. [9] showed how to combine their CDR construction with the framework of Asano et al. [1] to segment two dimensional images. This idea has been extended to consider other shapes (see [8] for a detailed list), but always two dimensional. The hope is that a high dimensional CDR with low error will produce more accurate segmentation algorithms. Although traditional images taken with a camera are two dimensional, images from a medical equipment such as those taken with an MRI machine can have three or even higher dimensions (say, when we want to track changes of a particular object along time).
The concept of consistency has also been investigated in more general graphs than Z d . A system of paths in a real-weighted graphs is a collection of paths defined between  Fig. 3 (Left) A drawing of a CDR in G + N ⊂ Z 3 for N = 4. Notice that the CDR is a tree whose leaves are at the plane x + y + z = N . (Middle) A cross section on the xy-plane of the same CDR. Observe that vertices A and B do not extend within the xy-plane. Thus, the subspace is a weak CDR (rather than a proper CDR). (Right) A map of the weak CDR into a two-colored pointset. Regions with many blue points and few red correspond to portions of the CDR with high error any two vertices in the graph. Similar to our setting, a system of paths is said to be consistent when the intersection of any two paths in the system is also a connected path in the system. The characterization of such system has been studied, see [3,10] for more details.

Differences Between Two and Higher Dimensions
When approximating some geometric object, it often happens that higher dimensions create a larger error than in a lower dimension setting. Since the high dimensional setting contains a two dimensional subspace, it is common for lower bounds to extend to higher dimensions. However, this is not true for the case of CDRs: although a three dimensional CDR contains two dimensional subspaces, those subspaces need not exactly be CDRs [and thus the Ω(log N ) lower bound does not directly hold]. In this paper, we further explain the reason and investigate the lower bound for the higher dimensional case.
The main reason why a subspace is not a CDR is because of the prolongation property (S4): we require that every segment is extendable, but has no constraints on the dimension in which it does so. In particular, a subspace of a high dimensional CDR need not be a CDR (see an example in Fig. 3). Subspaces of CDRs are what we call weak CDR: it is a construction that almost always behaves like a CDR but some vertices may not satisfy the prolongation property (S4). Each vertex that does not extend is called an inner leaf. In this paper we study weak CDRs in two dimensions and the implications that they have for (proper) CDRs in higher dimensions.
The lower bound argument for Z 2 is heavily based on discrepancy theory [15]. Any split vertex (branch point) of the CDR tree is mapped to an x-coordinate in [0, 1) ⊂ R (see Fig. 4). Then, a CDR contains many split vertices, and thus it is mapped to a sequence of real numbers in [0, 1). Håstad showed that the discrepancy of the sequence gives a lower bound for the Hausdorff error of the CDR in Z 2 . Afterwards, Christ et al. showed that there is a bijection between the two objects showing that sequences in [0, 1) with discrepancy d can be transformed into CDRs whose error is Θ(d).

Need of Bichromatic Discrepancy
A key property for Håstad's lower bound argument is that the intersection of a CDR in two dimensions with line x + y = c (for any c ∈ Z) contains a single split vertex. 4 Then, he maps the relative position of the split vertex into the [0, 1) interval and links the error of the CDR to the discrepancy of the transformed pointset. Unfortunately, the key property does not hold when we look at two dimensional subspaces of a CDR in three or more dimensions. Since subspaces can be weak, we can have inner leaves that in turn allow for more than one split vertex to exist in the same diagonal. Thus, we need to map both split and inner leaves into a two dimensional unit square. Similar to Håstad's argument, we can link the error of the CDR with the discrepancy of the generated pointset. However, because we have two types of points we must instead look at a two colored pointset and study the difference in size of the two groups.
This naturally brings the idea of bichromatic discrepancy: let R and B be a set of red and blue points in the unit square, respectively. Let m = |B| − |R| and assume m > 0. For any set P of points in the unit square and x, y ∈ [0, 1] let P[x, y] be the number of points in P ∩ [0, x] × [0, y]. For any two real numbers 0 ≤ x, y ≤ 1 we define the discrepancy of R and B at (x, y) as , the highest discrepancy we can achieve among all possible rectangles). The discrepancy D * R,B of a two-colored pointset is high if and only if there is an axisaligned rectangle with the origin as corner in which the difference of the cardinalities is far from the expected difference. This is a natural extension of the concept of discrepancy. Indeed, the classic definition of (monochromatic) discrepancy is the particular case in which R = ∅ (see [15] for a detailed survey of this concept and its many applications). To the best of our knowledge, the extension of discrepancy to chromatic settings is largely unexplored. Beck [2] considered coloring an uncolored pointset so as to minimize the chromatic discrepancy [obtaining O(log 4 n) upper and Ω(log 4 n) lower bounds for the definition given above, or O(n 1/2+ε ) upper and Ω(n 1/4−ε ) lower when rectangles can have arbitrary orientation]. Dobkin et al. [11] introduce algorithms to find the maximum discrepancy for a given pointset (under different definitions of bichromatic discrepancy).

Results and Paper Organization
As mentioned above, the lower bound argument for two dimensions maps CDR into a pointset and studied the dependency between the two objects. Our lower bound arguments need to use an additional intermediate space: from (a) any CDR in Z d we consider (b) the weak CDR it generates in the x 1 x 2 -plane, and (c) map the weak CDR into a set of points in the unit square. Along the paper we will analyze properties of each of the spaces, and see what implications it has for the other two. Specifically, we show the following: (i) First, in Sect. 2, we detail how to map weak CDRs into a two-colored pointset in [0, 1) × [0, 1).
(ii) As mentioned above, we must also extend the discrepancy results [15] to a (bi)chromatic setting. For the purposes of this paper, the main result we need is the following one: Theorem 1.2 (bichromatic discrepancy) For any set R and B of points such that |B| > |R|, there exists a constant c > 0 such that Proof of the chromatic extension can be done by making minor changes to Schmidt's original proof [16] for monochromatic discrepancy. As such, we defer the additional details needed to the appendix.
(iii) With this new discrepancy result we obtain a tradeoff between the error of any weak CDR and the number of inner leaves [i.e., vertices that do not satisfy (S4)]. When the weak CDR has zero inner leaves (and thus is a proper CDR) our bound matches the lower bound of Håstad. As the number of inner leaves increases, the lower bound decreases. In Sect. 3 we prove the following relationship. This shows an important relationship between (b) and (c) spaces mentioned above. In short, the CDR will have Ω(log N ) error unless there are ω(N ) many inner leaves.
(iv) Intuitively speaking Theorem 1.3 says that a CDR with few inner leaves [say, o(N log N )] in the x 1 x 2 -plane induces ω(1) error in that plane. On the other hand, we also prove that many inner leaves [say, ω(N )] in that plane cause too many points to extend to one of the remaining dimensions, and create ω(1) error as well.
Balancing these two error sources leads to our main result, i.e., a lower bound of Ω(log 1/(d−1) N ) for any CDR construction in d dimensions (see Sect. 4): Recall that Luby [14]'s CDR works in any dimension and has O(log N ) error, so the gap between upper and lower bounds grows with d. Although we believe our analysis to be loose (especially in Theorem 1.5), we have no reason to believe that O(log N ) is the correct bound either.
In Sects. 5 and 6, we explore the possibility of having a CDR in high dimensions with o(log N ) error (rather than directly looking at CDRs in high dimensions, we see what properties it would imply in the other two subspaces). Although we cannot explicitly find a construction with o(log N ) error, we provide interesting insight on how further research can solve this question.
(v) Our lower bound argument shows that for a CDR in Z 3 with o(log N ) error to exist we must be able to construct a weak CDR in Z 2 with O(N log N ) inner leaves and o(log N ) error. We show how to create a weak CDR with at most 5/2 error and Θ(N 2 ) inner leaves. Although the construction follows the spirit of the method of Chun et al. [9] (for the case in which the monotonicity property is not preserved), we believe our resulting CDR to be much more aesthetically pleasing and it resembles more the Euclidean segments. Theorem 1.6 For any N > 0 we can create a weak CDR in Z 2 with at most 5/2 error and at most N 2 /12 inner leaves.
Although the number of inner leaves is large (roughly speaking, one in six vertices will be an inner leaf), this construction has other interesting properties that would make it suit for practical purposes. Moreover, we extend this construction to have a tradeoff construction with O(c) error and O(N 2 /c) inner leaves for any c ≥ 1. Discussion of this construction and other variations is given in Sect. 5.
(vi) In order to reduce the number of inner leaves we instead look at how the mapping of any weak CDR with constant error to points would look. Discrepancy results give us a condition on any such CDR with o(N 2 ) many inner leaves. Specifically, in Sect. 6 we show the following result. Note that the constant 1 is crucial for our proof: although we would like the statement to hold when D * R,B = O(1), it is unlikely that our approach can be extended. We believe that this result could be the first step towards proving that the construction in (v) is asymptotically tight. Further discussion of this result is given in Sect. 5 (after the statement's proof).
Further discussion on the implication of these results is given in Sect. 7.

Mapping a Weak CDR into a Pointset
We start by showing how to transform a weak CDR in two dimensions into a twocolored pointset in [0, 1) 2 . Given any weak CDR, its restriction to G + N forms a spanning tree T of G + N because of axioms (S1) and (S3). Although the tree is undirected, we see it as a directed graph (rooted tree) whose edges are oriented away from the origin (root). Then, (S5) implies that the parent of each vertex (x, y) (except the root) is either (x − 1, y) or (x, y − 1). For any edge e = uv of T , where u is the parent of v, we define T (e) as the subtree of T that is rooted at the child node v of e. We slightly abuse the notation and use T (v) to denote the subtree that is emanating from v towards the leaves [that is, For any n ≤ N let L n be the points of G + N whose sum of coordinates is n [i.e., L n = {(x, y) ∈ G + N : x + y = n}]. We follow the usual terminology that we call a vertex of degree one a leaf. We further consider two subcategories: we say that a leaf v of T is an inner leaf if it is not in L N . All the vertices in L N are called boundary leaves. Note that, by properties of CDR, all vertices of L N are proper leaves (since any children should be in L N +1 , which is outside G + N ). Further note that in a proper CDR there will be no inner leaves. A vertex v of T is a split vertex if it has degree three or it is the origin. Let S be the set of split vertices and D the set of inner leaves.

Auxiliary Function
Before giving the transformation from a tree to a point set we first define an auxiliary function M : For any subtree T (v) of T we define two more functions inductively for v ∈ L n from n = N to 0 as follows: where M( p) for p ∈ D is defined in the next paragraph. For any inner leaf ∈ D, we know that the edges e 1 = ( x − 1, y + 1)( x , y + 1) and e 2 = ( x + 1, y − 1)( x + 1, y ) must be present in T . Thus, we define M( ) as M( ) = (max T (e 1 ) + min T (e 2 ))/2. Intuitively speaking, we look at the leaves above and to the right of , and assign a value that is in between the two of them (see Fig. 5, left). The following statement shows that these values are sorted along L n .

Lemma 2.1 Let T (u), T (v) ⊂ T be two subtrees of T rooted at the vertices u
Proof We prove this statement by induction on n from N to 1. If both u, v ∈ L N then both T (u) and T (v) consist of a single vertex and the proof trivially follows. Now, assume that the statement is true for any two vertices u , v ∈ L i for i > n. We need to show that the statement holds for any two vertices u, v ∈ L n such that u First observe that if we have two descendants u and v from u and v respectively such that u , v ∈ L n for some n > n, then it holds that u x < v x . Indeed, this follows from the fact that when we embed T in the natural way with edges drawn as straight segments, the result is a tree with no crossings. Thus, if v x < u x happened for some descendants, then the two paths in T from u to u and from v to v would either cross or form a cycle. Any of those two situations would contradict with the fact that T is a weak CDR.
Back to our original proof, consider the case in which neither u nor v are inner leaves. By the above argument we have that the x-coordinate of any child u ∈ L n+1 of u must be smaller than any child v ∈ L n+1 of v. By induction, this implies that The cases in which u or v are inner leaves are similar: if u is an inner leaf, we have max . By induction on u 1 and u 2 we have max T (u 1 ) < min T (u 2 ) and max T (u) < min T (u 2 ), thus we need to compare min T (u 2 ) with any children of v. If v is also an inner leaf, we can do a similar argument and have that max In general, given u, let u ∈ L n+1 be the child of u with the largest x-coordinate (or u = u 2 if u is an inner leaf). Similarly, we define v as the child of v with the smallest x-coordinate (or v = v 1 if v is an inner leaf). Again, by planarity of the natural embedding, we have that u x ≤ v x if at least one of u, v is an inner leaf. In either case, we can use induction and get that max For any subtree T of T , its depth is the longest possible length of a path from its root to any of its leaves. Any split vertex s ∈ S has two branching edges e 1 and e 2 , each defining a subtree. The subtree of higher depth is the preferred subtree of s [in case of tie, we choose the tree emanating from (s x + 1, s y )]. For any point p ∈ G + N we define a walk from p to some leaf of T . If p ∈ L n has degree two, we follow the single edge to L n+1 . If p ∈ S, we follow the edge to the preferred subtree. This process is continued until we reach a leaf γ (p).
With this virtual walk we can define the function M to all points p ∈ G + N (not only leaves) of the domain as follows. If p is neither a split nor a leaf, we define M( p) as M( p) = M(γ ( p)). For a split vertex s, let s be the child of s that is not on the preferred subtree of s. Then, we define M(s) as M(s) = M(γ (s )). Intuitively speaking, from any vertex we always follow its only edge away from the root (if it has degree 2) or the preferred edge (if it has degree 3) until we reach a leaf. The only exception is if we start on a split vertex, in which case we do not follow the preferred edge at the first step. This exception is needed to make sure that the end points of the walk starting from split vertices are distinct. Proof By definition of the auxiliary function, two leaves do not have the same mapping. Thus, it remains to show that the walk of two different split vertices cannot end at the same leaf. Imagine doing the walk backwards: start at any leaf, walk towards the origin and stop as soon as you reach a split vertex by traversing its non-preferred edge. Since each split vertex has exactly two children, it follows that exactly one leaf will stop at each split vertex. The exceptional case is the leaf (N , 0), from which walking backwards to the origin is a horizontal path and the path does not contain any nonpreferred edge. That is, in the inverse walk we follow preferred edges until we reach a non-preferred edge. This is equivalent to starting at a split vertex and follow the non-preferred edge once and continue with the preferred edges, which is the exact definition of our auxiliary function.

Transforming the Tree into a Pointset
With the auxiliary function M we can define the mapping between a weak CDR into a bicolored pointset in the unit square. For Given any weak CDR, we look at the tree T it defines in G + N . Each vertex v ∈ D creates a red point π(v) and each split vertex w ∈ S creates a blue point π(w) (note that we do not transform the boundary leaves in L N into points). We define the mapping of T as the union of the Fig. 5, right). Note that the two sets depend on the tree T [and thus R = R(T ) and B = B(T )]. From now on we assume that T is fixed, and thus we simplify the notation for ease of reading. For any set P of points in the unit square and x, y

Lemma 2.3 For any weak CDR T in G +
N ⊂ Z 2 and n < N , the red and blue points on the line y = n/N alternate in color starting and ending with a blue point. In particular, we have B [1, n Proof For the first statement we observe that only points that lie in L n will have ycoordinates equal to n/N . Moreover, since L n+1 has one more vertex than L n , each diagonal must have exactly one more split vertex than inner leaves. Indeed, Chun et al. showed that in proper CDRs each diagonal has exactly one split vertex (and of course, zero inner leaves). Now we need to show that split vertices and inner leaves appear alternatingly on the diagonal line. Consider two consecutive split vertices u, v ∈ L n such that u x < v x . By definition of split, the edges e u = (u x , u y )(u x + 1, u y ) and between e u and e v . Since two different vertices of L n cannot connect to the same vertex of L n+1 , one of them will not reach L n+1 . That vertex will be an inner leaf and will be between u and v as claimed.
That is, the blue pointset has one more point than the red pointset in each horizontal line y = i/N . Summing up the differences from i = 0 to n, we get that in total there are n + 1 additional blue points p = (x, y) with y ≤ n/N .
With the above observations we can now state the main relationship between the weak CDR and its mapped pointset. For any vertex v ∈ L n , its path to the origin splits the tree into two portions. Consider the portion of the tree up to L n that is above the path from v to the origin. In L 0 , the subtree contains a single vertex (the root) whereas at the diagonal L n contains v x + 1 vertices. Since the number of leaves grows with split vertices and shrinks with inner leaves, this means that in the portion of the tree that we are looking at, the difference between split vertices and inner leaves must be v x , see Fig. 5. Note that if the two children of a split vertex [e.g., (5, 0) in Fig. 5] are not in the same portion, the number of leaves does not grow with that split vertex. However, these split vertices may be still contained in the rectangle that we consider in the mapped pointset. This is the reason why we do not have an equality in Theorem 2.4.

Theorem 2.4 For any vertex
Proof We split the proof into two auxiliary lemmas.
When we keep following from v to the preferred subtree, we end up in a leaf, called .
This split vertex is below layer L n (indeed, we reach L n from by following only preferred edges and the inverse walk has to stop when we traverse a non-preferred edge of s) and therefore s is transformed to a blue point in the rectangle. Now let s be a split vertex which is mapped to a blue point in the rectangle. We will show that s = s. Let be the unique leaf such that M( ) = M(s ). Consider first the case in which is below layer L n (that is, x + y < n). Then let v be the vertex on dig(o, v) and L x + y . If . This would be a contradiction to s being mapped to a blue point in the rectangle. It remains to consider the case in which is above layer L n . Define to be the vertex on dig(o, ) and L n . Lemma 2.1 implies that Recall that there is only one split vertex whose walk to its corresponding leaf through preferred subtrees passes through v. Hence s = s and there is exactly one blue point in the rectangle.
We now show that there cannot be any red point either. Indeed, recall that for every red point there is a blue point with the same x-coordinate and smaller y-coordinate because for each inner leaf there is a unique split vertex s defined by the walk from s to such that M( ) = M(s). From the previous argument, we know that s with M(s) = M(γ (v)) is mapped to the only one blue point in the rectangle and its corresponding leaf defined by the walk is above L n . Hence, even if is an inner leaf, the mapped red point is not in the rectangle. Moreover, there cannot be any other red point in the rectangle (since it would imply that the corresponding blue point would also be in and we already ruled out this case).
In the same way we can also prove that if contains exactly one point, which is blue and has M(γ (v)) as x-coordinate. If v x = n then as defined above is the leaf (N , 0) and M( ) = 1. Lemma 2.2 implies that there is no split vertex s with M(s) = 1.

Lemma 2.6 For any vertex
Proof. We first prove by induction over n that for all n ∈ {0, 1, . . . , N } the following statement holds: The quantity We assume that (2) holds for layer L n and we prove that it also holds for L n+1 . We distinguish three cases for any vertex q in layer L n .
-If q has degree 2 then q and its child r ∈ L n+1 are mapped by M • γ to the same value. Moreover q does not create any vertex in the set B nor R. -If q is an inner leaf, then the value M(γ (q)) will not appear in {M(γ ( p)) : p ∈ L n+1 } any more. The value M(γ (q)) also disappears in Moreover, {M(γ ( p)) : p ∈ L n+1 } contains the additional value M(q). The value M(q) also appears in Hence (2) holds.
Let v be a vertex in layer L n , i.e., n = v x + v y . By Lemma 2.1 we know that a vertex u ∈ L n with u . Hence the number of vertices in layer L n with smaller x-coordinate than that of v is exactly the number of vertices which are mapped by M • γ to a smaller value than that of v. If By Lemma 2.3, the red and blue points on the line y = v x + v y alternate in color starting and ending with a blue point. Hence, any interval [0, x] on the line y = v x +v y contains at most one more blue points. Therefore, is at most one. Lemmas 2.6 and 2.3 directly imply Theorem 2.4.

Lower Bound for Two Dimensional Weak CDRs
Before giving the proof of Theorem 1.3, we recall that a proof for a proper CDR (i.e., one without inner leaves) was given in [9]. Our proof follows the same spirit, so we Consider any point p ∈ L N and virtually sweep a line of slope −1 from the origin all the way to L N . During the sweep, the intersection between the diagonal line and either the Euclidean segment op or the digital one dig(o, p) will be a point. Lemma 3.1 says that if we can find an instant of time for which two intersection points are at distance ∂ from each other, then the Hausdorff error of the whole CDR must be Ω(∂) (see Fig. 6).
In order to find this instant of time we see how much the subtrees grow. Consider a consecutive set of I vertices in some intermediate layer L n . Let L(I ) be the vertices of L N whose digital path to the origin passes through some vertex of I . If the CDR has small error, we need L(I ) to have roughly N |I |/n many points. The difference between the expected number of vertices and |L(I )| combined with Lemma 3.1 will give a lower bound on the Hausdorff error.
Our proof follows the same spirit (transform the tree into a pointset, use discrepancy to find a subset with too many/too few children and use Lemma 3.1 to find a large error). Although all three steps follow the same spirit, they need major changes to account for the possibility of inner leaves.
The biggest change is how we map the tree. In proper CDRs each line has a unique split vertex and always extends to L N . Thus, a region with a large number of split vertices directly implies a large error. In our setting, we could potentially have a region with many split vertices followed by a large number of inner leaves to cancel out the growth. This is why we need two major changes: first we now color the points red and blue depending on whether they are split vertices or inner leaves. We also introduce a second dimension to track when the children of a split vertex stop extending. Intuitively speaking, the x-coordinate of our mapping will be similar to the mapping done by Chun et al. [9] whereas the y-coordinate represents time. Thus, the difference in y-coordinates between red and blue points can be used to determine for how long are the two children of a split vertex alive (the longer the difference in y-coordinates, the further away that the two children extend).
We now use the mapping of Sect. 2 together with the two colors discrepancy (Theorems 1. Proof. Given a weak CDR and its associated tree T , consider its transformation into the sets R and B of red and blue points defined by π . Let b 2 and r 2 be the numbers of blue and red points in the rectangle [0, 1] × [1/2, 1] respectively. By Lemma 2.3, we have b 2 − r 2 = N /2 . We apply the discrepancy result (Theorem A.4) with b 2 − r 2 = N /2 and r 2 = κ 2 , and obtain that there exist α, β ∈ [0, 1] and c > 0 We want to use Theorem 2.4 on the vertex of T whose image is (α, β). Naturally, such a vertex need not exist, but we will find one nearby whose associated discrepancy is also high. Let n = N β and observe that B[α, β] = B[α, n/N ]; indeed, by the way we transform points, their y-coordinates are of the form i/N . However, by definition of n we know that β is between n/N and (n + 1)/N and thus no point can lie in the horizontal strip y ∈ (n/N , β] (by the same argument we also have If we substitute β in the previous equation we get for a large enough N , κ 2 ∈ O(N log N ) and for some c > 0. We get the additional 1 term because of the rounding in the definition of n. Now we need to do a similar operation for α. Let q i = (i, n − i) be a vertex of L n . By Lemma 2.1 the image of the auxiliary function M(q i ) monotonically increases as i grows. Let Q = {q i : M(q i ) ≤ α} and α = max q i ∈Q M(q i ). Note that, by definition of the set Q, it trivially holds that α ≤ α.
Proof The difference between the two rectangles is the rectangle Δ whose opposite corners are (α , 0) and (α, n/N ), and one of the boundary (α , 0)(α , n/N ) is open. We claim that red and blue points are paired (sharing the same x-coordinate) in Δ (and thus, for each red point that we remove we are also removing a blue one Assume, for the sake of contradiction that there exists a blue point p in Δ such that there does not exist a red point q with the same x-coordinate as p in Δ. Let s be the split vertex whose image is p. By definition of the transformation π , the x-coordinate of p is M(s), which is between α and α. We apply Lemma 2.2 to find the unique leaf such that M(s) = M( ). Since π( ) / ∈ Δ, we have that x + y > n. Let m be the unique vertex of L n that is in the path from s to . It follows that π(m) = (M( ), n/N ) ∈ Δ. This gives a contradiction with the definition of α , and thus implies that if there exists a blue point in Δ, then there also exists a red point in Δ with the same x-coordinate.
Thus, given a pair (α, β) whose associated rectangle has high discrepancy, we have snapped it to the pair (α , n/N ) that defines another rectangle with high discrepancy. More importantly, by definition of Q, we know that π(q |Q|−1 ) = (α , n/N ). Note that q |Q|−1 need not be a split vertex or an inner leaf (and thus, (α , n/N ) may not be a point of R ∪ B).
Let b = B[α , n/N ] and r = R[α , n/N ]. If we apply Theorem 2.4 to point q |Q|−1 we get that b − r − 2 ≤ |Q| − 1 ≤ b − r . This set Q is the one that makes the role of I in the proof overview: we know that vertices of Q are the ones that extend to cover all the vertices of L N whose image is α or less. As such, we would expect |Q| to contain roughly nα elements. However, the discrepancy result tells us that the size of Q is c N log N /(N + κ 2 ) units away from that value. We say that p is productive if some point of T ( p) is in L N (this is equivalent to the fact that p can be extended to reach the boundary). Let k ≤ b − r − 2 be the biggest integer such that q k is productive. Note that k is well defined because q 0 is always productive [(0, n) always extends to (0, N )]. The proof now considers a few cases depending on whether k is small or large (specifically, we say that k is small if

Fig. 7 (Left)
When k is small we have Ω((N logN )/(N + κ 2 )) consecutive vertices in L n that are not productive (shown as squares). In particular, the ray γ through the middle point must make a large detour.
(Right) When k is large, there is a digital path through q k with a big detour large otherwise) and if Q contains too few or too many points.
k is small Recall that we looked for the largest possible k (such that q k is productive). Thus, if k is small, we have many points in layer L n that are consecutive and not productive. In particular, none of the vertices in (note that this point is surrounded by non-productive points in both sides along L n ). Shoot a ray γ from o towards q m . Let p be the vertex on L N that is closest to γ . Observe that the · ∞ distance between γ and p is at most 1/2. Let γ be the ray shooting from o towards p. Similarly, the · ∞ distance between γ and q m is at most 1/2 (see Fig. 7, left). We now apply Lemma 3.1 to dig(o, p). We know that the Euclidean segment op is close to q m . The digital segment must cross L n and is far from q m ; the closest it can pass is either That is, we know that the intersection of op with the line x + y = n is at most half a unit away from q m . Similarly, the intersection with dig(o, p) is at least from q m . Thus, by triangle inequality the · ∞ distance between dig(o, p) and op is at least k is large and b − r ≥ nα + c · (N log N )/(N + κ 2 ) Look at the x-coordinate of q k . We know that Q has at least many elements, and k is among the productive vertices with the largest x-coordinate.
In particular, the x-coordinate of q k is at least Let p be the unique leaf of L N such that M( p) = M(q k ). We now apply Lemma 3.1 to dig(o, p) at the line x + y = n. By definition of p, we have that dig(o, p) passes through q k . Now, by definition of Q, we know that M(q k ) ≤ α and in particular the x-coordinate of p is at most α N (see Fig. 7, right). Thus, the Euclidean segment op must intersect at a point whose x-coordinate is at most αn. That is, when we look at the Euclidean and the digital segments along line x + y = n, the Euclidean crossing happens at x-coordinate at most αn. However, the x-coordinate of the digital crossing is at least By Lemma 3.1 we conclude that the error must be Ω(N log N /(N + κ 2 )) as claimed.
This proof is very similar to the previous case. Consider the vertex p = ( α N , N − α N ) ∈ L N and apply Lemma 3.1 to dig(o, p) and op. At line x + y = n the Euclidean segment op passes through a point whose x-coordinate is α N · n/N ≥ αn − 1. By definition, M( p) ≤ α and thus dig(o, p) must pass through some vertex q of Q. In particular, the x-coordinate of q is at most b − r < nα − c · N log N /(N + κ 2 ), giving the Ω(N log N /(N + κ 2 )) error and completing the proof of Theorem 1.3.
Note that if we use Theorem 1.2 instead, the same argument follows and we would get the following result.

Lower Bound for CDRs in High Dimensions
We now use the lower bound of weak CDRs to obtain a lower bound for CDRs in three or higher dimensions. Consider the restriction of any d-dimensional CDR T to the x 1 x 2 -plane (we call this restriction the x 1 x 2 -restriction of T and denote it by T x 1 x 2 ). Recall that the key observation is that T x 1 x 2 is a (possibly weak) CDR and that any inner leaf in T x 1 x 2 must extend in some x i -direction in T for some i ∈ [3..d]. We have seen that T x 1 x 2 needs to have a large number of inner leaves to have o(log N ) error. In the following, we will show that a large number of inner leaves will cause constraints for Z d and have an impact in the overall error of T .
We do a slight abuse of notation and use the same terms as in two dimensions. For simplicity of the notation, we assume that N is a positive even number. For any Given any CDR in G + N , we consider the CDR as a tree rooted at the origin. Let T (v) be the subtree rooted at v.
From Theorem 1.3, we already know that in order for T x 1 x 2 to have sublogarithmic error we must have κ 2 ∈ ω(N ) inner leaves. However, each inner leaf ties to a boundary leaf in L N in d dimensions. In other words, the subtrees rooted at the vertices in L N /2−1 ∩ T x 1 x 2 must cover all these boundary vertices. We now observe that a weak CDR with inner leaves in the x 1 x 2 -plane induces subtrees which are too big for the high dimensional proper CDR (see Fig. 8). In this region we know that we have κ 2 many inner leaves, which will extend to L N with the first step in the x i -direction for some i ∈ [3..d]. Let Y N be the extended vertices on L N from these κ 2 inner leaves, i.e., |Y N | ≥ κ 2 . Let The existence of this vertex v is the root of the problem. We conclude with the following statement. If we have lots of inner leaves in T xy , it will have many descendants in the three dimensional CDR at layer L N so that the height of the red region attempting to contain them is large. In particular, we can find a vertex v on the xy-plane such that v is on the dig(o, u) and u is far away from the xy-plane. For simplicity, we show the Euclidean error between v and u , but we note that the proof argues under the · ∞ metric  (d−2) ). By construction, we have that v is on the dig(o, u) and v j = 0, hence · ∞ distance between dig(o, u) and ou is Ω((κ 2 /N ) 1/(d−2) ).
Combining with Theorem 1.3 gives us a lower bound for CDRs in d dimensions.

A Construction of a Weak CDR with Constant Error
In this section we describe how to construct a weak CDR in two dimensions with constant error. Specifically, we show that the weak CDR has at most 5/2 error and at most N 2 /12 inner leaves, which is about 1/6 of the total number of grid points in G + N . Assume that N is a power of 2. We partition G + N into log 2 N diagonal slices by a set of lines x + y = 2 i for i = 1, . . . , log 2 N −1. We use S i to denote the ith slice between x + y = 2 i−1 and x + y = 2 i for i = 2, . . . , log 2 N . The first slice S 1 is G + 2 , which only has six points. There are two proper CDRs for this small set and both have the same error. So we can use either of the two. For each other slice S i , we draw a greedy digital path from each point p = ( p x , p y ) ∈ L 2 i−1 to 2 p = (2 p x , 2 p y ). The greedy digital path simply tries to approximate the Euclidean segment as much as possible. More formally, the path between p and 2 p is defined by picking a point in each L j that has the smallest · ∞ distance to the line segment p, 2 p for j = 2 i−1 , . . . , 2 i (in case of tie, we pick the point with smaller y-coordinate). Lemma 5.1 shows that the way we picked the points would give a digital path following the 4-neighbor grid topology.
The last step of the construction is as follows: for those points ( p x , . We call this construction GREEDY, see Fig. 9. The following lemma shows that every two consecutive points we picked in L j and L j+1 to form the greedy digital path is connected under the 4-neighbor topology. Proof It is trivial for p = (0, 2 i−1 ) and p = (2 i−1 , 0), so we ignore these two cases in the following. Suppose that there exists two consecutive points we picked in the greedy path u ∈ L j and v ∈ L j+1 for some 2 i−1 ≤ j ≤ 2 i − 1 such that u and v are not connected in the 4-neighbor topology, i.e., u x = v x and u y = v y . Since u and v are grid points, this implies that u − v ∞ ≥ 2. Let u and v be the points on the line segment p, 2 p with the smallest · ∞ distance to u and v respectively, i.e., u (resp. v ) is the intersection of p, 2 p and x + y = j (resp. x + y = j + 1). Since the slope of p, 2 p is between 0 and ∞ exclusively, u − v ∞ < 1. Furthermore, we know that the · ∞ distance between any two consecutive points on L j is 1, so u − u ∞ ≤ 0.5 and the same holds for v − v ∞ . By triangle inequality, we have It is easy to see that the greedy digital path is x y-monotone because we only pick one grid point per each L j .
Next, we show that any two greedy digital paths in the same slice S i are disjoint so that when we concatenate all the greedy digital paths slice by slice, it is easy to see that they form a tree rooted at the origin in Lemma 5.5.  Fig. 9 Outline of GREEDY. In the example, N = 32. G + N is partitioned into five slices by the red dash lines. The green solid lines indicate where the greedy paths are constructed between (x, y) and (2x, 2y). A digital path dig(o, v) is shown through the concatenation of some greedy paths as well as the notation used in the proof of the Hausdorff error for dig (o, v) Proof By the way we picked the grid points on the greedy digital paths, we can see that any grid point on the greedy digital path has at most 0.5 L-infinity distance to the corresponding line segment. Given any two consecutive line segments p, 2 p and q, 2q in S i where q x = p x + 1, for any point v ∈ p, 2 p/{ p}, the · ∞ distance from v to q, 2q is larger than 1. Hence, one grid point cannot be assigned to more than one greedy digital path.
Then, we show how the greedy digital paths in S i connect to the greedy digital paths in S i−1 , which gives us the structure of dig(o, p) how it passes through some intermediate points. Proof When p x is even, q = ( p x /2, p y /2) ∈ L 2 i−2 , so dig(q, p) is a greedy digital path. dig(q, 2 p) is the concatenation of dig(q, p) and dig( p, 2 p). Hence, dig( p, 2 p) ⊂ dig(q, 2 p).
By repeatedly applying Lemma 5.3 for all i = 3, . . . , log 2 N , we have the following corollary.
Now we have all the tools to show that GREEDY is a rooted tree at the origin so that GREEDY is a weak CDR.

Lemma 5.5 GREEDY is a rooted tree at the origin with x y-monotone paths to all the vertices.
Proof If we can show that every grid point v ∈ G + N except the origin has exactly one edge to either (v x − 1, v y ) or (v x , v y − 1), then GREEDY is a tree with x y-monotone paths connecting to all the grid points from the origin because the graph is connected in G + N and there are |G + N | − 1 edges. The x y-monotonicity comes from the fact that all the grid points are connected towards the origin. Clearly, this holds in S 1 because this part is a CDR with N = 2. Hence, we consider S i for i = 2, . . . , log 2 N . By Lemmas 5.1 and 5.2, we know that all the greedy digital paths in S i are x ymonotone and disjoint. Hence, for any point v ∈ dig( p, 2 p)/{ p} with p ∈ L 2 i−1 , there is only one edge to either Furthermore, the last step of GREEDY only applies to the grid points p ∈ G + N /{(0, 0)} not having an edge to ( p x − 1, p y ) or ( p x , p y − 1). Hence, there is only one edge to ( p x − 1, p y ) or ( p x , p y − 1) assigned to those points.
Then, we can talk about the quality of GREEDY in term of the number of inner leaves and the Hausdorff error in the next two lemmas.

Lemma 5.6
There are at most N 2 /12 inner leaves in GREEDY.
Proof By Corollary 5.4, every grid point on the greedy digital paths can be extended to L N . Thus, in each S i , the inner leaves are created between two greedy digital paths dig( p, 2 p) and dig(q, 2q) exclusively, where p x + p y = 2 i−1 , q x = p x + 1 and q y = p y − 1. We only consider the grid points below the line x = y. The other case is symmetric. By GREEDY construction, all the grid points between dig( p, 2 p) and dig(q, 2q) exclusively are connected to their left hand side neighbors. Hence, there is at most one inner leaf per each horizontal line between dig( p, 2 p) and dig(q, 2q), except the line y = 2 p y − 1 because (2 p x + 1, 2 p y − 1) can be extended to S i+1 . Therefore, there are at most 2 p y −2 y= p y 1 = p y − 1 inner leaves between dig( p, 2 p) and dig(q, 2q). By considering all dig( p, 2 p) for p y = 1, . . . , 2 i−2 and the symmetric case, we have 2 2 i−2 p y =1 p y − 1 = 2 i−2 (2 i−2 − 1) inner leaves in S i . We sum up for all the slices, we get inner leaves.

Lemma 5.7 The Hausdorff error in GREEDY is at most 5/2.
Proof Given any point v ∈ G + N , there exists some n ≤ N such that 2 n−1 < v x + v y ≤ 2 n . Based on our slice partition, we partition o, v into n line segments such that each line segment lies in some slice S i . Then, we bound the Hausdorff error between each line segment and the corresponding piece of digital segment within each slice, which implies the overall Hausdorff error. Recall that H (A, B) is the Hausdorff distance between A and B under · ∞ metric.
We first show how to partition o, v and dig(o, v). For the sake of simplicity, we assume that v x ≥ v y . Let k = v x + v y and let v i be the intersection of o, v and x + y = 2 i for i ≤ n − 1, i.e., v i,x = 2 i v x /k and v i,y = 2 i v y /k. Let v = ( 2 n−1 v x /k , 2 n−1 v y /k ) and v = ( 2 n−1 v x /k + 1, 2 n−1 v y /k − 1) so that v n−1 is between v and v on line x + y = 2 n−1 . Therefore, v is between v , 2v and v , 2v . Based on the GREEDY construction, v is also between dig(v , 2v ) and dig(v , 2v ). Suppose that v is not in dig(v , 2v ), then dig(o, v) is constructed by a horizontal path from v to dig(v , 2v ) and then following dig(o, 2v ) to the origin.

Because of the GREEDY construction, both
is also at most 1. Based on the GREEDY construction, we know that H ( p, 2 p, dig( p, 2 p) We go back to another case when v ∈ dig(v , 2v ).
. . , n − 1, we can apply the same argument as above to show that H (o, v, dig(o, v) Combining all these lemmas, we have our main theorem. Theorem 1.6 For any N > 0 we can create a weak CDR in Z 2 with at most 5/2 error and at most N 2 /12 inner leaves.
Proof Lemma 5.5 guarantees that GREEDY satisfies axioms 1, 2, 3, and 5. Lemmas 5.6 and 5.7 give the two qualities of the weak CDR. Proof We first apply the GREEDY construction in G + N /c , in which we have O(1) error and O(N 2 /c 2 ) inner leaves. Then, we scale up the tree by a factor of c so that the original grid edges have length c. Therefore, the error of the tree in G + N /c ·c becomes O(c), but the tree does not cover all the refined grid vertices. Then, we draw some vertical or horizontal line segments that branch from the tree as shown in Fig. 10. This will increase the number of inner leaves by a factor of c, i.e., O(N 2 /c). Each new branch is a copy of some sub-path of the original GREEDY tree and is shifted by at most c steps. Hence, their errors are still O(c).
In addition to the GREEDY construction for a weak CDR, we can also observe some nice properties in GREEDY. If we remove all the branches which end up at some inner leaves, we have an infinite tree which covers 2/3 of the grid points of G + N . In particular, for each grid point not in the tree, there must exist a vertex in the tree within one unit distance. Hence, given any point p in G + N , we can snap p to some vertex q in the tree with distance at most 1. Then, dig(o, p) can be approximated by dig(o, q) with a very small distortion at the end point, but the Hausdorff error H (o, p, dig(o, q)) is O (1). Let T G be the tree created by GREEDY after removing all the inner branches. We give a formal statement as follows: Proof By Lemma 5.5, we know that every path from any vertex in T G to the origin is x y-monotone. And by Corollary 5.4, we know that all the greedy digital paths can be extended to infinity. Hence, DS({o} × V ) realized by T G satisfies all the five axioms. Lemma 5.7 gives the O(1) error.
By definition of greedy digital path, in each L j between two consecutive greedy digital paths there is at most one point not on these two paths. Hence, the distance between those points and greedy paths is at most one.

Point Sets with Constant Discrepancy
In this section we construct red R and blue B point sets such that the absolute value of their discrepancy is 1. Let m > 0 be the difference between the number of blue and red points as defined in Appendix. Our construction has Θ(m 2 ) many points. Afterwards we also prove that a discrepancy of 1 cannot be achieved with o(m 2 ) many points. We first describe a specific configuration of points, called staircase. Given a staircase, we can define a curve by connecting consecutive points on the staircase. Additionally we add a vertical segment at the beginning and a horizontal segment at the end, in order to connect the curve to the boundary of the unit square, see Fig. 11. We will also use the term "staircase" for this curve. in which we expect i many blue points more than red points. Figure 12 illustrates the curves C i in black for m = 7. The idea of our construction is to approximate the level curves C i−0.5 by staircases, where i ∈ {1, . . . , m}. We will construct m staircases such that the staircase approximating C i−0.5 is between C i−1 and C i . This guarantees that the discrepancy D * R,B is at most 1.
We describe how we construct the staircase which approximates C i−0.5 . We start with a blue point at the intersection of the two curves C i−1 and x = y. This is the blue point Starting from there we move horizontally to the right until we hit the curve C i at the point We add a red point here. Then we move vertically down until we hit C i−1 and put a blue point. We continue in this fashion, i.e., from a blue point on C i−1 we move horizontally to the right and put a red point on C i . From a red point on C i we move vertically down and put a blue point on C i−1 . The blue points will have the coordinates and the red points have the coordinates where k ∈ {0, 1, 2, . . .}. We stop this construction when we leave the unit square, i.e., we look for the largest k such that the blue point (3) is still contained in [0, 1] 2 . The maximum value for k is for i ≥ 2 and k = 0 for i = 1. So far we described how we construct the staircases on the side y ≤ x. We add red and blue points on the side y > x to make the construction symmetric to the line y = x. Figure 12 illustrates our construction, which we call the symmetric greedy staircase construction.
There are 2k * (i) + 1 [resp. 2k * (i)] many blue (resp. red) points in the ith staircase. Proof. The number of blue points, which are used in our construction, is We now bound the denominator from below by Putting the inequalities together, we get The continuous function f (i) = i log (m/i) has exactly one maximum in the interval [2, m] with a value bounded by m log m and is monotone on both sides of it. Therefore we can replace the sum by an integral.
Note that point sets R, B with constant discrepancy and O(m 2 ) many points can also be constructed by applying the transformation of Sect. 2 on the weak CDR, constructed in Sect. 5. We now show that our construction is tight. Theorem 6.6 Let B and R be point sets, which can be decomposed into m nonintersecting staircases, and have a discrepancy bounded by a constant ξ . Then |B| = Ω(m 2 ).

Proof
The ith staircase is bounded from below by the level curve C i−ξ and from above by C i+ξ −1 because of the discrepancy constraint. We count how many points are necessary to create the ith stair. The minimum number can be realized by constructing a stair in a greedy manner between C i−ξ and C i+ξ −1 because both curves are convex.
The number of blue points can therefore be bounded by Using the inequality and comparing the sum with an integral, as done in the proof of Theorem 6.5, (1) the curves C i are contained in S i , and (2) the points between C i and C i+1 are either contained in S i or S i+1 . Therefore there exists a curve between C i and C i+1 which is only neighboring S i to its bottom-left and S i+1 to its top-right for each i ∈ {0, 1, . . . , m −1}. This curve is a staircase. Hence there exists a staircase between C i and C i+1 for each i ∈ {0, 1, . . . , m−1}. Those staircases are non-intersecting because D * R,B < 1. Therefore they consist of at least Ω(m 2 ) many points, as shown in Theorem 6.6. Theorem 1.8 is open if the upper bound D * R,B < 1 is replaced by O(1). Discussion. As mentioned in the introduction, this result could be the first step towards showing that GREEDY construction is tight (in the sense that the number of inner leaves cannot be drastically decreased without increasing the error): we want to create a weak CDR with O(1) error and few inner leaves. Theorem 1.3 states that Ω(n log n) many inner leaves will be necessary. Theorem 1.8 strengthens the result by saying Ω(n 2 ) many inner leaves are necessary. However, this claim only holds if we are going to use a CDR whose mapping decomposes into staircases that do not cross.
This non-crossing requirement is key and follows from the fact that we require D * R,B < 1. In particular, it is unlikely that our proof extends for any larger constant D * R,B = O(1). Doing so would most likely bring an improvement on the bichromatic discrepancy bound (and thus the non-chromatic as well). However, we could go a different route to improve the result: in general, weak CDRs could map to points whose staircases intersect (and then Theorem 1.8 does not apply). Intersecting staircases can again be decomposed into non-intersecting (only touching) staircases, where there does not need to be a blue or red point at every turn. Thus, rather than looking at higher discrepancy, it would make sense to study if we can extend the quadratic lower bound to colored pointsets that form such touching staircases.

Final Remarks
Common intuition would say that the Ω(log N ) lower bound for the error of two-dimensional CDR and CDS automatically extends to higher dimensions. The observation that this is not true opens up new ways in which research can continue. By the time of writing this, we know several ways to construct CDRs with O(log n) Hausdorff error in any dimension, but only know of Ω(log 1/(d−1) N ) lower bound. If we had to guess, the upper bound seems closer to the truth, but this is a hunch based on the fact that our analysis is a bit loose. Regardless of which bound is tight, further study in the relationship between the three spaces (CDR in high dimensions, 2-D weak CDR and the two-colored pointset) could lead to either designing tighter lower bounds or possibly lead to better CDR constructions [or even better, obtain a CDS construction with o(N ) error in arbitrary dimensions].
We also find that weak CDRs are an interesting research topic on their own. In particular, we would like to find the relationship between the number of inner leaves and the error of the construction. That is, say that we want a CDR with O(e) error (for some e ≤ log n). What is the minimum number of leaves = (e) that such a CDR must have? Can we find such a construction? Theorem 1.3 seems to indicate a linear relationship between the two, and it is not hard to obtain one (see, for example, Theorem 1.7 and Fig. 10). However, this construction is most likely not the best possible one. Indeed, even if we are interested in O(log N ) error, this construction creates a large number of inner leaves, but we know of CDRs with the same error and no inner leaves. Thus, the question becomes, can we significantly improve upon the greedy construction in Sect. 5? Or is there some exponential dependency between the number of inner leaves and the error of the weak CDR? trivial inequality Note that for simplicity in the notation we removed the integration limits. Our definition of G is identical to the one used by Schmidt: let m = log 2 (b + r ) + 1 and observe that, by definition of m we have 2(b + r ) ≤ 2 m ≤ 4(b + r ). Only in this section we use the variable name "m" in a different sense in order to keep the notation similar to [15]. For any j ∈ {0, . . . , m} we define function f j : [0, 1] 2 → {−1, 0, 1} as follows: subdivide the unit square with 2 j equally spaced vertical lines and 2 m− j horizontal lines.
For any value of j we subdivide the unit square into rectangles of area 2 −m (larger values of j will result in thinner but wider rectangles). Let A be a rectangle of subdivision associated to f j . We define f j within the rectangle to be 0 if A contains any point of R ∪ B. If A does not have neither red nor blue points, we further subdivide it into four congruent quadrants. The function value of f j is equal to 1 in the upper right and lower left quadrants, and −1 in upper left and lower right quadrants (see a visual representation of f j in [15, p. 173]).
Schmidt showed that |G| ≤ 2 (regardless of the value of m). Thus, we now focus in giving a lower bound for D R,B G. Lemma A.1 There exists a constant c 1 such that Proof By definition of G 1 we have D R,B G 1 = c m j=0 D R,B f j . Thus, it suffices to show that for any value of j it holds that D R,B f j ≥ c (b − r )/(b + r ) (for some other constant c > 0).
Recall that, when defining f j , we subdivided the unit square into at least 2(b + r ) rectangles. For the rectangles that contain at least one point of R ∪ B, f j is set to zero, and thus they do not contribute to the integral. Since we have b + r many points, we know that there must exist at least b +r rectangles that do not contain any point of R or B. Let A be any such rectangle, and let A SW , A NW , A SE , A NE be the four subquadrants of A (where the subindex refers to the cardinal position of the quadrant). Recall that f j is equal to 1 for any point of A SW ∪ A NE and −1 for points of A SE ∪ A NW .
Let w and h be vectors defined by the horizontal and vertical sides of A SW , respectively. Observe that their lengths are 2 − j−1 and 2 j−m−1 , respectively. Then, we have If we apply the definition of D R,B [cf. (4)] to the four terms inside the integral, we get Observe that we are integrating twice positively and twice negatively over almost identical functions. In fact, the terms of the first integral all cancel out except along the rectangle [x, x + w) × [y, y + h). Similarly, when we look at the second and third terms, the contribution of any point in R ∪ B is cancelled out unless it is in the rectangle [x, x + w) ×[y, y + h). However, by definition of A there are no such points. Thus, we obtain That is, when we integrate f j D R,B over a rectangle A containing no point of R ∪ B, the result is (b −r )2 −2m−4 . We know that there are at least b +r rectangles not containing points of R ∪ B, thus their contribution is at least Lemma A.2 There exists a constant c 2 such that m k=2 D R,B G k ≤ c 2 c 2 b − r b + r log (b + r ).
Proof Recall that G k = c k 0≤ j 1 < j 2 <...< j k ≤m f j 1 · · · f j k . Fix any valid set of indices and consider the value of f j 1 · · · f j k D R,B .
As shown in [15], function f j 1 · · · f j k is largely defined by f j 1 and f j k . Indeed, if we overlay the rectangular partition defined by functions f j 1 , . . . , f j k we obtain a grid of rectangles whose width is 2 − j k and height 2 −(m− j 1 ) . In each of these rectangles, the function is zero (if any of the rectangles associated to the f j i functions contains a point of R ∪ B), or is further subdivided into four equal sized quadrants and in each one it is +1 or −1 alternatively.
Let A be one of the rectangles of the refined grid. As shown in Lemma A.1, we have that where τ ∈ {−1, 1}. This extra term appears because the product of the different functions involved can change the sign of each of the four quadrants. In any case, we have A f j 1 · · · f j k D R,B ≤ (b − r )2 −2(m+g)−4 where g = j k − j 1 .
By the way the grid is constructed, there are 2 m− j 1 × 2 j k = 2 m+g many rectangles, and thus we conclude that f j 1 · · · f j k D R,B ≤ (b − r )2 −m−g−4 . In order to obtain a bound D R,B G k we sum over all possible indices.
Note that in the sum, the indices j 2 , . . . , j k−1 do not matter. Thus, we group the terms by the gap between the indices j 1 and j k (say, if j 1 = 3 and j k = 7 the gap is 4). Note that the minimum gap is at least k − 1 (since otherwise we do not have enough space to choose the k − 2 indices in between) and at most m. Once we have a gap of g there are m − g options for index j 1 .
In order to bound the sum over all G k from above, we first reorder the summation order. The sum contains the first terms of the geometric sum ∞ g=1 ((1 + c)/2) g−1 ≤ 2/(1 − c) (for any c < 1). In particular, if we set c ≤ 1/2 we can bound the partial sum by 4 from above. Recall that m = Θ(log(b + r )) and 2 m = Θ(b + r ). Thus, the lemma is proven.
This completes the proof of Theorem 1.2. When R = ∅, it would be expected that we need to distribute the blue points uniformly in the unit square to have a low discrepancy. Indeed, it is also held for the red points. The following theorem implies that even though there are many red points, if the red points are concentrated in the lower half of the unit square, the discrepancy cannot be reduced. For simplicity, we only show a special case of how the discrepancy Since D R,B x, 1 2 + y < c · (b 2 − r 2 ) log (b 2 + r 2 ) b 2 + r 2 and we can conclude that