This question is essentially a reposting of [this](https://math.stackexchange.com/q/3828287/10513) question from Math.SE, which has a partial answer. YCor suggested I repost it here.




---


Our starting point is a theorem of Matumoto: every group $Q$ is the outer automorphism group of some group $G\_Q$ [1]. It seems to be a research theme to place restrictions on the groups involved. For example, Bumagin and Wise proved that if we restrict $Q$ to be countable then we may take $G\_Q$ to be finitely generated [2], and more recently Logan proved that if we restrict $Q$ to be finitely generated and residually finite group then we may take $G\_Q$ to be residually finite [3, Corollary D] (this paper also cites quite a few other papers which play this game).


However, all the results I have found always produce infinite groups $G\_Q$, even when the "input" groups $Q$ are finite. For example, Matumoto's groups $G\_Q$ are fundamental groups of graphs of groups (so are always infinite), Bumagin and Wise use a variant of Rips' construction (so (as $Q$ is finite) their groups $G\_Q$ have finite index in metric small cancellation groups, so are infinite), and Logan's groups $G\_Q$ are HNN-extensions of hyperbolic triangle groups (so again are infinite). So we have a question:



> 
> Does every finite group $Q$ occur as the outer automorphism group of some *finite* group $G\_Q$?
> 
> 
> 


The answer is "yes" if we take $Q$ to be finite abelian or a symmetric group; this is what the [answer](https://math.stackexchange.com/a/3828440/10513) to the original Math.SE question proves.


[1] Matumoto, Takao. "Any group is represented by an outerautomorphism group." *Hiroshima Mathematical Journal* 19.1 (1989): 209-219. ([Project Euclid](https://projecteuclid.org/download/pdf_1/euclid.hmj/1206129490))


[2] Bumagin, Inna, and Daniel T. Wise. "Every group is an outer automorphism group of a finitely generated group." *Journal of Pure and Applied Algebra* 200.1-2 (2005): 137-147. ([doi](https://doi.org/10.1016/j.jpaa.2004.12.033))


[3] Logan, Alan D. "Every group is the outer automorphism group of an HNN-extension of a fixed triangle group." *Advances in Mathematics* 353 (2019): 116-152. ([doi](https://doi.org/10.1016/j.aim.2019.06.009), [arXiv](https://arxiv.org/abs/1709.06441))



Is every finite group the outer automorphism group of a finite group?
Yes.


For each finite group $Q$ I'll construct a finite group $H$ with $\mathrm{Out}(H)\simeq Q$, moreover $H$ will be constructed as a semidirect product $D\ltimes P$, with $P$ a $p$-group of exponent $p$ and nilpotency class $<p$, (with prime $p$ arbitrary chosen $>|Q|+1$) and $D$ abelian of order coprime to $p$ (actually $D$ being a power of a cyclic group of order $p-1$).




---


I'll use Lie algebras which are convenient tools to encode $p$-groups when $p$ is less than the nilpotency class, taking advantage of linear algebra.


In Lie algebras, we denote $[x\_1,\dots,x\_m]=[x\_1,[x\_2,\dots,[x\_{m-1},x\_m]\cdots]]$. Also I choose the convention to let permutations act on the left.


The base field is $K=\mathbf{F}\_p$, $p$ prime. Fix $n\ge 1$. Let $\mathfrak{f}\_n$ be the free Lie $K$-algebra on generators $(e\_1,\dots,e\_n)$. It admits a unique grading in $\mathbf{Z}^n$ such that $e\_i$ has degree $E\_i$, where $(E\_i)$ is the canonical basis of $\mathbf{Z}^n$, it is called multi-grading. For instance, $[e\_3,[e\_1,e\_3]]$ has multi-degree $(1,0,2,0,\dots,0)$.


Let $I$ be a finite-codimensional multi-graded ideal contained in $[\mathfrak{f}\_n,\mathfrak{f}\_n]$: so the quotient $\mathfrak{g}=\mathfrak{f}\_n/I$ is naturally multi-graded. There is a natural action of ${K^\*}^n$ on $\mathfrak{g}$: namely $(t\_1,\dots,t\_n)$ acts on $\mathfrak{g}\_{(m\_1,\dots,m\_n)}$ by multiplication by $\prod\_{i=1}^n t\_i^{m\_i}$. Let $D\subset\mathrm{Aut}(\mathfrak{g})$ be the image of this action. Also denote by $c$ the nilpotency class of $\mathfrak{g}$: we assume $p>c$.


Using that $p>c$, we endow, à la Malcev–Lazard, $\mathfrak{g}$ with the group law given by the Baker-Campbell-Hausdorff formula: $xy=x+y+\frac12[x,y]+\dots$. We thus view $\mathfrak{g}$ as both a Lie algebra and a group; we denote it as $G$ when endowed with the group law (but feel free to refer to the Lie algebra law in $G$); this is a $p$-group of exponent $p$ and nilpotency class $c<p$. Define $H=D\ltimes G$.


Every permutation $\sigma\in\mathfrak{S}\_n$ induces an automorphism $u\_\sigma$ of $\mathfrak{f}\_n$, defined by $u\_\sigma(e\_i)=e\_{\sigma(i)}$. Write $\Gamma\_I=\Gamma\_{\mathfrak{g}}=\{\sigma\in\mathfrak{S}\_n:u\_\sigma(I)=I\}$.


**Proposition 1.** The natural map $\Gamma\_\mathfrak{g}\to\mathrm{Out}(H)$ is an isomorphism.


We need a lemma:


**Lemma 2.** Define $M$ as $\mathbf{F}\_p^\*\ltimes\mathbf{F}\_p$. Then $\mathrm{Out(M^n})$ is reduced to the symmetric group permuting the $n$ factors.


*Proof.* Let $f$ be an automorphism. This is a product of $n$ directly indecomposable center-free abelian groups, hence its automorphism group permutes the $n$ (isomorphic) factors. Hence after composing with a permutation, we can suppose that $f$ preserves each factor. We are then reduced to checking that every automorphism of $\mathbf{F}\_p^\*\ltimes\mathbf{F}\_p$ is inner. Indeed after composing by an inner automorphism, we can suppose that it maps the Hall subgroup $\mathbf{F}\_p^\*$ into itself. Then after composing with an inner automorphism, we can also suppose it acts as identity on $\mathbf{F}\_p$. It easily follows that this is the identity. (Note for conciseness I used some slightly fancy results in this proof, but this lemma can be checked more elementarily.) $\Box$


*Proof of the proposition.*
After composing with an inner automorphism, we can suppose that $f$ maps the Hall subgroup $D$ into itself.


Next, $f$ induces an automorphism of $H/[G,G]$, which can naturally be identified with $M^n$ of the previous lemma (recall that $I\subset [G,G]=[\mathfrak{g},\mathfrak{g}])$. Hence after composing with conjugation by some element of $D$, we can suppose that $f$ both preserves $D$ and acts on $H/[G,G]\simeq M^n$ by permuting the factors (without changing coordinates). Hence $f$ acts as the identity on $D$, and $f(e\_i)=e\_{\sigma(i)}+w\_i$ for all $i$, with $w\_i\in [G,G]$ ($+$ is the Lie algebra addition). Now, for $d\in D$, we have $f(d)=d$, so $f(de\_id^{-1})=df(e\_i)d^{-1}$. Choose $d$ as the action of $(t,\dots,t)$. Then this gives $t(e\_{\sigma(i)}+w\_i)=te\_{\sigma(t)}+df(w\_i)d^{-1}$. Hence $w\_i$ is an eigenvector for the eigenvalue $t$ in $[\mathfrak{g},\mathfrak{g}]$, on which $d$ has the eigenvalues $(t^2,t^3,\dots,t^c)$. Choosing $t$ of order $p-1$, we see that $t$ is not an eigenvalue, and hence $w\_i=0$. Hence up to inner automorphisms, every automorphism of $H$ is induced by permutation of the $n$ coordinates. Necessarily such a permutation has to be in $\Gamma\_\mathfrak{g}$. $\Box$.


To conclude we have to prove:


**Proposition 3.** For every finite group $Q$ of order $n$ and prime $p>n+1$ there exist $n,p$ and $I$ finite-codimensional multi-graded ideal in $\mathfrak{f}\_n(=\mathfrak{f}\_n(\mathbf{F}\_p)$, such that $\Gamma\_I\simeq Q$. (And such that $\mathfrak{f}\_n/I$ has nilpotency class $\le n+1$.)


This starts with the following, which provides for each finite group $Q$ a relation whose automorphism group is the group $L\_Q\subset\mathfrak{S}(Q)$ of left translations of $Q$.


**Lemma 4.** Let $Q$ be a group, $n=|Q|$, and $q=(q\_1,\dots,q\_n)$ an injective $n$-tuple of $Q$. Define $X=Qq\subset Q^n$. Then $L\_Q=\{\sigma\in\mathfrak{S}(Q):\sigma X=X\}$.


*Proof*. Clearly $L\_Q$ preserves $X$. Conversely, if $\sigma$ preserves $X$, after composing with a left translation we can suppose that $\sigma(q\_1)=q\_1$, so $\sigma(q)\in\{q\_1\}\times Q^{n-1}$; since $X\cap \{q\_1\}\times Q^{n-1}=\{q\}$, we deduce $\sigma(q)=q$, which in turn implies $\sigma=\mathrm{Id}$. $\Box$.


*Proof of the proposition.*
Write $\mathfrak{f}\_Q\simeq\mathfrak{f}\_n$ as the free Lie algebra over the generating family $(e\_q)\_{q\in Q}$. It can be viewed as graded in $\mathbf{Z}^G$, with basis $(E\_q)\_{q\in Q}$. Write $E=\sum\_q E\_q$.


For $q\in Q^n$, define $\xi\_q=[e\_{q\_n},e\_{q\_1},e\_{q\_2},\dots,e\_{q\_n}]$ (note that it is homogeneous of degree $E+E\_{q\_n}$; in particular $(\xi\_h)\_{h\in X}$ is linearly independent. Fix an injective $n$-tuple $q$ and define $X$ as in the proof of the lemma; for convenience suppose $q\_n=1$.
Define $J$ as the $n$-dimensional subspace of $\mathfrak{f}\_Q$ with basis $(\xi\_h)\_{h\in X}$.


Define $I=J\oplus \mathfrak{f}\_Q^{n+2}$, where $\mathfrak{f}\_Q^i$ is the $i$-th term in the lower central series. Hence $I$ is an ideal, and $\mathfrak{g}=\mathfrak{f}\_Q/I$ is defined by killing all $i$-fold commutators for $i\ge n+1$ and certain particular $(n+1)$-fold commutators. (Since we assume $p>n+1$, we can view it as a group as previously.)


*Claim.* For $h=(h\_1,\dots,h\_n)\in Q^n$ with $h\_{n-1}\neq h\_n$, we have $\xi\_h\in I$ if and only if $h\in X$.


By definition, $h\in X$ implies the condition. Now suppose that $h$ satisfies the condition. First, the condition $h\_{n-1}\neq h\_n$ ensures that $\xi\_h\neq 0$; it is homogeneous in the multi-grading. If it belongs to $J$, its multi-degree is therefore some permute of $(2,1,\dots,1)$. This is the case if and only if the $h\_i$ are pairwise distinct, so we now assume it; its degree is therefore equal to $E\_{h\_n}+E$. Now $J\_{E+E\_{h\_n}}$ is 1-dimensional, and generated by $\xi\_{h\_nq}$. Hence $\xi\_h$ is a scalar multiple of $\xi\_{h\_nq}$:
$$[e\_{h\_n},e\_{h\_1},\dots,e\_{h\_{n-1}},e\_{h\_n}]=\lambda 
[e\_{h\_n},e\_{h\_nq\_1},\dots,e\_{h\_nq\_{n-1}},e\_{h\_n}].$$
The next lemma implies that $h\_i=h\_nq\_i$ for all $i\in\{1,\dots,n-1\}$. So $h\in X$. The claim is proved.


The claim implies that for every permutation $\sigma$ of $Q$, if the automorphism $u\_\sigma$ of $\mathfrak{f}\_Q$ preserves $I$, then $\sigma$ has to preserve $X$, and hence (Lemma 4) $\sigma$ is a left translation of $Q$. This finishes the proof. $\Box$.


**Lemma 5**
Consider the free Lie algebra on $(e\_1,\dots,e\_n)$. If for some permutation $\sigma$ of $\{1,\dots,n-1\}$ and scalar $\lambda$ we have
$$[e\_n,e\_1,\dots,e\_{n-1},e\_n]=\lambda [e\_n,e\_{\sigma(1)},\dots,e\_{\sigma(n-1)},e\_n],$$
then $\sigma$ is the identity and $\lambda=1$.


*Proof.* Use the representation $f$ in $\mathfrak{gl}\_n$ mapping $e\_i$ to the elementary matrix $\mathcal{E}\_{i-1,i}$ (consider indices modulo $n$). Then
$[e\_n,e\_1,\dots,e\_{n-1},e\_n]=[e\_n,e\_1,[e\_2,\dots,e\_n]]$ maps to $$[\mathcal{E}\_{n-1,n},\mathcal{E}\_{n,1},\mathcal{E}\_{1,n}]=[\mathcal{E}\_{n-1,n},\mathcal{E}\_{n,n}-,\mathcal{E}\_{1,1}]=\mathcal{E}\_{n-1,n}.$$
Let by contradiction $j$ be maximal such that $\sigma(j)\neq j$; note that $2\le j\le n-1$ and $n\ge 3$. Then $[e\_n,e\_{\sigma(1)},\dots,e\_{\sigma(n-1)},e\_n]=[e\_n,e\_{\sigma(1)},\dots,e\_{\sigma(j)},[e\_{j+1},\dots,e\_n]]$ maps to
$$w=[\mathcal{E}\_{n,n-1},\mathcal{E}\_{\sigma(1)-1,\sigma(1)},\dots,\mathcal{E}\_{\sigma(j)-1,\sigma(j)},\mathcal{E}\_{j,n}],$$
which cannot be zero. Hence $[\mathcal{E}\_{\sigma(j)-1,\sigma(j)},\mathcal{E}\_{j,n}]\neq 0$. Since $\sigma(j)<j$, this implies $\sigma(j)-1=n$ (modulo $n$), that is, $\sigma(j)=1$. So
$$w=-[\mathcal{E}\_{n,n-1},\mathcal{E}\_{\sigma(1)-1,\sigma(1)},\dots,\mathcal{E}\_{\sigma(j-1)-1,\sigma(j-1)},\mathcal{E}\_{j,1}].$$
In turn, $[\mathcal{E}\_{\sigma(j-1)-1,\sigma(j-1)},\mathcal{E}\_{j,1}]$, using that $\sigma(j-1)\neq 1$, implies $\sigma(j-1)=j$, and so on, we deduce that $\sigma$ is the cycle $j\mapsto j+1$ (modulo $n-1$). Eventually we obtain
$$w=[\mathcal{E}\_{n-1,1},\mathcal{E}\_{1,2},\mathcal{E}\_{2,1}]=\mathcal{E}\_{n-1,1}.$$
So $\mathcal{E}\_{n-1,n}=\lambda \mathcal{E}\_{n-1,1}$, contradiction.


(Note on Lemma 5: one has $[e\_1,e\_2,e\_1,e\_2]=[e\_2,e\_1,e\_1,e\_2]$, but this and its obvious consequences are probably the only identities between Lie monomials in the free Lie algebra, beyond the ones obtained from skew-symmetry in the last two variables.)


Note on the result: the resulting group $H$ roughly has size $|Q|^{|Q|}$, which is probably not optimal.


In Proposition 4, $I$ is strictly contained in $\mathfrak{f}\_Q^{n+1}$, as soon as $|Q|\ge 3$, so the nilpotency class of $G$ is then equal to $n+1$. (For $|Q|=1$, choosing $p\ge 3$ outputs $H$ as the group $M=M\_p$ which has trivial Out, and $G$ is abelian then; for $|Q|=2$, this outputs a group $H$ of order $(p-1)^2.p^3$ for chosen prime $p\ge 5$, and $G$ has nilpotency length $2$. For $|Q|=3$ it outputs a group $H$ of order $(p-1)^3.p^{29}$ for $p\ge 5$ which is already quite big.) To improve the bounds in explicit cases by running this method, one should describe $Q$ a permutation group of a set $Y$ that can be described as stabilizer of some $\ell$-ary relation $R$ contained in the set of pairwise distinct $\ell$-tuples of $Y$, for $\ell$ as small as possible.


