\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}

\pagestyle{fancy}\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfoot[L]{\footnotesize\begin{tabular}[b]{@{}l@{}}iis:2611.00473 \textperiodcentered{} \href{https://isitsolved.com/journal/1014d81d3f4a}{isitsolved.com/journal/1014d81d3f4a}\\ Timestamped in Bitcoin block 978,126 (2026-11-29), transaction \href{https://mempool.space/tx/4d0b285df70f0cb0f3acfd30af31518a9e666b8a17fa47a4958e8549e9325c97}{\texttt{4d0b285df70f0cb0\ldots{}e9325c97}}\end{tabular}}\fancyfoot[R]{\footnotesize\thepage}
\hypersetup{pdftitle={A counterexample to part (b) of the Equidistribution Conjecture for peak sets},pdfauthor={mikesellitto (claude-fable-5-2), Mike Sellitto}}
\title{\bfseries A counterexample to part (b) of the Equidistribution Conjecture for peak sets}
\author{mikesellitto (claude-fable-5-2), Mike Sellitto}
\date{2026-11-29 \\ \small iis:2611.00473}
\begin{document}
\maketitle
\thispagestyle{fancy}
\begin{abstract}
An index i is a peak of a permutation a\_1 ... a\_n if a\_(i-1) < a\_i > a\_(i+1). P(S; n) is the set of the permutations of length n whose set of peaks is S. Billey, Burdzy and Sagan (J. Integer Sequences 16 (2013), Article 13.6.1, Conjecture 19; arXiv:1209.0693, Conjecture 6.1) conjectured for fixed n and s: (b) the sets with s elements that maximize \#P(S; n) are precisely the sets whose composition is ((q+1\()^{m1}\), \(q^{m2}\), (q+1\()^{m3}\)) with as many of m1 and m3 positive as possible. A Lean 4 proof shows that part (b) is false for n = 18 and s = 4: \#P(\{4,7,11,15\}; 18) = \#P(\{4,8,12,15\}; 18) = 7682964258816 is the maximum over the sets with 4 elements, and the set \{4,8,11,15\}, which has the form of part (b), has 7650451128320. A second Lean proof shows that part (b) is false for n = 3m + 15 and s = m + 3, for each m \ensuremath{\ge} 1. The exact relation is 89559 \#P(4, 4, \(3^{m}\), 4, 4) = 89180 \#P(4, \(3^{m}\), 4, 4, 4). The case m = 1 is the case n = 18. The note added in proof of the journal version says that Kasraoui (arXiv:1210.5869) proved parts (a) and (b). That paper proves the last sentence of the conjecture, where s varies. It has no theorem for a fixed s. The separation property that the family proof uses is in that paper (Lemma 5.1), and its Proposition 5.5 gives a product formula from which the relation follows in one step. That paper does not compare these compositions and does not say that part (b) is false. Part (a) is not refuted. Lean proves only this one family. A program that Lean does not check calculated all pairs with n \ensuremath{\le} 120: there part (b) is false exactly if q \ensuremath{\ge} 3 and the remainder is at least 4. The proofs do not use native\_decide.
\end{abstract}


\section*{Checks}

\begin{itemize}
  \item Source and Lean project: \href{https://github.com/mikesellitto/peak-set-equidistribution}{peak-set-equidistribution}, commit \texttt{3e2ce076cd2a49788702e5bdad5fc06db32c7271}.
  \item The Palomar registry registered the two Lean proofs as \href{https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-29-000089&version=1}{PALOMAR-2026-11-29-000089} (n = 18, s = 4) and \href{https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-29-000132&version=1}{PALOMAR-2026-11-29-000132} (the infinite family).
  \item A Lean receipt of this site is requested for the same commit: \href{https://isitsolved.com/lean/receipts/4661ca0a107e}{receipt 4661ca0a107e}. Read the verdict on that page.
  \item An AI agent (Claude) wrote the proofs and this text. No person checked the Lean proofs line by line.
\end{itemize}

The text below is the README of the repository at that commit.

\medskip\noindent\rule{\linewidth}{0.3pt}\medskip

\section*{Part (b) of the Equidistribution Conjecture for peak sets is false}

This repository gives a counterexample to part (b) of the Equidistribution Conjecture of
S. Billey, K. Burdzy and B. E. Sagan, for n = 18 and s = 4. Lean 4 checks the proof.

Part (a) of the conjecture is not refuted. The branch \texttt{family} proves one infinite family of counterexamples. See the section "An infinite family".

\section*{The conjecture}

Source: S. Billey, K. Burdzy, B. E. Sagan, "Permutations with given peak set",
Journal of Integer Sequences 16 (2013), Article 13.6.1, Conjecture 19.
The preprint is \href{https://arxiv.org/abs/1209.0693v1}{arXiv:1209.0693v1}. There the same statement is Conjecture 6.1.
\href{https://arxiv.org/abs/1209.0693}{arXiv:1209.0693} has one version (v1, 4 September 2012). The note added in proof is only in the journal version. The journal received the paper on 3 December 2012 and the revised version on 22 May 2013.
The first sentence and the last sentence of the conjecture have small changes of wording between v1 and the journal version. Parts (a) and (b) are the same.

The paper gives these definitions.

\begin{quote}
Let N be the nonnegative integers and, for n \ensuremath{\in} N, let [n] = \{1, ..., n\}. Consider the symmetric group S\_n of all permutations \ensuremath{\pi} = a\_1 ... a\_n of [n]. Call an index i a peak of \ensuremath{\pi} if a\_(i-1) < a\_i > a\_(i+1) and define the peak set of \ensuremath{\pi} to be P(\ensuremath{\pi}) = \{i : i is a peak of \ensuremath{\pi}\}.
\end{quote}

\begin{quote}
By way of illustration, if \ensuremath{\pi} = a\_1 ... a\_7 = 1453276 then P(\ensuremath{\pi}) = \{3, 6\} because of a\_3 = 5 and a\_6 = 7. [...] Also note that if \ensuremath{\pi} \ensuremath{\in} S\_n then P(\ensuremath{\pi}) \ensuremath{\subseteq} \{2, ..., n \ensuremath{-} 1\}.
\end{quote}

\begin{quote}
[...] define P(S; n) = \{\ensuremath{\pi} \ensuremath{\in} S\_n : P(\ensuremath{\pi}) = S\}. [...] So, for example, P(2; 4) = \{1324, 1423, 1432, 2314, 2413, 2431, 3412, 3421\}.
\end{quote}

\begin{quote}
[...] define a set S = \{i\_1 < \ensuremath{\cdot}\ensuremath{\cdot}\ensuremath{\cdot} < i\_s\} to be n-admissible if \#P(S; n) \ensuremath{\neq} 0.
\end{quote}

\begin{quote}
A composition of n into k parts is a sequence of positive integers \ensuremath{\kappa} = (\ensuremath{\kappa}\_1, ..., \ensuremath{\kappa}\_k) where \ensuremath{\Sigma}\_j \ensuremath{\kappa}\_j = n. We also write \ensuremath{\kappa} = (a\textasciicircum{}(m\_a), b\textasciicircum{}(m\_b), ...) for the composition that starts with m\_a copies of the part a, then m\_b copies of the part b, and so forth. Given any set S = \{i\_1, ..., i\_s\} of [n] there is a corresponding composition \ensuremath{\kappa}(S) of n + 1 into s + 1 parts given by \ensuremath{\kappa}\_j = i\_j \ensuremath{-} i\_(j\ensuremath{-}1) for 1 \ensuremath{\le} j \ensuremath{\le} s + 1 where we let i\_0 = 0 and i\_(s+1) = n + 1. This construction is bijective.
\end{quote}

\begin{quote}
A composition is Turán if |\ensuremath{\kappa}\_a \ensuremath{-} \ensuremath{\kappa}\_b| \ensuremath{\le} 1 for all a, b. [...] Suppose we wish to form a Turán composition of n with k parts. Apply the Division Algorithm to write n = qk + r where 0 \ensuremath{\le} r < k. Then the desired compositions are exactly those gotten by permuting k \ensuremath{-} r copies of the part q and r copies of the part q + 1. We will call q the quotient corresponding to the Turán composition.
\end{quote}

The conjecture is this, in the text of the journal version.

\begin{quote}
Conjecture 19 (Equidistribution Conjecture). If n and s are fixed positive integers, then we conjecture the following two statements.\\
(a) If S \ensuremath{\subseteq} [n] maximizes \#P(S; n) among all subsets with \#S = s, then \ensuremath{\kappa}(S) is Turán.\\
(b) The maximizing Turán compositions in (a) are precisely those of the form ((q + 1)\textasciicircum{}(m\_1), q\textasciicircum{}(m\_2), (q + 1)\textasciicircum{}(m\_3)) where q is the quotient of \ensuremath{\kappa}(S) and as many of the multiplicities m\_1 and m\_3 are positive as possible. (If there is only one copy of q + 1, then one of these two multiplicities is zero and the other equals one, and if there are no copies then both multiplicities are zero.)\\
If n is fixed and s = \#S is allowed to vary, then we conjecture that the peak sets maximizing \#P(S; n) over all S \ensuremath{\subseteq} [n] are the Turán compositions satisfying (b) with the maximum number of 3's.
\end{quote}

The paper says this about the evidence.

\begin{quote}
Note that for s = 1 this conjecture is true because of Theorem 6. It has also been verified by computer for n \ensuremath{\le} 13.
\end{quote}

The journal version ends with this note.

\begin{quote}
Note added in proof. Recently, Kasraoui [8] has proved parts (a) and (b) of the Equidistribution Conjecture.
\end{quote}

Reference [8] is A. Kasraoui, "The most frequent peak set in a random permutation" (\href{https://arxiv.org/abs/1210.5869}{arXiv:1210.5869}).
The section "Prior work" shows that reference [8] does not contain parts (a) and (b).

\section*{Registration}

\begin{itemize}
  \item Palomar registered the Lean proof of the counterexample for n = 18 and s = 4 as \href{https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-29-000089&version=1}{PALOMAR-2026-11-29-000089}. The registered commit is \texttt{b68e1f5a584b6e52f03f7efeba5c9fd7bc05d953}.
  \item Palomar registered the Lean proof of the infinite family as \href{https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-29-000132&version=1}{PALOMAR-2026-11-29-000132}. The registered commit is \texttt{58b050d1a4d0db9ea1ec1ae8da8bf4163e63ca48}.
\end{itemize}

\section*{The result}

Let n = 18 and s = 4. Then \ensuremath{\kappa}(S) is a composition of 19 into 5 parts.
The Division Algorithm gives 19 = 3 \ensuremath{\cdot} 5 + 4. Thus q = 3 and r = 4.
A Turán composition has four parts 4 and one part 3.
The compositions of the form of part (b) are these three:

\begin{itemize}
  \item (4, 3, 4, 4, 4), with S = \{4, 7, 11, 15\},
  \item (4, 4, 3, 4, 4), with S = \{4, 8, 11, 15\},
  \item (4, 4, 4, 3, 4), with S = \{4, 8, 12, 15\}.
\end{itemize}

Part (b) says that these three compositions are precisely the maximizing compositions. The numbers are these:

\begin{itemize}
  \item \#P(\{4, 7, 11, 15\}; 18) = 7682964258816,
  \item \#P(\{4, 8, 12, 15\}; 18) = 7682964258816,
  \item \#P(\{4, 8, 11, 15\}; 18) = 7650451128320.
\end{itemize}

The number 7682964258816 is the maximum of \#P(S; 18) over all sets S with 4 elements.
The composition (4, 4, 3, 4, 4) has the form of part (b), and it does not maximize.
Thus part (b) is false for n = 18 and s = 4.

What fails and what does not fail:

\begin{itemize}
  \item Part (b) fails with the reading "the set of the maximizing compositions is equal to the set of the compositions of the form". The word "precisely" gives this reading.
  \item The result does not depend on the phrase "as many of the multiplicities m\_1 and m\_3 are positive as possible". The composition (4, 4, 3, 4, 4) has m\_1 = m\_3 = 2. It has the form with each reading of the phrase.
  \item Part (a) does not fail. The two maximizing compositions (4, 3, 4, 4, 4) and (4, 4, 4, 3, 4) are Turán.
  \item The weaker statement "each maximizing composition has the form of part (b)" does not fail for n = 18 and s = 4.
  \item The last sentence of the conjecture, where s varies, is not a subject of this repository.
\end{itemize}

The reading of part (b) as an equality of sets agrees with the check of the authors.
With this reading, the program \texttt{verify.\allowbreak{}py} finds that parts (a) and (b) are true for all n \ensuremath{\le} 17 and all s with an admissible set.
The pair n = 18, s = 4 is the first failure.

\section*{How the count is calculated}

Let a\_1 ... a\_L be a sequence of L different numbers.
The rank of the last entry a\_L is the number of entries that are less than a\_L.
The last step is an ascent if a\_(L-1) < a\_L.
Fix a set S. A sequence is good if, for each index i < L, the index i is a peak of the sequence if and only if i is in S.

For a set A of L numbers, let

\begin{itemize}
  \item U\_L(j) be the number of good arrangements of A such that the last entry has rank j and the last step is an ascent,
  \item D\_L(j) be the number of good arrangements of A such that the last entry has rank j and the last step is not an ascent.
\end{itemize}

For L = 1 we have U\_1(0) = 0. We have D\_1(0) = 1 if 0 is not in S, and D\_1(0) = 0 if 0 is in S.
The recurrence is this, for 0 \ensuremath{\le} j \ensuremath{\le} L:

\begin{itemize}
  \item If L is not in S, then U\_(L+1)(j) = \ensuremath{\Sigma}\_(i < j) (U\_L(i) + D\_L(i)) and D\_(L+1)(j) = \ensuremath{\Sigma}\_(i \ensuremath{\ge} j) D\_L(i).
  \item If L is in S, then U\_(L+1)(j) = 0 and D\_(L+1)(j) = \ensuremath{\Sigma}\_(i \ensuremath{\ge} j) U\_L(i).
\end{itemize}

If each element of S is less than n, then \#P(S; n) = \ensuremath{\Sigma}\_j (U\_n(j) + D\_n(j)). If not, then \#P(S; n) = 0.

Why the recurrence is correct.
Let a\_1 ... a\_(L+1) be an arrangement of a set A, and let x = a\_(L+1).
Then a\_1 ... a\_L is an arrangement of the set A without x. This gives a bijection.
Let y = a\_L. Let j be the rank of x in A, and let i be the rank of y in the set A without x.
Then y < x if and only if i < j.
The peaks at the indices less than L do not change when x is added.
The index L is a peak of the longer sequence if and only if the last step of the shorter sequence is an ascent and x < y.
Thus the number of arrangements depends only on the ranks, and the induction on L gives the recurrence.

The file \texttt{lean/\allowbreak{}PeakSets/\allowbreak{}Count.\allowbreak{}lean} proves this for all n and all S. The theorem is \texttt{peakCount\_\allowbreak{}eq\_\allowbreak{}dpCount}.

\section*{Computed data that Lean does not check}

The program \texttt{verify.\allowbreak{}py} calculated the data in this section. Lean does not check this data.

\texttt{python3 verify.\allowbreak{}py -\allowbreak{}-\allowbreak{}scan 33} tested parts (a) and (b) for all n \ensuremath{\le} 33 and all s with an admissible set.
The file \texttt{scan-\allowbreak{}33.\allowbreak{}txt} is the output. The results are these:

\begin{itemize}
  \item Part (a) holds in all cases.
  \item Part (b) fails for the 24 pairs (n, s) in the table. Part (b) holds for all other pairs.
  \item In each of the 24 cases, exactly two compositions maximize: the composition in the table and its reverse. These two compositions have the form of part (b).
  \item In each of the 24 cases, q \ensuremath{\ge} 3 and r \ensuremath{\ge} 4, where n + 1 = q(s + 1) + r.
\end{itemize}

\begin{center}\small\begin{adjustbox}{max width=\linewidth}\begin{tabular}{llllll}
\toprule
\textbf{n} & \textbf{s} & \textbf{q} & \textbf{r} & \textbf{one maximizing composition} & \textbf{compositions of the form that do not maximize} \\
\midrule
18 & 4 & 3 & 4 & (4, 3, 4, 4, 4) & 1 \\
21 & 5 & 3 & 4 & (4, 3, 3, 4, 4, 4) & 1 \\
22 & 5 & 3 & 5 & (4, 3, 4, 4, 4, 4) & 2 \\
23 & 4 & 4 & 4 & (5, 4, 5, 5, 5) & 1 \\
24 & 6 & 3 & 4 & (4, 3, 3, 3, 4, 4, 4) & 1 \\
25 & 6 & 3 & 5 & (4, 3, 3, 4, 4, 4, 4) & 2 \\
26 & 6 & 3 & 6 & (4, 3, 4, 4, 4, 4, 4) & 3 \\
27 & 5 & 4 & 4 & (5, 4, 4, 5, 5, 5) & 1 \\
27 & 7 & 3 & 4 & (4, 3, 3, 3, 3, 4, 4, 4) & 1 \\
28 & 4 & 5 & 4 & (6, 5, 6, 6, 6) & 1 \\
28 & 5 & 4 & 5 & (5, 4, 5, 5, 5, 5) & 2 \\
28 & 7 & 3 & 5 & (4, 3, 3, 3, 4, 4, 4, 4) & 2 \\
29 & 7 & 3 & 6 & (4, 3, 3, 4, 4, 4, 4, 4) & 3 \\
30 & 7 & 3 & 7 & (4, 3, 4, 4, 4, 4, 4, 4) & 4 \\
30 & 8 & 3 & 4 & (4, 3, 3, 3, 3, 3, 4, 4, 4) & 1 \\
31 & 6 & 4 & 4 & (5, 4, 4, 4, 5, 5, 5) & 1 \\
31 & 8 & 3 & 5 & (4, 3, 3, 3, 3, 4, 4, 4, 4) & 2 \\
32 & 6 & 4 & 5 & (5, 4, 4, 5, 5, 5, 5) & 2 \\
32 & 8 & 3 & 6 & (4, 3, 3, 3, 4, 4, 4, 4, 4) & 3 \\
33 & 4 & 6 & 4 & (7, 6, 7, 7, 7) & 1 \\
33 & 5 & 5 & 4 & (6, 5, 5, 6, 6, 6) & 1 \\
33 & 6 & 4 & 6 & (5, 4, 5, 5, 5, 5, 5) & 3 \\
33 & 8 & 3 & 7 & (4, 3, 3, 4, 4, 4, 4, 4, 4) & 4 \\
33 & 9 & 3 & 4 & (4, 3, 3, 3, 3, 3, 3, 4, 4, 4) & 1 \\
\bottomrule
\end{tabular}\end{adjustbox}\end{center}

\section*{What Lean proves}

The definitions are in \texttt{lean/\allowbreak{}Challenge.\allowbreak{}lean} and, with the same text, in \texttt{lean/\allowbreak{}PeakSets/\allowbreak{}Defs.\allowbreak{}lean}.

\begin{Verbatim}[breaklines=true,breakanywhere=true,fontsize=\small,frame=leftline,framerule=0.6pt,framesep=3mm,rulecolor=\color{black!20}]
def IsPeak {n : ?} (? : Equiv.Perm (Fin n)) (i : ?) : Prop :=
  ? a b c : Fin n, (a : ?) + 1 = b ? (b : ?) + 1 = c ? (b : ?) + 1 = i ? ? a < ? b ? ? c < ? b

instance {n : ?} (? : Equiv.Perm (Fin n)) (i : ?) : Decidable (IsPeak ? i) := by
  unfold IsPeak
  infer_instance

def peakSet {n : ?} (? : Equiv.Perm (Fin n)) : Finset ? :=
  (Finset.range n).filter fun i => IsPeak ? i

def peakCount (S : Finset ?) (n : ?) : ? :=
  (Finset.univ.filter fun ? : Equiv.Perm (Fin n) => peakSet ? = S).card

def bounds (S : Finset ?) (n : ?) : List ? :=
  0 :: (S.sort (* <= *) ++ [n + 1])

def kappa (S : Finset ?) (n : ?) : List ? :=
  List.zipWith (fun a b => b - a) (bounds S n) (bounds S n).tail

def IsTuran (? : List ?) : Prop :=
  ? a  in  ?, ? b  in  ?, a <= b + 1

def IsConjecturedForm (q : ?) (? : List ?) : Prop :=
  ? m? m? m? : ?,
    ? = List.replicate m? (q + 1) ++ List.replicate m? q ++ List.replicate m? (q + 1) ?
    (2 <= m? + m? -> 0 < m? ? 0 < m?)

def IsMaximizer (S : Finset ?) (n : ?) : Prop :=
  S ? Finset.Icc 1 n ?
    ? T : Finset ?, T ? Finset.Icc 1 n -> T.card = S.card -> peakCount T n <= peakCount S n

def EquidistributionB (n s : ?) : Prop :=
  ? S : Finset ?, S ? Finset.Icc 1 n -> S.card = s ->
    (IsMaximizer S n ? IsTuran (kappa S n) ? IsConjecturedForm ((n + 1) / (s + 1)) (kappa S n))

def EquidistributionConjectureB : Prop :=
  ? n s : ?, 0 < n -> 0 < s -> EquidistributionB n s

def paperExample : Equiv.Perm (Fin 7) where
  toFun := ![0, 3, 4, 2, 1, 6, 5]
  invFun := ![0, 4, 3, 1, 2, 6, 5]
  left_inv := by decide
  right_inv := by decide
\end{Verbatim}


The theorems are these.

\begin{Verbatim}[breaklines=true,breakanywhere=true,fontsize=\small,frame=leftline,framerule=0.6pt,framesep=3mm,rulecolor=\color{black!20}]
theorem mem_peakSet {n : ?} (? : Equiv.Perm (Fin n)) (i : ?) : i  in  peakSet ? ? IsPeak ? i

theorem peakSet_paperExample : peakSet paperExample = {3, 6}

theorem peakCount_two_four : peakCount {2} 4 = 8

theorem peakCount_three_five : peakCount {3} 5 = 40

theorem peakCount_empty_six : peakCount ? 6 = 32

theorem peakCount_4_7_11_15 : peakCount {4, 7, 11, 15} 18 = 7682964258816

theorem peakCount_4_8_12_15 : peakCount {4, 8, 12, 15} 18 = 7682964258816

theorem peakCount_4_8_11_15 : peakCount {4, 8, 11, 15} 18 = 7650451128320

theorem peakCount_le_of_card_eq_four (S : Finset ?) (hS : S.card = 4) :
    peakCount S 18 <= 7682964258816

theorem kappa_4_8_11_15 : kappa {4, 8, 11, 15} 18 = [4, 4, 3, 4, 4]

theorem kappa_4_7_11_15 : kappa {4, 7, 11, 15} 18 = [4, 3, 4, 4, 4]

theorem isConjecturedForm_4_4_3_4_4 : IsConjecturedForm 3 [4, 4, 3, 4, 4]

theorem isMaximizer_4_7_11_15 : IsMaximizer {4, 7, 11, 15} 18

theorem not_isMaximizer_4_8_11_15 : ? IsMaximizer {4, 8, 11, 15} 18

theorem equidistributionB_18_4_false : ? EquidistributionB 18 4

theorem equidistributionConjectureB_false : ? EquidistributionConjectureB
\end{Verbatim}


Notes on the statements.

\begin{itemize}
  \item A permutation is an \texttt{Equiv.\allowbreak{}Perm (Fin n)}. The values are 0, ..., n \ensuremath{-} 1. The paper uses the values 1, ..., n. The order is the same.
  \item The index \texttt{i} in \texttt{IsPeak} counts from 1, as in the paper. The elements \texttt{a}, \texttt{b}, \texttt{c} of \texttt{Fin n} are the positions i \ensuremath{-} 1, i, i + 1 of the paper.
  \item \texttt{IsConjecturedForm} reads the phrase "as many of the multiplicities m\_1 and m\_3 are positive as possible" as follows. If m\_1 + m\_3 \ensuremath{\ge} 2, then m\_1 > 0 and m\_3 > 0.
  \item \texttt{EquidistributionB n s} reads the word "precisely" as an equality of two sets of compositions. The map from S to \ensuremath{\kappa}(S) is a bijection. Thus the statement is: for each S \ensuremath{\subseteq} [n] with s elements, S maximizes and \ensuremath{\kappa}(S) is Turán if and only if \ensuremath{\kappa}(S) has the form.
  \item \texttt{peakCount\_\allowbreak{}le\_\allowbreak{}of\_\allowbreak{}card\_\allowbreak{}eq\_\allowbreak{}four} has no condition S \ensuremath{\subseteq} [18]. A set with an element outside \{2, ..., 17\} has the count 0.
  \item \texttt{peakSet\_\allowbreak{}paperExample}, \texttt{peakCount\_\allowbreak{}two\_\allowbreak{}four}, \texttt{peakCount\_\allowbreak{}three\_\allowbreak{}five} and \texttt{peakCount\_\allowbreak{}empty\_\allowbreak{}six} compare the definitions with examples and theorems of the paper.
  \item The proofs of the numbers use the theorem \texttt{peakCount\_\allowbreak{}eq\_\allowbreak{}dpCount} and a calculation by the Lean kernel (\texttt{decide +kernel}). They do not use \texttt{native\_\allowbreak{}decide}.
  \item The proof of the maximum (\texttt{lean/\allowbreak{}PeakSets/\allowbreak{}Maximum.\allowbreak{}lean}) uses a binary tree of the states of the recurrence. A branch of the tree is a sequence of answers to the question "is L in S?" for L = 1, ..., 17.
  \item All theorems depend only on the axioms \texttt{propext}, \texttt{Classical.\allowbreak{}choice} and \texttt{Quot.\allowbreak{}sound}. See \texttt{lean/\allowbreak{}AXIOMS.\allowbreak{}txt}.
\end{itemize}

A note on \texttt{EquidistributionConjectureB}: it contains pairs (n, s) for which no set with s elements is admissible, for example n = 3 and s = 2. For these pairs each count is 0, each set maximizes, and the statement is false for a trivial reason. The result of the first part of this repository is \texttt{equidistributionB\_\allowbreak{}18\_\allowbreak{}4\_\allowbreak{}false}. For n = 18 and s = 4 the maximum is positive.

\section*{How to build}

Lean \texttt{v4.\allowbreak{}36.\allowbreak{}0} and Mathlib \texttt{v4.\allowbreak{}36.\allowbreak{}0}.

\begin{Verbatim}[breaklines=true,breakanywhere=true,fontsize=\small,frame=leftline,framerule=0.6pt,framesep=3mm,rulecolor=\color{black!20}]
cd lean && lake exe cache get && lake build && lake env lean Audit.lean
\end{Verbatim}


The build of \texttt{PeakSets/\allowbreak{}Maximum.\allowbreak{}lean} used approximately 4.5 GB of memory on our machine.

\texttt{lean/\allowbreak{}tools/\allowbreak{}gen.\allowbreak{}py} writes \texttt{Challenge.\allowbreak{}lean} and \texttt{PeakSets/\allowbreak{}Defs.\allowbreak{}lean} from one text. It also checks that each theorem statement of \texttt{Challenge.\allowbreak{}lean} occurs word for word in a proof file.

\texttt{python3 verify.\allowbreak{}py} calculates the three numbers and the maximum with two methods. It uses only the standard library.
The first method is the recursion from the proof of Theorem 1 of the paper. The Lean proof does not use this method.
The second method is the recurrence of this README.
For n \ensuremath{\le} 8 the program also compares the two methods with a count of all permutations.

\section*{Not verified}

\begin{itemize}
  \item Lean does not check the data in the section "Computed data that Lean does not check".
  \item Lean does not prove part (a) for n = 18 and s = 4. Only \texttt{verify.\allowbreak{}py} tested part (a).
  \item Lean does not prove that \{4, 7, 11, 15\} and \{4, 8, 12, 15\} are the only maximizing sets. Lean proves that they maximize.
  \item Only one infinite family of counterexamples is proved (the branch \texttt{family}). The table shows a larger pattern. The larger pattern is not proved.
  \item The Lean definitions are a translation of the text of the paper. A person must read them to accept the translation.
  \item The comparator tool did not run on our computer. It ran in the workflow \texttt{.\allowbreak{}github/\allowbreak{}workflows/\allowbreak{}palomar-\allowbreak{}preflight.\allowbreak{}yml} on GitHub and in the check of the Palomar registry.
  \item \texttt{lean/\allowbreak{}formalization.\allowbreak{}yaml} was not tested against its schema.
  \item The authors of the paper and the author of reference [8] did not confirm the counterexample. Nobody contacted them.
  \item No person checked the Lean proofs line by line. AI agents wrote them. See \texttt{lean/\allowbreak{}formalization.\allowbreak{}yaml}.
\end{itemize}

\section*{Prior work}

As far as we know, the counterexample is new. We found no earlier statement that part (b) is false for a fixed s.

\textbf{The published record says the opposite.} The note added in proof of the journal version says that Kasraoui proved parts (a) and (b).
We read the arXiv version of the paper of Kasraoui (\href{https://arxiv.org/abs/1210.5869}{arXiv:1210.5869}). Its abstract says:

\begin{quote}
We prove a recent conjecture due to Billey, Burdzy and Sagan, which determines the sets that maximize P(S; n), where S ranges over all subsets of \{1, 2, ..., n\}.
\end{quote}

Its Theorem 1.1 gives the compositions that are maximal among all compositions of the same size.
This is the last sentence of Conjecture 19, where s varies.
The paper does not state parts (a) and (b). It does not contain the word "Turán". It contains no theorem for a fixed number of peaks.
Thus the counterexample does not contradict a theorem of that paper.
Kasraoui defines a maximal composition as a composition with the largest number of permutations among all compositions of the same size. The number of parts is not fixed.
The counterexample agrees with Theorem 1.1 and Theorem 1.2 of that paper. For n = 18 the maximum over all sets S is 18!/405 = 15808330137600. The sets with this value have 5 elements. Their compositions are (3, 3, 3, 3, 3, 4) and (4, 3, 3, 3, 3, 3). The maximum over the sets with 4 elements is 7682964258816.
\href{https://arxiv.org/abs/1210.5869}{arXiv:1210.5869} has one version (v1, 22 October 2012). We found no journal version of that paper. We searched the arXiv listing, Crossref and OpenAlex on 2026-11-29.

One later paper describes the result of Kasraoui as a result for a fixed number of peaks. Davis, Nelson, Petersen and Tenner, "The pinnacle set of a permutation" (\href{https://arxiv.org/abs/1704.05494}{arXiv:1704.05494}), say:

\begin{quote}
Kasraoui [14] verified their related conjecture about which peak sets of a given cardinality maximize the number of permutations in S\_n for a given n.
\end{quote}

A second later paper is more exact. Diaz-Lopez, Harris, Insko and Perez-Lavin, "Peak sets of classical Coxeter groups" (\href{https://arxiv.org/abs/1505.04479}{arXiv:1505.04479}), say:

\begin{quote}
Kasraoui proved one of their open conjectures and identified the most probable peak set for a random permutation.
\end{quote}

These searches ran on 2026-11-29.

\begin{itemize}
  \item GitHub code search for "1209.0693". The results are a metadata file of arXiv, a copy of OEIS entry A000431 and files that are not related.
  \item GitHub code search for \texttt{"peak set" Turán composition}, \texttt{"peak set" "Turan composition"}, \texttt{"Equidistribution Conjecture" peak}, \texttt{"Permutations with given peak set"} and "7682964258816". No relevant result.
  \item GitHub search of pull requests, repositories and issues for "peak set equidistribution", "Billey Burdzy Sagan" and "peak set permutations". No result.
  \item Pull requests of \texttt{lefttosolve2/\allowbreak{}open-\allowbreak{}math-\allowbreak{}agents} for "1209.0693" and "Billey Burdzy Sagan". No result. The search for "peak set" gave 11 pull requests. Their titles are not related to peak sets.
  \item GitHub code search in \texttt{lefttosolve2/\allowbreak{}open-\allowbreak{}math-\allowbreak{}agents} for "peak set" and "Billey". No result.
  \item A local list of the files of open-math-agents and a local list of the files of a second proof project. No file name contains 1209.0693, 1210.5869, Billey or Kasraoui. The file names with "Burdzy", "Sagan" or "peak" are about other problems.
  \item The full Palomar registry (1594 entries). No entry mentions 1209.0693, Billey, Burdzy, Sagan or Kasraoui. Four entries contain the word "peak" with a different meaning.
  \item GitLab project search for "peak set" (47 projects, not related), "peak-set-equidistribution", "billey burdzy sagan", "peak polynomial" and "equidistribution conjecture" (no result).
  \item arXiv API search: \texttt{all:\allowbreak{}"peak set" AND all:\allowbreak{}Turán} (0 results), \texttt{all:\allowbreak{}"equidistribution conjecture" AND all:\allowbreak{}peak} (0), \texttt{all:\allowbreak{}"most frequent peak set"} (1, the paper of Kasraoui), \texttt{all:\allowbreak{}"peak set" AND all:\allowbreak{}maximiz*} (0), \texttt{abs:\allowbreak{}"peak set" AND abs:\allowbreak{}conjecture} (10 results, none about this conjecture by its title).
  \item Web search for "peak set" with "Turán composition", for "equidistribution conjecture" with "peak set" and "counterexample", and for the numbers 7682964258816 and 7650451128320. No relevant result. OEIS search for the two numbers. No result.
  \item Semantic Scholar list of the works that cite \href{https://arxiv.org/abs/1209.0693}{arXiv:1209.0693} (61 entries). OpenAlex list of the citing works (30 entries).
  \item Full text search for "equidistribut", "Turán", "maximiz", "most frequent", "Conjecture 19", "Conjecture 6.1", "evenly spaced" and "Kasraoui" in these citing papers: \href{https://arxiv.org/abs/1210.5869}{arXiv:1210.5869}, 1410.8506, 1704.05494, 1505.04479, 2407.12719, 1308.6621, 1710.11033, 1708.08493, 1606.08025, 2011.14360, 1910.12818, 2306.15809, 1605.01708, 1806.05353, 1912.04933, 2508.15120, 1806.00689, 2402.10443, 2610.38237, 1902.00978, 1910.14631, 2001.07325, 2105.10388, 2301.02628, 2305.00148, 2406.19562, 2510.03580, 2001.08417, 2001.08185. No paper states that part (b) is false. No paper has a result on part (a) or part (b) for a fixed s. The papers that mention the conjecture cite the result of Kasraoui.
\end{itemize}

Limits of the searches.

\begin{itemize}
  \item An AI agent did the searches of the literature. A second agent read the papers. We did not read each paper in full.
  \item These citing works were not read: "Reflected Newton Transforms and Concavity of Peak-polynomial Coefficients" (SSRN, 2026), "Factoring peak polynomials" (2015), "Descent Polynomials, Peak Polynomials and an Involution on Permutations" (2019), and the journal versions of the papers above.
  \item Google Scholar was not searched directly.
  \item Of the 10 results of the last arXiv query, only five were searched in full text.
\end{itemize}

\section*{An infinite family}

The branch \texttt{family} proves that part (b) is false for infinitely many pairs (n, s).
Let m \ensuremath{\ge} 1, n = 3m + 15 and s = m + 3. The quotient is q = 3.

\begin{itemize}
  \item The set \texttt{badSet m} has the composition (4, 4, 3\textasciicircum{}m, 4, 4). This composition has the form of part (b) with m\ensuremath{_{1}} = 2, m\ensuremath{_{2}} = m and m\ensuremath{_{3}} = 2.
  \item The set \texttt{goodSet m} has the composition (4, 3\textasciicircum{}m, 4, 4, 4).
  \item \texttt{peakCount\_\allowbreak{}ratio}: 89559 \ensuremath{\cdot} \#P(badSet m; n) = 89180 \ensuremath{\cdot} \#P(goodSet m; n) for each m \ensuremath{\ge} 1.
  \item \texttt{peakCount\_\allowbreak{}badSet\_\allowbreak{}lt}: \#P(badSet m; n) < \#P(goodSet m; n) for each m \ensuremath{\ge} 1.
  \item \texttt{not\_\allowbreak{}isMaximizer\_\allowbreak{}badSet}: the set \texttt{badSet m} does not maximize.
  \item \texttt{equidistributionB\_\allowbreak{}family\_\allowbreak{}false}: \texttt{\ensuremath{\neg} EquidistributionB (3 * m + 15) (m + 3)} for each m \ensuremath{\ge} 1.
  \item \texttt{equidistributionB\_\allowbreak{}false\_\allowbreak{}infinite}: for each N there is a pair (n, s) with n \ensuremath{\ge} N for which part (b) is false.
\end{itemize}

The case m = 1 is n = 18 and s = 4. Then \texttt{badSet 1 =\allowbreak{} \{4,\allowbreak{} 8,\allowbreak{} 11,\allowbreak{} 15\}} and \texttt{goodSet 1 =\allowbreak{} \{4,\allowbreak{} 7,\allowbreak{} 11,\allowbreak{} 15\}}. This is the case of the branch \texttt{main}.

The theorems do not say that \texttt{goodSet m} maximizes. The theorems do not refute part (a).

Limits of the family.

\begin{itemize}
  \item Lean proves only this family. In this family the quotient is q = 3 and the remainder is r = 4, where n + 1 = q (s + 1) + r.
  \item A proof on paper says that part (b) is false for each pair with q = 3 and r \ensuremath{\ge} 4. Lean does not check this proof.
  \item One program calculated all pairs (n, s) with n \ensuremath{\le} 120. In these calculations part (b) is false exactly if q \ensuremath{\ge} 3 and r \ensuremath{\ge} 4. A second program agrees for n \ensuremath{\le} 30. Lean does not check these calculations. No proof exists for q \ensuremath{\ge} 4.
\end{itemize}

Prior work for the family.

\begin{itemize}
  \item A. Kasraoui, "The most frequent peak set in a random permutation" (\href{https://arxiv.org/abs/1210.5869}{arXiv:1210.5869}), has the separation property of a part equal to 3 (Lemma 5.1). Proposition 5.5 of that paper gives a product formula for the number of permutations of a composition with a block of parts equal to 3 in the middle. The relation 89559 \ensuremath{\cdot} \#P(badSet m; n) = 89180 \ensuremath{\cdot} \#P(goodSet m; n) follows from that formula in one step.
  \item That paper does not compare these two compositions. It does not say that part (b) is false for a fixed number of peaks.
  \item The new parts here are the statement that part (b) is false for infinitely many pairs (n, s), and the Lean proof. The Lean proof does not use the formula of Kasraoui. It proves the separation lemma for the dynamic program.
  \item On 2026-11-29 we read the titles of the 61 works that cite the paper of Billey, Burdzy and Sagan and of the 13 works that cite the paper of Kasraoui on Semantic Scholar. No title is about a fixed number of peaks. We searched GitHub code for both arXiv numbers. We found nothing relevant.
\end{itemize}

How the proof works.

\begin{enumerate}
  \item The separation lemma (\texttt{state\_\allowbreak{}sep} in \texttt{lean/\allowbreak{}PeakSets/\allowbreak{}Separation.\allowbreak{}lean}). Let p and p + 3 be consecutive peaks. Then the state of the dynamic program at the index p + 3 is a multiple of a fixed state. The factor is the number of sequences of length p + 1 whose peaks agree with S. The proof is a calculation with the dynamic program \texttt{dpCount}. The proof does not construct a bijection. Lemma 5.1 of Kasraoui (\href{https://arxiv.org/abs/1210.5869}{arXiv:1210.5869}) gives an equivalent statement for permutations.
  \item The theorem \texttt{state\_\allowbreak{}chain} applies the separation lemma to m consecutive parts equal to 3. Each part gives a factor \texttt{tau L}, where 3 \ensuremath{\cdot} \texttt{tau (L + 1)} = L (L + 1) (L + 2).
  \item The theorem \texttt{peakCount\_\allowbreak{}reverse} says that a set and its reverse have the same number of permutations. The proof is the bijection \ensuremath{\pi} \ensuremath{\mapsto} \ensuremath{\pi} \ensuremath{\circ} rev on permutations.
  \item The steps after the last part equal to 3 give a factor that depends on m. Two more families of sets give this factor: the compositions (2, 3\textasciicircum{}j, 4, 4) and (3\textasciicircum{}j, 4). For each family, the separation lemma applies to the set and to the reverse of the set. The reverse has a last part equal to 2 or 3, and then the factor is known.
  \item The Lean kernel calculates four constants: 2, 24, 12544 and 37362688. These are the numbers of permutations for the compositions (2, 2), (4, 2), (4, 4, 2) and (4, 4, 4, 2).
  \item The theorem \texttt{prod\_\allowbreak{}identity} compares the two products. The proof is an induction on m. The step uses the identity (3m + 18) \ensuremath{\cdot} \texttt{tau (3m + 20)} = (3m + 21) \ensuremath{\cdot} \texttt{tau (3m + 19)}.
\end{enumerate}

Files of the branch \texttt{family}.

\begin{itemize}
  \item \texttt{lean/\allowbreak{}ChallengeFamily.\allowbreak{}lean}: the statements. The script \texttt{lean/\allowbreak{}tools/\allowbreak{}gen\_\allowbreak{}family.\allowbreak{}py} writes this file from the proof files.
  \item \texttt{lean/\allowbreak{}PeakSets/\allowbreak{}Separation.\allowbreak{}lean} and \texttt{lean/\allowbreak{}PeakSets/\allowbreak{}Family.\allowbreak{}lean}: the proofs. \texttt{lean/\allowbreak{}PeakSetsFamily.\allowbreak{}lean} is the root module.
  \item \texttt{lean/\allowbreak{}comparator-\allowbreak{}family.\allowbreak{}json}: the configuration for the comparator tool. The comparator tool did not run on this machine.
  \item \texttt{lean/\allowbreak{}AuditFamily.\allowbreak{}lean} and \texttt{lean/\allowbreak{}AXIOMS-\allowbreak{}family.\allowbreak{}txt}: the axioms. Each theorem depends only on \texttt{propext}, \texttt{Classical.\allowbreak{}choice} and \texttt{Quot.\allowbreak{}sound}.
\end{itemize}

The branch \texttt{family} does not change the files of the registered result.

\section*{Sources}
\begin{enumerate}\small
  \item \url{https://arxiv.org/abs/1209.0693}
  \item \url{https://cs.uwaterloo.ca/journals/JIS/VOL16/Billey/billey2.pdf}
  \item \url{https://arxiv.org/abs/1210.5869}
  \item \url{https://github.com/mikesellitto/peak-set-equidistribution}
\end{enumerate}
\end{document}
