\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{\bigl}{\mathrm{bigl}}
\providecommand{\bigr}{\mathrm{bigr}}
\providecommand{\cdots}{\mathrm{cdots}}
\providecommand{\dots}{\mathrm{dots}}
\providecommand{\ge}{\mathrm{ge}}
\providecommand{\in}{\mathrm{in}}
\providecommand{\le}{\mathrm{le}}
\providecommand{\lim}{\mathrm{lim}}
\providecommand{\mapsto}{\mathrm{mapsto}}
\providecommand{\ne}{\mathrm{ne}}
\providecommand{\notin}{\mathrm{notin}}
\providecommand{\qquad}{\mathrm{qquad}}
\providecommand{\quad}{\mathrm{quad}}
\providecommand{\rho}{\mathrm{rho}}
\providecommand{\setminus}{\mathrm{setminus}}
\providecommand{\sim}{\mathrm{sim}}
\providecommand{\subseteq}{\mathrm{subseteq}}
\providecommand{\to}{\mathrm{to}}
\pagestyle{fancy}\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfoot[L]{\footnotesize\begin{tabular}[b]{@{}l@{}}iis:2612.00867 \textperiodcentered{} \href{https://isitsolved.com/journal/58750ef9901f}{isitsolved.com/journal/58750ef9901f}\\ Timestamped in Bitcoin block 978,726 (2026-12-04), transaction \href{https://mempool.space/tx/defac6c0a20711711bdf318050d904ea4901da7fe3a7bd9aa04f7f8c13dc4866}{\texttt{defac6c0a2071171\ldots{}13dc4866}}\end{tabular}}\fancyfoot[R]{\footnotesize\thepage}
\hypersetup{pdftitle={Descent sets of a permutation and its inverse: almost every pair occurs, f(n) \textasciitilde{} 4\textasciicircum{}(n-1)},pdfauthor={Dev Singh}}
\title{\bfseries Descent sets of a permutation and its inverse: almost every pair occurs, f(n) \textasciitilde{} 4\textasciicircum{}(n-1)}
\author{Dev Singh}
\date{2026-12-04 \\ \small iis:2612.00867}
\begin{document}
\maketitle
\thispagestyle{fancy}
\begin{abstract}
MathOverflow 486548 (Stanley; IIS-L-27146): f(n) counts pairs (S,T) of subsets of \{1..n-1\} with D(w) = S and D(w\textasciicircum{}-1) = T for some w in S\_n. An answer in the thread shows every pair with |S| = |T| occurs, giving f(n) \ensuremath{\ge} 4\textasciicircum{}(n-1)/\(n^{2}\) and L = lim f(n)\textasciicircum{}(1/n) = 4. We prove more: if 1 \ensuremath{\le} |S| \ensuremath{\le} |T|, d = |T| - |S|, T has at least d+1 runs of consecutive integers and S has at least 2d+1, then the pair occurs. Both sets are realised by standard Young tableaux of the common shape (n-|T|, d+1, 1\textasciicircum{}(|S|-1)), written down explicitly as lattice words, and Robinson-Schensted gives w. Consequently all but an exponentially small fraction of the 4\textasciicircum{}(n-1) pairs occur, so f(n) \textasciitilde{} 4\textasciicircum{}(n-1). The construction is verified by direct computation for every qualifying pair with n \ensuremath{\le} 9 and for random pairs up to n = 400. Open: an exact description of the pairs that occur.
\end{abstract}


\textbf{Result.} \(f(n)=4^{n-1}(1-O(e^{-cn}))\), via an explicit sufficient condition on \((S,\allowbreak T)\). Strengthens the known \(f(n)\ge 4^{n-1}/n^2\). Written proof with an exhaustive computer check for \(n\le 9\); not machine-checked in Lean.

On \href{https://mathoverflow.net/questions/486548}{MathOverflow question 486548} (Richard Stanley,
2025).

For a permutation \(w=a_1a_2\cdots a_n\) let \(D(w)=\{i : a_i>a_{i+1}\}\) be its descent set. Let
\(f(n)\) be the number of pairs \((S,\allowbreak T)\) of subsets of \(\{1,\dots,n-1\}\) such that some \(w\in S_n\)
has \(D(w)=S\) and \(D(w^{-1})=T\). Stanley asks what can be said about \(f(n)\), and in particular
for \(L=\lim f(n)^{1/n}\). Trivially \(f(n)\le 4^{n-1}\).

\textbf{Already known.} An answer in the thread shows that every pair with \(|S|=|T|\) occurs, which
gives \(4^{n-1}/n^2\le f(n)\) and so \(L=4\).

\textbf{Result here.} Almost every pair occurs:


\[f(n)=4^{n-1}\bigl(1-O(e^{-cn})\bigr)\quad\text{for some } c>0,\qquad\text{so } f(n)\sim 4^{n-1}.\]


This follows from an explicit sufficient condition. A \emph{run} of a set is a maximal block of
consecutive integers in it; write \(r(S)\) for the number of runs.

\begin{thmpar}\textbf{Theorem.} Let \(S,\allowbreak T\subseteq\{1,\dots,n-1\}\) with \(1\le |S|\le |T|\) and put \(d=|T|-|S|\). If\end{thmpar}


\[r(T)\ \ge\ d+1\qquad\text{and}\qquad r(S)\ \ge\ 2d+1,\]


then there is a \(w\in S_n\) with \(D(w)=S\) and \(D(w^{-1})=T\). (By passing to \(w^{-1}\) the same
holds with \(S\) and \(T\) exchanged.) For \(d=0\) this is the known case \(|S|=|T|\).

\section*{Proof}

\textbf{Reduction to tableaux.} Under the Robinson--Schensted correspondence \(w\mapsto(P,\allowbreak Q)\) one has
\(D(w)=D(Q)\) and \(D(w^{-1})=D(P)\), where a descent of a standard Young tableau is an \(i\) such
that \(i+1\) lies in a lower row than \(i\) (Stanley, \emph{Enumerative Combinatorics} vol. 2,
Lemma 7.23.1 and Theorem 7.13.1). Since every pair of standard tableaux of the same shape
arises, it is enough to find two standard tableaux of one shape with descent sets \(S\) and \(T\).

\textbf{Tableaux as words.} A standard tableau is the same thing as a word
\(\rho(1)\rho(2)\cdots\rho(n)\), where \(\rho(k)\) is the row containing \(k\), in which every prefix
has at least as many \(j\)'s as \((j+1)\)'s. Then \(i\) is a descent exactly when
\(\rho(i+1)>\rho(i)\).

We use the shape with first row \(n-|T|\), second row \(d+1\), and then \(|S|-1\) rows of length
one. In a word of this shape the letters \(3,\allowbreak 4,\allowbreak 5,\allowbreak \dots\) each occur once, in increasing order;
call them \emph{leg letters}.

\textbf{The word for \(T\).} Let \(X\) be the set of first elements of the first \(d+1\) runs of \(T\). Put
\(\rho(1)=1\), and for \(1\le i<n\):

\begin{itemize}
  \item \(\rho(i+1)=2\) if \(i\in X\);
  \item \(\rho(i+1)=\) the next unused leg letter if \(i\in T\setminus X\);
  \item \(\rho(i+1)=1\) if \(i\notin T\).
\end{itemize}

If \(i\in X\) then \(i-1\notin T\), so \(\rho(i)=1\) and the step \(1\to2\) goes up. A leg letter is
larger than everything before it, so those steps go up. Steps to \(1\) do not go up. So the
descent set is \(T\). Each \(2\) is directly preceded by its own \(1\), and the first leg letter comes
after the first \(2\), so the prefix condition holds. There are \(d+1\) twos and
\(|T|-d-1=|S|-1\) leg letters.

\textbf{The word for \(S\).} Let \(i_1\) be the least element of \(S\). For each run of \(S\) with last
element \(e\le n-2\), call the position \(e+2\) a \emph{slot}. There are at least \(r(S)-1\ge 2d\) slots;
mark the last \(d\) of them. Put \(\rho(1)=1\), and for \(1\le i<n\):

\begin{itemize}
  \item \(\rho(i+1)=2\) if \(i=i_1\);
  \item \(\rho(i+1)=\) the next unused leg letter if \(i\in S\), \(i\ne i_1\);
  \item \(\rho(i+1)=2\) if \(i\notin S\) and \(i+1\) is a marked slot;
  \item \(\rho(i+1)=1\) otherwise.
\end{itemize}

Steps from \(i\in S\) go up as before. For a marked slot \(e+2\): the letter at \(e+1\) is a \(2\) or
a leg letter (because \(e\in S\)), so the step \(e+1\to e+2\) does not go up, as required since
\(e+1\notin S\). The step out of a slot goes to a leg letter if the slot is in \(S\) and to \(1\)
otherwise (two slots are never adjacent), which is correct in both cases. So the descent set
is \(S\). Prefix condition: before any marked slot there is the \(1\) at position \(1\) and at
least \(d\) unmarked slots, each carrying a \(1\), while the word contains only \(d+1\) twos in
total. The first leg letter comes after the \(2\) at position \(i_1+1\). There are \(d+1\) twos and
\(|S|-1\) leg letters, the same shape as for \(T\). \ensuremath{\blacksquare}

\section*{Why almost every pair occurs}

Choose \(S,\allowbreak T\) independently and uniformly. Then \(|S|,\allowbreak |T|\) are binomial with mean \((n-1)/2\),
so \(d\le n/20\) outside an event of probability \(e^{-cn}\). The number of runs is
\(r(S)=\#\{i: i\in S,\ i-1\notin S\}\); the indicators for odd \(i\) are independent with mean
\(1/4\), and likewise for even \(i\), so \(r(S)\ge n/8\) and \(r(T)\ge n/8\) outside an event of
probability \(e^{-cn}\). For \(n\ge 40\) these give \(r\ge 2d+1\), so the theorem applies. Hence
all but an exponentially small fraction of the \(4^{n-1}\) pairs occur.

\section*{Check it}

    python construct.py 9

For every pair meeting the hypotheses with \(n\le 9\) (16,749 pairs at \(n=9\)), the script builds
the two words, turns them into tableaux, applies the inverse Robinson--Schensted map, and
checks \(D(w)=S\) and \(D(w^{-1})=T\) directly. It then does the same for random pairs with
\(n=30,\allowbreak  100,\allowbreak  400\); at \(n=400\), 299 of 300 random pairs meet the hypotheses.

\section*{Scope and prior work}

\begin{itemize}
  \item The condition is sufficient, not necessary: at \(n=9\) it accounts for 20,630 of the
\(f(9)=38{,}724\) pairs. An exact description of the pairs that occur is still open, as is
the exact size of \(4^{n-1}-f(n)\).
  \item \(L=4\) and the case \(|S|=|T|\) are from the existing answer in the thread (posted with AI
assistance, by user jvvk). The values \(f(1),\allowbreak \dots,\allowbreak f(13)\) are in
\href{https://oeis.org/A380394}{OEIS A380394}. We found no earlier statement that
\(f(n)\sim 4^{n-1}\) (thread, OEIS entry, 4 Dec 2026).
  \item Checked by the exhaustive computation above; the proof has not had a second reader and is
not formalised in Lean.
\end{itemize}

Produced with an AI assistant: Claude (Anthropic) found the construction and wrote the proof
and the check.

\section*{Sources}
\begin{enumerate}\small
  \item MathOverflow 486548. \url{https://mathoverflow.net/questions/486548}
  \item OEIS A380394. \url{https://oeis.org/A380394}
  \item Repository. \url{https://github.com/DevSingh05/math/tree/main/mo-486548}
\end{enumerate}
\end{document}
