\documentclass[11pt,a4paper]{article} \usepackage[margin=28mm]{geometry} \usepackage[T1]{fontenc} \usepackage{lmodern,microtype} \usepackage{amsmath,amssymb,amsthm,mathtools,mathrsfs} \usepackage{enumitem} \usepackage{tikz} \usetikzlibrary{arrows.meta,decorations.pathreplacing,positioning} \usepackage{caption} \captionsetup{font=small,labelfont=bf} \usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref} \hypersetup{ pdftitle={Finite-length permutation modules for free-amalgamation structures of arbitrary arity}, pdfauthor={Andr\'as Pongr\'acz} } \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{remark}[theorem]{Remark} \newcommand{\Aut}{\operatorname{Aut}} \newcommand{\supp}{\operatorname{supp}} \newcommand{\vsupp}{\operatorname{vsupp}} \newcommand{\length}{\operatorname{length}} \newcommand{\Bal}{\operatorname{Bal}} \newcommand{\Cog}{\operatorname{Cog}} \newcommand{\F}{\mathbb F} \newcommand{\A}{\mathbb A} \newcommand{\K}{\mathcal K} \newcommand{\OO}{\mathcal O} \newcommand{\PP}{\mathcal P} \newcommand{\aset}[1]{\underline{#1}} \newcommand{\Hh}{H_S} \title{Finite-length permutation modules for\\free-amalgamation structures of arbitrary arity} \author{Andr\'as Pongr\'acz\\[2pt] \small University of Debrecen, Institute of Mathematics\\ \small ORCID: \href{https://orcid.org/0000-0002-2771-8974}{0000-0002-2771-8974}} \date{10 November 2026} \begin{document} \maketitle \begin{abstract} Let $\A$ be the countable homogeneous limit of a free-amalgamation class in a finite relational language, expanded by a generic linear order. We prove that its tuple permutation modules have finite composition length over every field, also after naming finitely many points. More precisely, each orbit of increasing $d$-tuples disjoint from the named points has a permutation module of length $2^d$. This extends the theorem of Yang--Boja\'nczyk--Klin from unary and binary relations to relations of arbitrary arity. The main step shows that every finitely supported array whose sums over each single coordinate vanish is a linear combination of alternating sums obtained by independently doubling its coordinates. Its proof combines a Ramsey separation theorem with a construction that moves finite configurations into prescribed order intervals. Over a finite field, we also obtain finitely many closed invariant linear subspaces of $\F^{A^k}$; each is generated, in the product topology, by functions definable using at most $k$ additional parameters. \end{abstract} \section{Introduction} A permutation group acting on an infinite set gives rise to an infinite-dimensional vector space with a distinguished basis. The subspaces preserved by the group can nevertheless have a finite and rigid structure. For example, under the full symmetric group on an infinite set $X$, the space $\F[X]$ of finite formal linear combinations over a field $\F$ has exactly one nonzero proper invariant subspace: the vectors whose coefficients sum to zero. Indeed, swapping a point with nonzero coefficient with a point outside the support and subtracting shows that every nonzero invariant subspace contains all differences of basis vectors; these span the coefficient-sum kernel, which has codimension one, so $\F[X]$ has composition length two \cite[Example~4.2]{BFKM}. For an automorphism group of a homogeneous structure, tuples provide a natural supply of permutation modules. Their invariant subspaces encode linear relations compatible with the structure's symmetries. Finite composition length asks whether the number of strict steps in a chain of such subspaces is bounded. This question has arisen both in the theory of infinite permutation groups and in the study of computation over infinite alphabets; see Evans~\cite[Section~1.1]{Evans} and Boja\'nczyk--Fijalkow--Klin--Moerman~\cite{BFKM}. The latter authors prove finite length over arbitrary fields for the pure countable set and the countable dense linear order, including finite parameter expansions \cite[Theorems~4.8, 4.10 and Corollary~4.9]{BFKM}. Yang--Boja\'nczyk--Klin~\cite[Theorem~7.3]{YBK} extend these results to homogeneous structures obtained from free-amalgamation classes in finite unary and binary relational languages. Their theorem allows a generic linear order and finitely many named parameters, and it holds over every field. It covers, for instance, the random graph and the Henson graphs, as well as their generic ordered expansions. They also determine the exact length of an increasing tuple orbit and describe invariant subspaces by coordinate sums \cite[Theorem~8.14 and Corollary~8.16]{YBK}. They leave the removal of the restriction on relation arity open \cite[Remark~7.4]{YBK}. The purpose of this paper is to remove that restriction; see Theorem~\ref{thm:main}. For background on homogeneous structures, $\omega$-categoricity, automorphism groups and structural Ramsey theory, we refer to Bodirsky's monograph \cite[Chapters~2, 4, 5, 9 and~11]{BodirskyBook}. \subsection{Setting and main results} Let $L$ be a finite relational language and $\K$ a Fra\"iss\'e class of finite $L$-structures with free amalgamation. Here free amalgamation means the following. If $B,C\in\K$ have a common induced substructure $D$, their union over $D$ belongs to $\K$ when its basic relations are exactly those already present in $B$ or $C$. In particular, no relation tuple is added whose entries meet both $B\setminus D$ and $C\setminus D$. For graphs, this is the familiar operation of gluing over an induced subgraph and adding no edges between the two new parts. The same definition applies to relations of any arity. Let $\K^{<}$ consist of all expansions of members of $\K$ by a new linear order relation $<$, and let $\A$ be its countable Fra\"iss\'e limit, with domain $A$. We call this the \emph{generically ordered limit}. The word ``generic'' means that every linear order on every finite member of $\K$ is admitted. Free amalgamation is required only for the original language $L$; the added order relation $<$ is treated separately. After forming the free $L$-amalgam of two ordered structures over their common ordered substructure, we equip it with a linear order extending the orders on both pieces. Every such extension is allowed. For example, points from opposite pieces lying in the same gap of the common ordered substructure may be interleaved, provided the order within each piece is preserved. The resulting amalgam has order comparisons between the two new parts, but no basic $L$-relation instance meeting both parts. Choosing such an order in a particular construction places no further restriction on the class $\K^{<}$. No bound on the arity of the symbols of $L$ is assumed, and relation tuples may have repeated entries. The underlying unordered limit will be denoted by $\A_0$. We will repeatedly use the \emph{finite extension property} of the Fra\"iss\'e limit; see \cite{BodirskyBook}. If $B$ is a finite induced substructure of $\A$ and $C\in\K^{<}$ contains $B$ as an induced substructure, then there is an embedding $C\to\A$ fixing $B$ pointwise. Indeed, universality first gives an embedding of $C$ into $\A$. Homogeneity extends the inverse of its restriction to $B$ to an automorphism of $\A$; composing with that automorphism gives an embedding fixing $B$. Let $\F$ be a field. For a finite set $S\subseteq A$, write \[ H_S=\{g\in\Aut(\A):g(s)=s\text{ for every }s\in S\}. \] For any $H_S$-set $X$, the \emph{permutation module} $\F[X]$ is the vector space with basis $\{[x]:x\in X\}$ and action $g[x]=[g(x)]$, extended linearly. Its \emph{composition length} $\length_{H_S}\F[X]$ is the supremum of the set of integers $n$ for which there is a chain of invariant linear subspaces \[ \{0\}=W_00$ and $\alpha<1$. Bodor \cite[Theorem~5.11]{BodorMonadic} extends this finiteness result to all countable $\omega$-categorical monadically stable structures. These results establish the conjectured finiteness for entire classes, without a separate classification of the reducts of each individual structure. The connection with permutation modules is explained by Evans: failure of finite length over a finite field for a structure homogeneous in a finite relational language would yield a counterexample to Thomas's conjecture \cite[Remark~1.3]{Evans}. Our result establishes this finite-length condition throughout the free-amalgamation setting. Determining all reducts of these structures requires additional arguments. A second motivation concerns closed normal subgroups. Macpherson \cite[Question~2.2.7(4)]{MacphersonSurvey} asks whether the automorphism group of every countable structure homogeneous in a finite relational language has only finitely many closed normal subgroups, where closure is taken in the topology of pointwise convergence. Evans observes that a failure of finite composition length over a finite field would also yield a counterexample to this question \cite[Remark~1.3]{Evans}. Classical positive cases include the random graph, whose automorphism group was proved simple by Truss \cite{TrussGraph}. For $(\mathbb Q,<)$, the work of Higman \cite{Higman} and Holland \cite{Holland}, as stated in \cite[Theorem~1]{Eisenbud}, gives exactly three proper nontrivial normal subgroups: the automorphisms fixing some final interval pointwise, those fixing some initial interval pointwise, and their intersection. All three are dense, so $\Aut(\mathbb Q,<)$ is topologically simple, although it is not simple as an abstract group. Broader simplicity results apply to free-amalgamation limits. Macpherson--Tent \cite[Theorem~1.1]{MacphersonTent} prove that $\Aut(M)$ is simple when $M$ is countably infinite and homogeneous, its age has free amalgamation, and $\Aut(M)$ is transitive on $M$ but is not the full symmetric group $\operatorname{Sym}(M)$. Calderoni--Kwiatkowska--Tent \cite[Theorem~1.3]{CKT} prove simplicity for the generic linear order expansions of these structures. These results also cover the Henson graphs and generic $r$-uniform hypergraphs for $r\ge2$, together with their generic ordered expansions. In all these cases the only closed normal subgroups are the identity subgroup and the whole automorphism group. \section{Coordinate sums and doubled configurations}\label{sec:cogs} We fix a finite set $S\subseteq A$, a field $\F$, and an increasing $H_S$-orbit $\OO\subseteq A^d$ of degree $d\ge0$. For a tuple $a$, let $\aset a$ be the set of its entries. For $v=\sum_{a\in\OO}v(a)[a]\in\F[\OO]$, distinguish the \emph{tuple support} and the \emph{vertex support}: \[ \supp(v)=\{a:v(a)\ne0\},\qquad \vsupp(v)=\bigcup_{a\in\supp(v)}\aset a. \] Both are finite. Homogeneity implies that two tuples are in the same orbit over $S$ precisely when the map between their coordinates, together with the identity on $S$, is a finite partial isomorphism. In particular, the full relational diagram over $S$ is fixed on $\OO$. \subsection{Marginals and balanced vectors} Write $[d]=\{1,\ldots,d\}$, with $[0]=\varnothing$. For $J\subseteq[d]$ and $a\in\OO$, let $p_J(a)$ be the subtuple in the positions indexed by $J$, in increasing order of indices. Its image $p_J(\OO)$ is again an increasing orbit over $S$. We also write \[ p_J:\F[\OO]\longrightarrow\F[p_J(\OO)] \] for the linear extension. For $v\in\F[\OO]$ and $b\in p_J(\OO)$, it is given by \begin{equation}\label{eq:marginal} p_J(v)=\sum_{a\in\OO}v(a)[p_J(a)],\qquad (p_Jv)(b)=\sum_{\substack{a\in\OO\\p_J(a)=b}}v(a). \end{equation} Thus coefficients with the same projected tuple are added. We call $p_Jv$ a \emph{coordinate marginal}. The empty marginal is identified with the scalar $p_\varnothing(v)=\sum_a v(a)$. Put $p_{-i}=p_{[d]\setminus\{i\}}$. \begin{definition} For $d>0$, the space of balanced vectors is \[ \Bal(\OO)=\bigcap_{i=1}^d\ker p_{-i}. \] \end{definition} For ordered atoms, this is the balancedness condition of \cite[Section~4.1, equation~(4)]{BFKM}; its formulation on tuple orbits follows \cite[Section~8.1]{YBK}. Every proper marginal of a balanced vector vanishes: a projection onto a proper subset of positions factors through at least one of the one-coordinate deletions. All these maps commute with $H_S$, so $\Bal(\OO)$ is invariant. \begin{example}\label{ex:matrix} For $d=1$, balanced means simply that the coefficient sum is zero. For $d=2$, we can arrange the coefficients of a vector \[ v=\sum_{(x,y)\in\OO}\lambda_{x,y}[(x,y)] \] in a table: put $\lambda_{x,y}$ in row $x$, column $y$, and put zero in every position $(x,y)\notin\OO$. Denote the resulting matrix by $M$. Its rows and columns are indexed by $A$, but only finitely many entries are nonzero. Thus a finite portion of the matrix contains all the nonzero coefficients. The projection $p_{\{1\}}$ keeps the first coordinate and forgets the second. In particular, both $[(x,y)]$ and $[(x,z)]$ are sent to $[x]$, so their coefficients are added. More generally, \[ p_{\{1\}}v =\sum_{x\in p_{\{1\}}(\OO)} \left(\sum_{y\in A}M_{x,y}\right)[x]. \] The coefficient of $[x]$ is the sum of row $x$. Since distinct basis vectors are linearly independent, $p_{\{1\}}v=0$ precisely when every row sum is zero. Similarly, $p_{\{2\}}$ keeps the second coordinate, and the coefficient of $[y]$ in $p_{\{2\}}v$ is the column sum $\sum_{x\in A}M_{x,y}$. Hence $v$ is balanced exactly when every row and every column separately sums to zero. Merely requiring the sum of all coefficients to vanish would be weaker. For a concrete example, take $\A=(\mathbb Q,<)$, $S=\varnothing$, and the orbit $\OO=\{(x,y)\in\mathbb Q^2:x0$ in this subsection, and start with a tuple $a=(a_1,\ldots,a_d)\in\OO$. We want to replace each coordinate $a_i$ by either itself or a new point $b_i$, so that all $2^d$ choices give tuples in $\OO$. We prescribe more than this: the whole finite configuration is an independent doubling of the original one. \begin{definition}\label{def:double} An \emph{independent doubling} of $a$ over $S$ consists of a tuple $b=(b_1,\ldots,b_d)$ of pairwise distinct points outside $S\cup\aset a$, with \begin{equation}\label{eq:interleave} a_1=Stealth,font=\small] \node[draw,rounded corners,minimum width=3.3cm,minimum height=.75cm] (aa) at (0,1.3) {$+[(a_1,a_2)]$}; \node[draw,rounded corners,minimum width=3.3cm,minimum height=.75cm] (ab) at (5,1.3) {$-[(a_1,b_2)]$}; \node[draw,rounded corners,minimum width=3.3cm,minimum height=.75cm] (ba) at (0,-.4) {$-[(b_1,a_2)]$}; \node[draw,rounded corners,minimum width=3.3cm,minimum height=.75cm] (bb) at (5,-.4) {$+[(b_1,b_2)]$}; \draw[dashed,gray] (aa)--(ab); \node[above,text=black] at (2.5,1.9) {replace position 2}; \draw[dashed,gray] (ba)--(bb); \draw[dashed,gray] (aa)--(ba); \node[left,align=right,text=black] at (-1.9,.45) {replace\\position 1}; \draw[dashed,gray] (ab)--(bb); \draw[->] (-1.7,-1.8)--(6.8,-1.8); \foreach \x/\lab in {-.7/a_1,1.3/b_1,3.3/a_2,5.3/b_2}{ \fill (\x,-1.8) circle (1.6pt); \node[below] at (\x,-1.8) {$\lab$}; } \end{tikzpicture} \caption{A schematic of the degree-two cog described in \cite[p.~11]{BFKM}. The four boxes represent basis tuples, not vertices of the underlying structure. Each row and column of the square cancels under the corresponding marginal. The strip below records the order of the four actual vertices. The dashed lines indicate coordinate replacement, not basic relations.} \label{fig:cog} \end{figure} In general, deleting position $i$ identifies the term indexed by $J$ with the term indexed by $J\mathbin{\triangle}\{i\}$, and their coefficients are opposite. Therefore \begin{equation}\label{eq:easy-inclusion} \Cog(\OO)\subseteq\Bal(\OO). \end{equation} The reverse inclusion is the substantive statement. \begin{theorem}[Generation by cogs]\label{thm:cogs} For every finite $S\subseteq A$, every positive integer $d$, and every increasing orbit $\OO$ of degree $d$ over $S$, \[ \Bal(\OO)=\Cog(\OO). \] \end{theorem} \subsection{The degree-one argument} It is useful to prove the first case explicitly. Although every zero-sum vector is a linear combination of differences of points, an arbitrary difference $[x]-[y]$ need not itself be a cog: the points might have a basic relation between them, or might occur in the wrong order. A fresh point provides the needed bridge. \begin{proof}[Proof of Theorem~\ref{thm:cogs} in degree one] Let $v=\sum_{x\in F}\lambda_x[x]$ with $F\subseteq\OO$ finite and $\sum_x\lambda_x=0$. All points of $\OO$ have the same cut and the same relational type over $S$. Freely amalgamate the structure on $S\cup F$ with one new copy $b$ of a point of $\OO$ over $S$. Put $b$ to the right of every point of $F$, still in their common $S$-cut. For each $x\in F$, the pair $(x,b)$ is an independent doubling over $S$: its two one-point diagrams agree over $S$, and every basic $L$-relation instance on $S\cup F\cup\{b\}$ that uses both $x$ and $b$ is false. Hence $[x]-[b]$ is a cog. Now \[ \sum_{x\in F}\lambda_x([x]-[b]) =\sum_{x\in F}\lambda_x[x] -\left(\sum_{x\in F}\lambda_x\right)[b] =v. \] The auxiliary coefficient at $b$ disappears because $v$ is balanced. \end{proof} The higher-degree proof uses the same principle: auxiliary points allow a controlled replacement, and their unwanted contributions cancel. We must perform these replacements without disturbing the coordinate sums. \section{Ramsey separation and the proof strategy}\label{sec:ramsey} A class of finite ordered structures is \emph{Ramsey} if, for every $B,C$ in the class and every positive integer $r$, some member $D$ has the following property: every colouring of the copies of $B$ in $D$ with $r$ colours has a copy of $C$ all of whose copies of $B$ receive the same colour. A homogeneous ordered structure is called Ramsey when its age, the class of its finite induced substructures up to isomorphism, has this property. The Ramsey theorem for ordered relational structures originates in the work of Ne\v{s}et\v{r}il--R\"odl \cite{NR77}, with further development for classes of set systems in \cite{NR83}. For unrestricted finite ordered relational structures, it was also proved independently by Abramson--Harrington \cite{AH78}. The free-amalgamation form of the Ne\v{s}et\v{r}il--R\"odl theorem states that $\K^{<}$ is Ramsey; see \cite[Theorem~1.2]{EHN} for a modern formulation covering the relational languages used here. Naming finitely many constants preserves the Ramsey property: see the elegant proof in \cite[Proposition~10]{BPT}, based on the theorem of Kechris--Pestov--Todorcevic \cite{KPT} describing Ramsey structures via a dynamical property. Homogeneity in a finite relational language also implies that $H_S$ has finitely many orbits on $A^n$ for every $n$: only finitely many induced diagrams on $n$ entries and the fixed set $S$ can occur. By the Ryll--Nardzewski theorem, $(\A,S)$ is $\omega$-categorical; see \cite[Chapter~4]{BodirskyBook} and \cite[Section~1.3]{Evans} for this background. These facts permit the following application of Evans's theorem. \begin{lemma}[Evans's separation theorem]\label{lem:separator} Let $U\leq\F[\OO]$ be $H_S$-invariant and $v\in \F[\OO]\setminus U$. Set $T=S\cup\vsupp(v)$. There is a function $f:\OO\to\F$ invariant under $H_T$ such that \[ \sum_{a\in\OO}u(a)f(a)=0\quad(u\in U),\qquad \sum_{a\in\OO}v(a)f(a)\ne0. \] \end{lemma} \begin{proof} If $d=0$, then $\OO$ consists of the empty tuple and $\F[\OO]$ is one-dimensional. Since $v\notin U$, necessarily $U=0$ and $v\ne0$, so the function taking value $1$ on the empty tuple has the required properties. Henceforth assume $d\ge1$. We apply \cite[Corollary~1.5]{Evans}, identifying its structure, group, module, and support explicitly. Let \[ M=(\A,(s)_{s\in S}) \] be the expansion obtained by naming each element of $S$ as a constant. Its automorphism group is $G=\Aut(M)=H_S$: an automorphism of $M$ is exactly an automorphism of $\A$ fixing every element of $S$. The preceding discussion shows that $M$ is both $\omega$-categorical and Ramsey, as required by Evans's corollary. For the set $W$ in that corollary, take $W=\OO$. Every orbit on finite tuples under the automorphism group of an $\omega$-categorical structure is definable without parameters. Thus $\OO$, being a $G$-orbit, is definable without parameters in $M$: the elements of $S$ have already been named in its language. To check the sort hypothesis, recall that Evans permits sorts $D/E$, where $D$ is a parameter-free definable set and $E$ is a parameter-free definable equivalence relation on $D$ \cite[Section~1.3.2]{Evans}. Taking $D=\OO$ and $E$ to be equality identifies $D/E$ with $\OO$. The action of $G$ on $W=\OO$ is coordinatewise: \[ g(a_1,\ldots,a_d)=(g(a_1),\ldots,g(a_d)) \qquad(g\in G,\ (a_1,\ldots,a_d)\in\OO). \] The free vector space denoted by $FW$ in Evans's corollary is therefore exactly $\F[\OO]$. We take his field $F$ to be our $\F$, his invariant subspace $V$ to be $U$, and his vector $x$ to be $v$. The hypotheses that $V$ is $G$-invariant and $x\notin V$ are precisely the assumptions that $U$ is $H_S$-invariant and $v\notin U$. The support used in Evans's conclusion is the support of $x$ as a vector with basis $W$. In our application this is \[ \Sigma=\supp(v)=\{a\in\OO:v(a)\ne0\}. \] Thus $\Sigma$ is a finite set of tuples, whereas $S$ and $T=S\cup\vsupp(v)$ are finite sets of vertices. We use the letter $\Sigma$ because the support is denoted by $S$ in Evans's statement, with a different meaning from our parameter set $S$. Evans's corollary gives invariance under $G_{(\Sigma)}$, the subgroup fixing each tuple in $\Sigma$ individually. Fixing a tuple under the coordinatewise action is equivalent to fixing each of its entries. Since every element of $G=H_S$ already fixes $S$ pointwise, we obtain \[ \begin{aligned} G_{(\Sigma)} &=\{g\in H_S:g(a)=a\text{ for every }a\in\Sigma\}\\ &=H_{S\cup\bigcup_{a\in\Sigma}\aset a} =H_{S\cup\vsupp(v)} =H_T. \end{aligned} \] Here it is essential that the tuples are fixed individually: merely permuting the tuples in $\Sigma$ would not suffice. With these choices, the corollary supplies a function $f:\OO\to\F$ satisfying \[ f(g(a))=f(a)\qquad(g\in H_T,\ a\in\OO) \] and \[ \sum_{a\in\OO}u(a)f(a)=0\quad(u\in U), \qquad \sum_{a\in\OO}v(a)f(a)\ne0. \] These sums express Evans's separation conclusion: the linear functional obtained by summing against $f$ vanishes on every vector in $U$ and does not vanish on $v$. All sums are finite because the vectors have finite support. Together with the $H_T$-invariance, these are exactly the conclusions of the lemma. \end{proof} We use the same symbol $f$ for the function on tuples and its linear extension to $\F[\OO]$: for $w=\sum_{a\in\OO}w(a)[a]$, we set \[ f(w)=\sum_{a\in\OO}w(a)f(a). \] The sum is finite because $w$ has finite support. Ordinary linear algebra gives a functional separating $v$ from $U$; the additional content of Lemma~\ref{lem:separator} is invariance under $H_T$. In particular, the value of $f$ on a tuple depends only on its induced diagram over $T$. \subsection{Proof outline for cog generation}\label{sec:cog-outline} Our goal is Theorem~\ref{thm:cogs}, $\Bal(\OO)=\Cog(\OO)$. The inclusion $\Cog(\OO)\subseteq\Bal(\OO)$ was established in \eqref{eq:easy-inclusion}, and the degree-one case was proved in Section~\ref{sec:cogs}. We outline the inductive step for $d\ge2$, assuming the theorem in degree $d-1$ for every finite parameter set. The constructions needed for this step are proved in Sections~\ref{sec:moving} and~\ref{sec:finish-cogs}; here we describe what they must achieve and how they yield a contradiction. Suppose that $v\in\Bal(\OO)\setminus\Cog(\OO)$, and put $U=\Cog(\OO)$ and $T=S\cup\vsupp(v)$. Applying Lemma~\ref{lem:separator} and rescaling the resulting function gives an $H_T$-invariant $f:\OO\to\F$ whose linear extension vanishes on $U$ and satisfies $f(v)=1$. The first construction, proved in Lemma~\ref{lem:compression} in Section~\ref{sec:moving}, produces a balanced vector $u\in\F[\OO]$ such that \[ u-v\in U,\qquad \vsupp(u)\cap T=\varnothing, \] and, for each position $i$, all $i$th coordinates of tuples in $\supp(u)$ lie in one fixed cut over $T$. The construction repeatedly replaces all occurrences of one vertex in one coordinate position. After that coordinate is deleted, the chosen slice is balanced in degree $d-1$ over $S$ together with the fixed vertex. The induction hypothesis decomposes this slice into smaller cogs. Lemma~\ref{lem:slice} constructs a replacement point so that each smaller cog, with the old and new points inserted, gives a degree-$d$ cog. Consequently each replacement changes the vector by an element of $U$. Lemma~\ref{lem:compression} specifies the order of replacements and their destination cuts, proving that finitely many replacements give all the stated support conditions. These are the constructions to be justified in Section~\ref{sec:moving}. Once $u$ has been obtained, it satisfies \[ f(u)=f(v)+f(u-v)=1. \] The second construction concerns the individual tuples occurring in $u$. Let $a=(a_1,\ldots,a_d)$ range over $\supp(u)$, so that \[ u=\sum_{a\in\supp(u)}u(a)[a]. \] We introduce a tuple $b(a)$ to complete $a$ to a cog. Since $f$ vanishes on every cog, this will give an identity expressing $f(a)$ through its values on mixed tuples. The choice of $b(a)$ must also ensure that these other values depend only on proper subtuples of $a$. For each such $a$, Section~\ref{sec:finish-cogs} constructs a tuple $b=b(a)=(b_1,\ldots,b_d)$ of fresh points outside $T\cup\aset a$ forming an independent doubling of $a$ over $S$ (Definition~\ref{def:double}). Each $b_i$ lies in the same $T$-cut as $a_i$. In the induced structure on $T\cup\aset a\cup\aset b$, every basic $L$-relation instance meeting both $\aset b$ and $T\setminus S$ is false. The tuple $b(a)$ is chosen separately for each $a$. For $J\subseteq[d]$, recall that $a^J$ is obtained from $a$ by replacing $a_i$ with $b_i$ exactly when $i\in J$. In particular, $a^\varnothing=a$ and $a^{[d]}=b(a)$. The independent doubling gives $c(a,b(a))\in U$, so applying $f$ yields the connecting identity \[ 0=f(c(a,b(a))) =f(a)+\sum_{\varnothing\ne J\subseteq[d]}(-1)^{|J|}f(a^J) \qquad(a\in\supp(u)). \] Thus the auxiliary tuple $b(a)$ supplies the mixed tuples whose values under $f$ determine $f(a)$. The additional conditions imposed on $b(a)$ relative to $T$ ensure dependence on retained coordinates. More precisely, Section~\ref{sec:finish-cogs} proves the following assertion. For each nonempty $J\subseteq[d]$, put $K=[d]\setminus J$. There is a well-defined function \[ g_J:p_K(\supp(u))\longrightarrow\F \quad\text{such that}\quad f(a^J)=g_J(p_K(a))\qquad(a\in\supp(u)). \] Thus, if two supported tuples have the same retained subtuple, their mixed tuples have the same value under $f$. The later proof establishes this by comparing the induced diagrams over $T$ and using the $H_T$-invariance of $f$. Substituting these values into the displayed cog identity expresses $f(a)$ as a signed sum of functions of proper subtuples. When multiplied by $u(a)$ and summed over $a\in\supp(u)$, each such term vanishes because the corresponding proper marginal of $u$ is zero. Hence $f(u)=0$, contrary to $f(u)=1$. The detailed summation is given in Section~\ref{sec:finish-cogs}, after the constructions and the dependence on retained coordinates have been proved. \section{Moving a balanced vector into fixed intervals}\label{sec:moving} We now prove the first construction used in the outline of Section~\ref{sec:cog-outline}. Given a balanced vector $v$ and a finite set $T\supseteq S$, we will construct a balanced vector $u$ with no support vertex in $T$, with each coordinate position confined to a specified cut over $T$, and with $v-u\in\Cog(\OO)$. Thus the construction changes the representative of the coset $v+\Cog(\OO)$ while controlling where its vertices lie. Throughout this section $d\ge2$. We assume Theorem~\ref{thm:cogs} in degree $d-1$ for every finite parameter set and every increasing orbit of that degree. This simultaneous induction is needed because fixing one coordinate at a vertex $z$ leaves a vector of degree $d-1$ over the enlarged parameter set $S\cup\{z\}$. The local operation replaces all terms having a specified vertex in a specified position. Lemma~\ref{lem:slice} proves that a suitable replacement changes the vector by a sum of cogs. Lemma~\ref{lem:compression} then arranges a finite sequence of these replacements to reach the required cuts. \subsection{Replacing one coordinate slice} The slice-decomposition method comes from \cite[proofs of Claim~E.5 and Theorem~E.6]{YBK}. The proof below extends its lifting step to relations of arbitrary arity and establishes the freedom to prescribe a cut for the replacement point. We give the construction explicitly, including the placement of the auxiliary vertices used in the decomposition. \begin{lemma}[Slice replacement]\label{lem:slice} Let $v\in\Bal(\OO)$, let $i\in[d]$, and let $z\in A\setminus S$ occur in position $i$ in some tuple in $\supp(v)$. Define \begin{equation}\label{eq:slice} w=\sum_{\substack{a\in\OO\\a_i=z}}v(a)[p_{-i}(a)], \qquad P=\vsupp(w). \end{equation} The vector $w$ is the \emph{slice at $a_i=z$}, with its fixed coordinate deleted. Restoring $z$ in position $i$ recovers each original tuple, so deletion is injective on this slice and no coefficients combine. The set $P$ consists of the vertices in the other positions of the supported tuples in this slice; we call these vertices the \emph{partners of $z$ in position $i$}. In particular, $z\notin P$. Let $D\subseteq A$ be finite with $S\cup\vsupp(v)\subseteq D$. Let $J$ be a cut over $D$ such that \[ pz$ that works for the entire cog decomposition of $w$. Each transported degree-one cog has the form $[b]-[c]$, where $(b,c)$ is an independent doubling over $S\cup\{z\}$ and $b1$, choose $i\in R_q(x)$ and put $D=T\cup\vsupp(q)$. Choose the cut immediately to the right of $x$ in the finite order on $D$. Every point of $D\setminus\{x\}$ has the same comparison with this cut as with $x$. In particular this holds for $S$ and for all partners of $x$ in the chosen slice, which do not include $x$ itself. Lemma~\ref{lem:slice} therefore applies. It replaces all occurrences of $x$ in position $i$ by one fresh vertex $x'$, leaving the other positions unchanged. The replacement is injective on the supported tuples, as shown in the proof of Lemma~\ref{lem:slice}. Thus $x$ loses exactly position $i$, the new vertex $x'$ occurs only in position $i$, and the position sets of every other vertex are unchanged. The nonnegative integer \[ E(q)=\sum_{x\in\vsupp(q)}\bigl(|R_q(x)|-1\bigr) \] therefore decreases by exactly one. After finitely many steps $E(q)=0$, so every support vertex has a unique position. This property will persist through Stage 2, since each replacement point is fresh and is used in just one position. \medskip\noindent \emph{Stage 2: move the positions into their destination cuts.} Process the coordinate positions in the order $d,d-1,\ldots,1$. Within a position, process its support vertices in any order. At the beginning of this stage, declare all support vertices unmoved. Let $N$ and $M$ denote, respectively, the sets of currently unmoved and moved support vertices; initially $N=\vsupp(q)$ and $M=\varnothing$. A fresh replacement is declared moved and is never processed again. For each cut $I$ over $S$, maintain the order condition \begin{equation}\label{eq:order-invariant} xi$ has already moved, because that entire position has been processed. It is above $z$ in its tuple, and if it lies in $I$ it is also above the prescribed cut. The unique-position property from Stage 1 ensures that these statements about moved and unmoved vertices are unambiguous. Partners outside $I$ retain their comparisons automatically, since $z$ and its replacement stay in the same $S$-cut. The comparisons with $S$ are preserved for the same reason. Thus the cut has exactly the required comparisons with $S$ and all partners, and Lemma~\ref{lem:slice} supplies a replacement $z'$ in it. Replace the slice, remove $z$ from $N$, and add $z'$ to $M$. The vertex $z$ disappears from the support because it had only position $i$. Every other old support vertex remains, and $z'$ is fresh. The old moved vertices still satisfy \eqref{eq:order-invariant}; the new moved vertex $z'$ satisfies it by the chosen cut. Hence the invariant is preserved. Each step decreases $|N|$ by one, so Stage 2 terminates after finitely many replacements. \medskip\noindent \emph{Conclusion.} Let $u$ be the final vector. Every support vertex of $u$ was introduced in Stage 2 outside a set $D$ containing $T$, so $\vsupp(u)\cap T=\varnothing$. Every such vertex in position $i$ lies in $I_i$ and above every point of $T\cap I_i$, by \eqref{eq:order-invariant}. It therefore lies in $J_i$. Balancedness has been preserved at every step. Finally, list all vectors in both stages as $q_0=v,q_1,\ldots,q_\ell=u$, where $\ell$ is the total number of replacements. Lemma~\ref{lem:slice} gives $q_{k-1}-q_k\in\Cog(\OO)$ for each $k=1,\ldots,\ell$. Since this is a vector subspace, \[ v-u=\sum_{k=1}^{\ell}(q_{k-1}-q_k)\in\Cog(\OO). \] This proves the remaining conclusion. \end{proof} \begin{figure}[tbp] \centering \begin{tikzpicture}[x=1cm,y=1cm,>=Stealth,font=\small] \draw[->] (0,0)--(12.7,0); \foreach \x/\lab in {0/s,12/t}{ \draw[thick] (\x,-.12)--(\x,.12); \node[below] at (\x,-.12) {$\lab$}; } \foreach \x/\lab in {1.6/c_1,4.6/c_2}{ \draw[thick] (\x,-.12)--(\x,.12); \node[above] at (\x,.14) {$\lab\in T$}; } \foreach \x in {.8,2.6,5.5,6.3}{\fill[gray] (\x,0) circle (2pt);} \fill (3.5,0) circle (2pt);\node[below] at (3.5,-.12) {$z$}; \fill[orange!80!black] (7.8,0) circle (2.5pt); \node[below] at (7.8,-.12) {$z'$}; \foreach \x in {9.3,10.2,11.1}{\fill[blue!65!black] (\x,0) circle (2.5pt);} \draw[->,thick] (3.5,.2) to[bend left=28] node[above] {replace the chosen position} (7.8,.2); \draw[decorate,decoration={brace,mirror,amplitude=4pt}] (.6,-.65)--(6.5,-.65); \node[below,align=center] at (3.55,-.85) {unmoved support and extra parameters}; \draw[decorate,decoration={brace,mirror,amplitude=4pt}] (9.1,-.65)--(11.3,-.65); \node[below,align=center] at (10.2,-.85) {moved support}; \end{tikzpicture} \caption{One step inside an $S$-interval $I=(s,t)$. The new point $z'$ is placed after the unmoved support and the parameters in $T\cap I$, and before the moved support. Processing larger coordinate positions first ensures that every partner in a smaller position stays below $z'$, while every partner in a larger position stays above it. The same construction works in unbounded $S$-intervals.} \label{fig:compression} \end{figure} For three coordinates lying in the same $S$-interval, this procedure first puts all third-coordinate points to the right of $T$, then places the second-coordinate points between $T$ and those third coordinates, and finally places the first-coordinate points in the remaining gap. The fixed order of the coordinates is preserved throughout. Notice also that the induction always uses $S$ as its permanent parameter set. The extra points of $T\setminus S$ may be crossed; they constrain the desired final cuts, not the allowed cog replacements. \section{Completion of the cog-generation proof}\label{sec:finish-cogs} We now carry out the argument outlined in Section~\ref{sec:ramsey}. The essential issue is to make the other corners of a doubled tuple depend only on the coordinates that were not replaced. \begin{proof}[Proof of Theorem~\ref{thm:cogs}] The degree-one case was proved in Section~\ref{sec:cogs}. Assume the theorem in degree $d-1$ for every finite parameter set. Suppose that $v\in\Bal(\OO)\setminus\Cog(\OO)$. By Lemma~\ref{lem:separator}, choose an $H_T$-invariant function $f:\OO\to\F$ with $f(\Cog(\OO))=0$ and $f(v)=1$, where $T=S\cup\vsupp(v)$. Lemma~\ref{lem:compression} gives a balanced $u$ in the prescribed fixed $T$-cuts, disjoint from $T$, with $u-v\in\Cog(\OO)$. Hence $f(u)=1$. Let $Q\subseteq\OO$ consist of the tuples avoiding $T$ with these fixed cuts, so that $\supp(u)\subseteq Q$. For each $a=(a_1,\ldots,a_d)\in Q$, form an independent doubling over $S$ and freely amalgamate it with the actual structure on $T\cup\aset a$ over $S\cup\aset a$; see Figure~\ref{fig:amalgam}. Write $b=b(a)=(b_1,\ldots,b_d)$ for the tuple of new points in this amalgam. This choice is made separately for each $a$. Choose their order so that $a_i0$, and any finite set $D\supseteq S\cup\aset a$. Put $B=D\setminus\aset a$ and apply Definition~\ref{def:double} over $B$. The resulting independent doubling $(a,b)$ has each $b_i$ immediately after $a_i$ in the finite order on \[ C=D\cup\aset b. \] For each $i\in[r]$, define \[ \sigma_i:C\setminus\{b_i\}\longrightarrow C\setminus\{a_i\}, \qquad \sigma_i(a_i)=b_i, \] fixing every other point of its domain. Each $\sigma_i$ is a partial isomorphism. To check the $L$-relations, consider any relation instance in its domain. Whether it contains both members of another twin pair is unchanged by $\sigma_i$; if it does, the doubling rule makes both the instance and its image false. Otherwise, their truth values are read from the same tuple in $D$ under the map fixing $D$ and sending every $b_j$ to $a_j$. This verifies preservation and reflection for every arity, including instances with several twins or repeated arguments. The order is preserved because $a_i$ and $b_i$ are consecutive in $C$. Homogeneity therefore extends $\sigma_i$ to an automorphism $\pi_i\in H_S$. Since $D$ was arbitrary, it may include the entire vertex support of a vector to which YBK's successive-difference argument is applied. One further structural fact used at the start of \cite[Appendix~F.1]{YBK} is the absence of algebraicity: every point outside a finite set $D$ has an infinite orbit under its pointwise stabilizer. Indeed, for any $x\in A\setminus D$, free amalgamation produces arbitrarily many copies of $D\cup\{x\}$ over $D$, with their new points distinct and in the same $D$-cut as $x$. The extension property and homogeneity realize them as images of $x$ over $D$. Consequently, an $H_S$-equivariant bijection between increasing tuple orbits outside $S$ must preserve the set of entries: each image entry is fixed by the stabilizer of the source tuple, and the inverse gives the reverse containment. Since the tuples are increasing, the bijection is the identity after coordinate reindexing. \subsection{The marginal description inherited from YBK} We retain the notation for joint marginals because the duality argument in Section~\ref{sec:consequences} uses the individual coefficient evaluations. Fix a finite $S\subseteq A$ and $k\ge0$. Let $\mathscr O$ be a finite collection of distinct increasing $H_S$-orbits of degree at most $k$. For each $\OO\in\mathscr O$, let $E_\OO$ be a finite-dimensional $\F$-vector space with trivial $H_S$-action, and put \[ V=\bigoplus_{\OO\in\mathscr O}E_\OO\otimes_\F\F[\OO]. \] Thus $v\in V$ has coefficients $v_\OO(a)\in E_\OO$, only finitely many of which are nonzero. Choosing a basis of $E_\OO$ identifies its summand with $\dim E_\OO$ labelled copies of $\F[\OO]$, as in \cite[Remark~8.13]{YBK}. Following \cite[Definition~F.1]{YBK}, group all projections with the same target orbit $\PP$. Keep a separate coefficient slot for each source and projection label: \[ Z_\PP=\bigoplus_{\substack{\OO\in\mathscr O,\ J\subseteq[\deg\OO]\\ p_J(\OO)=\PP}}E_\OO. \] For $v\in V$ and $b\in\PP$, the joint marginal coefficient is \begin{equation}\label{eq:joint-profile} \rho_\PP:V\longrightarrow Z_\PP\otimes\F[\PP],\qquad \bigl(\rho_\PP(v)(b)\bigr)_{(\OO,J)} =\sum_{\substack{a\in\OO\\p_J(a)=b}}v_\OO(a). \end{equation} The target orbits $\PP$ range over all coordinate projections, including the identity and empty projections. Keeping the slots together records linear relations between different marginal coefficients evaluated at the same tuple. \begin{theorem}[Marginal description]\label{thm:profiles} For an $H_S$-invariant subspace $W\le V$, set \[ E_\PP(W)=\{\rho_\PP(w)(b):w\in W\}\le Z_\PP, \] where $b\in\PP$ is fixed. This subspace is independent of the choice of $b$, and \begin{equation}\label{eq:profile-description} W=\{v\in V:\rho_\PP(v)(b)\in E_\PP(W) \text{ for every }\PP\text{ and every }b\in\PP\}. \end{equation} \end{theorem} \begin{proof}[Proof by transfer of the YBK argument] When $k=0$, the statement is ordinary finite-dimensional linear algebra. For general $k$, linearity makes $E_\PP(W)$ a subspace; transitivity on $\PP$ and invariance of $W$ make it independent of $b$. These are the coefficient spaces in \cite[Theorem~8.14]{YBK}, and $\rho_\PP$ is their grouped projection from Definition~F.1, with the multiplicities recorded by the spaces $E_\OO$. The preceding no-algebraicity observation justifies grouping by equality of increasing target orbits. The proof in \cite[Appendix~F.1, Lemma~F.3]{YBK} reconstructs membership in $W$ by successively removing assumptions that marginals vanish. Its two steps carry over as follows. The calculation in Claim~F.4 uses only composition of coordinate projections and finite sums, so is unchanged. It produces a balanced vector with coefficients in a finite-dimensional subspace. Theorem~\ref{thm:cogs}, applied in each component of a basis of that coefficient space, supplies the cog decomposition used there from their Theorem~8.12. Claim~F.5 then lifts these cogs to vectors of $W$ by successive differences; the automorphisms required for this step were constructed above. All these statements allow several labelled orbit components, as in \cite[Remark~8.13 and Appendix~F.1]{YBK}. Thus the induction of Lemma~F.3 proves \eqref{eq:profile-description} without any further change depending on relation arity. \end{proof} The exact-length argument of \cite[Corollary~8.16 and Appendix~F.2]{YBK} now carries over as well. We give that calculation in Section~\ref{sec:consequences}, followed separately by the duality argument and the bound on additional parameters. \section{Composition lengths and closed function spaces}\label{sec:consequences} We apply the marginal description to obtain the length formula by YBK's argument, and then use Evans's formulation of standard duality to deduce the assertions about closed function spaces. \subsection{The exact length} \begin{proof}[Proof of Theorem~\ref{thm:main}] By Theorem~\ref{thm:profiles}, a strict inclusion of invariant subspaces strictly increases at least one of the spaces $E_\PP(W)$. The dimension count of \cite[Corollary~F.6]{YBK} therefore gives \begin{equation}\label{eq:length-upper} \length_{H_S}V\le\sum_\PP\dim Z_\PP =\sum_{\OO\in\mathscr O}(\dim E_\OO)2^{\deg\OO}. \end{equation} For a single increasing orbit $\OO$ of degree $d>0$, this is the upper bound $2^d$. The matching lower-bound proof in \cite[Corollary~8.16, Appendix~F.2]{YBK} constructs $2^d$ strict inclusions using partial alternating sums on an independent doubling. The configuration and automorphisms are available by Section~\ref{sec:profiles}; the remaining coordinate-projection identities are unchanged in every arity and characteristic. Thus $\length_{H_S}\F[\OO]=2^d$. In degree zero, the orbit module is one-dimensional, giving the same formula. To pass from increasing orbits to $A^k$, partition $A^k$ into its finitely many $H_S$-orbits. A tuple in one orbit is determined by the increasing list of its distinct entries outside $S$, together with a fixed pattern specifying repeated entries and entries from $S$. This identifies its orbit equivariantly with an increasing orbit of degree at most $k$. If several orbits give the same increasing orbit, they supply a finite coefficient multiplicity. Thus $\F[A^k]$ has the form of $V$ above, and has finite length. The unordered stabilizer $\Aut(\A_0)_{(S)}$ contains $H_S$. Every subspace invariant under that larger group is invariant under $H_S$, so its chains satisfy the same finite bound. This proves the unordered assertion as well. \end{proof} \subsection{Duality and the parameter bound} The closed-function assertions follow by combining the marginal description with standard vector-space duality. We use \cite[Lemma~2.2]{Evans}: for the pairing \[ \langle v,f\rangle=\sum_{x\in A^k}v(x)f(x), \qquad v\in\F[A^k],\quad f\in\F^{A^k}, \] annihilators give an inclusion-reversing correspondence between invariant subspaces of $\F[A^k]$ and closed invariant subspaces of $\F^{A^k}$. Here the annihilator consists of the elements on the other side that pair to zero with the given subspace; the double annihilator of a function space is its closure. The deduction below follows the finite-dimensional separation and pullback argument in the proof of \cite[Corollary~2.3]{Evans}, using the joint marginals of \cite[Theorem~8.14]{YBK}. Evaluating a marginal at a tuple of length at most $k$ yields the uniform parameter bound. The same deduction already applies to YBK's binary setting. \begin{proof}[Proof of Corollary~\ref{cor:codes}] Let $\F$ be finite and let $C\le\F^{A^k}$ be closed and $H_S$-invariant. Let $\Psi:\F[A^k]\to V$ be the equivariant orbit decomposition from the proof of Theorem~\ref{thm:main}, and put $W=\Psi(C^\perp)$. For every projected orbit $\PP$, every $b\in\PP$, and every linear functional $\lambda:Z_\PP\to\F$ vanishing on $E_\PP(W)$, define \begin{equation}\label{eq:generator} f_{\PP,b,\lambda}(x) =\lambda\bigl(\rho_\PP(\Psi([x]))(b)\bigr), \qquad x\in A^k. \end{equation} These functions annihilate $C^\perp$, hence belong to $C$. Equivariance fixes each of them over $S\cup\aset b$; since $\deg\PP\le k$, this uses at most $k$ additional parameters. Theorem~\ref{thm:profiles} and finite-dimensional separation in each $Z_\PP$ show that their common annihilator is exactly $C^\perp$. Double-annihilator duality therefore gives $C$ as their closed linear span. Finally, the field and all the spaces $Z_\PP$ are finite, and there are only finitely many projected orbits $\PP$. There are consequently only finitely many choices for the subspaces $E_\PP(W)$. These determine $W$ by Theorem~\ref{thm:profiles}, and duality then determines $C$. \end{proof} There is an immediate quotient consequence. Under the same hypotheses, let $C_1