\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper,margin=2.5cm]{geometry}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\usepackage{booktabs,array,adjustbox}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{fvextra}
\usepackage[colorlinks=true,linkcolor={blue!50!black},urlcolor={blue!50!black},citecolor={blue!50!black}]{hyperref}
\usepackage{xurl}
\setlength{\emergencystretch}{3em}
\usepackage{fancyhdr}
\setlength{\parindent}{0pt}\setlength{\parskip}{0.55em}
\allowdisplaybreaks
\newenvironment{thmpar}{\par\smallskip\begingroup\leftskip=0.9em\rightskip=0pt}{\par\endgroup\smallskip}
\providecommand{\R}{\mathbb{R}}\providecommand{\N}{\mathbb{N}}\providecommand{\Z}{\mathbb{Z}}\providecommand{\Q}{\mathbb{Q}}\providecommand{\C}{\mathbb{C}}
\providecommand{\mathscr}{\mathcal}\providecommand{\bm}{\boldsymbol}\providecommand{\Bbb}{\mathbb}
\providecommand{\Omega}{\mathrm{Omega}}
\providecommand{\Pr}{\mathrm{Pr}}
\providecommand{\cdots}{\mathrm{cdots}}
\providecommand{\cup}{\mathrm{cup}}
\providecommand{\delta}{\mathrm{delta}}
\providecommand{\ge}{\mathrm{ge}}
\providecommand{\le}{\mathrm{le}}
\providecommand{\lfloor}{\mathrm{lfloor}}
\providecommand{\mid}{\mathrm{mid}}
\providecommand{\pi}{\mathrm{pi}}
\providecommand{\rfloor}{\mathrm{rfloor}}
\providecommand{\sigma}{\mathrm{sigma}}
\pagestyle{fancy}\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfoot[L]{\footnotesize\begin{tabular}[b]{@{}l@{}}iis:2611.00536 \textperiodcentered{} \href{https://isitsolved.com/journal/ecc335a7d219}{isitsolved.com/journal/ecc335a7d219}\\ Timestamped in Bitcoin block 978,152 (2026-11-30), transaction \href{https://mempool.space/tx/32553b0ed63b82256315f408af8a2518183e3aa5e5fa9e39b4a6388249c56180}{\texttt{32553b0ed63b8225\ldots{}49c56180}}\end{tabular}}\fancyfoot[R]{\footnotesize\thepage}
\hypersetup{pdftitle={Exactly k-tuple-uniform random permutations whose matching union has only bounded components (answer to MO 286057(a))},pdfauthor={Dev Singh}}
\title{\bfseries Exactly k-tuple-uniform random permutations whose matching union has only bounded components (answer to MO 286057(a))}
\author{Dev Singh}
\date{2026-11-30 \\ \small iis:2611.00536}
\begin{document}
\maketitle
\thispagestyle{fancy}
\begin{abstract}
MathOverflow question 286057 (H. A. Helfgott, 2017), part (a), asks: let G be a graph on a vertex set Omega with no isolated vertices, and let pi be a random permutation that is only required to be approximately uniform on ordered k-tuples of distinct vertices for bounded k (say k \ensuremath{\le} 100); must the union of G and its image under pi be connected, or have a component with more than 0.9|Omega| vertices, with positive probability? Helfgott wrote that his intuition was no. We prove the answer is no in a strong form. For every k \ensuremath{\ge} 1, every even N \ensuremath{\ge} k and a perfect matching M on N vertices, there is a distribution on permutations pi such that every ordered j-tuple, j \ensuremath{\le} k, is sent to every ordered j-tuple with probability exactly 1/(N)\_j, while every component of the union of M and pi(M) has at most 4*floor(k/2) + 2 vertices for every outcome. For k = 100 that is at most 202 vertices however large N is. The construction starts from a uniform permutation, cuts each long alternating cycle of the red-blue union into cycles that are still longer than k, and symmetrises by the automorphism group of M on both sides; cutting does not change the joint count of red and blue patterns of any tuple of at most k vertices, and the tuple probabilities depend only on those counts. Part (b) of the question is not addressed. Written proof, checked by hand by a second reader, with two independent exhaustive computations for N = 8, k = 3; not formalised in Lean.
\end{abstract}


\section*{Exactly tuple-uniform permutations whose matching union has only small components}

\begin{thmpar}\textbf{Theorem.} For \(k\ge1\), even \(N\ge k\) and a perfect matching \(M\) on \(N\) vertices there is a random permutation \(\pi\) with \(\Pr(\pi a=b)=1/(N)_j\) for all ordered distinct \(j\)-tuples \(a,\allowbreak b\), \(j\le k\), such that every component of \(M\cup\pi M\) has at most \(4\lfloor k/2\rfloor+2\) vertices. Written proof with a computer check of a small case; not machine-checked in Lean.\end{thmpar}

An answer to part (a) of \href{https://mathoverflow.net/questions/286057}{MathOverflow question 286057} (H. A. Helfgott, 2017).

Harald Helfgott asks whether a graph with no isolated vertices and its image under an approximately tuple-uniform permutation must have a giant component with positive probability. His condition tests every pair of ordered tuples of distinct vertices, for all tuple lengths up to a fixed bound such as 100. \href{https://mathoverflow.net/questions/286057/when-is-the-union-of-a-graph-and-a-random-permutation-thereof-connected}{Original question, part (a)}

\textbf{Answer to (a): no.} Fix \(k\ge1\), an even \(N\ge k\), and a perfect matching \(M\) on \(N\) vertices. There is a distribution on permutations \(\pi\) with these two properties:

\begin{enumerate}
  \item For any \(j\le k\) and any ordered distinct \(j\)-tuples \(a,\allowbreak b\), \(\Pr(\pi a=b)=1/(N)_j\), where \((N)_j=N(N-1)\cdots(N-j+1)\).
  \item Every component of \(M\cup\pi M\) has at most \(4\lfloor k/2\rfloor+2\) vertices, for every outcome.
\end{enumerate}

For example, take \(k=100\) and \(N=404\), or any larger even \(N\). Every test involving at most 100 vertices has exactly its uniform probability, yet the largest possible component has at most 202 vertices.

\section*{Construction}

Color the edges of \(M\) red. Start with a genuinely uniform permutation \(\sigma\) and color the matching \(\sigma M\) blue. Keep both colors when they occupy the same edge. The resulting graph is a disjoint union of even alternating cycles, counting a doubled edge as a cycle of length two.

Put \(b=\lfloor k/2\rfloor+1\). In any alternating cycle containing \(L\ge 2b\) red edges, cut the cyclic list of red edges into blocks of sizes between \(b\) and \(2b-1\). Such a partition exists: take blocks of size \(b\) and add the remainder to the last block. Within each block, retain the red edges and close the alternating path with a blue edge. Leave all other cycles intact. Any deterministic convention for the first red edge and orientation works. Call the new blue matching \(B\). The altered cycles, both before and after cutting, have more than \(k\) vertices. The new graph has at most \(2(2b-1)\) vertices per component.

Fix a permutation \(g\) carrying \(M\) to \(B\) (for instance order each matching's edges and each edge's endpoints lexicographically and match corresponding entries). Independently sample two uniform elements \(U,\allowbreak V\) of the automorphism group \(H\) of the red matching. Output \(\pi=UgV\). The components of \(M\cup\pi M\) are a relabeling by \(U\) of those of \(M\cup B\).

\section*{Why all tuple probabilities survive the cut}

On an ordered tuple, its red pattern lists exactly which pairs of positions are red partners. Define its blue pattern in the same fashion. For any \(j\le k\) the joint histogram of these two patterns over all ordered distinct \(j\)-tuples is exactly the same before and after cutting.

To prove this, first count all color-preserving graph homomorphisms from any pattern graph \(F\) on at most \(j\) labeled vertices to the red-blue graph. For connected \(F\), choose a root and a spanning tree. Once the root image is specified, all tree images are forced: every target vertex has exactly one neighbor of each color. A remaining edge gives a compatibility check along the tree path between its endpoints followed by that edge, a closed word of length at most \(j\). This argument also allows parallel edges and loops. To test closure, cancel consecutive equal colors in the word, since each color acts as an involution. A remaining nonempty alternating word of length at most \(j\) walks in one direction along its alternating cycle and cannot close on any cycle longer than \(j\). The empty word always closes. Thus all vertices lying in changed cycles give identical outcomes to every check, and their total number is preserved. All unaltered cycles are identical. This proves equality of homomorphism counts; for a disconnected \(F\) multiply the counts of its components.

To enforce distinct tuple entries, apply inclusion--exclusion to pairwise vertex equalities. Each resulting count is a homomorphism count from a quotient of \(F\) with at most \(j\) vertices. To impose the exact red and blue patterns, also exclude unwanted colored edges by inclusion--exclusion. Every term is of the type just proved invariant. This establishes the histogram assertion, including tuples that meet several different cycles.

Finally, \(H\) acts transitively on tuples of each red pattern: any prescribed correspondence extends by matching whole red edges, filling in unused partners and then the remaining edges. Write \(D_P\) for the number of tuples of pattern \(P\) in one matching. It is the same for every perfect matching. Let \(P\) be the red pattern of input \(a\), and \(Q\) the red pattern of output \(b'\). Conditional on \(g\), the tuple \(gVa\) is uniform on the \(D_P\) tuples of blue pattern \(P\). The left factor \(U\) can send one of these to \(b'\) with probability \(1/D_Q\) precisely when its red pattern is \(Q\). Consequently

\[
 \Pr(UgVa=b'\mid g)=
 \frac{\#\{\text{ordered distinct tuples with red pattern }Q,\ \text{blue pattern }P\}}
 {D_P D_Q}.
\]

By histogram invariance, this conditional probability is unchanged if we use \(\sigma\) in place of \(g\) with its original blue matching. Average over \(\sigma\): the product \(U\sigma V\) is genuinely uniform, giving exactly \(1/(N)_j\). This proves the theorem.

\section*{Explicit finite check}

For \(N=8\), \(k=3\), fix the consecutive-pair red matching. Give permutations weight zero if the union is an eight-cycle, weight five if it consists of two four-cycles, and weight one otherwise, all divided by \(8!\). The verifier enumerates all 40,320 permutations. Each allowed output triple receives total weight 120 for each input red-pattern representative, so its probability is \(120/40320=1/336\). Separately it counts the joint induced patterns directly on alternating polygons, comparing the eight-cycle with two four-cycles and checking splits at tuple lengths four and five. Both checks passed. Run the verifier with Node.js. \href{https://github.com/DevSingh05/mo-286057-tuple-uniform-matching/blob/main/verify-286057.js}{Verifier}. A second, independent script, \href{https://github.com/DevSingh05/mo-286057-tuple-uniform-matching/blob/main/check_n8_k3.py}{check\_n8\_k3.py}, enumerates all 40,320 permutations with the same weights and confirms that every image triple has weight exactly 120.

\section*{Scope and prior work}

Aaron Meyerowitz's answer analyzes a genuinely uniform matching. Will Sawin's comment gives a vector-space obstruction under a relaxation that only controls most tuples. Both are relevant predecessors. The theorem above controls every tuple, with zero error. The question in part (b) concerns several independent images of the graph; this construction settles part (a) only. \href{https://mathoverflow.net/questions/286057/when-is-the-union-of-a-graph-and-a-random-permutation-thereof-connected}{Thread and discussion}

Prior-art checks covered the source thread, GitHub issue and code search, the open-math agent repositories, and web searches by problem number, author and mathematical description (including the literature on k-wise independent permutations). We found no earlier solution of part (a). If there is one, please open an issue and we will credit it.

The bound \(4\lfloor k/2\rfloor+2\) does not depend on \(N\), so the construction defeats every threshold \(\delta|\Omega|\), not only the \(0.9|\Omega|\) in the question. Helfgott wrote that his intuition for (a) was "no"; this confirms it.

\textbf{How far it has been checked.} A written proof, checked by hand by a second reader, plus two independent exhaustive computations for \(N=8\), \(k=3\). Not formalised in Lean and not read by a human specialist.

Produced with AI assistants: Codex (OpenAI) found and wrote the proof; Claude (Anthropic) refereed it.

\section*{Sources}
\begin{enumerate}\small
  \item MathOverflow question 286057. \url{https://mathoverflow.net/questions/286057}
  \item Proof and verification scripts. \url{https://github.com/DevSingh05/mo-286057-tuple-uniform-matching}
\end{enumerate}
\end{document}
