\documentclass[11pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern,microtype} \usepackage[margin=27mm]{geometry} \usepackage{amsmath,amssymb,amsthm,mathtools} \usepackage[dvipsnames]{xcolor} \usepackage[colorlinks=true,linkcolor=MidnightBlue,citecolor=MidnightBlue,urlcolor=MidnightBlue]{hyperref} \hypersetup{pdftitle={Monotone transport and planar measure discrepancy},pdfauthor={Research investigation}} \setlength{\parindent}{0pt} \setlength{\parskip}{4pt} \setlength{\emergencystretch}{2em} \allowdisplaybreaks \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newcommand{\pref}{\mathrm{pref}} \newcommand{\rect}{\mathrm{rect}} \newcommand{\seg}[2]{[\min(#1,#2),\max(#1,#2)]} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \title{The planar Gates of Hell problem: an optimal-order discrepancy bound for arbitrary probability measures} \author{Bal\'azs Maga (contributor)} \date{30 November 2026} \hypersetup{ pdftitle={The planar Gates of Hell problem}, pdfauthor={Balazs Maga} } \begin{document} \maketitle \begin{abstract} We give a recursive construction which, for every doubly stochastic \(n\times n\) matrix \(A\), produces a permutation matrix \(P\) with prefix-sum error at most \(\frac12\lceil\log_2 n\rceil\). The construction transports a fractional child measure monotonically to the available unit atoms and then rounds cumulative masses in one dimension. The child error remains between zero and the parent error, up to one half. A recursive interval estimate prevents a second logarithmic loss. It follows that every Borel probability measure on the square admits an equal-weight \(n\)-point approximation with star discrepancy at most \((\frac12\lceil\log_2n\rceil+1)/n\), and rectangle discrepancy at most \((2\lceil\log_2n\rceil+4)/n\). Approximating points may lie outside the original support. The rounding argument is finite-dimensional and applies to arbitrary real matrix entries. Together with Schmidt's classical planar lower bound for Lebesgue measure, this settles the order-of-magnitude version of the planar Gates of Hell problem. The central existence theorems have also been formalized in Lean 4. The scope of the formalization and the available verification evidence are discussed in the appendix. The Lean source files will be made publicly available separately. \end{abstract} \paragraph{Research provenance.} The contributor initiated and directed the research investigation. The mathematical proof, the Lean formalization, and the manuscript were generated using ChatGPT. The expanded manuscript includes an AI-assisted mathematical and bibliographic audit. The scope and limitations of the verification are described in the appendix. The contributor is currently working towards a thorough human understanding and independent verification of the arguments, with the intention of preparing a subsequent arXiv submission. \section{Introduction and position in the literature}\label{sec:intro} The problem of approximating an arbitrary probability measure by an empirical measure of prescribed size arises naturally in geometric discrepancy and quasi-Monte Carlo integration. For a fixed dimension $d$, put \[ E_{n,d}^*(\mu)=\inf_{z_1,\ldots,z_n\in[0,1]^d} \sup_{t\in[0,1]^d}\left|\mu([0,t])-\frac1n\sum_{i=1}^n \mathbf 1_{[0,t]}(z_i)\right|, \qquad W_d(n)=\sup_{\mu} E_{n,d}^*(\mu), \] where $[0,t]=\prod_{j=1}^d[0,t_j]$ and the last supremum is over all Borel probability measures. All constants in estimates for $W_d$ must be independent of the measure, including when it depends on $n$. Throughout, $\log$ without a subscript denotes the natural logarithm. \subsection{The historical gap} For Lebesgue measure $\lambda_d$, classical low-discrepancy constructions (such as Halton constructions; see \cite{Halton,ABN}) give an upper bound of order $(\log n)^{d-1}/n$. In dimension two, Schmidt's theorem \cite{Schmidt} gives the matching lower bound, so \begin{equation}\label{eq:schmidt} E_{n,2}^*(\lambda_2)\asymp \frac{\log n}{n}\qquad(n\ge2). \end{equation} The classical bound extends to multisets and closed prefixes: if needed, perturb coincident points to distinct points by arbitrarily small amounts. For the continuous uniform CDF, sandwiching the perturbed empirical CDF between shifted prefixes of the original empirical CDF changes its upper discrepancy bound by at most the uniform CDF's modulus of continuity. Points on the boundary can be moved into the square in this argument, and strict-prefix queries follow by one-sided limits. For arbitrary measures, the historical sequence of upper bounds is rather different. Beck's 1980s work gave a bound with logarithmic exponent $2d$ (and also a version with exponent $d+2$; see \cite{Beck89,AD,ABN}). Aistleitner and Dick \cite{AD} proved $W_d(n)=O_d((\log n)^{(3d+1)/2}/n)$ with an explicit constant. Aistleitner, Bilyk and Nikolov \cite[Theorem 1]{ABN}, using the transference principle and Nikolov's bound for combinatorial discrepancy \cite{Nikolov}, improved this to \begin{equation}\label{eq:abn} W_d(n)=O_d\left(\frac{(\log n)^{d-1/2}}{n}\right). \end{equation} In the plane, the exponent in \eqref{eq:abn} is $3/2$, leaving a factor of $\sqrt{\log n}$ relative to \eqref{eq:schmidt}. Lower bounds for measures with densities, such as Chen's extensions of Roth's method \cite{Chen}, and work on special measures and low-dimensional discrepancy formulas \cite{FGW,Weiss}, do not give the uniform planar upper bound sought here. The related work of Brandolini, Colzani and Travaglini \cite{BCT} concerns different test sets (balls in a torus) and discrepancy norms; it should not be confused with the rectangular star-discrepancy problem. A particularly direct antecedent is Fairchild, Goering and Wei\ss \cite[Theorem 1.5 and Remark 1.7]{FGW}. They establish the optimal order in dimension one and explicitly discuss the possibility that arbitrary planar probability measures admit an $O(\log N/N)$ star-discrepancy estimate. They explain why the classical duality between one-dimensional sequences and planar point sets for Lebesgue measure does not directly extend to arbitrary measures: the proof uses the product structure of Lebesgue measure. Our bound establishes the estimate discussed in their Remark 1.7, with a universal constant and with control of both strict and closed endpoints. The one-dimensional transport principle in their Lemma 1.8 is also closely related to our reduction by monotone marginal maps, but the latter alone does not solve the approximation problem for a general copula. \subsection{Which Gates of Hell problem is being resolved?} In the introduction of \cite{ABN} the authors ask whether the worst-case minimal discrepancy for nonuniform measures is greater than that for Lebesgue measure. Their question is motivated explicitly by the gap in the logarithmic exponents, and they name it the Gates of Hell problem in the acknowledgements. A precise asymptotic formulation in dimension $d$ is \begin{equation}\label{eq:gates} \text{Does there exist }C_d<\infty\text{ such that } W_d(n)\le C_d E_{n,d}^*(\lambda_d)\quad(n\ge2)? \end{equation} Our answer to \eqref{eq:gates} for $d=2$ is affirmative, or, equivalently, negative to the question whether some measures are asymptotically harder by an unbounded factor. This is a minimax statement, stronger than a pointwise $O_\mu(\log n/n)$ bound. The upper bound proved here does not require the measure to be fixed as $n$ grows. The strictly stronger statement $W_d(n)=E_{n,d}^*(\lambda_d)$ for all $n$ is not the assertion proved here. In fact, for the closed star convention this exact statement fails already at $d=2,n=1$. To see this, consider the permuton $\mu_-$ which is the law of $(X,1-X)$ for $X$ uniform on $[0,1]$. Its CDF is $F_-(s,t)=\max(0,s+t-1)$. For any permuton with CDF $F$, the star error of the single node $(a,b)$ is \[ \max\{a,b,1-F(a,b)\}. \] Indeed, prefixes excluding the node have supremal mass $\max(a,b)$, by the marginal constraints and one-sided limits; prefixes containing it have minimum mass $F(a,b)$. For $\mu_-$ this expression is minimized at $(2/3,2/3)$ and equals $2/3$: writing $M=\max(a,b)$, the error is at least $\max(M,1-\max(0,2M-1))$, whose minimum is $2/3$. For $\lambda_2$ the same minimization gives $(\sqrt5-1)/2$, by minimizing $\max(M,1-M^2)$ and taking $a=b=M$. Thus exact finite-$n$ extremality is different from the sharp order claim. This example concerns star discrepancy, not an assertion of strict inequality for all-rectangle discrepancy or for large $n$. \subsection{Recent higher-dimensional developments} Ullrich \cite[Theorem 1.1]{Ullrich}, in a preprint dated 27 November 2026, proves that for each $d\ge3$ and all sufficiently large $n$ there exists a probability measure supported on $O_d(n\log n)$ points for which even an $n$-node quadrature rule with arbitrary real weights has star discrepancy at least \[ c_d\frac{(\log n)^{d-1}}{n(\log\log n)^{\chi_d}} \] for a finite dimension-dependent exponent $\chi_d$. In conjunction with the improved Lebesgue-measure upper bounds cited in his paper, this separates the two approximation problems by an unbounded factor. His Corollary 1.2 further gives a single countably supported measure exhibiting a separation along infinitely many sizes. The stated lower-bound theorem is restricted to $d\ge3$; illustrations and auxiliary estimates in dimension two are not a planar superlogarithmic lower bound. Our result rules out precisely such a planar separation in the equal-weight setting. Since equal weights are an admissible special case of arbitrary weights, it also rules out an $\omega(\log n/n)$ lower bound for the unrestricted weighted problem. A comparison with the \emph{optimal weighted} Lebesgue benchmark would require a weighted lower bound, which we do not assert or use here. \subsection{The role of the combinatorial problem} Tusn\'ady's problem concerns a different minimax quantity: \[ \Delta_2(N)=\sup_{|X|=N}\min_{\chi:X\to\{-1,1\}} \sup_R\left|\sum_{x\in X\cap R}\chi(x)\right|, \] where $X$ is a prescribed finite point set. Nikolov's upper bound is $O(\log^{3/2}N)$ \cite{Nikolov}. In October 2026, Wei \cite{Wei} announced a matching planar lower bound, even for random point sets with high probability. Recent preprints of Wengiel and Lei \cite{Wengiel,Lei} report matching bounds also in higher dimensions. We cite these as recent preprint claims, not as independently verified proofs. If $X$ has $2n$ elements and $Y\subset X$ has $n$ elements, let $\mu_X$ and $\mu_Y$ be the uniform probability measures on them. For the coloring $+1$ on $Y$ and $-1$ on $X\setminus Y$, \[ \mu_Y(R)-\mu_X(R)=\frac1{2n}\sum_{x\in X\cap R}\chi(x). \] Thus Wei's lower bound, if confirmed, gives examples where halving by selecting a subset costs $\Omega(\log^{3/2}n/n)$, while our construction permits $O(\log n/n)$ by moving the nodes. This illustrates why the free-node problem is not equivalent to Tusn\'ady's problem. We do not infer a lower bound for every possible support-restricted multiset or arbitrary weighted configuration from a result about two-colorings. Our approach departs from the coloring/transference method: it preserves the marginal totals but may change the pairing of the coordinates. The core is an ordered child-splitting estimate with a signed error interval, followed by a balanced recursion. \section{Statements and conventions} For an \(n\times n\) matrix \(C\), set \[ \|C\|_{\pref}= \max_{0\le i,j\le n}\left|\sum_{a=1}^{i}\sum_{b=1}^{j}C_{ab}\right|. \] Empty sums are zero. A doubly stochastic matrix is nonnegative with every row and every column sum equal to one. A permutation matrix \(P_\pi\) has \((P_\pi)_{i,\pi(i)}=1\). \begin{theorem}[Prefix rounding]\label{thm:matrix} For every doubly stochastic \(n\times n\) real matrix \(A\), there is a permutation \(\pi\in S_n\) such that \begin{equation} \boxed{\|P_\pi-A\|_{\pref}\le\frac12\lceil\log_2 n\rceil.} \label{eq:matrix} \end{equation} The construction is allowed to put permutation entries in zero cells of \(A\). \end{theorem} For a Borel probability \(\mu\) on \([0,1]^2\), write \[ e_n^*(\mu)=\inf_{z_1,\ldots,z_n} \sup_{s,t\in[0,1]} \left|\mu([0,s]\times[0,t])- \frac1n\sum_{r=1}^n\mathbf1_{\{z_r\in[0,s]\times[0,t]\}}\right|. \] Let \(e_n(\mu)\) use all axis-parallel rectangles instead. We use closed prefixes, retaining the boundary faces of the square. Other rectangle endpoint choices are obtained by one-sided limits. Repeated nodes are permitted. Inclusion--exclusion gives \(e_n(\mu)\le4e_n^*(\mu)\). \begin{corollary}[Arbitrary measures]\label{cor:measure} For every Borel probability \(\mu\) on \([0,1]^2\) and every integer \(n\ge1\), \begin{equation} \boxed{ e_n^*(\mu)\le\frac{\frac12\lceil\log_2n\rceil+1}{n},\qquad e_n(\mu)\le\frac{2\lceil\log_2n\rceil+4}{n}.} \label{eq:measure} \end{equation} In particular, no sequence of measures can have \(\limsup_n ne_n(\mu_n)/\log n=\infty\). \end{corollary} \begin{corollary}[Sharp minimax order]\label{cor:sharp} With $\lambda_2$ denoting Lebesgue measure, for $n\ge2$, \[ \sup_{\mu}e_n^*(\mu)\asymp e_n^*(\lambda_2) \asymp \frac{\log n}{n},\qquad \sup_{\mu}e_n(\mu)\asymp e_n(\lambda_2) \asymp \frac{\log n}{n}. \] All comparison constants are absolute. \end{corollary} \begin{proof} The upper estimates follow from Corollary~\ref{cor:measure} uniformly in $\mu$. The lower estimate follows by choosing $\mu=\lambda_2$ and applying Schmidt's theorem \eqref{eq:schmidt}; the all-rectangle error dominates the star error since the test family contains all anchored rectangles. \end{proof} The upper-bound proof below is self-contained. Its elementary splitting step is the essential point. The relationship with the previous investigation, support restrictions, and verification is discussed at the end. \section{One ordered splitting lemma} We formulate the finite construction directly; no optimal-transport theorem is needed. Let a block \(I\) of \(m\) consecutive rows be assigned a set of \(m\) column indices \[ S=\{s_1<\cdots0, \qquad G(u)=\int_0^u f(v)\,dv. \] Zero-length intervals are ignored. Thus \(G\) is nondecreasing and 1-Lipschitz, and \begin{equation} G(0)=0,\qquad G(m)=\ell,\qquad G(c_j)=\sum_{b=1}^{j}l_b. \label{eq:G} \end{equation} For \(r=0,\ldots,m\), put \[ q_r=\left\lfloor G(r)+\frac12\right\rfloor. \] Since \(0\le G(r)-G(r-1)\le1\), \[ q_r-q_{r-1}\in\{0,1\},\qquad q_0=0,\qquad q_m=\ell. \] Assign \(s_r\) to \(S_L\) if \(q_r-q_{r-1}=1\), and put \(S_R=S\setminus S_L\). These sets have exactly the required sizes. For a column cut \(j\), set \[ b_j=|S\cap\{1,\ldots,j\}|,\qquad e(j)=b_j-c_j, \] and define the child errors by \[ e_L(j)=|S_L\cap\{1,\ldots,j\}|-\sum_{b=1}^{j}l_b, \qquad e_R(j)=e(j)-e_L(j). \] \begin{lemma}[Error interval]\label{lem:split} The same partition \(S=S_L\sqcup S_R\) satisfies, simultaneously for every \(j=0,\ldots,n\), \begin{equation} e_L(j),e_R(j)\in \left[\min(0,e(j))-\frac12,\ \max(0,e(j))+\frac12\right]. \label{eq:interval} \end{equation} \end{lemma} \begin{proof} The elements of \(S\) below the column cut are precisely its first \(b_j\) elements, so their left-child count is \(q_{b_j}\). By \eqref{eq:G}, \begin{equation} e_L(j)=q_{b_j}-G(c_j) =\bigl(q_{b_j}-G(b_j)\bigr)+\bigl(G(b_j)-G(c_j)\bigr). \label{eq:splitidentity} \end{equation} The first term is in \([-1/2,1/2]\). Because \(G\) is nondecreasing and 1-Lipschitz, the second term lies between zero and \(b_j-c_j=e(j)\). This proves the left-child claim. The interval in \eqref{eq:interval} is invariant under \(x\mapsto e(j)-x\), so the right-child claim follows from additivity. \end{proof} \paragraph{Transport interpretation.} The variable \(u\) parametrizes the parent measure by cumulative mass, and \(f(u)\) records the fraction belonging to its left child. The \(r\)-th available column atom receives the color mass \(G(r)-G(r-1)\). Across a given column cut, the transported child mass differs from its original mass by \(G(b_j)-G(c_j)\). It has the same sign as the parent error and no greater magnitude. Nearest cumulative rounding adds at most one half. Importantly, the construction of \(G,q_r,S_L\) is independent of the cut \(j\). \paragraph{An alternative primitive used in the formalization.} Write $L_j=\sum_{b\le j}l_b$. Instead of the integrated piecewise linear interpolant one may use the finite formula \begin{equation}\label{eq:cone} G_+(u)=\min_{0\le j\le n}\{L_j+\max(0,u-c_j)\}. \end{equation} The cumulative data satisfy $L_i\le L_j+\max(0,c_i-c_j)$ for all $i,j$: for $i\le j$ this follows from monotonicity of $L$, and otherwise it follows from domination of the child increments by the parent increments. Evaluating \eqref{eq:cone} at $c_i$, each term is therefore at least $L_i$ and the term $j=i$ attains it. Each term is nondecreasing and 1-Lipschitz. For $u\le v$ the minimum is nondecreasing, and evaluating the minimum at $v$ using an index minimizing at $u$ shows $G_+(v)\le G_+(u)+v-u$. Hence $G_+$ has every property of $G$ used in Lemma~\ref{lem:split}, including the endpoints $0,\ell$. It can replace $G$ everywhere in the proof. The two interpolants may differ between consecutive cumulative cuts, so the resulting permutations need not coincide. This formulation avoids integration entirely and is the construction used in the companion Lean code. \section{A recursive error interval} Build a balanced binary tree of consecutive row intervals. At a node with \(m>1\) rows, its left child has \(\lfloor m/2\rfloor\) rows and its right child has \(\lceil m/2\rceil\) rows. The height of the tree is \(h=\lceil\log_2 n\rceil\). Assign all columns to the root and apply Lemma \ref{lem:split} recursively. At every node \(v\), the assigned set \(S_v\) has size \(|I_v|\), and its two child sets partition it. Each leaf therefore has exactly one column, and the leaves give a permutation matrix \(P\). Fix a column cut \(j\). Let \[ e_v=|S_v\cap\{1,\ldots,j\}|- \sum_{a\in I_v,\ b\le j}A_{ab}. \] The final permutation entries below \(v\) use exactly \(S_v\), so this is also the discrepancy of the whole row interval \(I_v\). If \(v\) has children \(L,R\), then \(e_v=e_L+e_R\). Let \(H_v\) be the height of the subtree at \(v\), and let \(E_v(k)\) be the discrepancy on its first \(k\) rows and the fixed column prefix: \[ E_v(k)=\sum_{\substack{a\text{ among first }k\text{ rows of }I_v\\b\le j}} (P_{ab}-A_{ab}),\qquad 0\le k\le |I_v|. \] \begin{lemma}[Prefix interval]\label{lem:prefix} For every node \(v\) and every \(k\), \begin{equation} E_v(k)\in \left[\min(0,e_v)-\frac{H_v}{2},\ \max(0,e_v)+\frac{H_v}{2}\right]. \label{eq:corridor} \end{equation} \end{lemma} \begin{proof} At a leaf, the two prefixes have errors \(0,e_v\), and \(H_v=0\). Assume the claim for both children. If the prefix is contained in \(L\), its error belongs to the interval with endpoints \(0,e_L\), enlarged in both directions by \(H_L/2\). By Lemma \ref{lem:split}, both endpoints are in the interval with endpoints \(0,e_v\), enlarged by \(1/2\). Since \(H_L+1\le H_v\), this gives \eqref{eq:corridor}. If the prefix contains all of \(L\) and a prefix of \(R\), its error is \(e_L+E_R(k-|I_L|)\). The inductive interval now has endpoints \(e_L\) and \(e_L+e_R=e_v\), enlarged by \(H_R/2\). Both endpoints again lie in the interval with endpoints \(0,e_v\), enlarged by \(1/2\). Since \(H_R+1\le H_v\), the result follows. \end{proof} \begin{proof}[Proof of Theorem \ref{thm:matrix}] At the root, for every column cut \(j\), \[ e_{\rm root}=j-\sum_{a=1}^{n}\sum_{b=1}^{j}A_{ab}=0, \] using the column sums of \(A\). Lemma \ref{lem:prefix} therefore bounds every rectangular prefix error by \(h/2\). \end{proof} \paragraph{Why there is only one logarithm.} Individual node errors need not stay bounded independently of depth. What matters is their signed relationship. Equivalently, \eqref{eq:interval} implies \[ |e_L|+|e_R|\le |e_v|+1. \] Following one boundary path in the row tree spends only one unit of this budget per level. Estimating each of the \(O(\log n)\) canonical row blocks separately would discard this relationship and create an unnecessary second logarithm. \section{From matrices to arbitrary measures}\label{sec:measures} \subsection{Permutons} First suppose \(\mu\) has uniform marginals. Partition both axes into \(n\) intervals of length \(1/n\), and put \[ A_{ij}=n\mu\left(\left((i-1)/n,i/n\right] \times\left((j-1)/n,j/n\right]\right). \] Boundary lines have zero mass, so the endpoint choices are harmless here. The matrix is doubly stochastic. Apply Theorem \ref{thm:matrix} and use the midpoint nodes \[ z_i=\left(\frac{i-1/2}{n},\frac{\pi(i)-1/2}{n}\right), \qquad Q=\frac1n\sum_{i=1}^{n}\delta_{z_i}. \] At every grid corner, the CDF error is at most \(h/(2n)\). For arbitrary \((x,y)\), set \[ k=\left\lfloor nx+\tfrac12\right\rfloor,\qquad l=\left\lfloor ny+\tfrac12\right\rfloor. \] Then \(0\le k,l\le n\), and \[ Q([0,x]\times[0,y])=Q([0,k/n]\times[0,l/n]). \] This includes midpoint ties, because the formula chooses the upper grid boundary. Uniform marginals give \[ \left|\mu([0,x]\times[0,y])- \mu([0,k/n]\times[0,l/n])\right| \le |x-k/n|+|y-l/n|\le1/n. \] Hence \(d_*(\mu,Q)\le(h/2+1)/n\). If \(\widehat\pi\) denotes the permutation permuton obtained by spreading mass \(1/n\) uniformly over each occupied grid square, the same matrix estimate gives \[ d_{\rect}(\mu,\widehat\pi)\le\frac{2h+8}{n}. \] Indeed, at grid corners the CDF error is still at most \(h/(2n)\). Between a query and its lower grid corner, both permutons' CDF increments lie in \([0,2/n]\), so their difference costs at most \(2/n\). This gives an \(O(\log n/n)\) bound in the permutation approximation formulation of \cite{Maga} as well. \subsection{Marginal atoms and quantile pushforward} Now let \(\mu\) be arbitrary, and let \(F_1,F_2\) be its marginal CDFs. For \((X,Y)\sim\mu\) and independent uniforms \(S,T\), put \[ U=F_1(X-)+S\bigl(F_1(X)-F_1(X-)\bigr), \] \[ V=F_2(Y-)+T\bigl(F_2(Y)-F_2(Y-)\bigr). \] The law \(\widetilde\mu\) of \((U,V)\) is a permuton, by the distributional transform (see \cite{Ruschendorf}). Define \[ q_i(u)=\inf\{x\in[0,1]:F_i(x)\ge u\}\quad(u>0),\qquad q_i(0)=0. \] These maps are nondecreasing and measurable. For completeness, consider a single coordinate $X$ with CDF $F$ and randomized CDF $U$. For $0a\}$ we have $U\ge t$. On $\{X=a\}$ the conditional law of $U$ is uniform on $[F(a-),F(a)]$ when the atom has positive mass. Consequently \[ \Pr(U