\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} \newtheorem*{maintheorem}{Main Theorem} \newtheorem*{corollarymain}{Corollary} \newtheorem*{propositionD}{Proposition D} \newtheorem*{propositionE}{Report E} \newtheorem*{propositionF}{Proposition F} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \makeatletter\newcommand{\rawinput}[1]{\@@input #1 }\makeatother \emergencystretch=3em % Draft marks. \chk{...}: a number or fact to be re-checked against the final verification package. % \placeholder{...}: an open point. Set \draftmarksfalse for the version to be posted (after every % placeholder is resolved): \chk then prints its argument unchanged and \placeholder prints nothing. \IfFileExists{xcolor.sty}{\usepackage{xcolor}}{\providecommand{\textcolor}[2]{#2}} \newif\ifdraftmarks \draftmarksfalse \newcommand{\chk}[1]{\ifdraftmarks\textcolor{blue}{#1}\else #1\fi} \newcommand{\placeholder}[1]{\ifdraftmarks\textcolor{red}{\textbf{[OPEN: #1]}}\fi} \title{An instance of size 7 with no weakly stable matching\\ for three-sided matching with cyclic preferences\thanks{Versions 1.0 to 1.2 of this note were posted on Zenodo under the title ``An instance of size 13 with no weakly stable matching for three-sided matching with cyclic preferences'' (\url{https://doi.org/10.5281/zenodo.24654696}).}} \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 v2.0, 3 December 2026} \hypersetup{pdfauthor={Tohid Atashbar}, pdftitle={An instance of size 7 with no weakly stable matching for three-sided matching with cyclic preferences}} \begin{document} \maketitle \ifdraftmarks \begin{center}\fbox{\parbox{0.92\textwidth}{\small\textbf{Draft of version 2.0; not posted.} \textcolor{blue}{Blue}: numbers and facts to be re-checked against the final verification package. \textcolor{red}{\textbf{Red}}: open points. Both marks disappear in the version to be posted.}} \end{center} \fi \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 $14$ and $13$ (versions 1.0 to 1.2 of this note). We give an explicit instance of size $7$ with no weakly stable matching (Table~\ref{tab:inst7}). Hence the least size for which such an instance exists is $6$ or $7$. By a simple padding argument such instances then exist for every size from $7$ on; size $6$ is the only size for which the existence of a weakly stable matching is open. The instance was found by a counterexample-guided search over the instances in which nine lists begin with the lists of the unsolvable instance of size $3$ with incomplete lists that is the core of Lerner's construction. That each of its $25{,}401{,}600$ matchings has a blocking triple was checked by exhaustive enumeration with four separately written programs, and by Boolean formulas that several solvers find unsatisfiable, with refutations accepted by three checkers, one of which is proved sound in Lean~4. This is a computation, not a formal proof: the statement about the instance of size $7$ is not itself in Lean, and no system of tops is claimed for it. Every deletion of one man, one woman and one dog from the instance gives an instance of size $6$ that has a weakly stable matching. The earlier results are kept: an instance of size $13$ and one of size $14$ for which the tops of the lists ($141$ of $507$ entries, $171$ of $588$) already force the conclusion, both machine-checked in Lean~4. There is no proof that a person can follow by hand. 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}. Versions 1.0 to 1.2 of this note gave instances of sizes $14$ and $13$, obtained from the construction of that paper by deleting agents and, for size $13$, by reordering ranks that the construction leaves free; they are kept below (Sections~\ref{sec:earlier} to~\ref{sec:lean}). The instance of size $7$ given here was obtained differently. It keeps one thing from that construction, its core: nine of its lists begin with the lists of the unsolvable instance of size $3$ with incomplete lists of \cite{LL}. None of the gadgets of the construction is used; the other twelve agents and all lower ranks were chosen by a search (Section~\ref{sec:seven}). By a simple padding argument (Proposition~F) instances without weakly stable matching then exist for every size from $7$ on; size $6$ is the only size for which the existence of a weakly stable matching is open. \begin{maintheorem}[computer-assisted] The instance $I_7$ of size $7$ printed in Table~\ref{tab:inst7} has no weakly stable matching. \end{maintheorem} An instance without weakly stable matching can be enlarged by one agent of each side: \begin{propositionF}[padding] Let $I$ be an instance of size $n$ with no weakly stable matching. Let $I^+$ be an instance of size $n+1$ obtained from $I$ by adding a man $m^*$, a woman $w^*$ and a dog $d^*$ such that $m^*$ ranks $w^*$ first, $w^*$ ranks $d^*$ first and $d^*$ ranks $m^*$ first; every man of $I$ ranks $w^*$ last, every woman of $I$ ranks $d^*$ last and every dog of $I$ ranks $m^*$ last; and the agents of $I$ rank one another as in $I$. The other entries of the three new lists are arbitrary. Then $I^+$ has no weakly stable matching. \end{propositionF} \begin{proof} Call the agents of $I$ old and $m^*,w^*,d^*$ new. Let $M$ be a matching of $I^+$; we show that some triple blocks it. (a) The three new agents form a triple of $M$. Then the other triples of $M$ are a matching of $I$, which has a blocking triple of old agents. In $M$ these three agents have the same partners, and they rank the old agents as in $I$, so the triple blocks $M$. (b) No two new agents are in a common triple of $M$. Then the woman of $m^*$, the dog of $w^*$ and the man of $d^*$ are old, and each new agent strictly prefers its first choice to its partner; so $(m^*,w^*,d^*)$ blocks $M$. (c) Otherwise exactly two new agents share a triple of $M$, and the third is in another triple. Suppose first that $m^*$ and $w^*$ share a triple $(m^*,w^*,d)$; then $d$ is old, and $d^*$ is in a triple $(m,w,d^*)$ with $m$ and $w$ old. Replace these two triples by the one triple $(m,w,d)$ and keep the other triples of $M$: this is a matching $M'$ of $I$, so some triple $(a,b,c)$ of old agents blocks $M'$. Compare $M$ with $M'$. Every old man has the same woman in both. Every old woman has the same dog in both, except $w$, whose dog in $M$ is $d^*$, her last choice. Every old dog has the same man in both, except $d$, whose man in $M$ is $m^*$, its last choice. An agent whose partner is its last choice strictly prefers every other agent to it. Hence each of $a$, $b$, $c$, which strictly prefers the agent offered by the triple to its partner in $M'$, also strictly prefers it to its partner in $M$, and $(a,b,c)$ blocks $M$. The two remaining cases are the same with the sides rotated. If $w^*$ and $d^*$ share a triple $(m,w^*,d^*)$ and $m^*$ is in $(m^*,w,d)$, or if $d^*$ and $m^*$ share a triple $(m^*,w,d^*)$ and $w^*$ is in $(m,w^*,d)$, replace the two triples by $(m,w,d)$; again every old agent has in $M$ the partner it has in $M'$ or a new agent that it ranks last. \end{proof} The argument is elementary. Boros, Gurvich, Jaslar and Krasner extend an instance in the same way, by three agents who rank each other first and are ranked last by all others, for lexicographically cyclic preferences \cite[Lemma~3]{BGJK}; there the new triple blocks every matching that does not contain it, which is not so here, hence case (c). For the model studied here we did not find the statement in the works we read; it may well be known. It is not machine-checked. As a check by computation, made in the separate reading described in Section~\ref{sec:seven}: $I_7$ padded once in this way has no weakly stable matching according to a search over all its matchings and to four solvers, and $I_7$ padded twice has none according to four solvers. With the results for $n\le5$ quoted above, the Main Theorem and Proposition~F give: \begin{corollarymain} (a) The least $n$ for which some instance of size $n$ has no weakly stable matching is $6$ or $7$. (b) For every $n\ge 7$ there is an instance of size $n$ with no weakly stable matching. So $n=6$ is the only size for which it is open whether every instance has a weakly stable matching. \end{corollarymain} \begin{propositionD}[computer-assisted; further facts about $I_7$] (a) $I_7$ has $(7!)^2=25{,}401{,}600$ matchings. Each has at least one blocking triple, and $4334$ of them have exactly one. (b) For each of the $7^3=343$ choices of a man, a woman and a dog, the instance of size $6$ obtained from $I_7$ by deleting these three agents, all lists keeping their order, has a weakly stable matching. (c) The lists of the men $0,1,2$, the women $0,1,2$ and the dogs $0,1,2$ of Table~\ref{tab:inst7} begin with the entries printed before the bar, $16$ entries in all, and these nine beginnings are, after a renaming of the agents, the lists of the core of Lerner's construction (Section~\ref{sec:seven}). This is the only core at the top of the lists of $I_7$: among the $35^3=42{,}875$ choices of three men, three women and three dogs, these nine agents are the only ones for which some beginnings of their lists, containing only agents of the choice, form an instance with incomplete lists that has no weakly stable matching. \end{propositionD} For size $6$ we have, beyond Proposition~D(b), only the report of a computation; it is not among the claims of this note. \begin{propositionE}[a computation, not a claim; size $6$] Let $I$ be an instance of size $6$ in which, for some three men, three women and three dogs, the lists of these nine agents begin with their lists in an instance of size $3$ with incomplete lists that has no weakly stable matching. According to a computation with one solver, $I$ has a weakly stable matching. A second formulation, given to another version of the same solver, has confirmed all $24$ cases; for $23$ of them a refutation was accepted by a checker. \end{propositionE} The problem with incomplete lists is recalled in Section~\ref{sec:seven}. Report~E concerns, at size $6$, the instances with a core at the top; $I_7$, Lerner's instances of sizes $24$ and $20$ and the printed instances of sizes $13$ and $14$ are of this kind at their sizes. Even if it is confirmed, it does not decide size $6$: an instance of size $6$ without weakly stable matching, if there is one, would have no unsolvable instance of size $3$ at the top of nine of its lists, and nothing is shown here about such instances. \paragraph{Status of the new statements.} Proposition~F has the proof printed above; it is not machine-checked. The Main Theorem is a computation, not a formal proof. It rests on exhaustive enumerations of all matchings of $I_7$, each matching tested against the definition, made by four separately written programs, and on Boolean formulas found unsatisfiable by several solvers, with refutations accepted by three checkers, one of them a checker from the standard library of Lean~4 that is proved sound there (Section~\ref{sec:seven}). Proposition~D(a) rests on the same enumerations; the number $4334$ comes from one of them, a separate reading. Proposition~D(b) rests on $343$ explicit matchings, each checked directly from the definition, and on a separate count in the separate reading. Proposition~D(c) is a comparison of lists and, for its last sentence, an enumeration made in the separate reading. Report~E rests on the answers of one solver; a second formulation confirms all $24$ of its cases and a refutation was checked for $23$ of them. None of the new statements is a theorem checked by the Lean kernel. All programs were written with the same AI system (see the section on how this work was carried out) and may share blind spots. None of this has been peer reviewed. \section{The instance of size 7}\label{sec:seven} \begin{table}[!htbp] \centering {\footnotesize\ttfamily \input{instance_table_n7} } \caption{The instance $I_7$. Agents of each side are numbered from $0$; lists are best first. For the nine agents $0,1,2$ of each side, the entries before the bar are the lists of the core, and the second column gives the name of the agent in the core of Lerner's construction \cite{Lerner20}, whose agents are numbered $0,\dots,8$ (under this renaming the sides are rotated: the men of the table are the agents $2,5,8$ of the core, the women $0,3,6$ and the dogs $7,4,1$); $f3,\dots,f6$ are the agents outside the core. The bar does not mark a system of tops in the sense of Theorems~B and~\ref{thm:struct}: no such statement is made for $I_7$.}\label{tab:inst7} \end{table} \paragraph{The core.} In the problem with incomplete lists an agent lists only some agents of the next side; a matching is a set of disjoint triples $(m,w,d)$ in which each agent is on the list of the previous one, and agents may stay unmatched, which they like less than any agent on their list; a triple blocks if each of its three agents strictly prefers the agent offered by the triple to its present state. Lerner and Lerner \cite{LL} gave instances of size $3$ of this problem with no weakly stable matching. One of them, with $16$ list entries on three agents of each side, is the \emph{core} of Lerner's construction \cite{Lerner20}: in his instances of sizes $24$ and $20$ the lists of nine agents begin with their core lists and continue with agents of the gadgets. We say that an instance \emph{has a core at the top} if, for some three men, three women and three dogs, the lists of these nine agents begin with their lists in an unsolvable instance of size $3$ with incomplete lists. The printed instances of sizes $13$ and $14$ of the later sections have Lerner's core at the top as well. $I_7$ has it too (Proposition~D(c)): this was imposed in the search. The remaining $131$ of its $147$ list entries came out of the search. \paragraph{What we can and cannot say about $I_7$.} We do not know a structural reason why $I_7$ has no weakly stable matching. It is close to having one: the matching in which the men $0,\dots,6$ have the women $2,1,0,4,3,5,6$ and the women $0,\dots,6$ have the dogs $0,1,2,3,5,4,6$ has exactly one blocking triple, (man $0$, woman $4$, dog $3$). The men $3$ and $4$ have the same list; exchanging them is not a symmetry, and the instance has no symmetry at all: no renaming of the agents within the sides other than the identity, and none combined with a rotation of the sides, maps it to itself. There is no triple in which each agent is the first choice of the previous one. The twelve agents outside the core do not form gadgets attached to single core agents as in Lerner's construction. The $16$ core entries alone do not force the conclusion: exchanging two adjacent entries in the list of man $3$ or of man $4$, at any of the six positions, leaves all core lists as they are and gives an instance with a weakly stable matching. More generally, of the $126$ instances obtained from $I_7$ by exchanging two adjacent entries of one list, $91$ have a weakly stable matching and $35$ have none; almost all of the $35$ are exchanges low in a list or in the lists of man $6$, woman $6$ and dog $6$. (These counts are from the separate reading described below.) So some entries of $I_7$ are free, but which entries are needed was not computed, and no system of tops is claimed. \paragraph{How it was found.} The search was written to examine the instances that have a core at the top, first for size $6$ (Report~E) and then for size $7$ with Lerner's core, in the expectation that all of them would turn out to have weakly stable matchings. For size $7$ it ended instead with $I_7$. It works as follows. One formula describes all instances of size $n$ whose nine core lists begin as prescribed (a variable for each agent and each pair of agents of the next side says which of the two is ranked higher, with transitivity). A solver proposes such an instance; a second formula returns weakly stable matchings of it; for each of them the condition ``this matching has a blocking triple'' is added to the first formula; and so on. If the first formula becomes unsatisfiable, every instance of the class has one of the recorded matchings as a weakly stable matching; if a proposed instance has no weakly stable matching, the search stops with it. To shorten the search, the agents outside the core were renamed so that the four other women are in the order of their first choices and then the four other men in the order of theirs; this loses no instance up to renaming. The search is a heuristic and plays no role in the correctness of the Main Theorem, which is checked directly on the printed lists. The search program is not part of the package. \paragraph{How the Main Theorem is verified.} All checks start from the $21$ printed lists. The files and programs named here are in the folder for size $7$ of the accompanying package, whose \texttt{README} gives one command per check, with the saved outputs: that folder contains every program and every output named in this paragraph and its list. The checks were made with four separately written programs or groups of programs: the checker written with the search; the programs of the package of versions 1.0 to 1.2, used unchanged; a separate exhaustive check; and a separate reading, made without opening the other programs, which has three methods of its own and four solvers. All were written with the same AI system. Together they are a computation, not a formal proof. \begin{itemize} \item \emph{Enumeration.} The plain program of the package of versions 1.0 to 1.2 (\texttt{brute.py}, unchanged) goes through all $25{,}401{,}600$ pairs of a bijection from men to women and a bijection from women to dogs and tests each of the $343$ triples by three strict comparisons: no matching is without blocking triple. This check rests on the definition only. The checker written with the search and the separate exhaustive check do the same with their own code and find the same. The separate reading enumerates all matchings without pruning and gives the full distribution: no matching has no blocking triple, $4334$ have exactly one, $16{,}843$ have two, and the largest number is $121$. It also runs a search with pruning, which builds a matching triple by triple and abandons it as soon as three placed agents block, from each of the three sides, and again from the men's side in an uncompiled form: no weakly stable matching, and $4334$ matchings with exactly one blocking triple from each side. \item \emph{Formulas.} The formula $F(I_7)$ of Section~\ref{sec:enc} has $294$ variables and $1757$ clauses and is unsatisfiable according to CaDiCaL~1.5.3, Glucose~4.1 and MiniSat~2.2, so $I_7$ has no weakly stable matching by Proposition~\ref{prop:F}. Two refutations of it are in the package. One, written by CaDiCaL~2.1.2 in the LRAT format ($1011$ steps), is accepted by the LRAT checker of the standard library of Lean~4, which is proved sound in Lean; the checker was run as a compiled program on the files, so this is not a theorem about $I_7$ checked by the Lean kernel, and the small program that reads the formula file is new and unverified. The same refutation cut to its first $300$ lines is rejected. The other, written by Glucose in the DRAT format ($1196$ clauses), is accepted by the checker of Section~\ref{sec:ver}. The second of the separately written programs of Section~\ref{sec:ver}, unchanged, reports no weakly stable matching with its own formula ($147$ variables, $1610$ clauses), the same three solvers and Z3, and its own checker accepts a refutation of $763$ clauses. The separate reading uses a third formula ($147$ variables, $10{,}250$ clauses), unsatisfiable according to four solvers (the three above and Lingeling); these last answers were not passed through a checker. The standard checker drat-trim was not run. \item \emph{Deletions (Proposition~D(b)).} The package contains, for each of the $343$ deletions, a weakly stable matching of the smaller instance; a program without solver checks each against the definition, and rejects a corrupted one. In the separate reading the weakly stable matchings of the $343$ smaller instances were counted: between $138$ and $1206$. \item \emph{The core (Proposition~D(c)).} In the separate reading, every choice of three men, three women and three dogs ($42{,}875$) and every way of cutting their lists to beginnings that contain only chosen agents ($3{,}172{,}396$ instances with incomplete lists) was tested. Exactly one choice gives unsolvable ones: the agents $0,1,2$ of each side, with the $16$ entries of Table~\ref{tab:inst7} (and one longer cut of the same lists). Exactly one renaming, with a rotation of the sides, carries these lists onto Lerner's core, as recorded from the figures of \cite{Lerner20}; cutting the last entry of any one of the nine lists gives an instance with a weakly stable matching. So $I_7$ does not contain two disjoint cores. \item \emph{Controls, from the separate reading.} On $60$ pseudo-random instances of size $7$ its methods agree with each other, and every one of these instances has weakly stable matchings (at least $2532$). The $126$ exchanges of adjacent entries are reported above. The numbers of $I_7$ read in another way (lists read worst first, lists read as ranks, or the three sides in the opposite direction) give instances with weakly stable matchings: the statement is for the reading of Table~\ref{tab:inst7}. \end{itemize} \paragraph{On Report~E.} Given an instance of size $3$ with incomplete lists and no weakly stable matching, cut off last entries of its lists for as long as the instance stays unsolvable. The result is a minimal one: cutting the last entry of any one of its lists gives an instance with a weakly stable matching. The lists of the given instance begin with those of the minimal one, so only minimal instances have to be considered. A computation finds $24$ of them up to renaming of the agents within the sides and rotation of the sides, Lerner's core being one. For each, the search described above ended with its first formula unsatisfiable according to one solver (CaDiCaL). A second program, with its own formulation, has confirmed this for Lerner's core with another solver (Glucose) and for all $24$ cases with another version of CaDiCaL (2.1.2). For $23$ of the $24$ cases a refutation of the first formula in the LRAT format was accepted by the checker of Lean's standard library, run as a compiled program. The classification into $24$ cases was not compared with any published list, and the files of this computation are not in the package. This is why it is reported and not claimed. \section{Earlier results: instances of sizes 13 and 14}\label{sec:earlier} The statements of this section are those of versions 1.0 to 1.2, unchanged and with their names and numbers. They concern instances obtained from Lerner's construction by deleting agents. \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, gave the bound of versions 1.0 to 1.2, which the Main Theorem now improves: \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~\ref{sec:inst}). 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~\ref{sec:found}). In Lerner's names (Section~\ref{sec:inst}), $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 (the Main Theorem gives one of size $7$), 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 of this section.} 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 of sizes 13 and 14}\label{sec:inst} \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~\ref{sec:found}. 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~\ref{sec:found} 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 of sizes 13 to 19 were found}\label{sec: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~\ref{sec:inst}, $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~\ref{sec:inst} compares the two). The search is a heuristic and plays no role in the correctness of the statements. The search programs of this section 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