The fundamental theorem of affine geometry on tori

Abstract: The classical Fundamental Theorem of Affine Geometry states that for $n\geq 2$, any bijection of $n$-dimensional Euclidean space that maps lines to lines (as sets) is given by an affine map. We consider an analogous characterization of affine automorphisms for compact quotients, and establish it for tori: A bijection of an n-dimensional torus ($n\geq 2$) is affine if and only if it maps lines to lines.

\section{Introduction}
\label{sec:intro}

\subsection{Main result} A map $f:\ensuremath{\mathbb{R}}^n\to \ensuremath{\mathbb{R}}^n$ is \emph{affine} if there is an $n\times n$-matrix $A$ and $b\in\ensuremath{\mathbb{R}}^n$ such that $f(x)=Ax+b$ for all $x\in\ensuremath{\mathbb{R}}^n$. The classical Fundamental Theorem of Affine Geometry (hereafter abbreviated as FTAG), going back to Von Staudt's work in the 1840s \cite{ftag}, characterizes invertible affine maps of $\ensuremath{\mathbb{R}}^n$ for $n\geq 2$: Namely, if $f:\ensuremath{\mathbb{R}}^n\to \ensuremath{\mathbb{R}}^n$ is a bijection so that for any line $\ell$, the image $f(\ell)$ is also a line, then $f$ is affine.

Since then, numerous generalizations and variations have been proven, both algebraic and geometric. For example, on the algebraic side, there is a version for for projective spaces (see e.g. \cite{ftpg}), general fields $k$, and for noninvertible maps (by Chubarev-Pinelis \cite{ftgnoninv}). On the geometric side, an analogue of FTAG holds in hyperbolic geomety (see e.g. \cite{fthg}), as well as in Lorentzian geometry, where the role of lines is played by lightcones (by Alexandrov \cite{ftlg}).

All of these versions have in common that they are characterizations of self-maps of the model space of the corresponding geometry (e.g. $\ensuremath{\mathbb{E}}^n, \ensuremath{\mathbb{H}}^n$, or $\ensuremath{\mathbb{P}}^n$). On the other hand, if $X$ is some topological space, and $\mathcal{C}$ is a sufficiently rich family of curves on $X$, then one can expect rigidity for self-maps of $X$ preserving $\mathcal{C}$. In this light it seems reasonable to ask for the following generalized version of the FTAG:
	\begin{ques}[Generalized FTAG] Let $M$ be an affine manifold of dimension $>1$. Suppose that $f:M\to M$ is a bijection such that for any affine line $\ell$ in $M$, the image $f(\ell)$ is also an affine line (as a set). Is $f$ affine?\label{q:genftag}\end{ques}
	\begin{rmk} Here by \emph{affine manifold} and \emph{affine line}, we use the language of geometric structures: If $M$ is a smooth manifold of dimension $n$, then an \emph{affine structure} on $M$ is a covering of $M$ by $\ensuremath{\mathbb{R}}^n$-valued charts whose transition functions are locally affine. An \emph{affine line} in an affine manifold $M$ is a curve in $M$ that coincides with an affine line segment in affine charts. A map is \emph{affine} if in local affine coordinates, the map is affine. See \cite{geomstruct} for more information on affine manifolds and geometric structures. \label{rmk:geomstruct}\end{rmk}

	\begin{rmk} Of course one can formulate analogues of Question \ref{q:genftag} for the variations of FTAG cited above, e.g. with affine manifolds (affine lines) replaced with projective manifolds (projective lines) or hyperbolic manifolds (geodesics).\end{rmk}

	The only case in which Question \ref{q:genftag} known is the classical FTAG (i.e. $M=\ensuremath{\mathbb{A}}^n$ is affine $n$-space). Our main result is that Question \ref{q:genftag} has a positive answer for the standard affine torus:
	\begin{thm} Let $n\geq 2$ and let $T=\ensuremath{\mathbb{R}}^n\slash \ensuremath{\mathbb{Z}}^n$ denote the standard $n$-torus. Let $f:T\to T$ be any bijection that maps lines to lines (as sets). Then $f$ is affine. \label{thm:main}\end{thm}
	\begin{rmk} Note that $f$ is not assumed to be continuous! Therefore it is not possible to lift $f$ to a map of $\ensuremath{\mathbb{R}}^n$ and apply the classical FTAG. In addition, the proof of FTAG does not generalize to the torus setting: The classical proof starts by showing that $f$ maps midpoints to midpoints. Iteration of this property gives some version of continuity for $f$, which is crucial to the rest of the proof. The reason that $f$ preserves midpoints is that the midpoint of $P$ and $Q$ is the intersection of the diagonals of any parallellogram that has $PQ$ as a diagonal. This property is clearly preserved by $f$.

	There are several reasons this argument fails on the torus: First, any two lines may intersect multiple, even infinitely many, times. Hence there is no hope of characterizing the midpoint as the unique intersection of two diagonals. And second, any two points are joined by infinitely many distinct lines. Therefore there is no way to talk about the diagonals of a parallellogram.

	In fact, these two geometric differences (existence of multiple intersections and multiple lines between points) will play a crucial role in the proof of Theorem \ref{thm:main}.\end{rmk}

	\begin{rmk} The standard affine structure on the torus is the unique Euclidean structure. However, there are other affine structures on the torus, both complete and incomplete. We refer to \cite{geomstruct} for more information. We do not know whether a similar characterization of affine maps holds for these other, non-Euclidean structures.\end{rmk}

Finally, let us mention some related questions in (pseudo-)Riemannian geometry. If $M$ is a smooth manifold, then two metrics $g_1$ and $g_2$ on $M$ are called \emph{geodesically equivalent} if they have the same geodesics (as sets). Of course if $M$ is a product, then scaling any factor will not affect the geodesics. Are any two geodesically equivalent metrics isometric up to scaling on factors?

This is of course false for spheres (any projective linear map preserves great circles), but Matveev essentially gave a positive answer for Riemannian manifolds with infinite fundamental group \cite{geodeq}: If $M$ admits two Riemannian metrics that are geodesically equivalent but not homothetic, and $\pi_1(M)$ is infinite, then $M$ supports a metric such that the universal cover of $M$ splits as a Riemannian product.

Of course Matveev's result makes no reference to maps that preserve geodesics. The related problem for maps has been considered with a regularity assumption, and has been called the ``Projective Lichnerowicz Conjecture" (PLC): First we say that a smooth map $f:M\rightarrow M$ of a closed (pseudo-)Riemannian manifold $M$ is \emph{affine} if $f$ preserves the Levi-Civita connection $\nabla$. Further $f$ is called \emph{projective} if $\nabla$ and $f^\ast\nabla$ have the same (unparametrized) geodesics. PLC then states that unless $M$ is covered by a round sphere, the group of affine transformations has finite index in the group of projective transformations.

For Riemannian manifolds, Zeghib has proven PLC \cite{zeghibPLC}. See also \cite{PLOC} for an earlier proof by Matveev of a variant of this conjecture. In view of these results, and Question \ref{q:genftag}, let us ask:

\begin{ques} Let $M$ be a closed nonpositively curved manifold of dimension $>1$ and let $\nabla$ be the Levi-Civita connection. Suppose $f:M\rightarrow M$ maps geodesics to geodesics (as sets). Is $f$ affine (i.e. smooth with $f^\ast \nabla=\nabla$)? \label{q:npc}\end{ques}

As far as we are aware, the answer to Question \ref{q:npc} is not known for any choice of $M$. Theorem \ref{thm:main} is of course a positive answer to Question \ref{q:npc} for the case that $M=T^n$ is a flat torus.

\subsection{Outline of the proof} Let $f:T^n\rightarrow T^n$ be a bijection preserving lines. The engine of the the proof is that $f$ preserves the number of intersections of two objects. A key observation is that affine geometry of $T^n$ allows for affine objects (lines, planes, etc.) to intersect in interesting ways (e.g. unlike in $\ensuremath{\mathbb{R}}^n$, lines can intersect multiple, even infinitely many, times).

In Section \ref{sec:planes}, we give a characterization of rational subtori in terms of intersections with lines. This is used to prove that $f$ maps rational subtori to rational subtori.

Then we start the proof of Theorem \ref{thm:main}. The proof is by induction on dimension, and the base case (i.e. dimension 2) is completed in Sections \ref{sec:q2dim} and \ref{sec:end2dim}. In Section \ref{sec:q2dim}, we start by recalling a characterization of the homology class of a rational line in terms of intersections with other lines. This allows us to associate to $f$ an induced map $A$ on $H_1(T^2)$, even though $f$ is not necessarily continuous. We regard $A$ as the linear model for $f$, and the rest of the section is devoted to proving $f=A$ (up to a translation) on the rational points $\ensuremath{\mathbb{Q}}^2\slash \ensuremath{\mathbb{Z}}^2$. In Section \ref{sec:end2dim}, we finish the proof by showing that $A^{-1}\circ f$ is given by a (group) isomorphism on each factor of $T^2$. We show this isomorphism lifts to a field automorphism of $\ensuremath{\mathbb{R}}$, and hence is trivial. This completes the proof of the 2-dimensional case

Finally in Section \ref{sec:ndim}, we use the base case and the fact that $f$ preserves rational subtori (proven in Section \ref{sec:planes}), to complete the proof in all dimensions.

\subsection{Notation} We will use the following notation for the rest of the paper. Let $n\geq 1$. Then $T=\ensuremath{\mathbb{R}}^n\slash\ensuremath{\mathbb{Z}}^n$ will be the standard affine $n$-torus. If $x\in\ensuremath{\mathbb{R}}^n$, then $[x]$ denotes the image of $x$ in $T$. Similarly, if $X\subseteq \ensuremath{\mathbb{R}}^n$ is any subset, then $[X]$ denotes the image of $X$ in $T$.

\subsection{Acknowledgments} WvL would like to thank Ralf Spatzier for interesting discussions on the geodesic equivalence problem, which sparked his interest in Question \ref{q:genftag}. In addition we would like to thank Kathryn Mann for conversations about the structure of homomorphisms of $S^1$. This work was completed as part of the REU program at the University of Michigan, for the duration of which JS was supported by NSF grant DMS-1045119. We would like to thank the organizers of the Michigan REU program for their efforts.

\section{Rational subtori are preserved}
\label{sec:planes}

\begin{dfn} Let $n\geq 1$ and $1\leq k\leq n$. Then a $k$-\emph{plane} $W$ in $T=\ensuremath{\mathbb{R}}^n\slash\ensuremath{\mathbb{Z}}^n$ is the image in $T$ of an affine $k$-dimensional subspace $V\subseteq \ensuremath{\mathbb{R}}^n$. Let $V_0$ be the translate of $V$ containing the origin. If $V_0$ is spanned by $V_0\cap \ensuremath{\mathbb{Q}}^n$, we say $W$ is \emph{rational}. In this case we also say $W$ is a \emph{rational subtorus} of dimension $k$. If $k=1$, we also say $W$ is a \emph{rational line}.\end{dfn}

The goal of this section is to show:

\begin{prop} Let $n\geq 2$ and $1\leq k\leq n$. Write $T=\ensuremath{\mathbb{R}}^n\slash\ensuremath{\mathbb{Z}}^n$ and let $f:T\to T$ be a bijection that maps lines to lines. Then the image under $f$ of any rational $k$-dimensional subtorus is again a rational $k$-dimensional subtorus.
\label{prop:qsub}
\end{prop}

For the rest of this section, we retain the notation of Proposition \ref{prop:qsub}. We start with the following criterion for subtori to be rational:

\begin{lem} Let $V$ be a plane in $T$. Then the following are equivalent:
\begin{enumerate}[(i)]
	\item $V$ is rational.
	\item $V$ is compact.
	\item Every rational line not contained in $V$ intersects $V$ at most finitely many times.
\end{enumerate}
\label{lem:qcrit}
\end{lem}

\begin{proof} The equivalence of (i) and (ii) is well-known. Let us prove (ii)$\implies$(iii). First suppose that $V$ is compact and let $\ell$ be any rational line not contained in $V$. If $\ell\cap V=\emptyset$, we are done. If $v_0\in \ell\cap V$, we can translate $\ell$ and $V$ by $-x_0$, so that we can assume without loss of generality that $\ell$ and $V$ intersect at 0. Then $\ell\cap V$ is a compact subgroup of $T$ and not equal to $\ell$. Because $\ell$ is 1-dimensional, any proper compact subgroup of $\ell$ is finite. This proves $\ell$ and $V$ intersect only finitely many times.

Finally we prove (iii)$\implies$(ii). Suppose that $V$ is not compact. Then $\overline{V}$ is a compact torus foliated by parallel copies of $V$. Let
	$$\psi:U\rightarrow \ensuremath{\mathbb{R}}^k\times \ensuremath{\mathbb{R}}^{n-k}$$
be a chart near $0\in T$ such that the slices $\ensuremath{\mathbb{R}}^k\times \{y\}, \, y\in \ensuremath{\mathbb{R}}^{n-k}$, correspond to the local leaves of the foliation. Since $V$ is dense in $\overline{V}$, there are infinitely many values of $y$ such that $\ensuremath{\mathbb{R}}^k\times y\subseteq \psi(V\cap U)$.

Now choose a rational line $\ell$ in $\overline{V}$ that is not contained in $V$ but with $0\in\ell$. If the neighborhood $U$ above is chosen sufficiently small, then $\psi(\ell\cap U)$ intersects all leaves $\ensuremath{\mathbb{R}}^k\times y$. Since there are infinitely many values of $y$ such that $\ensuremath{\mathbb{R}}^k\times y\subseteq \psi(V)$, it follows that $\ell\cap V$ is infinite. \end{proof}

Recall that we are trying to show that the image under $f$ of any rational subtorus is again a rational subtorus. We first show the image is a plane.

\begin{claim} Let $S$ be any rational subtorus of dimension $k$. Then $f(S)$ is a $k$-plane.
\label{claim:planes1}
\end{claim}

\begin{proof}
We induct on $k=\dim(S)$. The base case $k=1$ is just the assertion that $f$ maps lines to lines.

\par
Suppose now $k\geq 2$ and that the claim holds for $l$-planes where $l<k$, and let $S$ be a rational $k$-dimensional subtorus. Choose some $x_0\in S$ and  let $S_0:=S-x_0$ be the translate of $S$ passing through 0. Let $V_0\subseteq \ensuremath{\mathbb{R}}^n$ be the subspace that projects to $S_0$. Since $S$ is rational, we can choose a basis $v_1,\dots,v_k$ of $V$ with $v_i\in\ensuremath{\mathbb{Q}}^n$ for every $1\leq i\leq k$.

To use the inductive hypothesis, consider the $(k-1)$-plane
	$$V_{1}=\Span\{v_{1},...,v_{k-1}\}$$
and similarly $V_{2}=\Span\{v_{2},...,v_{k}\}$. For $i=1,2$, set $S_i:=[V_i+x_0]$. Since $v_i$ are rational vectors for each $i$, we clearly have that $S_1$ and $S_2$ are rational $(k-1)$-dimensional subtori. Also let $S_{12}:=S_1\cap S_2$ be the intersection, which is a $(k-2)$-dimensional rational subtorus. The inductive hypothesis implies that $f(S_1)$ and $f(S_2)$ and $f(S_{12})$ are all rational subtori of $T$.

Since $f(S_1)$ and $f(S_2)$ are $(k-1)$-planes that intersect in a $(k-2)$-plane, they span a $k$-dimensional plane. More precisely, let $W_1$ (resp. $W_2$) be the subspace of $\ensuremath{\mathbb{R}}^n$ that projects to $f(S_1)-f(x_0)$ (resp. $f(S_2)-f(x_0)$). Then $W_1$ and $W_2$ are $(k-1)$-dimensional subspaces of $\ensuremath{\mathbb{R}}^n$ that intersect in a $(k-2)$-dimensional subspace, and hence span a $k$-dimensional subspace $W_0$. Then the $k$-plane $W:=[W_0]+f(x_0)$ contains both $f(S_1)$ and $f(S_2)$.

We claim that $f(S)=W$. We start by showing the inclusion $f(S)\subseteq W$. Let $x\in S$. If $x\in S_1\cup S_2$, then clearly $f(x)\in W$, so we will assume that $x\in S$ but $x\notin S_1\cup S_2$.

	\begin{figure}[h]
		\centering
		\includegraphics[height=3in]{planes}
		\caption{A ball $B\subseteq S_2$ such that lines from $x$ to $B$ meet $S_1$.}
		\label{fig:isec}
	\end{figure}

Since $S_1$ and $S_2$ are closed codimension 1 submanifolds of $S$, there is an open ball $B\subseteq S_2$ such that for any $y\in B$, there is a line joining $x$ and $y$ that intersects $S_1$ (see Figure \ref{fig:isec}). Set $Y:=f(B)$. Since $f$ sends lines to lines and preserves intersections, $f(x)$ is a point with the property that for any $y\in Y$, there is a line $\ell_y$ joining $f(x)$ and $y$ that intersects $f(S_1)$. We claim that this implies that $f(x)\in W$.

Write $U_1:=f(S_1)-f(x_0)$ for the translate of $f(S_1)$ that passes through the origin. We can regard $U_1$ as a subgroup of $T$, and consider the projection
	$$\pi: T\rightarrow T\slash U_1.$$
The image $\pi(W)$ of $W$ is a line because $f(S_1)$ has codimension 1 in $W$. Further $\pi(f(x))$ is a point with the property that for any $y\in Y$, the line $\pi(\ell_y)$ joins the point $\pi(f(S_1))=\pi(f(x_0))$ and $\pi(f(x))$, and intersects $\pi(W)$ at the point $\pi(y)$.

Note that there are only countably many lines from $\pi(f(x_0))$ to $\pi(f(x))$, and unless one of them is contained in $\pi(W)$, each one has at most countably many intersections with the line $\pi(W)$. However, since $\pi(Y)$ is uncountable, we conclude that not every point $\pi(y)$ can lie on a line that passes through both $\pi(f(x_0))$ and $\pi(f(x))$, unless $\pi(f(x))\in \pi(W)$. Therefore we must have that $\pi(f(x))\in\pi(W)$, so that $f(x)\in W$. This proves that $f(S)\subseteq W$.

\par
To establish the reverse inclusion, we just apply the same argument to $f^{-1}$. The above argument then yields that $f^{-1}(W)\subseteq S$. Applying $f$ gives $W\subseteq f(S)$, as desired. \end{proof}

Actually the above proof also shows the following more technical statement, which basically states that linearly independent lines are mapped to linearly independent lines. We will not need this until Section \ref{sec:ndim}, but it is most convenient to state it here.

\begin{lem} Let $S=[V]$ be a rational subtorus containing 0, where $V\subseteq \ensuremath{\mathbb{R}}^n$ is a subspace. For $1\leq i\leq k:=\dim(S)$, let $v_i\in\ensuremath{\mathbb{Q}}^n$ such that $v_1,\dots,v_k$ is a basis for $V$. Set $\ell_i:=[\ensuremath{\mathbb{R}} v_i]$ and choose $w_i\in \ensuremath{\mathbb{Q}}^n$ such that $f(\ell_i)=[\ensuremath{\mathbb{R}} w_i]$. Then
	$$f(S)=[\Span(w_1,\dots,w_k)].$$
	\label{lem:span} \end{lem}
	\vspace{-.5cm}
\begin{proof} Recall that (with the notation of the proof of Claim \ref{claim:planes1}), we have
	$$W=\Span(w_1,\dots,w_k),$$
	and we have shown $f(S)=[W]$, as desired.
\end{proof}

It remains to show that if $S$ is a rational subtorus, then $f(S)$ is also rational. We first show this for $S$ of codimension 1.

\begin{claim}
\label{claim:qcodim1}
Let $S \subseteq T$ be a rational codimension 1 subtorus. Then $f(S)$ is also rational. \end{claim}

\begin{proof} Let $S\subseteq T$ be a codimension 1 rational subtorus and let $\ell$ be any rational line not contained in $S$. By Lemma \ref{lem:qcrit} applied to $S$, we see that $\ell\cap S$ is finite. Then $f(\ell)$ and $f(S)$ also intersect only finitely many times.

Suppose now that $f(S)$ is not rational. Then $\overline{f(S)}$ is a connected compact torus properly containing the codimension 1 plane $f(S)$, and therefore $\overline{f(S)}=T$, i.e. $f(S)$ is dense in $T$. But if $f(S)$ is dense, then it intersects any line that is not parallel to $S$ infinitely many times. We know that $f(\ell)$ is not parallel to $f(S)$, because $f(\ell)$ and $f(S)$ intersect at least once. On the other hand, $f(\ell)$ and $f(S)$ intersect finitely many times. This is a contradiction. \end{proof}

Finally we can finish the proof of Proposition \ref{prop:qsub}.

\begin{proof}[Proof of Proposition \ref{prop:qsub}] First note that if $S_1$ and $S_2$ are rational subtori, then any component of $S_1\cap S_2$ is also rational (e.g. by using that rationality is equivalent to compactness).

Now let $S$ be any rational subtorus of codimension $l$. Then we can choose $l$ rational codimension 1 subtori $S_1,\dots,S_l$ such that $S$ is a component of $\cap_i S_i$. Since $f$ is a bijection, we have
	$$f(S)\subseteq f\left(\bigcap_{1\leq i\leq l} S_i\right)=\bigcap_{1\leq i\leq l} f(S_i)$$
and by Claim \ref{claim:qcodim1}, we know that $f(S_i)$ are rational. Therefore $f(S)$ is a codimension $l$-plane contained in $\cap_i f(S_i)$. The components of $\cap_i f(S_i)$ have codimension $l$, so we must have that $f(S)$ is a component, and hence is rational.\end{proof}

\section{The 2-dimensional case: Affinity on rational points}
\label{sec:q2dim}

The goal of this section is to prove a rational version Theorem \ref{thm:main} in the two-dimensional case. More precisely, under the assumptions of Theorem \ref{thm:main}, we will prove that there is a linear automorphism $A$ of $T^2$ such that, up to a translation of $T^2$, we have $f=A$ on $\ensuremath{\mathbb{Q}}^2\slash\ensuremath{\mathbb{Z}}^2$. In the next section, we will complete the proof of the two-dimensional case by proving that, up to a translation, $f=A$ on all of $T^2$.

We start by recalling the following elementary computation of the number of intersections of a pair of rational lines.

\begin{prop} Let $\ell_1$ and $\ell_2$ be two affine rational lines in the torus. For $i=1,2$, let $v_i \in \ensuremath{\mathbb{Z}}^2$ be a primitive tangent vector to the translate of $\ell_i$ passing through $0\in T^2$. Then the number of intersections of $\ell_1$ and $\ell_2$ is given by
	$$|\ell_1\cap \ell_2|= \left| \det\begin{pmatrix}
| & | \\
v_1 & v_2 \\
| & |
 \end{pmatrix}\right|.$$
 \label{prop:inr}
 \end{prop}

We now turn towards proving Theorem \ref{thm:main} in the two-dimensional case. For the rest of this section, suppose $f: T^2\to T^2$ is a bijection that maps lines to lines. Also let us fix the following notation: For $i=1,2$, set $\ell_i:=\begin{bmatrix} \ensuremath{\mathbb{R}} e_i\end{bmatrix}$. We first make some initial reductions: By replacing $f$ with
	$$x\mapsto f(x)-f(0),$$
we can assume that $f(0)=0$. For the next reduction, we need the following claim.

\begin{claim} There is a linear automorphism $A:T^2\rightarrow T^2$ such that $A \ell_i = f(\ell_i)$.\label{claim:reduct}\end{claim}
\begin{proof} Since $f(0)=0$, the lines $f(\ell_i)$ pass through 0. In addition, because $\ell_i$ are rational, so are $f(\ell_i)$ (see Proposition \ref{prop:qsub}). Therefore there are coprime integers $p_i$ and $q_i$ such that
	$$f(\ell_i)=\begin{bmatrix}\ensuremath{\mathbb{R}} \begin{pmatrix} p_i \\ q_i\end{pmatrix}\end{bmatrix}.$$
Note that $\ell_1$ and $\ell_2$ intersect exactly once, and hence so do $f(\ell_1)$ and $f(\ell_2)$. By Proposition \ref{prop:inr}, the number of intersections is also given by
	$$|f(\ell_1)\cap f(\ell_2)|=\left| \det\begin{pmatrix} p_1 & p_2 \\ q_1 & q_2\end{pmatrix}\right|,$$
so the linear transformation $A:T^2\rightarrow T^2$ with matrix
	$$A=\begin{pmatrix} p_1 & p_2 \\ q_1 & q_2 \end{pmatrix}$$
is an automorphism, and clearly satisfies $A\ell_i = f(\ell_i)$.\end{proof}

Let $A$ be as in Claim \ref{claim:reduct}. Then by replacing $f$ by $A^{-1}\circ f$, we can assume that $f(\ell_i)=\ell_i$ for $i=1,2$. Note that because each $v_i$ is only unique up to sign, the matrix $A$ is not canonically associated to $f$. Therefore we cannot expect that $A^{-1}\circ f=\text{id}$, and we have to make one further reduction to deal with the ambiguity in the definition of $A$. Let us introduce the following notation: For a rational line $\ell=\begin{bmatrix}\ensuremath{\mathbb{R}}\begin{pmatrix} p \\ q\end{pmatrix}\end{bmatrix}$, let \reflectbox{\rotatebox[origin=c]{180}{$\ell$}} \, be the line obtained by reflecting $\ell$ in the $x$-axis, i.e. \reflectbox{\rotatebox[origin=c]{180}{$\ell$}}\,=$\begin{bmatrix} \ensuremath{\mathbb{R}} \begin{pmatrix} p \\ -q\end{pmatrix} \end{bmatrix}$.
 \begin{claim}
\label{claim:alt}
 Let $\ell$ be a rational line in $T^2$ passing through the origin. Then $f(\ell)=\ell$ or $f(\ell)=\reflectbox{\rotatebox[origin=c]{180}{$\ell$}}$.
  \end{claim}

\begin{proof} Let $p,q$ be coprime integers such that $\ell=\begin{bmatrix} \ensuremath{\mathbb{R}}\begin{pmatrix} p \\ q\end{pmatrix} \end{bmatrix}$. Also choose coprime integers $r,s$ such that $f(\ell)=\begin{bmatrix}\ensuremath{\mathbb{R}}\begin{pmatrix} r\\ s\end{pmatrix}\end{bmatrix}$. We can compute $p,q,r,s$ as suitable intersection numbers. Indeed, we have
	$$|p|=\left| \det\begin{pmatrix}
p & 0 \\ q & 1
 \end{pmatrix}\right| = |\ell\cap \ell_2|.$$

 Since $f(\ell_2)=\ell_2$ and $f$ preserves the number of intersections of a pair of lines, we see that
 	$$|p|=|\ell\cap \ell_2|=|f(\ell)\cap \ell_2| = |r|,$$
and similarly $|q|=|s|$. Therefore we find that
	$$\ensuremath{\mathbb{R}} \begin{pmatrix} p \\ q\end{pmatrix} = \ensuremath{\mathbb{R}} \begin{pmatrix} r \\ s \end{pmatrix} \hspace{1 cm} \text{or} \hspace{1 cm} \ensuremath{\mathbb{R}} \begin{pmatrix} p \\ -q\end{pmatrix} = \ensuremath{\mathbb{R}}\begin{pmatrix} r \\ s \end{pmatrix},$$
	which exactly corresponds to $\ell=f(\ell)$ or $\reflectbox{\rotatebox[origin=c]{180}{$\ell$}}=f(\ell)$.\end{proof}
We will now show that whichever of the two alternatives of Claim \ref{claim:alt} occurs does not depend on the line $\ell$ chosen.
\begin{claim}
\label{claim:onlyone} Let $\ell$ be a rational line passing through the origin that is neither horizontal nor vertical (i.e. $\ell\neq \ell_i$ for $i=1,2$). Suppose that $f(\ell)=\ell$. Then for any rational line $m$ passing through the origin, we have $f(m)=m$.
\end{claim}

\begin{proof} Let $p,q$ coprime integers such that $\ell=\begin{bmatrix}\ensuremath{\mathbb{R}}\begin{pmatrix} p \\ q\end{pmatrix}\end{bmatrix}$. Since $\ell$ is neither vertical nor horizontal, we know that $p$ and $q$ are nonzero.

Now let $m$ be any other rational line, and choose coprime integers $r,s$ such that $m=\begin{bmatrix}\ensuremath{\mathbb{R}} \begin{pmatrix} r\\ s\end{pmatrix}\end{bmatrix}$. The number of intersections of $\ell$ and $m$ is given by
	$$|\ell\cap m| = \left| \det \begin{pmatrix} p & r \\ q & s\end{pmatrix}\right| = |ps-qr|.$$
We will argue by contradiction, so suppose that $f(m)\neq m$. Using the other alternative of Claim \ref{claim:alt} for $m$, we have that
	$$|f(\ell)\cap f(m)|= \left| \det \begin{pmatrix} p & r \\ q & -s\end{pmatrix}\right| = |ps+qr|.$$
Since $f$ preserves the number of intersections, we therefore have
	$$|ps-qr|=|ps+qr|$$
which can only happen if $ps=0$ or $qr=0$. Since we know that $p$ and $q$ are nonzero, we must have $r=0$ or $s=0$. This means that $m$ is horizontal or vertical,  but in those cases the alternatives provided by Claim \ref{claim:alt} coincide. \end{proof}

We can now make the final reduction: If $f(\ell)=\ell$ for any rational line $\ell$, then we leave $f$ as is. In the other case, i.e. $f(\ell)=\reflectbox{\rotatebox[origin=c]{180}{$\ell$}}$ for any rational line $\ell$, we replace $f$ by
	$$\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \circ f,$$
after which we have $f(\ell)=\ell$ for any rational line $\ell$ passing through the origin. After making these initial reductions, our goal is now to prove that $f=\text{id}$ on the rational points $\ensuremath{\mathbb{Q}}^2\slash \ensuremath{\mathbb{Z}}^2$. We start with the following easy observation:

\begin{claim} \label{claim:||} If $\ell$ and $m$ are parallel lines in $T$, then $f(\ell)$ and $f(m)$ are also parallel.\end{claim}
\begin{proof} Since $\dim(T)=2$, two lines in $T$ are parallel if and only if they do not intersect. This property is obviously preserved by $f$.\end{proof}
Combining our reductions on $f$ so far with Claim \ref{claim:||} yields the following quite useful property for $f$: Given any rational line $\ell$, the line $f(\ell)$ is parallel to $\ell$. However, we still do not know the behavior of $f$ in the direction of $\ell$ or transverse to $\ell$. In particular we do not know
	\begin{itemize}
		\item whether or not $f$ leaves invariant every line $\ell$; we only know this for $\ell$ passing through the origin, and
		\item whether or not $f=\text{id}$ on rational lines $\ell$ passing through the origin.
	\end{itemize}
We can now prove:
\begin{thm}
\label{theorem:rationals}
For any rational point $x\in \mathbb{Q}^2/\mathbb{Z}^2 $ we have $f(x)=x$.
\end{thm}

\begin{proof} For $n>2$, set
	$$G_{n}=\begin{bmatrix} \dfrac{1}{n} \, \ensuremath{\mathbb{Z}}^2\end{bmatrix}.$$
Clearly we have $\ensuremath{\mathbb{Q}}^2\slash\ensuremath{\mathbb{Z}}^2=\cup_n G_n$, so it suffices to show that $f=\text{id}$ on $G_n$ for every $n> 2$. We purposefully exclude the case $n=2$ because $G_2$ only consists of 4 points, and this is not enough for the argument below. However, since we have $G_2\subseteq G_6$, this does not cause any problems. Fix $n\geq 2$.

Set $Q:=\begin{bmatrix} \dfrac{1}{n}\begin{pmatrix} 1 \\ 1\end{pmatrix}\end{bmatrix}.$

\begin{claim} If $f(Q)=Q$, then $f=\text{id}$ on $G_n$. \label{claim:fqq} \end{claim}
\begin{proof} Suppose that $x=\begin{bmatrix} x_1 \\ y_1 \end{bmatrix}$ is any point of $G_n$ with $f(x)\neq x$. We can choose $x_1$ and $y_1$ that lie in $[0,1)$. We will show that $f(Q)\neq Q$.

Let $x_2, y_2\in [0,1)$ be such that $f(x)=\begin{bmatrix} x_2 \\ y_2\end{bmatrix}$. Then there are two cases: Either $x_1\neq x_2$ or $y_1\neq y_2$. Clearly the entire setup is symmetric in the two coordinates, so we will just consider the case $x_1\neq x_2$. See Figure \ref{fig:grids} for an illustration of the various lines introduced below.

For $a\in[0,1)$, let $v_a$ (resp. $h_a$) denote the vertical (resp. horizontal) line $\begin{bmatrix} x=a\end{bmatrix}$ (resp. $\begin{bmatrix} y=a\end{bmatrix}$). Since $f$ maps parallel lines to parallel lines by Claim \ref{claim:||} and $f(\ell_i)=\ell_i$ by assumption, we know that $f$ maps vertical (resp. horizontal) lines to vertical (resp. horizontal) lines. In particular we have that $f(v_{x_1})=v_{x_2}$ and $f(h_{y_1})=h_{y_2}$. We will show that $f(Q)\neq Q$ by showing that $f(h_{1/n}) \neq h_{1/n}$.

\begin{figure}[h]
		\centering
		\includegraphics[height=3in]{grids}
		\caption{Illustration of the proof of Claim \ref{claim:fqq}. The points in \textcolor{aqua}{aqua} are the possibilities for $f(z)$. The proof amounts to showing all of these lie at different heights than $z$ does.}
		\label{fig:grids}
	\end{figure}

Consider the point $z:=\begin{bmatrix}  x_1 , \dfrac{1}{n} \end{bmatrix}\in T^2$. Since $x \in G_n$, there is an integer $0\leq a<n$ such that $x_1 = \dfrac{a}{n}$. First note that $a>0$: For if $a=0$, then $x\in \ell_2$. Since $f(\ell_2)=\ell_2$, we see that $x_2=0$ as well. This contradicts the initial assumption that $x_1\neq x_2$.

Since $a>0$, $z$ lies on the line $\ell$ of slope $\dfrac{1}{a}$ going through the origin. By Claim \ref{claim:onlyone} we have $f(\ell)=\ell$, so $f(z)\in\ell$.

In addition, since $z\in v_{x_1}$, we have $f(z)\in v_{x_2}$. An easy computation yields
	$$\ell\cap v_{x_2} = \begin{bmatrix} x_2 \\ \frac{x_2}{a} \end{bmatrix} + \frac{1}{a}\begin{bmatrix} 0 \\ \ensuremath{\mathbb{Z}}\end{bmatrix}.$$
Therefore we automatically have $f(h_{\frac{1}{n}})\neq h_{\frac{1}{n}}$ unless
	$$\frac{1}{a} x_2 + \frac{k}{a} \equiv \frac{1}{n} \mod \ensuremath{\mathbb{Z}}$$
for some integer $k$ with $0\leq k<a$. Solving for $k$ yields
	$$k\equiv \frac{a}{n}-x_2 \mod a\ensuremath{\mathbb{Z}}.$$
Since $0\leq k<a$ and $0<a<n$ and $0\leq x_2<1$, we see that the only option is that $k=0$. Hence $x_2\equiv \frac{a}{n}\equiv x_1\mod \ensuremath{\mathbb{Z}}$, which contradicts our initial assumption that $x_1\neq x_2$.
\end{proof}

It remains to show that $f(Q)=Q$. Consider the points $P, R, S$ as shown in Figure \ref{fig:quad}. Let us give a brief sketch of the idea so that the subsequent algebraic manipulations are more transparent.

\begin{figure}[h]
		\centering
		\includegraphics[height=3in]{quad}
		\caption{Quadrilateral in $T^2$ with vertices $P,Q,R,S$.}
		\label{fig:quad}
	\end{figure}

Because $P$ and $Q$ lie on a vertical line, and $f$ maps vertical lines to vertical lines, $f(P)$ and $f(Q)$ have to lie on the same vertical line. Because $P$ lies on the line of slope $n-1$ through the origin, $f(P)$ also has to lie on this line. Therefore however much $P$ and $f(P)$ differ in the horizontal direction determines how much they differ in the vertical direction. Finally since $P$ and $S$ lie on a horizontal line, the vertical difference between $P$ and $f(P)$ equals the vertical difference between $S$ and $f(S)$. The upshot of this is that any difference between $Q$ and $f(Q)$ translates into information about the vertical difference between $S$ and $f(S)$.

The same reasoning with $P$ replaced by $R$ yields information about the horizontal difference between $S$ and $f(S)$. Finally because $S$ lies on a line of slope 1 through the origin, any horizontal difference between $S$ and $f(S)$ matches the vertical difference. Therefore the information gained about the difference between $S$ and $f(S)$ using the two methods (once using $P$ and once using $R$) has to match. We will see that this forces $Q=f(Q)$.

Let us now carry out the calculations. Choose $\delta \in \left(\dfrac{-1}{n},\dfrac{n-1}{n}\right)$ such that
	$$f(v_{\frac{1}{n}})=v_{\frac{1}{n}}+\begin{bmatrix} \delta \\ 0\end{bmatrix},$$
so that $f(P)$ and $f(Q)$ have first coordinate $\frac{1}{n}+\delta$.  Note that the boundary cases $\delta=-\frac{1}{n}$ and $\delta=\frac{n-1}{n}$ are impossible since these correspond to $f(v_{\frac{1}{n}})=\ell_2$. Since $Q$ lies on the line of slope $1$ through the origin, we have
	\begin{equation} f(Q)=
	\begingroup
		\renewcommand*{\arraystretch}{2}
		\begin{bmatrix} \dfrac{1}{n}+\delta \\ \dfrac{1}{n}+\delta\end{bmatrix}
	\endgroup
 	\end{equation}
Since $P$ lies on the line of slope $n-1$ through the origin, there is some integer $k_P$ such that
	\begin{equation} f(P)=
		\begingroup
			\renewcommand*{\arraystretch}{2}
			\begin{bmatrix} \dfrac{1}{n}+\delta \\ \dfrac{n-1}{n}+\delta(n-1)-k_P\end{bmatrix}.
		\endgroup
		\label{eq:fp}
	\end{equation}
Here we can choose $k_P$ such that
	$$0\leq \frac{n-1}{n}+\delta(n-1)-k_P < 1.$$
Using that $R$ lies on the line of slope $\frac{1}{n-1}$ through the origin, we similarly find an integer $k_R$ such that
	$$f(R)=
		\begingroup
			\renewcommand*{\arraystretch}{2}
			\begin{bmatrix} \dfrac{n-1}{n}+\dfrac{\delta}{n-1}-k_R \\ \dfrac{1}{n}+\delta \end{bmatrix}.
		\endgroup
	$$
Finally, using that $S$ lies on the same horizontal line as $P$, and on the same vertical line as $R$, we find
	\begin{equation} f(S)=
		\begingroup
			\renewcommand*{\arraystretch}{2}
			\begin{bmatrix} \dfrac{n-1}{n}+\dfrac{\delta}{n-1}-k_R \\ \dfrac{n-1}{n}+\delta(n-1)-k_P\end{bmatrix}.
		\endgroup
		\label{eq:fs}
	\end{equation}
Since $S$ lies on the line of slope 1 through the origin, so does $f(S)$. Setting the two coordinates of $f(S)$ given by Equation \ref{eq:fs} equal to each other, we find (after some simple algebraic manipulations):
	\begin{equation} k_P - k_R = \delta\left(n-1-\dfrac{1}{n-1}\right). \label{eq:rel} \end{equation}
We can obtain one more equation relating $k_P$ and $\delta$ by noting that $P$ lies on the line of slope $-1$ through the origin, and hence so must $f(P)$. This means that $f(P)$ is of the form $(x,1-x)$. Using Equation \ref{eq:fp}, this gives after some algebraic manipulations:
	\begin{equation} k_P=n\delta \label{eq:kpd}\end{equation}
We can use Equation \ref{eq:kpd} to eliminate $k_P$ from Equation \ref{eq:rel} to obtain:
	\begin{equation} k_R = \delta\left(1+\frac{1}{n-1}\right). \label{eq:krd}\end{equation}
Using that
	$$-\frac{1}{n}<\delta<\frac{n-1}{n},$$
and $n>2$ one easily sees that
	$$-1<k_R<1.$$
Since $k_R$ is also an integer, this forces $k_R=0$. Combining this with Equation \ref{eq:krd}, we see that $\delta=0$. Therefore $f(Q)=Q$, as desired.\end{proof}
This finishes the proof that $f$ is affine on $\ensuremath{\mathbb{Q}}^2\slash\ensuremath{\mathbb{Z}}^2$. In the next section, we will promote this to the entire torus.

\section{The 2-dimensional case: End of the proof}
\label{sec:end2dim}

At this point we know that the map $f:T^2\to T^2$ is a bijection sending lines to lines, with the additional properties that
	\begin{itemize}
		\item $f=\text{id}$ on $\ensuremath{\mathbb{Q}}^2\slash\ensuremath{\mathbb{Z}}^2$,
		\item if $\ell$ is a line with rational slope $\alpha$, then $f(\ell)$ is also a line with slope $\alpha$, and
		\item if $\ell$ has irrational slope, then so does $f(\ell)$.
	\end{itemize}
In this section we will prove that $f=\text{id}$ on all of $T^2$. We start with the following observation. Write $T^2=S^1\times S^1$ and for $x,y\in S^1$, write
	$$f(x,y)=(f_1(x,y),f_2(x,y)).$$
Since $f$ maps vertical lines to vertical lines, the value of $f_1(x,y)$ does not depend on $y$. Similarly, the value of $f_2(x,y)$ does not depend on $x$. Hence for $i=1,2$, there are functions $f_i:S^1\to S^1$ such that
	$$f(x,y)=(f_1(x),f_2(y)).$$
We actually have $f_1=f_2$: Indeed, for any $x\in S^1$, consider the point $p:=(x,x)\in T^2$. Since $p$ lies on the line of slope 1 through the origin, so does $f(p)=(f_1(x),f_2(x))$. Hence $f_1=f_2$. We will write $\sigma:S^1\to S^1$ for this map, so that
	$$f(x,y)=(\sigma(x),\sigma(y))$$
for any $x,y\in S^1$.

Let us now outline the proof that $f=\text{id}$. We first show that $\sigma$ is a homomorphism $S^1\to S^1$ (Claim \ref{claim:hom}), and then that $\sigma$ lifts to a map $\widetilde{\sigma}:\ensuremath{\mathbb{R}}\to\ensuremath{\mathbb{R}}$ (Claim \ref{claim:lift}). We finish the proof by showing that $\widetilde{\sigma}$ is a field automorphism of $\ensuremath{\mathbb{R}}$ and hence trivial (Claims \ref{claim:tildehomog}-\ref{claim:mult}).

We start with the observation that besides collinearity of points, $f$ preserves another geometric configuration:
	\begin{dfn} A set of 4 points in $T^2$ is a \emph{block} $B$ if the points are the vertices of a square all of whose sides are either horizontal or vertical, i.e. if we can label the points $P,Q,R,S$ such that
		\begin{itemize}
			\item $P$ and $Q$ lie on a horizontal line $h_{x_0}$, and $R$ and $S$ lie on a horizontal line $h_{x_1}$,
			\item $P$ and $R$ lie on a vertical line $v_{x_0}$, and $Q$ and $S$ lie on a vertical line $v_{x_1}$, and
			\item $P$ and $S$ lie on a line of slope 1, and $Q$ and $R$ lie on a line of slope -1.
		\end{itemize}
			\label{dfn:block}
		\end{dfn}
It is immediate from the fact that $f$ preserves horizontal lines, vertical lines, and lines of slope $\pm 1$, that $f$ preserves blocks. If $B$ is a block, we will denote the block obtained by applying $f$ to the vertices of $B$ by $f(B)$. We have the following useful characterization of blocks:
\begin{lem} Let  $x_0,x_1,y_0,y_1\in S^1$. Then the points $(x_i,y_j)$ where $i,j\in \{1,2\}$ form a block if and only if either
	\begin{enumerate}[(1)]
		\item $x_1-x_0=y_1-y_0$, or
		\item $x_1-x_0=y_0-y_1$.
	\end{enumerate}
	\label{lem:blockcrit}
\end{lem}
\begin{proof} To be done.\end{proof}
We have the following application of this characterization.
\begin{claim} \label{claim:hom} $\sigma:S^1\to S^1$ is a (group) isomorphism. \end{claim}
\begin{proof} Since $\sigma(0)=0$, it suffices to show that $\sigma(x+y)=\sigma(x)+\sigma(y)$ for all $x,y\in S^1$. We will first show that this holds if $y$ is rational. Consider the block $B$ consisting of the vertices $(0,y),(0,x+y), (x,y),$ and $(x,x+y)$. The two alternatives of Lemma \ref{lem:blockcrit} applied to the block $f(B)$ yield
	\begin{enumerate}[(1)]
		\item $\sigma(x)=\sigma(x+y)-\sigma(y),$ or
		\item $\sigma(x)=\sigma(y)-\sigma(x+y).$
	\end{enumerate}
If (1) holds we are done. If (2) holds we reverse the roles of $x,y$ (note that we have not used yet that $y$ is rational). Again we obtain either $\sigma(y)=\sigma(x+y)-\sigma(x)$, in which case we are done, or $\sigma(y)=\sigma(x)-\sigma(x+y)$. If the latter holds, we find that $2(\sigma(x)-\sigma(y))=0$, so that either $\sigma(x)=\sigma(y)$ or $\sigma(x)=\sigma(y)+\frac{1}{2}$. In either case, using that $y=\sigma(y)$ is rational, we see that $\sigma(x)$ is rational as well, and hence we have $x=\sigma(x)$. This finishes the proof under the additional assumption that $y$ is rational.

We will now show that $\sigma(x+y)=\sigma(x)+\sigma(y)$ for all $x,y$. Note that we only used that $y$ is rational in the above argument to deal with the final two cases, where either $\sigma(x)=\sigma(y)$ or $\sigma(x)=\sigma(y)+\frac{1}{2}$. We consider these two cases separately.

\subsection*{Case 1} ($\sigma(x)=\sigma(y)$): Since $\sigma$ is a bijection, we have $x=y$. Consider the block $B$ with vertices $(0,x),(x,x),(0,2x),(x,2x)$. The two alternatives of Lemma \ref{lem:blockcrit} for the block $f(B)$ yield that either
	\begin{enumerate}[(1)]
		\item $\sigma(x)=\sigma(2x)-\sigma(x)$, or
		\item $\sigma(x)=\sigma(x)-\sigma(2x).$
	\end{enumerate}
	In the first case we obtain that $\sigma(2x)=2\sigma(x)$, so that
		$$\sigma(x+y)=\sigma(2x)=2\sigma(x)=\sigma(x)+\sigma(y).$$
	If (2) holds, we have that $\sigma(2x)=0$ and hence $2x=0$, so that $x$ is rational (in which case the claim is already proven).

\subsection*{Case 2} ($\sigma(x)=\sigma(y)+\frac{1}{2}$): In this case we had
	$$\sigma(x+y)=\sigma(x)-\sigma(y)=\frac{1}{2}.$$
Now by using that $\sigma$ is additive if one of the variables is rational, we see that
	$$\sigma(x)=\sigma(y)+\frac{1}{2}=\sigma\left(y+\frac{1}{2}\right).$$
Since $\sigma$ is a bijection, we must have $x=y+\frac{1}{2}$. Hence
	\begin{align*}
	\sigma(x+y)	&=\sigma\left(2y+\frac{1}{2}\right)=\sigma(2y)+\frac{1}{2}\\
				&=2\sigma(y)+\frac{1}{2}=\sigma\left(y+\frac{1}{2}\right)+\sigma(y)\\
				&=\sigma(x)+\sigma(y),
	\end{align*}
where on the second line we also use that $\sigma(2z)=2\sigma(z)$ for all $z$, which was proven in the solution of Case 1. This completes the proof.\end{proof}

For the remainder of this section, we introduce the following notation: If $\alpha\in \ensuremath{\mathbb{R}}$, let $\ell_\alpha$ be the line in $T^2$ of slope $\alpha$ through 0. Also recall that $h_\alpha$ (resp. $v_\alpha$) denotes the horizontal line $[y=\alpha]$ (resp. the vertical line $[x=\alpha]$). We use the homomorphism property of $\sigma$ to provide a link between the $\sigma$ and the image under $f$ of any line:
	\begin{claim} \label{claim:lift} Let $x_0\in \ensuremath{\mathbb{R}}$ and let $y_0$ be the slope of $f(\ell)$. Then $y_0\equiv \sigma(x_0)\mod \ensuremath{\mathbb{Z}}$.\end{claim}
\begin{proof} Consider the intersections of $\ell$ with the line $v_0:=[x=0]$. We have
		$$\ell\cap v_0=\{[0,k x_0]\mid k\in\ensuremath{\mathbb{Z}}\}.$$
	Let $f(\ell)$ have slope $y_0$. Then $[0,\sigma(x_0)]\in f(\ell)\cap v_0$, so we can write
		$$\sigma(x_0)=ky_0 \mod \ensuremath{\mathbb{Z}}$$
	for some $k\in \ensuremath{\mathbb{Z}}$. On the other hand $[0,y_0]\in f(\ell)\cap v_0=f(\ell\cap v_0)$, so there exists $l\in \ensuremath{\mathbb{Z}}$ such that $y_0\equiv l\sigma(x_0)$ mod $\ensuremath{\mathbb{Z}}$. Hence we have
		$$y_0\equiv l\sigma(x_0)\equiv lk y_0 \mod \ensuremath{\mathbb{Z}}.$$
	Since images under $f$ of lines with irrational slope are irrational, and $x_0$ is irrational, we must have that $y_0$ is irrational. Therefore we have $lk=1$, so that $l=\pm 1$.

	It remains to show that $k=1$. Suppose not, so that we have $y_0\equiv -\sigma(x_0)\mod \ensuremath{\mathbb{Z}}$. Write $y_0=-\sigma(x_0)+k_0$ for some $k_0\in \ensuremath{\mathbb{Z}}$. Consider the intersections of $\ell$ with the line $v_{\frac{1}{3}}$. These occur at the points $[\frac{1}{3},\frac{1}{3}x_0+l x_0]$ for $l\in \ensuremath{\mathbb{Z}}$. Now application of $f$ maps these points to intersections of $f(\ell)$ and $v_{\frac{1}{3}}$, which are given by $[\frac{1}{3},\frac{1}{3}y_0+l y_0]$ for $l\in \ensuremath{\mathbb{Z}}$. Consider the image of the point $[\frac{1}{3},\frac{1}{3}x_0]\in \ell\cap v_{\frac{1}{3}}$. Then we can write
		$$\sigma\left(\frac{1}{3}x_0\right)\equiv \frac{1}{3}y_0+k_3 y_0\mod \ensuremath{\mathbb{Z}}$$
	for some $k_3\in \ensuremath{\mathbb{Z}}$. Now using that $y_0=-\sigma(x_0)+k_0$, we have
		$$\sigma\left(\frac{1}{3}x_0\right)\equiv -\frac{1}{3}\sigma(x_0)+\frac{k_0}{3}+k_3\sigma(x_0) \mod \ensuremath{\mathbb{Z}}.$$
	Hence
		$$\sigma(x_0)\equiv 3\sigma\left(\frac{1}{3}x_0\right)\equiv (3k_3-1)\sigma(x_0)\mod \ensuremath{\mathbb{Z}}.$$
	Since $\sigma(x_0)\notin\ensuremath{\mathbb{Q}}$, we must have $3k_3-1=1$, which is a contradiction.
	\end{proof}
	Consider now the map
		$$\widetilde{\sigma}:\ensuremath{\mathbb{R}}\to\ensuremath{\mathbb{R}}$$
	defined by $\widetilde{\sigma}(x_0):=y_0$, where the image under $f$ of a line with slope $x_0$ has slope $y_0$. The claim above establishes that $\widetilde{\sigma}$ is a lift of the map $\sigma:S^1\to S^1$. In the claims below we will establish that $\widetilde{\sigma}$ is a field automorphism of $\ensuremath{\mathbb{R}}$ and hence $\widetilde{\sigma}=\text{id}$.
		\begin{claim} For any integer $a$ and $x\in \ensuremath{\mathbb{R}}$, we have $\widetilde{\sigma}(ax)=a\widetilde{\sigma}(x)$. \label{claim:tildehomog}\end{claim}
		\begin{proof} Let $a\in \ensuremath{\mathbb{Z}}$ and $x_0\in \ensuremath{\mathbb{R}}$. If $x_0$ is rational then the claim is already proven, so we will assume that $x_0$ is irrational. Since we have
			$$\widetilde{\sigma}(ax_0)\equiv \sigma(ax_0)\equiv a\sigma(x_0)\equiv a\widetilde{\sigma}(x_0) \mod \ensuremath{\mathbb{Z}},$$
		we can choose $k\in\ensuremath{\mathbb{Z}}$ such that $\widetilde{\sigma}(ax_0)=a\widetilde{\sigma}(x_0)+k$. Choose $p>1$ prime and let $\ell_{ax_0}$ be the line in $T^2$ through 0 with slope $ax_0$. The intersections of $\ell_{ax_0}$ and $v_{\frac{1}{p}}$ occur at heights $\frac{a}{p}x_0+a\ensuremath{\mathbb{Z}} x_0$ mod $\ensuremath{\mathbb{Z}}$. Under $f$ these are bijectively mapped to the intersections of $v_{\frac{1}{p}}$ and $\ell_{\widetilde{\sigma}(ax_0)}$, which occur at heights $\frac{1}{p}\widetilde{\sigma}(ax_0)+\ensuremath{\mathbb{Z}}\widetilde{\sigma}(ax_0)$. In particular there exists $l\in \ensuremath{\mathbb{Z}}$ such that
		\begin{equation} \sigma\left(\frac{a}{p}x_0+lax_0\right)\equiv \frac{1}{p}\widetilde{\sigma}(ax_0)\mod \ensuremath{\mathbb{Z}}. \label{eq:relmod} \end{equation}
For the left-hand side we have
		\begin{equation}\sigma\left(\frac{a}{p}x_0+lax_0\right)\equiv a \sigma\left(\frac{1}{p}x_0+lx_0\right)\mod \ensuremath{\mathbb{Z}}.\label{eq:homog}\end{equation}
Note that $[\frac{1}{p},\frac{1}{p}x_0+lx_0]$ is an intersection point of $\ell_{x_0}$ and $v_{\frac{1}{p}}$ so that $[\frac{1}{p},\sigma(\frac{1}{p}x_0+lx_0)]$ is an intersection point of $\ell_{\widetilde{\sigma}(x_0)}$ and $v_{\frac{1}{p}}$. Hence there exists $n\in\ensuremath{\mathbb{Z}}$ such that
	\begin{equation}\sigma\left(\frac{1}{p}x_0+lx_0\right)\equiv \frac{1}{p}\widetilde{\sigma}(x_0)+n\widetilde{\sigma}(x_0)\mod \ensuremath{\mathbb{Z}}.\label{eq:isect}\end{equation}
Combining Equations \ref{eq:relmod}, \ref{eq:homog} and \ref{eq:isect}, we see that
		$$\frac{a}{p}\widetilde{\sigma}(x_0)+an\widetilde{\sigma}(x_0)\equiv \frac{1}{p}\widetilde{\sigma}(ax_0) \mod \ensuremath{\mathbb{Z}}.$$
Further using that $\widetilde{\sigma}(ax_0)=a\widetilde{\sigma}(x_0)+k$, we have
		$$\frac{a}{p}\widetilde{\sigma}(x_0)+an\widetilde{\sigma}(x_0)\equiv \frac{a}{p}\widetilde{\sigma}(x_0)+\frac{k}{p} \mod\ensuremath{\mathbb{Z}},$$
	so that
		$$an\widetilde{\sigma}(x_0)\equiv \frac{k}{p}\mod \ensuremath{\mathbb{Z}}.$$
Because $\widetilde{\sigma}(x_0)$ is irrational, this is impossible unless $an=0$ and $\frac{k}{p}\in \ensuremath{\mathbb{Z}}$. Since $p$ was an arbitrary prime number, we must have $k=0$.
		\end{proof}
		\begin{claim} $\widetilde{\sigma}$ is a homomorphism of $\ensuremath{\mathbb{R}}$ (as an additive group).
		\label{claim:tildehom}
		\end{claim}
		\begin{proof} The previous claim with $a=-1$ shows that $\widetilde{\sigma}(-x)=-\widetilde{\sigma}(x)$.  Therefore it remains to show that $\widetilde{\sigma}$ is additive. Let $x,y\in \ensuremath{\mathbb{R}}$ be arbitrary. Since $\widetilde{\sigma}$ is a lift of $\sigma$, we have for any $n\geq 1$:
		\begin{align*}
			\widetilde{\sigma}\left(\frac{x+y}{n}\right)&\equiv \sigma\left(\frac{x}{n}+\frac{y}{n}\right)\\
											&\equiv \sigma\left(\frac{x}{n}\right)+\sigma\left(\frac{y}{n}\right)\\
											&\equiv \widetilde{\sigma}\left(\frac{x}{n}\right)+\widetilde{\sigma}\left(\frac{y}{n}\right)\mod \ensuremath{\mathbb{Z}}.
		\end{align*}
Multiplying by $n$ and using Claim \ref{claim:tildehomog} with $a=n$, we have
			$$\widetilde{\sigma}(x+y)\equiv \widetilde{\sigma}(x)+\widetilde{\sigma}(y)\mod n\ensuremath{\mathbb{Z}}.$$
	Since $n$ was arbitrary, we must have $\widetilde{\sigma}(x+y)=\widetilde{\sigma}(x)+\widetilde{\sigma}(y)$ as desired.	\end{proof}

		\begin{claim} For any $x\neq 0$, we have $\widetilde{\sigma}(\frac{1}{x})=\frac{1}{\widetilde{\sigma}(x)}$.\end{claim}
			\begin{proof} We will first show that $\widetilde{\sigma}(\frac{1}{x})\equiv \frac{1}{\widetilde{\sigma}(x)}\mod \ensuremath{\mathbb{Z}}$ for $x\neq 0$. Let $x_0\in \ensuremath{\mathbb{R}}^\times$ and let $\ell_{x_0}$ again be the line with slope $x_0$ through 0. We can assume that $x_0$ is irrational. Note that the intersections of $\ell_{x_0}$ with the horizontal line $h_0$ occur at the points $[\frac{k}{x_0}, 0]$. Under $f$ these are bijectively mapped to the intersections of $\ell_{\widetilde{\sigma}(x_0)}$ with $h_0$. In particular there are integers $k,l\in \ensuremath{\mathbb{Z}}$ such that
			$$\sigma\left(\frac{1}{x_0}\right)\equiv \frac{k}{\widetilde{\sigma}(x_0)}\mod\ensuremath{\mathbb{Z}}$$
		and
			$$\sigma\left(\frac{l}{x_0}\right)\equiv \frac{1}{\widetilde{\sigma}(x_0)}\mod \ensuremath{\mathbb{Z}}.$$
	Hence
			$$\frac{1}{\widetilde{\sigma}(x_0)}\equiv \sigma\left(\frac{l}{x_0}\right)\equiv l\sigma\left(\frac{1}{x_0}\right)\equiv kl\frac{1}{\widetilde{\sigma}(x_0)}\mod \ensuremath{\mathbb{Z}}.$$
		Since $\widetilde{\sigma}(x_0)$ is irrational, we must have $kl=1$ so that $k=\pm 1$. We claim that $k=1$. To see this, consider the intersections of $\ell_{x_0}$ with the horizontal line $h_{\frac{1}{3}}$. These occur at $[\frac{1}{3x_0}+\frac{n}{x_0},\frac{1}{3}]$ for $n\in\ensuremath{\mathbb{Z}}$. Under $f$ these are mapped to the intersections of $\ell_{\widetilde{\sigma}(x_0)}$ with $h_{\frac{1}{3}}$. Hence there exists $n\in\ensuremath{\mathbb{Z}}$ such that
		\begin{equation} \sigma\left(\frac{1}{3x_0}\right)\equiv \frac{1}{3\widetilde{\sigma}(x_0)}+\frac{n}{\widetilde{\sigma}(x_0)} \mod \ensuremath{\mathbb{Z}}. \label{eq:rel1}\end{equation}
For the left-hand side, we have
		\begin{equation} \sigma\left(\frac{1}{3x_0}\right)\equiv \widetilde{\sigma}\left(\frac{1}{3x_0}\right)\equiv \frac{1}{3}\widetilde{\sigma}\left(\frac{1}{x_0}\right)\equiv \frac{k}{3}\frac{1}{\widetilde{\sigma}(x_0)} \mod \ensuremath{\mathbb{Z}},\label{eq:rel2}\end{equation}
	where we used that $\widetilde{\sigma}$ is $\ensuremath{\mathbb{Q}}$-linear (because it is a homomorphism $\ensuremath{\mathbb{R}}\to\ensuremath{\mathbb{R}}$). Combining Equations \ref{eq:rel1} and \ref{eq:rel2}, we find
		$$(3n+1-k)\frac{1}{\widetilde{\sigma}(x_0)}\equiv 0\mod 3\ensuremath{\mathbb{Z}}.$$
	Since $\widetilde{\sigma}(x_0)$ is not rational, we must have $3n+1-k=0$ so that $k\equiv 1\mod 3$. Since we already found that $k=1$ or $-1$, we must have $k=1$, as desired.

	At this point we know that $\widetilde{\sigma}(\frac{1}{x})\equiv \frac{1}{\widetilde{\sigma}(x)}\mod \ensuremath{\mathbb{Z}}$ for any $x\neq 0$. It remains to show that $\widetilde{\sigma}(\frac{1}{x})=\frac{1}{\widetilde{\sigma}(x)}$. To see this, let $x\in \ensuremath{\mathbb{R}}^\times$ be arbitrary. We can assume that $x$ is irrational. Let $n\in \ensuremath{\mathbb{Z}}$ such that
		$$\widetilde{\sigma}\left(\frac{1}{x}\right)=\frac{1}{\widetilde{\sigma}(x)}+n.$$
	Set $N=|n|+1$, and note that
		$$\widetilde{\sigma}\left(\frac{1}{Nx}\right)=\frac{1}{N}\widetilde{\sigma}\left(\frac{1}{x}\right)=\frac{1}{\widetilde{\sigma}(NX)}+\frac{n}{N}.$$
	Hence if $n\neq 0$, we have $\widetilde{\sigma}\left(\frac{1}{Nx}\right)\not\equiv \frac{1}{\widetilde{\sigma}(Nx)}\mod \ensuremath{\mathbb{Z}}$, which is a contradiction.\end{proof}
In the final two claim we will show that $\widetilde{\sigma}$ is multiplicative.
	\begin{claim} For any $x,y\in \ensuremath{\mathbb{R}}$, we have $\widetilde{\sigma}(xy)=\widetilde{\sigma}(x)\widetilde{\sigma}(y)$. \label{claim:mult}	\end{claim}
	\begin{proof} Let $x_0,y_0\in \ensuremath{\mathbb{R}}$. Note that since $\widetilde{\sigma}$ is an isomorphism of $\ensuremath{\mathbb{R}}$ as an additive group, $\widetilde{\sigma}$ is $\ensuremath{\mathbb{Q}}$-linear. Hence without loss of generality, we assume that $x_0$ is irrational. Consider the intersections of $\ell_{x_0}$ with the vertical line $v_{y_0}$. These occur at the points $[y_0,x_0 y_0+k x_0]$ for $k\in \ensuremath{\mathbb{Z}}$. Under $f$ these intersection points are mapped to the points of intersection of $\ell_{\widetilde{\sigma}(x_0)}$ with $v_{\widetilde{\sigma}(y_0)}$. In particular, by considering the image of $[y_0,x_0 y_0]$, we see that there is $k\in \ensuremath{\mathbb{Z}}$ such that
		$$\sigma(x_0 y_0)\equiv \widetilde{\sigma}(x_0)\widetilde{\sigma}(y_0)+k\widetilde{\sigma}(x_0)\mod \ensuremath{\mathbb{Z}}.$$
	Since $\sigma(x_0 y_0)\equiv \widetilde{\sigma}(x_0 y_0)\mod \ensuremath{\mathbb{Z}}$, we see that
		$$\widetilde{\sigma}(x_0 y_0)-\widetilde{\sigma}(x_0)\widetilde{\sigma}(y_0)\in \ensuremath{\mathbb{Z}}+\ensuremath{\mathbb{Z}}\widetilde{\sigma}(x_0).$$
	For $x\in \ensuremath{\mathbb{R}}$, let $\mu_x:\ensuremath{\mathbb{R}}\to \ensuremath{\mathbb{R}}$ denote multiplication by $x$. Then the above argument shows that the homomorphism
		$$(\widetilde{\sigma}\circ  \mu_{x_0})-\left(\mu_{\widetilde{\sigma}(x_0)}\circ \widetilde{\sigma}\right):\ensuremath{\mathbb{R}} \to \ensuremath{\mathbb{R}}$$
	has image contained in $\ensuremath{\mathbb{Z}}+\ensuremath{\mathbb{Z}}\widetilde{\sigma}(x_0)$. Since $\widetilde{\sigma}(x_0)$ is irrational, we have $\ensuremath{\mathbb{Z}}+\ensuremath{\mathbb{Z}}\widetilde{\sigma}(x_0)\cong \ensuremath{\mathbb{Z}}^2$ as additive groups. But any homomorphism $\ensuremath{\mathbb{R}}\to \ensuremath{\mathbb{Z}}^2$ is trivial (because $\ensuremath{\mathbb{R}}$ is divisible), so that $\widetilde{\sigma}\circ \mu_{x_0}=\mu_{\widetilde{\sigma}(x_0)}\circ \widetilde{\sigma}$, as desired.\end{proof}
As commented at the beginning of this section, the above results finish the 2-dimensional case of Theorem \ref{thm:main}. Indeed, up to precomposition by an affine automorphism, any bijection $f:T^2\to T^2$ that maps lines to lines, is of the form $(\sigma,\sigma)$, where $\sigma$ is a homomorphism $S^1\to S^1$ that lifts to a field automorphism $\widetilde{\sigma}$ of $\ensuremath{\mathbb{R}}$. Since any field automorphism of $\ensuremath{\mathbb{R}}$ is trivial, it follows that $\sigma=\text{id}$ and hence the original map is affine.

\section{The $n$-dimensional case}
\label{sec:ndim}
We finish the proof of Theorem \ref{thm:main} that any bijection of $T=\ensuremath{\mathbb{R}}^n\slash \ensuremath{\mathbb{Z}}^n, \, n\geq 2,$ that maps lines to lines, is an affine map. We argue by induction on $n$. The base case $n=2$ has been proven in the previous section. Let $f:T\to T$ be a bijection that maps lines to lines. We recall that in Section \ref{sec:planes}, we showed that for any rational subtorus $S\subseteq T$, the image $f(S)$ is also a rational subtorus.

\begin{proof}[Proof of Theorem \ref{thm:main}] Without loss of generality, we assume $f(0)=0$. For $1\leq i\leq n$, we let
	$$\ell_i:=\begin{bmatrix} \ensuremath{\mathbb{R}} e_i \end{bmatrix}$$
denote the (image of the) coordinate line. Each $\ell_i$ is a rational line, so $f(\ell_i)$ is also a rational line. Choose primitive integral vectors $v_i\in\ensuremath{\mathbb{Z}}^n$ such that
	$$f(\ell_i)=\begin{bmatrix} \ensuremath{\mathbb{R}} v_i\end{bmatrix}.$$
Note that $v_i$ is unique up to sign. Let $A$ be the linear map of $\ensuremath{\mathbb{R}}^n$ with $A e_i = v_i$ for every $i$. Our goal is to show that $f=A$ as maps of the torus.
\begin{claim} $A$ is invertible with integer inverse. \label{claim:ainv} \end{claim}
\begin{proof} To show that $A$ is invertible, we need to show that $v_1,\dots, v_n$ span $\ensuremath{\mathbb{R}}^n$. To show that $A^{-1}$ has integer entries, we need to show that in addition, $v_1,\dots,v_n$ generate $\ensuremath{\mathbb{Z}}^n$ (as a group). For $1\leq j\leq n$, set
	$$U_j:=\Span\{e_i \mid i\leq j\},$$
and
	$$V_j:=\Span\{v_i \mid i \leq j\}.$$
Note that $f [U_j]=[V_j]$ by Lemma \ref{lem:span}. Taking $j=n$, this already shows that $v_1,\dots,v_n$ span $\ensuremath{\mathbb{R}}^n$, so $A$ is invertible. We argue by induction on $j$ that $\{v_1,\dots,v_j\}$ generate $\pi_1[V_j]\subseteq \pi_1 T$. For $j=n$, this exactly means that $v_1,\dots,v_n$ generate $\pi_1 T$, which would finish the proof.

The base case $j=1$ is exactly the assertion that $v_1$ is a primitive vector. Now suppose the statement is true for some $j$. Consider the composition
	\begin{equation} f(\ell_j) \hookrightarrow V_j \to V_j\slash V_{j-1}. \label{eq:quot} \end{equation}
This composition is a homomorphism of  $f(\ell_j)\cong S^1$ to $V_j\slash V_{j-1}\cong S^1$. The kernel is given by
	$$f(\ell_j)\cap V_{j-1}= f(\ell_j \cap U_{j-1})=f(0)=0.$$
Therefore the map $f(\ell_j)\rightarrow V_j\slash V_{j-1}$ is an isomorphism, and
	$$\pi_1(V_j)\cong \pi_1(V_{j-1})\oplus \pi_1(f(\ell_j)).$$
Since we know by the inductive hypothesis that $\pi_1(V_{j-1})$ is generated by $v_1,\dots,v_{j-1}$, and that $\pi_1(f(\ell_j))$ is generated by $v_j$ (again because $v_j$ is primitive), we find that $\pi_1(V_j)$ is generated by $v_1,\dots,v_j$, as desired.\end{proof}

For the remainder of the proof we set $g:=A^{-1}\circ f$. Our goal is to show that $g=\text{id}$. Note that $g$ is a bijection of $T$ with $g(0)=0$ and $g(\ell_i)=\ell_i$ for every $i$. Let
	$$H_{i}:=\begin{bmatrix} \Span(e_j \mid j\neq i)\end{bmatrix}$$
denote the (image of the) coordinate hyperplane. Since $g(\ell_i)=\ell_i$ for every $i$, we know (using Lemma \ref{lem:span} again) that $g(H_i)=H_i$. By the inductive hypothesis, $g$ is given by a linear map $A_i$ on $H_i$. But any linear automorphism of $H_i$ that leaves the coordinate lines $\ell_j, \, j\neq i,$ invariant, must be of the form
	$$\begin{pmatrix} \pm 1 & & \\ & \ddots & \\ & & \pm 1 \end{pmatrix}.$$
Now recall that $v_i$ was unique up to sign. Replace $v_i$ by $-v_i$ whenever $g|_{\ell_i} = -\text{id}$. After this modification, we have that $g=\text{id}$ on every coordinate hyperplane $H_i$. Our goal is to show that $g=\text{id}$ on $T$.

\begin{claim} Fix $1\leq i\leq n$ and let $\ell$ be any line parallel to $\ell_i$. Then $g(\ell)=\ell$.\end{claim}
\begin{proof} First recall the following elementary general fact about the number of intersections of a line with a coordinate hyperplane: If $m$ is any rational line and
	$$v=\begin{pmatrix} v_1 \\ \vdots \\ v_n\end{pmatrix}$$
is a primitive integer vector with $m=[\ensuremath{\mathbb{R}} v]$, then
	$$|v\cap H_i|=|v_i|.$$
Now let $\ell$ be parallel to $\ell_i$. Then
	$$|\ell\cap H_j|=\delta_{ij},$$
and hence also
	$$|g(\ell)\cap H_j|=|g(\ell)\cap g(H_j)|=|\ell\cap H_j|=\delta_{ij}.$$
Therefore we see that if $v$ is a primitive integer vector with $g(\ell)=[\ensuremath{\mathbb{R}} v]$, then $v=e_i$. This exactly means that $\ell$ and $g(\ell)$ are parallel. Hence to show that $\ell=g(\ell)$, it suffices to show that $\ell\cap g(\ell)$ is nonempty.

Since $\ell$ is parallel to $\ell_i$, there is a unique point of intersection $x_\ell:=\ell\cap H_i$. Since $x_\ell \in H_i$, we have $g(x_\ell)=x_\ell$, so $x_\ell\in \ell\cap g(\ell)$, as desired.\end{proof}

We are now able to finish the proof of the main theorem. Let $x\in T$ and let $\ell_i(x)$ be the unique line parallel to $\ell_i$ that passes through $x$. For any two distinct indices $i\neq j$, the point $x$ is the unique point of intersection of $\ell_i(x)$ and $\ell_j(x)$. On the other hand,
	$$g(x)\in g(\ell_i(x))\cap g(\ell_j(x))=\ell_i(x)\cap \ell_j(x),$$
so we must have $g(x)=x$.\end{proof}

\bibliographystyle{alpha}

Differential Geometry (math.DG); Geometric Topology (math.GT)


On Two Related Questions of Wilf Concerning Standard Young Tableaux

Abstract: We consider two questions of Wilf related to Standard Young Tableaux. We provide a partial answer to one question, and that will lead us to a more general answer to the other question. Our answers are purely combinatorial.

\section{Introduction} In 1992, in his paper \cite{wilf}, Herb Wilf has
proved the following interesting result.

\begin{theorem} \label{wilf} (Wilf, \cite{wilf}.) Let $u_k(n)$ be the number
of permutations of length $n$ that contain no increasing subsequence of
length $k+1$, and let $y_k(n)$ be the number of Standard Young Tableaux
on $n$ boxes that have no rows longer than $k$. Then for all even positive
integers $k$, the equality
\begin{equation}
\label{wilfeq} {2n\choose n} u_k(n) =
\sum_{r=0}^{2n} {2n\choose r} (-1)^r y_k(r)y_k(2n-r)
\end{equation} holds.
\end{theorem}

Wilf's proof of Theorem \ref{wilf} was not elementary; it used modified
Bessel functions and computed the determinant of a Toeplitz matrix. Therefore,
Wilf asked the following two intriguing questions.

\begin{enumerate}
\item Is there a purely combinatorial proof for Theorem \ref{wilf} ?
\item What statement corresponds to Theorem \ref{wilf}  for odd $k$?
\end{enumerate}

In this paper, we answer Question 1 in a special case, which then will lead
us to a more general answer to Question 2. This answer will be a formula
that will still contain a summation sign, but each summand will be
positive, and there will be less summands. We point out that in another
special case, that of $k=2$, a simple and elegant bijective proof has
recently been given by Rebecca Smith and Micah Coleman \cite{smith}.

We will assume familiarity with the Robinson-Schensted correspondence.
between permutations of length $n$, and pairs of Standard Young tableaux
on $n$ boxes and of the same shape. In particular, we will need the
following facts.

\begin{enumerate}
\item There is a one-to-one correspondence $RS$ between involutions on an
$n$-element set and Standard Young tableaux
on $n$ boxes.
\item The length of the longest increasing subsequence of the involution
$v$ is equal
to the length of the first row of $RS(v)$, and
\item the length of the longest decreasing subsequence of the involution
$v$ is equal
to the length of the first column of $RS(v)$.
\end{enumerate}

Readers who want to deepen their knowledge of the Robinson-Schensted
correspondence should consult the book \cite{sagan} of Bruce Sagan.
The Robinson-Schensted
correspondence makes Theorem \ref{wilf} even more intriguing, since both
sides of (\ref{wilfeq}) can be interpreted in terms of Standard Young
Tableaux as well as in terms of permutations.

In Section 3, we will also need the following, somewhat less well-known
result of Janet Simpson Beissinger.

\begin{theorem} \cite{beissinger} \label{beissinger}
Let $v$ be an involution, and let $RS(v)$ be its image under the
Robinson-Schensted correspondence. Then the number of fixed points
of $v$ is equal to the number of odd columns of $RS(v)$.
\end{theorem}

Our combinatorial argument may remind some readers to the classic proof
of the Inclusion-Exclusion Principle given by Doron Zeilberger in
\cite{zeilberger}.

\section{When $k=2n$}
In this Section, we bijectively prove Theorem \ref{wilf} in the special
case when $k=2n$. It is clear that in that special case, the requirement
on the increasing subsequences on the left-hand side
of (\ref{wilfeq}), and the requirement on the length of rows on
the right-hand side of (\ref{wilfeq})  are automatically satisfied.
 Therefore,
if $y(m)$ denotes the number of involutions of an $m$-element set, then
 Theorem
\ref{wilf} simplifies to the following proposition.

\begin{proposition} \label{nolimits}
For all positive integers $n$, we have
\begin{equation}
\label{easyone}
{2n\choose n} n! = \sum_{r=0}^{2n} {2n\choose r} (-1)^ry(r)y(2n-r).
\end{equation}
\end{proposition}

\begin{proof}
Let $[i]$ denote the set $\{1,2,\cdots ,i\}$.
 Let $A_n$ be the set of all permutations of the elements
of  $n$-element subsets of $[2n]$. Then the left-hand side of
(\ref{easyone}) is equal to $|A_n|$.

Let $B_n$ be the set of ordered pairs $(p,q)$, where $p$ is an involution
on a subset $s_p$ of $[2n]$, and $q$ is an involution on the
set $[2n]-s_p$, the complement of $s_p$ in $[2n]$.
Then the right-hand side of (\ref{easyone}) counts the elements of $B_n$
taking the parity of $r$ into account. More precisely, the
 right-hand side of (\ref{easyone}) is equal to the number of
elements of $B_n$ in which $|s_p|$ has an even size minus
the number of
elements of $B_n$ in which $|s_p|$ has an odd size.

Now we are going to define an involution $f$ on a subset of $B_n$. Let
$(p,q)\in B_n$. As $p$ is an involution, all cycles of $p$ are of length one
(these are also called fixed points) or length two.  Let
$F(p,q)$ be the set of all fixed points of $p$ and of all fixed points of $q$.
Let $M(p,q)$
 be the maximal element of $F(p,q)$ as long as $F(p,q)$ is a non-empty set.
 Now {\em move} $M(p,q)$
 to the {\em other}
involution in $(p,q)$. That is, if $M(p,q)$ was a fixed point of $p$, then
move $M(p,q)$ to $q$, and if $M(p,q)$ was a fixed point of $q$, then move
 $M$ to $p$.
Call the resulting pair of involutions $f(p,q)=(p',q')$.

\begin{example} Let $n=4$, and let $p=(31)(62)(5)$, and let $q=(7)(84)$.
Then $F(p,q)=\{5,7\}$, so $M(p,q)=7$, and therefore, $f(p,q)=(p',q')$, where
$p'=(31)(62)(75)$ and $q'=(84)$.
\end{example}

It is clear that $f(p',q')=(p,q)$, since $F(p,q)=F(p',q')$, and
so $M(p,q)=M(p',q')$. So applying $f$ a second time simply moves
$M(p,q)$ back to its original place.

As the number of elements in $p$ and in $p'$ differs by exactly one,
these two numbers are of different parity, and so the total contribution of
$(p,q)$ and $f(p,q)$ to the right-hand side of (\ref{easyone}) is 0.
Therefore, the only pairs $(p,q)$ whose contribution is not canceled
by the contribution of
$f(p,q)$ are the pairs for which $f(p,q)$ is {\em not defined}, that is,
pairs $(p,q)$ in which both $p$ and $q$ are {\em fixed point-free
involutions}.

Noting that fixed point-free involutions are necessarily of even length,
this shows that (\ref{easyone}) will be proved if we can show
that
\begin{equation} \label{fffree}
{2n\choose n} n! = \sum_{r=0}^{2n} {2n\choose r} x(r)x(2n-r),
\end{equation}
where $x(r)$ is the number of {\em fixed point-free} involutions
of length $r$.

This equality is straightforward to prove computationally, using the
fact that $x(2t)=(2t-1)\cdot (2t-3)\cdot \cdots \cdot 1=(2t-1)!!$ and
$x(2t+1)=0$. However,
for the sake of combinatorial purity, we provide a bijective proof.

The left-hand side counts the ways to choose $n$ elements
$a_1,a_2,\cdots ,a_n$ of $[2n]$ and then to arrange them in a line.
Let $a\in A_n$ denote such an choice and arrangement.
Now let $i_1<i_2<\cdots <i_n$ be the elements of $[2n]$ that we did {\em not}
choose, listed increasingly. Take the fixed point-free involution
whose cycles are the 2-cycles $(i_j,a_j)$, for $1\leq j\leq n$. Color
the cycles in which $i_j<a_j$ red, and the cycles in which $i_j>a_j$ blue.
Call the obtained fixed point-free permutation with bicolored cycles
$g(a)$.

It is then clear that $g$ maps into the set $D_n$
of fixed-point free permutations
on $[2n]$ whose cycles are colored red or blue. The right-hand side of
(\ref{fffree}) counts precisely such involutions. Finally, it is
straightforward to see that $g:A_n\rightarrow D_n$ is a bijection as
it has an inverse. (Just choose the smaller entry in each of the red cycles
and the larger entry in each of the blue cycles to recover $i_1,i_2,\cdots
,i_n$.) This completes the proof of (\ref{fffree}), and therefore,
of Proposition \ref{nolimits}.
\end{proof}

\section{When $k$ is odd}

If we want to find a combinatorial proof of Theorem \ref{wilf} along the
line of the proof of Proposition \ref{nolimits}, we encounter several
difficulties. First, inserting a new fixed point into a partial permutation
can increase the length of its longest increasing subsequence, taking
it thereby out of the set that is being counted. More importantly,
equality (\ref{fffree}) no longer holds if we replace $n!$ by $u_k(n)$ on
its left-hand side, and $x(h)$ by the number of fixed point-free involutions
with no increasing subsequences longer than $k$ on its right-hand side.
Indeed, for $k=2$ and $n=3$, the left-hand side would be
${2n\choose n} u_2(3)=20\cdot 5=100$, while the right-hand side would
be $10+15\cdot 3+15\cdot 3 +10=110$.

It is therefore even more surprising that for the case of odd $k$,
fixed points, and fixed point-free involutions, turn out to be relevant
again. We point out that we will be considering
involutions without long {\em decreasing} rather than increasing subsequences.

Note that   $y_k(r)$ is equal to both the number of
 {\em involutions} on an $r$-element set
 with no {\em increasing} subsequences longer
than $k$, and the number    {\em involutions} on an $r$-element set with no
 {\em decreasing subsequences} longer than $k$ (just take conjugates of
the corresponding Standard Young Tableaux). However, this symmetry is
broken if we restrict our attention to {\em fixed point-free involutions},
since the conjugate of a tableaux with even columns only may have odd columns,
and our claim follows from Theorem \ref{beissinger}.

Let $x_k(r)$ be the number of {\em fixed point-free} involutions of
length $r$ with no {\em decreasing subsequences} with more than $k$ elements.
Note that $x_k(r)=0$ if $r$ is odd.

\begin{theorem} \label{oddk}
For all positive integers $n$, and for all {\em odd} positive
integers $k$ the equality
\begin{equation} \label{tobeproved}
\sum_{r=0}^{2n} {2n\choose r} x_k(r)x_k(2n-r) = \sum_{r=0}^{2n}
 (-1)^r {2n\choose r}
y_{k}(r)y_{k}(2n-r)\end{equation}
holds.
\end{theorem}

\begin{proof} Recall from the proof of Proposition \ref{nolimits} that
$B_n$ is the set of ordered pairs $(p,q)$, where $p$ is an involution
on a subset $s_p$ of $[2n]$, and $q$ is an involution on the
set $[2n]-s_p$, the complement of $s_p$ in $[2n]$.

Let $B(n,k,r)$ be the subset of $B_n$ consisting of
pairs $(p,q)$ so that neither $p$ nor $q$ has
a decreasing subsequence longer than $k$.
It is then clear that
\[ |B(n,k,r)| = {2n\choose r}  y_{k}(r)y_{k}(2n-r) .\]
Let $B(n,k)=\cup_r B(n,k,r)$.

Recall the involution $f$ from the proof of Proposition \ref{nolimits},
(the involution that took the largest fixed point present in $p\cup q$ and
moved it to the other involution),
and let $f_{n,k}$ be the restriction of $f$ to the set $B(n,k)$.

Our theorem will be proved if we can show that $f_{n,k}$ maps into
$B(n,k)$. Indeed, that would show that the only pairs $(p,q)\in B(n,k)$
whose contribution to the right-hand side of (\ref{tobeproved}) is not
canceled by the contribution of $f_{n,k}(p,q)$ are the pairs for which
$f(p,q)$ is not defined. It follows from the definition of $f_{n,k}$ that
these are the pairs in which both $p$ and $q$ are fixed point-free
involutions.

Our main tool is the following lemma.

\begin{lemma} \label{fixedpoint}
Let $w$ be an involution whose longest decreasing subsequence is of length
$2m+1$. Then each longest decreasing subsequence of $w$ must contain a fixed
point.
\end{lemma}

\begin{proof} Induction on $z$, the number of fixed points of $w$.
If $z=0$, then the statement is vacuously true, since by Theorem
\ref{beissinger} the
Standard Young Tableau corresponding to $w$ has no odd columns, so
the length of its first column (and so, the length of the longest decreasing
subsequence of $w$) cannot be odd.

Otherwise, assume that we know that the statement holds for $z-1$.
Also assume that $w$ has $z>0$ fixed points, and $w$ has a longest
decreasing subsequence $s$ of length $2m+1$ that does not contain any
fixed points. Remove a fixed point from $w$ to get $w'$. Then $w'$ still
has  a longest
decreasing subsequence $s$ of length $2m+1$ that contains no fixed points,
 even though $w'$ has only
$z-1$ fixed points, contradicting our induction hypothesis.
\end{proof}

Let $(p,q)\in B(n,k)$. In order to show that  $f_{n,k}$ maps into
$B(n,k)$, we need to show that $f_{n,k}(p,q)=f(p,q)=(p',q')$ has no decreasing
subsequence longer than $k$. The action of $f$ on $(p,q)$ consists of taking
a fixed point of one of $p$ and $q$ and adding it to the other. We can
assume without loss of generality that a fixed point of $p$ is being moved to
$q$. So the longest decreasing subsequence of $p'$ is not longer than that
of $p$, and so, not longer than $k$,
 since $p'$ is a substring of $p$. There remains to show that the
longest decreasing subsequence of $q'$ is also not longer than $k$.

As $q'$ differs from  $q$ only by the insertion of the fixed point $M=M(p,q)$,
 the only way $q'$ could possibly have a
decreasing subsequence longer than $k$ would be when $q$ itself has
a decreasing subsequence of length $k=2m+1$. In that case, by
Lemma \ref{fixedpoint}, all maximum-length decreasing subsequences of $q$
contain a fixed point. So when $M$ is inserted into $q$, and $q'$ is formed,
$M$ cannot extend any of the maximum-length decreasing subsequences of
 $q$ because that would mean that {\em two} fixed points are part of the
same decreasing subsequence. That is impossible, since fixed points form
increasing subsequences.

So indeed, $f_{n,k}$ maps into $B(n,k)$, and our claim is proved.
\end{proof}

\subsection{The special case $k=3$}

The first special case of Theorem \ref{oddk} is when $k=1$. Then
$x_k(r)=0$ for any $r$, while $y_k(r)=1$ for any $r$. So
(\ref{tobeproved}) simplifies to the well-known binomial-coefficient
identity
\[0=\sum_{r=0}^{2r} (-1)^r {2n\choose r} .\]

The special case of $k=3$ is more interesting.
It follows from Theorem \ref{beissinger} that if $v$ is fixed-point free,
then $RS(v)$ has no odd columns. Therefore, $x_{2m+1}=x_{2m}(r)$.
In particular, for $k=3$, Theorem \ref{oddk} simplifies to
\[\sum_{r=0}^{2n} (-1)^r {2n\choose r}
y_{3}(r)y_{3}(2n-r) = \sum_{r=0}^{2n} {2n\choose r} x_2(r)x_2(2n-r).\]
Note that $x_2(r)$ is just the number of Standard Young Tableaux
in which each column is of length two (of even length not more than two).
The number of such tableaux is well-known (see for instance Exercise 6.19.ww
of \cite{stanley}) to be the Catalan number
$C_{r/2}$ if $r$ is even, and of course, 0 if $r$ is odd.
Therefore, the previous displayed equation simplifies to
\[\sum_{r=0}^{2n} (-1)^r {2n\choose r}
y_{3}(r)y_{3}(2n-r) =  \sum_{i} {n\choose i} {2n \choose 2i} C_iC_{n-i}.\]

It turns out that the right-hand side is a well-known sequence
(sequence A005568 in the On-Line Encyclopedia of Integer Sequences by
N. J. A. Sloane). In particular \cite{guy},
 it has the closed form $C_nC_{n+1}$, and it is also equal
\cite{gouyou} to $y_4(2n)$.

So we have proved the following identity.

\begin{corollary}
For all positive integers $n$, we have
\[\sum_{r=0}^{2n} (-1)^r {2n\choose r}
y_{3}(r)y_{3}(2n-r)=y_4(2n)=C_{n}C_{n+1}=
\frac{{2n\choose n}{2n+2 \choose n+1}}{(n+1)(n+2)}.\]
\end{corollary}


A new distribution problem of balls into urns, and how to color a graph by different-sized sets

Abstract: Set-coloring a graph means giving each vertex a subset of a fixed color set so that no two adjacent subsets have the same cardinality. When the graph is complete one gets a new distribution problem with an interesting generating function. We explore examples and generalizations.

\subsection*{Balls into urns} We have $n$ labelled urns and an unlimited supply of balls of $k$ different colors.  Into each urn we want to put balls, no two the same color, so that the number of colors in every urn is different.  Balls of the same color are indistinguishable and we don't care if several are in an urn.  How many ways are there to do this?
 (The reader will note the classical terminology.  Our question appears to be new but it could as easily have been posed a hundred years ago.)
 Call the answer $\chiset_n(k)$.  We  form the exponential generating function,
 \[
 \X(t) := \sum_{n=0}^\infty \chiset_n(k) \frac{t^n}{n!} \ ,
 \]
taking $\chiset_0(k) = 1$ in accordance with generally accepted counting principles.  Then we have the generating function formula
\begin{equation}\mylabel{E:urns}
\X(t) = \prod_{j=0}^k \Big[ 1 + \binom{k}{j} t \Big] .
\end{equation}
For the easy proof, think about how we would choose the sets of colors for the urns.  We pick a subset of $n$ integers, $\{j_1<j_2<\cdots j_n\} \subseteq \{0,1,\ldots,k\}$, and assign each integer to a different urn; then we choose a $j_i$-element subset of $[k] := \{1,2,\ldots,k\}$ for the $i$th urn.  The number of ways to do this is
\[
\sum_{S\subseteq[k]: |S|=n} n! \, \prod_{j\in S} \binom{k}{j}.
\]
Forming the exponential generating function, the rest is obvious.

There are several interesting features to the question and its answer.
First of all, as far as I know the question is a new distribution problem.
Second, the sequence $\chiset_0(k), \chiset_1(k), \ldots, \chiset_{k+1}(k)$, besides (obviously) being increasing, is logarithmically concave, because the zeros of its generating function are all negative real numbers.
Third, the theorem generalizes to graphs and can be proved by means of M\"obius inversion over the lattice of connected partitions of the vertex set, just as one proves the M\"obius-function formula for the chromatic polynomial.
Fourth, \eqref{E:urns} and the graphical extension generalize to formulas in which the binomial coefficients are replaced by arbitrary quantities.
Finally, this way of putting balls into urns, and its graphical generalization, are really a problem of coloring gain graphs by sets, which suggests a new kind of gain-graph coloring; we discuss this briefly at the end.

Some elementary notation: $\bbN$ denotes the set of nonnegative integers and $[n] := \{1,2,\ldots,n\}$ for $n\geq0$; $[0]$ is the empty set.  Furthermore, $\cP_k$ denotes the power set of $[k]$.

To set the stage for the graph theory, first we generalize Equation \eqref{E:urns}.  Let $\alpha := (\alpha_j)_0^\infty$ be a sequence of numbers, polynomials, power series, or any quantities for which the following expressions and generating functions, including those in Equation \eqref{E:gf}, are defined.  Let $\beta_r := \sum_{j=0}^\infty \alpha_j^r$.  Let $\chi_n(\alpha)$ := the sum of\/ $\prod_1^n \alpha_{f(i)}$ over all injective functions $f : [n] \to \bbN$.  Then, generalizing \eqref{E:urns}, and with a similar proof, we have
\begin{equation}\mylabel{E:gf}
\X_a(t) := \sum_{n=0} \chi_n(\alpha) \frac{t^n}{n!} =  \prod_{j=0}^\infty \big[ 1 + \alpha_j t \big] .
\end{equation}
 %
 As with the set-coloring numbers, if $\alpha$ is nonnegative and is a finite sequence $(\alpha_j)_{j=0}^k$, then the sequence $(\chi_n(\alpha))$ is logarithmically concave.  We can even closely approximate the index $m$ of the largest $\chi_n(\alpha)$.  Darroch's Theorem 3 \cite{Darroch} says that $m$ is one of the two nearest integers to
 \[
 M := k+1 - \sum_{j=0}^k \frac{1}{1+\alpha_j} ,
 \]
and $m=M$ if $M$ is an integer.\footnote{I thank Herb Wilf for telling me of Darroch's theorem and reminding me about logarithmic concavity.}

A combinatorial problem that falls under Equation \eqref{E:gf} is filling urns from the equivalence classes of a partition.  We have a finite set $\cS$ with a partition that has $k+1$ blocks $\cS_0, \cS_1,\ldots, \cS_k$.
We want the number of ways to put one ball into each of $n$ labelled urns with no two from the same block.  Call this number $\chi_n(\pi)$.  The generating function is \eqref{E:gf} with $\alpha_j = |\cS_j|$.
It is clear that $\chi_n(\pi)$ increases with its maximum at $n=k$.
As an example let $\cS =$ the lattice of flats of a rank-$k$ matroid, two flats being equivalent if they have the same rank; then $\alpha_j = W_j$, the number of flats of rank $j$ (the Whitney number of the second kind).  In particular, if $\cS =$ the lattice of subspaces of the finite vector space $\GF(q)^k$, the rule being that each urn gets a vector space of a different dimension, then
\[
\X_\cS(t) = \prod_{j=0}^k \left( 1 + \gauss{k}{j} t \right),
\]
where $\gauss{k}{j}$ is the Gaussian coefficient.
For a similar example where the $\alpha_j$ are (the absolute values of) the Whitney numbers of the first kind, take $\cS$ to be the broken circuit complex of the matroid.

\subsection*{Graphs}  In the graphical generalization we have $\D$, a graph on vertex set $V=[n]$.  $\Pi(\D)$ is the set of \emph{connected partitions} of $\D$, that is, partitions $\pi$ of $V$ such that each block $B \in \pi$ induces a connected subgraph.  The set $\Pi(\D)$, ordered by refinement, is a geometric lattice with bottom element $\hat0$, the partition in which every block is a singleton.
A \emph{set $k$-coloring} of $\D$ is a function $c: V \to \cP_k$ that assigns to each vertex a subset of $[k]$, and it is \emph{proper} if no two adjacent vertices have colors (that is, sets) of the same cardinality.  We define the \emph{set-coloring function} $\chiset_\D(k)$ to be the number of proper set $k$-colorings of $\D$.  This quantity is positive just when the chromatic number of $\D$ does not exceed $k+1$.

The \emph{extended Franel numbers} are
\[
\Fr(k,r) := \sum_{j=0}^k \binom{k}{j}^r
\]
for $k, r \geq 0$.  (The Franel numbers themselves are the case $r=3$ \cite[Sequence A000172]{OEIS}.  There is a nice table of small values of the extended numbers at \cite{BinomMW}.  There are closed-form expressions when $r \leq 2$ but not otherwise.)
The set-coloring function satisfies
\begin{equation}\mylabel{E:set-coloring}
\chiset_\D(k) = \sum_{\pi\in\Pi(\D)} \mu(\hat0,\pi) \prod_{B\in\pi} \Fr(k,|B|)
\end{equation}
where $\mu$ is the M\"obius function of $\Pi(\D)$.

It is amusing to see the high-powered machinery involved in deriving \eqref{E:urns} from \eqref{E:set-coloring}.  We outline the method.
Obviously, $\chiset_{K_n}(k) = \chiset_n(k)$.  In \eqref{E:set-coloring} we substitute the known value $\mu(\hat0,\pi) = \prod_{B\in\pi} [ -(-1)^{|B|}(|B|-1)! ]$.  Then we apply the exponential formula to the exponential generating function, substituting $y = -\binom{k}{j}t$ in $\log(1-y) = -\sum_{n=1}^\infty y^n/n$ and finding that the exponential and the logarithm cancel.

Rather than proving Equation \eqref{E:set-coloring} itself, we generalize still further; the proof is no harder.  Define
 \[
 \chi_\D(\alpha) := \sum_f  \prod_{i=1}^n \alpha_{f(i)},
 \]
summed over all functions $f: V \to \bbN$ such that $f(i) \neq f(j)$ if $i$ and $j$ are adjacent; that is, over all proper $\bbN$-colorings of $\D$.  One could think of $f$ as a proper $\bbN$-coloring weighted by $\prod \alpha_{f(i)}$.  (Again, we assume $\alpha$ has whatever properties are required to make the various sums and products in the theorem and its proof meaningful.  A sequence that is finitely nonzero will satisfy this requirement.)

 \begin{thm}\mylabel{T:graph-labels}
We have
 \[
 \chi_\D(\alpha) = \sum_{\pi\in\Pi(\D)} \mu(\hat0,\pi) \prod_{B\in\pi} \beta_{|B|}.
 \]
\end{thm}

To derive Equation \eqref{E:set-coloring} we set $\alpha_j = \binom{k}{j}$.  It is easy to see that the left-hand side of the theorem equals $\chiset_\D(k)$.

 \begin{proof}
The method of proof is the standard one by M\"obius inversion.  For $\pi\in\Pi(\D)$ define
\[
g(\pi) = \sum_f \prod_1^n \alpha_{f(i)},
\]
summed over functions $f: V \to \bbN$ that are constant on blocks of $\pi$, and
\[
h(\pi) = \sum_f \prod_1^n \alpha_{f(i)},
\]
summed over every such function whose values differ on blocks $B, B' \in \pi$ that are joined by one or more edges.  It is clear that
\[
g(\pi') = \sum_{\pi\geq\pi'} h(\pi)
\]
for every $\pi'\in \Pi(\D)$, $\pi$ also ranging in $\Pi(\D)$.  By M\"obius inversion,
\begin{equation}\mylabel{E:mu}
h(\pi') = \sum_{\pi\geq\pi'} \mu(\pi',\pi) g(\pi).
\end{equation}
Set $\pi' = \hat0$ and observe that $h(\hat0) = \chi_\D(\alpha)$.

To complete the proof we need a direct calculation of $g(\pi)$.  We may choose $f_B \in \bbN$ for each block of $\pi$ and define $f(i)=f_B$ for every $i\in B$; then
\[
g(\pi) = \prod_{B\in\pi} \sum_{j=0}^\infty \alpha_j^{|B|} = \prod_{B\in\pi} \beta_{|B|}.
\]
Combining with Equation \eqref{E:mu}, we have the theorem.
\end{proof}

As with our original balls-into-urns problem, there is a combinatorial special case where we color $\D$ from a set $\cS$ with a partition $\pi$, so that no two adjacent vertices have equivalent colors.  We call this \emph{coloring from a partitioned set} and denote the number of ways to do it by $\chi_\D(\pi)$.

\newcommand\colmin{.3in}
\begin{table}[htdp]
\begin{center}
\begin{tabular}{rc | rrr rrr rrr}
 & $k$ & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7  \\
$n$ && \hspace{\colmin} & \hspace{\colmin} & \hspace{\colmin} & \hspace{\colmin} & \hspace{\colmin} & \hspace{\colmin} & \hspace{\colmin} & \hspace{\colmin} & \hspace{\colmin} \\
\hline
0 && 1 & 1 & 1 & 1 & 1 		& 1 	& 1 	& 1 \\
1 && 1 & 2 & 4 & 8 & 16 	& 32 	& 64 	& 128 \\
2 && 0 & 2 & 10 & 44 & 186 	& 772 	& 3172 	& 12952 \\
3 && 0 & 0 & 12 & 144 & 1428 	& 13080 & 115104 & 989184 \\
4 && 0 & 0 & 0 & 216 & 6144 	& 139800 & 2821464 & 53500944 \\
5 && 0 & 0 & 0 & 0 & 11520 	& 780000 & 41472000 & 1870310400 \\
6 && 0 & 0 & 0 & 0 & 0 		& 1800000 & 293544000 & 37139820480 \\
7 && 0 & 0 & 0 & 0 & 0 		& 0 	& 816480000 & 325275955200 \\
8 && 0 & 0 & 0 & 0 & 0 		& 0 	& 0 	& 1067311728000 \\
9 && 0 & 0 & 0 & 0 & 0 		& 0 	& 0 	& 0 \\
\end{tabular}
\bigskip
\caption{Values of $\chiset_n(k)$ for small $n$ and $k$.}\mylabel{Tb:urns}
\end{center}

\end{table}

\subsection*{Examples}  The table
shows some low values of $\chiset_n(k)$, and the list below has formulas for special cases.
We also calculate two graphical set-chromatic functions. A trivial one is $\chiset_\D(k)$ for $\bar K_n$, the graph with no edges, since $\chiset_\D$ is multiplicative over connected components, and it is not hard (if tedious) to do graphs of order at most $3$, such as the $3$-vertex path $P_3$.  Here are some examples:
 %
 \begin{align*}
\chiset_0(k) &= 1, \\
\chiset_1(k) &= 2^k, \\
\chiset_2(k) &= 2^{2k} - \binom{2k}{k}, \\
\chiset_3(k) &= 2^{3k} - 3\cdot2^k\binom{2k}{k} + 2\cdot\Fr(k,3) , \\
\chiset_n(k) &= 0 \text{ when } k < n-1, \\
\chiset_n(n-1) &= n! \, \binom n0 \binom n1 \cdots \binom nn , \\
\chiset_{P_3}(k) &= 2^{3k} - 2\cdot2^k\binom{2k}{k} + \Fr(k,3), \\
\chiset_{\bar K_n}(k) &= 2^{nk}.
\end{align*}
The table entries for $n>3$ were obtained from the preceding formulas and, with the help of Maple, from the generating function \eqref{E:urns}.

The table shows that the values of $\chiset_2(k)$ match the number of rooted, $k$-edge plane maps with two faces \cite[Sequence A068551]{OEIS}.  The two sequences have the same formula.  It would be interesting to find a bijection.  A casual search of \cite{OEIS} did not reveal any other known sequences in the table that were not obvious.

\subsection*{Gain graphs} Set coloring began with an idea about gain graph coloring when the gains are permutations of a finite set.

Take a graph $\G$, which may have loops and parallel edges, and assign to each oriented edge $e_{ij}$ an element $\phi(e_{ij})$ of the symmetric group $\fS_k$ acting on $[k]$, in such a way that reorienting the edge to the reverse direction inverts the group element; symbolically, $\phi(e_{ji}) = \phi(e_{ij})\inv$.  We call $\phi$ a \emph{gain function} on $\G$, and $(\G,\phi)$ is a \emph{permutation gain graph} with $\fS_k$ as its \emph{gain group}.
A \emph{proper set coloring} of $(\G,\phi)$ is an assignment of a subset $S_i \subseteq [k]$ to each vertex $i$ so that for every oriented edge $e_{ij}$, $S_j \neq S_i \phi(e_{ij})$.  One way to form a permutation gain graph is to begin with a simple graph $\D$ on vertex set $[n]$ and replace each edge ${ij}$ by $k!$ edges $(g,{ij})$, each labelled by a different element $g$ of the gain group $\fS_k$.  (Then the notations $(g,{ij})$ and $(g\inv,{ji})$ denote the same edge.)
We call this the \emph{$\fS_k$-expansion} of $\D$ and write it $\fS_k\D$.  Now a proper set coloring of $\fS_k\D$ is precisely a proper set coloring of $\D$ as we first defined it: an assignment to each vertex of a subset of $[k]$ so that no two adjacent vertices have sets of the same size.  Thus I came to think of set-coloring a graph.

Our calculations show that the number of proper set colorings of a graph $\D$, or equivalently of its $\fS_k$-expansion, is exponential in $k$.  There is a standard notion of coloring of a gain graph with gain group $\fG$, in which the colors belong to a group $\fH=\fG\times\bbZ_k$ and there is a chromatic function, a polynomial in $|\fH|$, that generalizes the chromatic polynomial of an ordinary graph and has many of the same properties, in particular satisfying the deletion-contraction law $\chi_\Phi(y) = \chi_{\Phi\setminus e}(y) - \chi_{\Phi/e}(y)$ for nonloops $e$ \cite{BG3}.
The set-coloring function $\chiset_\D(k)$ is not a polynomial in $k$, of course, but also is not a polynomial function of $k! = |\fS_k|$ (see the small examples) and does not obey deletion-contraction for nonloops, not even with coefficients depending on $k$, as I found by computations with very small graphs.  A calculation with $\D = K_3$ convinced me the set-coloring function cannot obey deletion-contraction even if restricted to edges that are neither loops nor isthmi; but a second example would have to be computed to get a firm conclusion.
However, going to gain graphs changes the picture: then there is a simple deletion-contraction law.  This indicates that the natural domain for studying set coloring and coloring from a partition is that of gain graphs.  I will develop this thought elsewhere.