TITLE: Density in $\mathbb{Z}^2$
QUESTION [7 upvotes]: I am self-studying topics in additive combinatorics and am working on a problem.
One way to define density of a subset $A$ in $\mathbb{Z}^2$ is the so called upper density, defined as
$$\limsup\limits_{N\to\infty} \frac{|A\cap[-N,N]^2|}{(2N+1)^2}$$
where basically one takes larger and larger square grids and examine the fraction which intersects $A$.
Instead of taking the "default" square grid at each step-size, one might consider maximising over all possible cartesian products. That is, one might consider instead 
$$\lim\limits_{N\to\infty} \max\limits_{\ \ \ \ X,Y\subset\mathbb{Z}\\|X|=|Y|=N} \frac{|A\cap(X\times Y)|}{N^2}$$

The problem is to show that the limit exists but is always 0 or 1.

I have reasoned that if $A$ has positive upper density, then for each $N$, by Szemerédi’s theorem, I can find a $N\times N$ square grid (possibly dilated and translated) within $A$, so there is always some choice of $X$ and $Y$ for which $\frac{|A\cap(X\times Y)|}{N^2} = 1$. Thus in such a case, the limit clearly exists and equals to 1. 
Unfortunately, if A has zero upper density, besides obvious examples of $A$ where the limit is 0, I have constructed a case of $A$ where the limit is 1 (e.g. $A$ is union of $N\times N$ grids where the grids are exponentially further and further apart from the origin). Thus I am not sure if splitting by upper density is the right way to address the problem, although it is very tempting as having zero upper density is quite a restricted case left to consider. Would appreciate any help on this problem.

REPLY [2 votes]: I managed to derive a solution after revisiting this a week later. The solution is quite cool.
For ease of notation, let
$$d_N(A)= \max\limits_{\ \ \ \ X,Y\subset\mathbb{Z}\\|X|=|Y|=N} \frac{|A\cap(X\times Y)|}{N^2}$$
Suppose it is not the case that $\lim\limits_{N\to\infty}d_N(A)=0$. Although we do not yet know if $\lim\limits_{N\to\infty}d_N(A)$ exists, we do know that $\exists\epsilon>0$ such that $d_N(A)>\epsilon$ for infinitely many values of $N$.
I claim that actually $d_N(A)=1$ for all values of $N$. To prove this, fix some $N=n$ and let $L$ be some sufficiently large integer that happens to also satisfy $d_L(A)>\epsilon$. The "sufficiently large" bound which $L$ will have to satisfy will be described later, but we know such $L$ exists regardless of the bound needed. By definition of $d_L(A)$, there exists $X_L,Y_L$ such that $|A\cap(X_L\times Y_L)| > \epsilon L^2$.
Consider the bipartite graph(!) $G$ where the vertices on the "left" consists of $n$-subsets of $X_L$, and the vertices on the "right" consists of 1-subset of $Y_L$. Draw an edge from the $n$-subset $(x_1,\dots,x_n)$ to the 1-subset $(y)$ iff the $n$ points $(x_1,y),\dots,(x_n,y)\in A$.
Notice that if some vertex on the left has degree $\ge n$, we are done -- the $n$ rows represented by the left vertex and the $n$ columns represented by its $n$ neighbours give $X_n,Y_n$ such that $|A\cap(X_n\times Y_n)|=n^2$. Thus, it remains to prove that the graph we constructed has $>(n-1){L\choose n}$ edges.
Now, if $y\in Y_L$ has $a_y$ values of $x\in X_L$ for which $(x,y)\in A$, then the 1-subset $(y)$ has degree $a_y \choose n$. By applying Jensen's inequality to the function
$$f(z) = \begin{cases}
{z\choose n} \ \text{(as a polynomial)}\quad \text{ if }z\ge n-1 \\
0 \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \text{otherwise}
\end{cases}$$
we conclude that the number of edges is
$$ = \sum\limits_{y\in Y_L} {a_y\choose n} \ge L {\frac{\sum a_y}{L} \choose n} > L {\epsilon L \choose n}
$$
which can be made $\ge(n-1){L\choose n}$ with a sufficiently large choice of $L$.