\documentclass[11pt]{article} \usepackage[margin=1in]{geometry} % Fonts: Latin Modern with T1 encoding if the package is installed; otherwise the default Computer Modern % fonts. Either way the fonts are scalable and embedded. Build with: pdflatex --disable-installer (twice). \IfFileExists{lmodern.sty}{\usepackage[T1]{fontenc}\usepackage{lmodern}}{% \DeclareTextCommandDefault{\textasteriskcentered}{\ensuremath{*}}% \DeclareTextCommandDefault{\textbullet}{\ensuremath{\bullet}}} \usepackage{amsmath,amssymb,amsthm} \usepackage{booktabs} \usepackage[hidelinks]{hyperref} \newtheorem{theorem}{Theorem} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \newtheorem*{theoremA}{Theorem A} \newtheorem*{theoremB}{Theorem B} \newtheorem*{propositionC}{Proposition C} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \makeatletter\newcommand{\rawinput}[1]{\@@input #1 }\makeatother \emergencystretch=3em \title{An instance of size 13 with no weakly stable matching\\ for three-sided matching with cyclic preferences} \author{Tohid Atashbar\thanks{International Monetary Fund. The views expressed in this paper are those of the author and do not necessarily represent the views of the IMF, its Executive Board, or IMF management.}} \date{Version v1.1, 30 November 2026} \hypersetup{pdfauthor={Tohid Atashbar}, pdftitle={An instance of size 13 with no weakly stable matching for three-sided matching with cyclic preferences}} \begin{document} \maketitle \begin{abstract} In three-sided matching with cyclic preferences there are $n$ men, $n$ women and $n$ dogs; men rank women, women rank dogs, dogs rank men, with complete strict lists. A matching into triples is weakly stable if no man, woman and dog all strictly prefer each other to their partners. A weakly stable matching exists whenever $n\le 5$; instances without one were known for sizes $90$ and $45$ (from a reduction of Lam and Plaxton), $24$ and $20$ (Lerner), and Lerner states that the least such size is not less than $6$ and not greater than $20$. We give an explicit instance of size $13$ with no weakly stable matching (Table~\ref{tab:inst13}). A stronger form holds: $141$ of its $507$ list entries, the tops of the lists, already force the conclusion, whatever the order of the remaining entries. We also give an instance of size $14$ (Table~\ref{tab:inst}) with the same two properties ($171$ of $588$ entries), which is the end of a chain of instances of sizes $19,18,\dots,14$ without weakly stable matching, each obtained from the previous one by deleting one agent of each side. The instance of size $13$ is not obtained from it by deleting agents: it comes from a second instance of size $14$, obtained from the same instance of size $15$ as the first, by deleting one agent of each side and then reordering ranks that Lerner's construction leaves free. Every deletion of one agent of each side from either printed instance gives an instance that has a weakly stable matching. The statements are certified by exact Boolean computation with checked refutations and were reproduced by separately written programs; the four statements about the two printed instances are in addition machine-checked in Lean~4. There is no proof that a person can follow by hand. A search aimed at size $12$ found nothing and establishes nothing; sizes $6$ to $12$ remain open. The results have not yet been peer reviewed. \end{abstract} \section{The problem and the result} Knuth's Problem 11 asks: ``Can the stable-matching problem be generalized to three sets of objects (for example men, women, and dogs)?'' (\cite{Knuth}, as quoted in the revised version of \cite{Lerner20}). According to \cite{CEGQ}, the form with cyclic preferences studied here is from Ng and Hirschberg \cite{NH}. The model is as follows. There are $n$ men, $n$ women and $n$ dogs. Every man has a strict preference list of all women, every woman of all dogs, every dog of all men. A \emph{matching} is a partition of the $3n$ agents into $n$ triples (man, woman, dog). A triple $(m,w,d)$ \emph{blocks} a matching if $m$ prefers $w$ to the woman of his triple, $w$ prefers $d$ to the dog of her triple, and $d$ prefers $m$ to the man of its triple, all three strictly. A matching without blocking triple is \emph{weakly stable}; this is the notion of \cite[formula (1)]{Lerner20} (there called stable) and of \cite{LP,CEGQ}. The three agents of a blocking triple necessarily lie in three different triples of the matching. (Under the more demanding notion of strong stability, where a triple also blocks if some of its agents are merely not worse off, the situation is different and is not our subject.) Boros, Gurvich, Jaslar and Krasner proved that a weakly stable matching exists for $n\le 3$ \cite{BGJK}, and Eriksson, Sj\"ostrand and Strimling for $n=4$, conjecturing existence for all $n$ \cite{ESS} (both as reported in \cite{CEGQ,Lerner20}); Pashkovich and Poirrier proved it for $n=5$, by a computation \cite{PP}. Lam and Plaxton disproved the conjecture and showed that deciding existence is NP-complete \cite{LP}. As Lerner explains \cite[p.~3]{Lerner20}, their reduction multiplies the size of an instance with incomplete lists and no stable matching by $15$: applied to the instance of size $6$ of Bir\'o and McDermid \cite{BM} it gives size $90$, and applied to the instance of size $3$ of \cite{LL} it gives size $45$. Lerner reduced the size to $24$ and then to $20$ \cite[Theorems 1 and 2]{Lerner20}, by hand, attaching gadgets to an instance with incomplete lists that has no stable matching \cite{LL}; the size-$24$ theorem appeared in \cite{Lerner24} and the size-$20$ theorem in the journal article listed with \cite{Lerner20}, of which we read an author's revised version; Theorem~2, its figures and the sentences quoted next are the same there. His paper states: ``the minimum size of 3DSM with no stable matching is not less than 6 and not greater than 20. Its exact value is not known yet'' \cite[Section 6]{Lerner20}. The revised version continues: ``Possibly, the construction, which would allow us to build counterexamples of a small size, principally differs from that used in this paper and in [12]'', where [12] is \cite{LP}. The instances below are obtained from the construction of that paper by deleting agents and, for size $13$, by reordering ranks that the construction leaves free. \begin{theoremA}[computer-assisted] The instance $I_{13}$ of size $13$ printed in Table~\ref{tab:inst13} has no weakly stable matching. \end{theoremA} \begin{theoremB}[computer-assisted] In Table~\ref{tab:inst13} every list is divided by a bar into a top and a rest; the tops contain $141$ of the $507$ entries. Every instance of size $13$ in which each list begins with the printed top, the remaining agents of the next side following in any order, has no weakly stable matching. \end{theoremB} Theorem~A is the case of Theorem~B in which the rest of each list is as printed. The same two statements hold for an instance of size $14$: \begin{theorem}[computer-assisted]\label{thm:inst} The instance $I_{14}$ of size $14$ printed in Table~\ref{tab:inst} has no weakly stable matching. \end{theorem} \begin{theorem}[computer-assisted]\label{thm:struct} In Table~\ref{tab:inst} every list is divided by a bar into a top and a rest; the tops contain $171$ of the $588$ entries. Every instance of size $14$ in which each list begins with the printed top, the remaining agents of the next side following in any order, has no weakly stable matching. \end{theorem} Theorem~A, together with the results for $n\le5$ quoted above, gives: \begin{corollary} The least $n$ for which some instance of size $n$ has no weakly stable matching satisfies $6\le n\le 13$. \end{corollary} \begin{proposition}[computer-assisted]\label{prop:chain} There are instances $I_{19},I_{18},\dots,I_{15}$ of sizes $19,\dots,15$ with no weakly stable matching such that, for $15\le k\le 19$, $I_{k-1}$ is obtained from $I_k$ by deleting one man, one woman and one dog, all lists keeping their order. \end{proposition} \begin{proposition}[local minimality; explicit witnesses]\label{prop:min} (a) For each of the $14^3=2744$ choices of a man, a woman and a dog, the instance of size $13$ obtained from $I_{14}$ by deleting these three agents has a weakly stable matching. (b) For each of the $41$ lists of Table~\ref{tab:inst} with a nonempty top, if the last entry of that top is moved to the rest, some instance beginning with the new tops has a weakly stable matching. (c) For each of the $13^3=2197$ choices of a man, a woman and a dog, the instance of size $12$ obtained from $I_{13}$ by deleting these three agents has a weakly stable matching. (d) For each of the $39$ lists of Table~\ref{tab:inst13}, if the last entry of its top is moved to the rest, some instance beginning with the new tops has a weakly stable matching. \end{proposition} \paragraph{How $I_{13}$ is related to $I_{14}$.} $I_{13}$ is not obtained from $I_{14}$: by Proposition~\ref{prop:min}(a) no deletion from $I_{14}$ gives an instance without weakly stable matching, and $I_{13}$ contains an agent (the dog named $c7$ in Table~\ref{tab:inst13}) that $I_{14}$ does not contain. It comes from a second instance of size $14$: \begin{propositionC}[computer-assisted; the origin of $I_{13}$] There is an instance $J_{14}$ of size $14$ with no weakly stable matching, different from $I_{14}$ and not isomorphic to it, that is also obtained from $I_{15}$ by deleting one man, one woman and one dog, all lists keeping their order. The agents of $I_{13}$ are those of $J_{14}$ without one man, one woman and one dog. Of the $39$ lists of $I_{13}$, $30$ are the lists of $J_{14}$ with the deleted agent taken out, and $9$ differ from them, only in the order of the entries below the inherited top (the top prescribed by Lerner's construction; see Section~2). For each of the $2744$ choices of a man, a woman and a dog, the instance obtained from $J_{14}$ by deleting these three agents, all lists keeping their order, has a weakly stable matching. \end{propositionC} So $I_{13}$ is the result of a deletion \emph{and} a reordering of ranks that Lerner's construction leaves free. In this search no chain of deletions alone leads to an instance of size $13$: every deletion from $I_{14}$ and from $J_{14}$ gives an instance with a weakly stable matching, and according to the solver the same holds for the twelve other instances of size $14$ that the search reached (Section~3). In Lerner's names (Section~2), $I_{14}$ and $J_{14}$ are $I_{15}$ without the man $e36$, the woman $e7$ and one dog: $c7$ for $I_{14}$, $e58$ for $J_{14}$. Proposition~\ref{prop:min} says that $I_{14}$ and $I_{13}$ cannot be made smaller by deleting agents and that no single top of Theorems~B and~\ref{thm:struct} can be shortened. It does not say more. It does not exclude instances of size $12$ or less without weakly stable matching, nor instances of size $13$ or $14$ with fewer prescribed entries; deleting agents and then changing lists is not covered by it (this is how $I_{13}$ was obtained), and neither is any instance unrelated to these. Deletion is not monotone: of the $15^3=3375$ instances obtained from $I_{15}$ by deleting one agent of each side, $3367$ have a weakly stable matching (explicit matchings, checked from the definition), and for eight, pairwise non-isomorphic, of which $I_{14}$ and $J_{14}$ are two, three solvers find none. \paragraph{Status of the statements.} Theorems~A, B, \ref{thm:inst} and \ref{thm:struct}, Proposition~\ref{prop:chain} and the first part of Proposition~C are certified by exact Boolean computation with checked refutations (Sections~\ref{sec:enc} and \ref{sec:ver}) and were reproduced by separately written programs, to the extent stated in Section~\ref{sec:ver}. Proposition~\ref{prop:min} and the last sentence of Proposition~C rest on explicit matchings, each checked directly from the definition; the comparison of lists in Proposition~C is made by a program without solver. Theorems~A, B, \ref{thm:inst} and \ref{thm:struct} are in addition machine-checked in Lean~4 (checked by the kernel, no \texttt{native\_decide}, axioms \texttt{propext}, \texttt{Classical.choice}, \texttt{Quot.sound}); for both sizes the statement files were audited against the definition and the build was repeated from a clean copy by a separate AI-assisted check (Section~\ref{sec:lean}, with the limits of these checks). Propositions~\ref{prop:chain}, \ref{prop:min} and~C are not in Lean. None of this has been peer reviewed, and there is no proof by cases for a human reader. \section{The instances} \begin{table}[!htbp] \centering {\footnotesize\ttfamily \input{instance_table_n13} } \caption{The instance $I_{13}$. Agents of each side are numbered from $0$; lists are best first. The second column gives the name of the agent in Lerner's construction \cite{Lerner20}: $0,\dots,8$ are the agents of his core, and a letter followed by digits is an agent of the gadget attached to the core agent(s) with these digits. The entries before the bar are the tops of Theorem~B.}\label{tab:inst13} \end{table} \begin{table}[!htbp] \centering {\footnotesize\ttfamily \input{instance_table} } \caption{The instance $I_{14}$, in the same notation. The entries before the bar are the tops of Theorem~\ref{thm:struct}.}\label{tab:inst} \end{table} Lerner's instance of size $20$ consists of a core of nine agents (three of each side), whose mutual ranks form an instance with incomplete lists and no stable matching, and of seven gadgets: a gadget of seven agents attached to each of the core agents $0,1,2,4,7$ and a gadget of eight agents shared by the core agents $3,6$ and another shared by $5,8$ \cite[Theorem 2]{Lerner20}. Each agent has a prescribed top of its list; the ranks below it are arbitrary. When agents are deleted, we call the prescribed top of a remaining agent, with the deleted agents taken out, its \emph{inherited top}. \paragraph{Size 14.} $I_{14}$ keeps all nine core agents, with their core lists at the top followed by those of their gadget entries that remain, as in Lerner's construction. Of the gadgets it keeps: all seven agents of the gadgets on $1$ and on $2$; four of seven on $0$ and on $4$; one of seven on $7$; four of eight of the gadget on $(3,6)$; six of eight of the gadget on $(5,8)$. Below the inherited tops, the lists of $I_{14}$ rank the remaining agents in one common order (decreasing index). Of the $42$ tops of Theorem~\ref{thm:struct}, $19$ are exactly the inherited ones (among them those of seven of the nine core agents); $20$ are longer and reach into this common order (among them those of the core agents $7$ and $8$, woman $2$ and dog $2$ of the table); and $3$ are shorter: woman $7$ and dog $3$ need only the first entry of their inherited top, and man $3$ needs nothing. \paragraph{Size 13.} $I_{13}$ also keeps all nine core agents. Of the gadgets it keeps: all seven agents of the gadgets on $1$ and on $2$; three of seven on $0$ and on $4$; two of seven on $7$; four of eight of the gadget on $(3,6)$ and four of eight of the gadget on $(5,8)$. Every list begins with its inherited top. Below it, $30$ lists rank the remaining agents by decreasing index, as in $I_{14}$; the other nine (men $0,3,4,5,6$, women $2,3$, dogs $5,10$ of the table) do not: their order below the inherited top was chosen by the search of Section~3. Of the $39$ tops of Theorem~B, $20$ are exactly the inherited ones, $18$ are longer, and one is shorter: man $3$ needs only the first entry of its inherited top. No top is empty. Lerner's proof uses two lemmas saying that a core agent with a complete gadget behaves as if its list were incomplete. With incomplete gadgets these lemmas do not apply as stated, and we have no replacement: we do not know a structural reason why $I_{14}$ or $I_{13}$ has no weakly stable matching. Each is close to having one: there is a matching with exactly one blocking triple (given in the package for both). \paragraph{Two further instances of size 13.} The search of Section~3 produced two more instances of size $13$ with no weakly stable matching, in the same way as $I_{13}$ (a deletion and a reordering below the inherited tops): one from $J_{14}$ again, by another deletion, and one from another of the eight deletions from $I_{15}$ mentioned after Proposition~\ref{prop:min}. They are not isomorphic to $I_{13}$ or to each other: for each pair, an exact test over all renamings of the agents within the sides combined with the three cyclic rotations of the sides finds no isomorphism (with complete lists an isomorphism is determined by the image of one man, so there are $39$ candidate maps for each pair). They are not unrelated: the three come from the same search and share lists. They are in the package (folder \texttt{verification/further}), with the instance of size $14$ from which the second of them comes, and are certified in the same way as $I_{13}$: three solvers, a checked refutation, and for each of their $2197$ deletions of one agent of each side a weakly stable matching of the smaller instance, checked from the definition. They are not printed here, are not in Lean, and no system of tops was computed for them. \section{How the instances were found} We rebuilt Lerner's structure of size $20$ from the figures of \cite{Lerner20}. The rebuild is ours; it was not compared with files of the author, and Theorems~A, B, \ref{thm:inst} and \ref{thm:struct} do not depend on it, since they are checked directly on the printed lists. (As a control, the formula of Proposition~\ref{prop:G} for the rebuilt structure, which prescribes $147$ of $1200$ entries, is unsatisfiable according to three solvers, in agreement with Lerner's theorem.) Step 1. One agent of each side was deleted from the structure, the prescribed tops being kept; a solver proposed an order for the free ranks, a second formula returned the weakly stable matchings of the resulting instance, these were added as constraints, and so on. In $86$ deletions tried, $23$ gave an instance of size $19$ with no weakly stable matching, $14$ of them at the first order proposed; the other $63$ runs were stopped at a limit of $40$ rounds and establish nothing. Step 2. Starting from one of these instances, one agent of each side was deleted and the smaller complete instance tested, depth first. A chain $19\to18\to17\to16\to15\to14$ was found within minutes. All $2744$ deletions from $I_{14}$ give a weakly stable matching (Proposition~\ref{prop:min}); $25$ further attempts in which the free ranks were refilled after a deletion were stopped at the same limit. Step 3. The tops of Theorem~\ref{thm:struct} were obtained from $I_{14}$ by shortening one list top at a time, as long as a formula with the meaning of $G(T)$ in Proposition~\ref{prop:G} stayed unsatisfiable, in one pseudo-random order of the agents. The result depends on that order; it is locally minimal (Proposition~\ref{prop:min}(b)), not shown to be smallest. Step 4. The descent of Step 2 kept every instance without weakly stable matching that it met and went on with them: the seven other instances of size $14$ obtained from $I_{15}$, one of which is $J_{14}$, then another instance of size $15$ obtained from $I_{16}$, and nine instances of size $14$ obtained from it ($2055$ of its $3375$ deletions were tested). Two of these nine are $J_{14}$ again: one with the same six agents deleted from $I_{16}$ in another order, and one in which the man $a4$ is kept in place of $b4$, the lists being the same entry by entry. Another of the nine has, in the same way, the same lists as one of the instances obtained from $I_{15}$. The search did not notice this. So $17$ instances of size $14$ were stored; they are $14$ different instances ($J_{14}$ three times, one other twice), and these $14$ are pairwise non-isomorphic. For each of the $17$ all $2744$ deletions were tested, and none gave an instance without weakly stable matching (solver answers; with matchings checked from the definition for $I_{14}$ and $J_{14}$ only). Then, as for $I_{14}$, up to $25$ deletions were tried again as in Step 1: the three agents are deleted, the inherited tops are kept, and the order of the other ranks is left to the solver. On the fifteen stored instances of size $14$ treated first, among them $I_{14}$ and, twice, $J_{14}$, this gave nothing ($375$ attempts: $368$ stopped at the limit of $40$ rounds; in $7$ the search showed that every order of the free ranks gives an instance with a weakly stable matching). On the sixteenth, which is $J_{14}$ stored the third time and tried with another pseudo-random choice of deletions, the seventeenth attempt, the deletion of the man $t4$, the woman $t58$ and the dog $b0$, gave $I_{13}$ at round $20$. Step 5. A search aimed at size $12$ was then run for about eight hours on one processor core, with the step just described (delete one agent of each side, keep the inherited tops, at most $40$ rounds), applied in turn to the instances of size $13$ and of size $14$ at hand. From the $17$ stored instances of size $14$ ($J_{14}$ three times, one other twice): $620$ attempts, of which $2$ gave the two further instances of size $13$ of Section~2, $598$ were stopped at the limit, and in $20$ every order of the free ranks was excluded. From the three instances of size $13$: $1241$ attempts ($414$, $414$ and $413$ different deletions of the $2197$ possible for each), of which none gave an instance of size $12$ without weakly stable matching, $1218$ were stopped at the limit, and in $23$ every order of the free ranks was excluded; $25$ earlier attempts on $I_{13}$ were also stopped at the limit. A run stopped at the limit establishes nothing. The search therefore says nothing about size $12$, beyond the $23$ excluded cases and Proposition~\ref{prop:min}(c). Step 6. The tops of Theorem~B were obtained from $I_{13}$ by shortening one list after the other (men, women, dogs, in the order of the table), each to the shortest beginning for which a solver still found unsatisfiable the formula used in the Lean development (Section~\ref{sec:lean}; it has the meaning of the reduced system of Proposition~\ref{prop:red}). The result depends on that order; it is locally minimal (Proposition~\ref{prop:min}(d)), not shown to be smallest. These tops are the outcome of this procedure; they are not the tops of Lerner's construction (Section~2 compares the two). The search is a heuristic and plays no role in the correctness of the statements. The search programs are not part of the package; logs of Steps 1, 2, 4 and 5, saved from the runs, are in its folder \texttt{verification/outputs}. \section{The formulas}\label{sec:enc} Sides are numbered $0$ (men), $1$ (women), $2$ (dogs); side $s$ ranks side $s+1$ modulo $3$. \paragraph{Formula $F(I)$ for a complete instance $I$.} Variables: $x^s_{ij}$ (agent $i$ of side $s$ is matched to agent $j$ of the next side) and $g^s_{ij}$, for $s\in\{0,1,2\}$ and $i,j\in\{0,\dots,n-1\}$. Clauses: \begin{itemize} \item[(P)] for each $s$, the matrix $(x^s_{ij})$ is a permutation matrix: every row and every column contains at least one true entry and no two; \item[(C)] $\lnot x^0_{mw}\lor\lnot x^1_{wd}\lor x^2_{dm}$ for all $m,w,d$; \item[(G)] $\lnot g^s_{ij}\lor\bigvee\{x^s_{ij'} : j'=j \text{ or } i \text{ ranks } j' \text{ above } j\}$ for all $s,i,j$; \item[(B)] $g^0_{mw}\lor g^1_{wd}\lor g^2_{dm}$ for all $m,w,d$. \end{itemize} \begin{proposition}\label{prop:F} $F(I)$ is satisfiable if and only if $I$ has a weakly stable matching. \end{proposition} \begin{proof} Let $M$ be a weakly stable matching. Put $x^0_{mw}$, $x^1_{wd}$, $x^2_{dm}$ true exactly when $(m,w)$, $(w,d)$, $(d,m)$ lie in a common triple of $M$, and $g^s_{ij}$ true exactly when the partner of $i$ is $j$ or is ranked by $i$ above $j$. Then (P), (C) and (G) hold. If (B) failed for $(m,w,d)$, each of $m$, $w$, $d$ would rank the agent offered by the triple strictly above its partner, and the triple would block $M$. Conversely, take a satisfying assignment. By (P) the matrices are permutations $\sigma$ from men to women, $\tau$ from women to dogs and $\rho$ from dogs to men. By (C), $\rho(\tau(\sigma(m)))=m$ for every $m$, so the triples $(m,\sigma(m),\tau(\sigma(m)))$ form a matching $M$ in which the man of dog $d$ is $\rho(d)$. Let $(m,w,d)$ be any triple. By (B) one of $g^0_{mw}$, $g^1_{wd}$, $g^2_{dm}$ is true, say the first (the other cases are the same). By (G), $\sigma(m)$ is $w$ or is ranked by $m$ above $w$, so $m$ does not strictly prefer $w$ to his partner and the triple does not block. Hence $M$ is weakly stable. \end{proof} \paragraph{Formula $G(T)$ for a system of tops $T$.} $T$ gives each agent a list of distinct agents of the next side (possibly empty). A \emph{completion} of $T$ is an instance in which each list begins with the given top. Variables: those of $F$; for each agent $i$ of side $s$ and each pair $ab$ we read $o^s_{i,ab}$ as $\lnot o^s_{i,ba}$); and $y^s_{i,uw}$ for $u\ne w$. Clauses: (P), (C), (B) as before, and \begin{itemize} \item[(O)] for all $a