EXTREMAL SOLUTIONS OF AN INEQUALITY CONCERNING SUPPORTS OF PERMUTATION GROUPS AND PUNCTURED HADAMARD CODES

: If S is the degree of a permutation group and s is the maximum degree of its elements, then S ≤ 2 s − 2. We show that this inequality is sharp for some permutation group if and only if s is a power of 2, and then there is exactly one such permutation group up to isomorphism. The unique example is an elementary Abelian 2-group that arises from a punctured Hadamard code. Then we discuss the solutions of S = 2 s − 3 and S = 2 s − 4.


Introduction
In this paper, a basic question is investigated: given a finite permutation group G, how large can the support of G be, compared to the supports of the elements of G? The cardinality of the support of G is denoted by S, and the biggest set we obtain as a support of an element has size s.
The dual notion µ(G), the minimum degree of non-identity elements, is a central notion in permutation group theory.It has been particularly well studied for primitive permutation groups; see [13] for a recent improvement on the lower bound.Often the results are phrased for the fixity S − µ(G) of G, i.e., the maximum number of fixed points of a non-identity element in G; see [17,19,20].
This work is supported by the EFOP-3.6.2-16-2017-00015 and EFOP-3.6.1-16-2016-00022projects, which have been supported by the European Union and are financed by the European Social Fund.The paper was also supported by the National Research, Development and Innovation Fund of Hungary, financed under the FK 124814 and PD 125160 funding schemes, the János Bolyai Research Scholarship of the Hungarian Academy of Sciences, and by the ÚNKP-18-4 and ÚNKP-19-4 New National Excellence Programs of the Ministry of Human Capacities.
In a recent paper [1], an upper estimation for S in terms of s was applied to obtain a theoretical result on the asymptotic probability that a finite structure over a given finite relational language has an automorphism group isomorphic to some permutation group H, provided that the automorphism group contains a given permutation group G. Surprisingly, only finitely many H occur with positive asymptotic probability, and the probability for any such H converges to a rational number.This recent result is an extension of the well-known theorem that, given a finite relational vocabulary, asymptotically almost all finite structures are rigid; see [7,8,5,10] for further details.In order to compute the family of possible H corresponding to a given G, it is important to refine the upper bound of S in terms of s.The first result provides the sharpest estimation and classifies all permutation groups where equality holds.
Construction 1.1.We define an action of Z n 2 on 2n elements, and refer to it as the natural action in the sequel.We partition the 2n-element set into n pairs, and fix a one-to-one correspondence between the set of n coordinates of Z n 2 and the set of n pairs.A vector in Z n 2 switches the elements of each pair that corresponds to a coordinate where the entry of the vector equals 1, and acts identically on the remaining pairs.Definition 1.2.The punctured Hadamard code H k for k ≥ 1 is the binary linear code generated by the rows of the matrix obtained by writing the numbers from 1 to 2 k − 1 in binary in columns in increasing order from left to right.We refer to the row vectors in this matrix as the standard basis {e 1 , . . ., e k } of H k .
The first main result of the paper is shown in Section 2.
Theorem.Let G be a finite permutation group with support of size S and no singleton orbits.Let max g∈G |supp(g)| = s.Then S ≤ 2s − 2, and equality holds if and only if s = 2 k for some k ≥ 1, and G is isomorphic to the natural permutation group action of the punctured Hadamard code The proof relies on the following classification of punctured Hadamard codes up to equivalence in terms of the maximum distance of the code.Following standard terminology (see [14]), two binary linear codes are equivalent if one can be obtained from the other by permuting the coordinates.Throughout this paper, the distance of two codewords in a code is the Hamming distance, and the weight w(c) of a codeword c is the distance of c from the all-zero codeword.We only study linear codes, thus the maximum distance D equals the maximum weight in the code.We say that a coordinate is essential in a code if not all codewords equal 0 in that position.
Proposition.Let n ∈ N and assume that a binary linear code C of length n has maximum distance D ≤ (n + 1)/2.Assume that all coordinates of the code are essential.Then D = (n + 1)/2 = 2 k−1 for some k ≥ 1, and C is equivalent to the punctured Hadamard code with parameters Furthermore, we discuss the situation when S = 2s − for some small values of .
Construction 1.3.The group S 3 has an intransitive action of degree 5.It can be obtained from the standard degree 3 action by adjoining a pair of new elements to the underlying set.The pair is point-wise fixed by elements of A 3 and switched by the other three elements.
In Section 3 we show that there are only three permutation groups with S = 2s − 3.
Proposition.If S = 2s − 3, then G is isomorphic to S 3 , acting as described in Construction 1.3, or the standard action of S 3 or A 3 .
In the following constructions we make use of the idea of repeating a coordinate or a set of coordinates in a code C. Repeating the i-th coordinate means that we increase the length of the code by one by introducing a new coordinate, and for all codewords c ∈ C the value of c in the new coordinate is the same as the value of c in the i-th coordinate.By executing this procedure simultaneously on several coordinates, we can also repeat a set of coordinates.For example, if we repeat all coordinates k times, then the distance of any pair of codewords is multiplied by k.This is a basic idea in the theory of error-correcting codes, as it is the simplest way to increase the error-correcting number of a code [3].If any two codewords c, c ∈ C has the same value in the i-th and j-th coordinates for some i, j, we say that the i-th and j-th coordinates are equivalent (with respect to C). Repeated coordinates are equivalent.
The restriction of H 3 to the first 2 2 − 1 = 3 coordinates yields H 2 (every codeword in H 2 occurs twice as a restricted codeword).Thus we obtain a generating matrix of H 3|2 from M 3 by copying the first three columns and add them to the right-hand side of the matrix: We provide a generating matrix of H 3×2 , as well: Binary linear codes with maximum distance D and length n such that D = n 2 + 1 appear to have a more complicated description than those with the property D = n+1 2 ; see Proposition 2.1.Clearly, H k|m ≤ H k×m , and any binary linear code C such that However, this list is not exhaustive.For m = k, let C be a code generated as a vector space over Z 2 by H m|m and any vector that is the characteristic vector of a subset of coordinates of H m in the first copy and the characteristic vector of the complement of the subset in the second copy.Then C has the same length and maximum distance as Interestingly, such lower bounds for the maximum distance of linear codes have not been studied yet.Few results are concerned with lower estimation of the maximum distance; see for example [2].For an introduction to linear codes see [14,3,18].
We have the following partial results on codes with D = n 2 + 1. Proposition.Let C ≤ (Z 2 , +) n be a binary linear code all of whose coordinates are essential such that n = 2 or 4|n.Let D be the maximum weight of C, and assume that D = n 2 + 1.Then n = 2 k with k ≥ 1, and C is one of the codes H k×1 , H k|1 in Construction 1.4.
Theorem.Let n ∈ N and assume that a binary linear code C of length n has maximum distance D = n 2 + 1. Assume that all coordinates of the code are essential.Then there exist The full classification of codes with maximum distance D = n 2 + 1 is a more challenging problem than Proposition 2.1; see the follow-up paper [16].It turns out that such codes can be obtained from punctured Hadamard codes by three essentially different constructions.Somewhat surprisingly, all of these codes have large minimum weight, the parameter that is most relevant in coding theory, as it provides high error detection and error correction values.In fact, several of the codes obtained attain the Griesmer or the Plotkin bound for the minimum weight [15,9].Moreover, all of these constructions are 2-weight or 3-weight codes, concepts that are more and more popular recently in coding theory [6,11,12,21].We note that 1-weight codes were famously classified by A. Bonisoli [4]; the binary examples are exactly those that can be obtained from some punctured Hadamard code by a number of repetitions of the full code, or in the spirit of Construction 1.4, H k|k|•••|k .Fortunately, the above partial results are sufficiently strong to classify permutation groups with S = 2s − 4.
Construction 1.6.The group D 4 has an intransitive action with degree 8 and maximum degree of elements 6.It can be obtained from the standard degree 4 action on a square by adjoining two pairs of new elements to the underlying set.The pairs are point-wise fixed by elements in the center, and reflections to the diagonals switch both pairs.Both reflections to the perpendicular bisectors switch the first pair and act identically on the second, and the order 4 rotations switch the second pair and act identically on the first.
The index 2 subgroup G 2,3,3 ≤ S 3 × S 3 consists of all pairs of permutations of the same parity.It acts on the union of three orbits, one of which has size 2 and the others have size 3.The action on the two 3-element orbits is the intransitive action of the direct product, and the pair is switched exactly by the permutations that are odd in both coordinates.The 6-element diagonal subgroup D 2,3,3 ≤ G 2,3,3 consists of those elements that act the same way on the two 3-element orbits.Then D 2,3,3 and G 2,3,3 both have degree 8 and the maximum degree of elements is 6.
For transitive groups of degree 4 we have S = s = 4.These are S 4 , A 4 , D 4 , and the Cayley actions of the 4-element cyclic group and the Klein group.
Besides these particular permutation groups, there are two infinite families of examples.The first one consists of the natural actions of binary linear codes C with length n and maximum distance D = n 2 + 1; see [16].The other family of permutation groups consists of an action of H k for all k ≥ 2. This can be constructed by compressing the underlying set in the natural action of H k , replacing three pairs of points with four new elements.We pick three coordinates so that the restriction of H k to these is isomorphic to H 2 , which is isomorphic to the Klein group as an abstract group.Now replace the action of H 2 on the restriction to the three pairs with the Cayley action of the Klein group.(The compressed action of H 2 is the Cayley action of the Klein group, which already appeared in the list above.)This permutation group has degree 2 k+1 − 4 and the maximum degree of elements is 2 k .
Theorem.Let G be a finite permutation group with support of size S and no singleton orbits.Let max

Binary linear codes and the extremal permutation groups
We prove the classification result on binary linear codes that are extremal in terms of the maximum distance.
Proposition 2.1.Let n ∈ N and assume that a binary linear code C of length n has maximum distance D ≤ (n + 1)/2.Assume that all coordinates of the code are essential.Then D = (n + 1)/2 = 2 k−1 for some k ≥ 1, and C is equivalent to the punctured Hadamard code with parameters Proof: Because every coordinate is essential in C, the average weight of codewords in C is n 2 .Since in any non-trivial linear code the average weight is strictly smaller than the maximum weight, we have n 2 < D ≤ n+1 2 , and consequently D = n+1 2 .We prove the assertion by induction on n.Clearly, the only code with one essential coordinate is H 1 , so assume that n ≥ hypothesis, C ∼ = H k−1 for some k ≥ 2. In particular, the dimension of C is k − 1 and the length is 2 k−1 − 1 = n−1 2 , which yields n = 2 k − 1, and then D = n+1 2 = 2 k−1 .Let K be the code generated by the -preimage of a basis of C and c.Then K has the same properties as those of C in the proposition.Moreover, the kernel of , where the inequality is obtained by estimating the weight of all non-zero codewords in K by D. Thus all non-zero codewords in K have weight D.
Pick a basis c 1 , . . ., c k ∈ K.The fact that every non-empty subsum of c 1 + • • • + c i has weight D for any given i ≤ k uniquely determines the weight of the intersection of the supports of any given subset c i1 , . . ., c ij to be 2 k−j .Thus we can inductively rearrange the coordinates of K so that the mapping c j → e j for j ≤ i induces an isomorphism of the codes c 1 , . . ., c i and e 1 , . . ., e i , generated by the standard basis (see Definition 1.2), and then Assume that there is a maximum weight codeword c ∈ C\K.Then the same argument yields that the intersection of the supports of c, c 1 , . . ., c k has weight 2 k−(k+1) = 1 2 , a contradiction.Thus every codeword c ∈ C\K has weight at most n−1 2 , making the average weight in C less than n 2 , a contradiction.Hence, We mention an alternative way to end the proof.Once it is shown that all non-zero codewords of K have the same weight D, i.e., K is a socalled 1-weight code, we can refer to A. Bonisoli's celebrated theorem [4], which provides a classification of such codes.In particular, binary linear 1-weight codes are precisely those equivalent to the r-fold repetition of a punctured Hadamard code H k for some k, r ∈ N. By comparing the weight D and the length n of K, we have r = 1.
Proof: By counting the number of elements in the support we obtain As G is a finite permutation group with no singleton orbits, the average number of fixed points of its elements is ∞ i=2 n i by Burnside's lemma.The identity element has S fixed points, and all other group elements have at least S − s fixed points.Thus Subtracting both sides from ∞ i=2 in i = S yields the first item as follows: Putting = 2s−S we have ∈ N. Thus if there were an i ≥ +2 such that n i = 0, then S would be less than 2s − , a contradiction.Hence, n i = 0 for all i ≥ + 2. Note that as S = 2s − , we have S ≡ (mod 2).
Assume that is odd or, equivalently, S is odd.Then it is impossible for all orbits to have size 2 or ( + 1).Thus there must be an orbit of size 2 < k ≤ .In particular, = 1, and we obtain the third item of the lemma.Moreover, ≥ 3, thus the first item yields Hence, − 2 ≥ ( − 1)n +1 , and thus n +1 = 0.
Finally, assume that is even or, equivalently, S is even.If all orbits have size 2 or ( + 1), then there must be an even number of the latter.Hence, if n +1 = 0, then n +1 ≥ 2. The formula in the first item yields and consequently, ≤ 1, a contradiction.Hence, if n +1 = 0, then there must be some 2 < k ≤ such that n k = 0, in which case we proceed as before: This generalization of Burnside's lemma is the key to the proof of our first theorem.Proof: According to Lemma 2.2, we have S ≤ 2s − 2 by (iii), and if equality holds, then all orbits are pairs by (ii).In such a permutation group, every element either switches a pair of elements in an orbit or fixes them both.Consider the natural action of Z s−1 2 on the S/2 = s − 1 pairs.We define a mapping ϕ : G → Z s−1

2
. Given a g ∈ G, let the i-th coordinate of ϕ(g) be equal to 1 iff the i-th pair is switched by g, and equal 0 otherwise.Then ϕ is an injective permutation group homomorphism.So we may identify G by a subgroup of Z s−1 2 , i.e., G is a binary linear code with length n = s − 1.
Every codeword in G has weight at most s 2 = n+1 2 .Clearly, every coordinate is essential in the code, as every pair of points that forms an orbit of G is in the support of G, thus some group element switches them.Hence, the assertion follows from Proposition 2.1.

Near-extremal permutation groups
Relaxing the inequality constraint of Theorem 2.3 does not necessarily lead to more examples.The condition S = 2s − 3 turns out to be more restrictive than S = 2s − 2. We remind the reader of the intransitive action of S 3 , where a pair of elements is added to the underlying set, such that the two points are switched by the odd permutations and stabilized by the even ones; cf.Construction 1.3.Proof: By Lemma 2.2(ii), all orbits have size 2 or 3. Lemma 2.2(i) yields n 3 ≤ 2. As S is odd, we have n 3 = 1.Hence, there is exactly one orbit X of size 3, and all other orbits are pairs.If there are no such pairs, then G acts transitively on X, and it is isomorphic to the Cayley action of the 3-element group or the standard action of S 3 .
We may assume that the set of pairs is non-empty.Then the number of pairs is S−3 2 = s − 3. Let G be the restriction of G to the union of pairs.Note that G is a homomorphic image of G as an abstract group.The degree of G is S := S − 3 = 2s − 6.
There exists a group element g that acts as a 3-cycle on X.By replacing g with g 2 if necessary, we may assume that g acts trivially on the pairs.Thus every h ∈ G has a support of size at most s := s−2, as otherwise the element h ∈ G whose restriction is h or the element hg ∈ G has a support of size greater than s, since the restriction of both of these elements to X cannot be identical.But then G is a permutation group with S ≥ 2s − 2. Hence, by Theorem 2.3, the restriction is the natural action of H k for some k ≥ 1, and s = s − 2 = 2 k .
Let ϕ : G → S 3 be the group homomorphism obtained by restricting permutations to X, and let N be the preimage of A 3 .Given a permutation in N , it can be multiplied by a power of g so that the restriction to X is a 3-cycle, and it is unaltered on the pairs.Thus all such group elements can move at most s−3 points in the union of pairs, which is less than s .Hence, the restriction of any permutation in N to the union of pairs is the trivial element of the Hadamard code, and then N ∼ = A 3 with the standard action on X and the trivial one on the pairs.In particular, ϕ is injective.It is also surjective, otherwise every element of G would act trivially on the pairs.Hence, G is isomorphic to S 3 as an abstract group.As G ∼ = H k is also a homomorphic image of G, we have k = 1, so there is exactly one pair among the orbits.The action of A 3 ≤ S 3 ∼ = G was already described, and it is consistent with Construction 1.3.As some permutation in G has to switch the elements of the unique pair, it must be an element outside A 3 .But then all of them have to act as a transposition on the pair as they can be obtained from each other by multiplication with a power of g, and then the permutation action is as described in Construction 1.3.
Before solving S = 2s − 4, we note that the number 3 is special in Proposition 3.1, in the sense that there is a finite number of permutation groups with S = 2s − 3. Given a group G as in Theorem 2.3, the intransitive action of the direct product G m on the union of m copies of the underlying set satisfies S = 2s − 2m.Similarly, the intransitive action of G m × S 3 satisfies S = 2s − 2m − 3. Thus for any integer ≥ 2 and = 3 there are infinitely many non-isomorphic permutation groups such that S = 2s − .Lemma 3.2.Let C ≤ (Z 2 , +) n be a binary linear code all of whose coordinates are essential such that 2|n.Let D be the maximum weight of C, and assume that D = n 2 +1.Assume that there is a coordinate such that every codeword with maximum weight equals 1 in that coordinate.Then n = 2 k , and C is one of the codes H k×1 , H k|1 in Construction 1.4.
Proof: Let C be the code obtained by puncturing a coordinate of C where all maximum weight codewords are equal to 1. Then C ∼ = H k for some Hadamard code H k by Proposition 2.1.There are two possibilities: the kernel K of the homomorphism ϕ : C → C defined by the above restriction is either trivial or a 2-element subgroup.
If the kernel is trivial, then the ϕ-image of the codewords in C that are equal to 0 in the punctured coordinate is an index 2 subgroup in C ∼ = H k , thus it is generated by k − 1 independent codewords.There is exactly one coordinate such that all those k − 1 codewords in that coordinate equal 0. Hence, in this case, the repetition of that coordinate in C yields C, so C ∼ = H k|1 .
If |K| = 2, then the non-trivial element in K is a codeword with only one non-zero coordinate, and 2 .The conditions of Theorem 2.3 apply to the punctured code and, consequently, it is isomorphic to H k for some k ≥ 1.In particular, all nonzero codewords in the punctured code have weight n 4 , and then w(b) ≥ n 2 for all 0 = b ∈ C whose support is not contained in that of c.Thus w(b) is either n 2 or n 2 + 1 for all 0 = b ∈ C whose support is not contained in that of c.As the maximum weight codeword c was arbitrary in this argument, we have that w(b) is either n 2 or n 2 + 1 for any non-zero b whose support is not contained in the support of all maximum weight codewords.If the support of some non-zero codeword in C is a subset of the support of all maximum weight codewords, then we are done by Lemma 3.2.Assuming that this is not the case, the weight of every nonzero codeword is either n 2 or n 2 +1.The parity homomorphism that maps every codeword to its weight (mod 2) is surjective, hence exactly half of the codewords have weight n 2 +1.The kernel of the parity homomorphism is a subgroup which consists of elements of weight 0 and n 2 .In particular, not all coordinates are essential in this subgroup, as the average weight is less than half the length.Pick a coordinate where all codewords of even weight equal 0. As exactly half of the elements in C equal 1 in that coordinate, the maximum weight codewords must be equal to 1 there, and then we are done by Lemma 3.2.
Before the next theorem, recall that the code H k|m is derived from H k by repeating a collection of m coordinates where the restriction of H k is isomorphic to H m .As there are no equivalent coordinates in punctured Hadamard codes, there are m pairs of equivalent coordinates in H k|m and k − m singleton equivalence classes of coordinates.In particular, there is no triple of equivalent coordinates in H k|m .Theorem 3.4.Let n ∈ N and assume that a binary linear code C of length n has maximum distance D = n 2 + 1. Assume that all coordinates of the code are essential.Then there exist , and H k|m is a subcode of C.
Proof: Clearly, the length n must be even.We use induction on n, ranging through the even positive integers.By Proposition 3.3, we may assume that n ≡ 2 (mod 4), and the statement holds for n = 2. Now assume that n ≥ 6, n ≡ 2 (mod 4), and the assertion holds for all smaller even numbers.
Furthermore, we may assume that all proper subcodes in C fail to satisfy at least one of the two conditions in the assertion of the theorem: otherwise we could switch C to such a subcode, and then the existence of a copy of H k|m in that subcode would imply the same in C. Note that the maximum distance in a proper subcode of C cannot be less than n 2 + 1: as n is even, it would mean that the maximum distance is at most n 2 .In summary, we may assume that C is minimal in the sense that all proper subcodes of C have a non-essential coordinate.
Let c ∈ C be a maximum weight codeword.Puncture the code by omitting the essential coordinates of c.Let C be the code obtained and : and consequently, putting k = k + 1 and m = m + 1 we have n = 2 k + 2 m − 2 and D = 2 k−1 + 2 m−1 .Furthermore, the above calculation shows that any maximum weight codeword in C is the restriction of some maximum weight codeword in C. In particular, every coordinate is covered by a maximum weight codeword in C.
Hence, all coordinates are essential in the subcode generated by c and the -preimage of a basis of the copy of H k |m in C .By the minimality of C, this subcode must be C itself.Thus C ∼ = H k |m and the kernel of the restriction homomorphism is {0, c}.
In particular, there exist pairs of equivalent coordinates in C, i.e., two coordinates such that every codeword has the same value in them.There cannot be triples of equivalent coordinates.Indeed, if every maximum weight codeword intersects such a given triple, then we obtain a contradiction by Lemma 3.2, as n is not a power of 2. If there is a maximum weight codeword that is all zero in the triple, then choosing it as c and puncturing the code leads to H k |m with three equivalent coordinates, again a contradiction.Thus there are p pairs of equivalent coordinates in C with p ≥ 1, and some coordinates that are singleton equivalence classes, which we are going to refer to as singleton coordinates.As every coordinate is covered by a maximum weight codeword in C, we can pick a maximum weight codeword c ∈ C that covers at least one pair of equivalent coordinates in C. Since the punctured code obtained by omitting the essential coordinates of c is isomorphic to H k |m , it has 2 m − 1 pairs of equivalent coordinates.In particular, p ≥ 2 m .
Given any non-singleton coordinate, there is a maximum weight codeword c ∈ C that equals 0 in that coordinate, as otherwise Lemma Proof: By Lemma 2.2(ii), all orbits have size 2, 3, or 4. Lemma 2.2(i) yields 3 ≥ n 3 + 2n 4 .As S is even, n 3 is even, thus we have three possibilities in terms of the values of n 3 and n 4 .
Case 1: n 3 = n 4 = 0. Then every orbit is a pair, and the permutation group is the natural action of a binary linear code.The length is n = S 2 = s − 2, and the maximum weight is D = s 2 = n 2 + 1. Case 2: n 3 = 0, n 4 = 1.If n 2 = 0, then G is a transitive group of degree 4. So we may assume that n 2 ≥ 1.
First suppose that there exists a group element g 3 that acts as a 3-cycle on the 4-element orbit X.We may assume that g 3 is a 3-cycle by taking the square of it if necessary.Then S = 2n 2 + 4, s = n 2 + 4.There cannot be an h ∈ G moving more than n 2 + 2 elements in the union of pairs, otherwise h or hg 3 would move more than n 2 + 4 elements.First assume that the maximum number of elements moved in the union of pairs is n 2 + 2.
As the restriction of G to X contains a 3-cycle and is transitive, it is either A 4 or S 4 .In particular, all eight 3-cycles are represented.Using the square trick, all eight permutations that act as a 3-cycle on X and identically on the union of pairs are in G. Any element of S 4 can be multiplied by (at most two) 3-cycles such that the product is a degree 4 permutation.Thus every g ∈ G moves at most n 2 points within the n 2 pairs, as otherwise there would exist some g ∈ G with support larger than n 2 + 4 = s.This is a contradiction, as the average degree of the restriction to the pairs is n 2 .
We conclude that the restriction of G to X does not contain a 3-cycle.Thus it is a degree 4 transitive permutation group in a Sylow 2-subgroup of S 4 .Then the four points of X can be arranged as vertices of a square, and the restriction is in the dihedral group D 4 , namely it is either D 4 , the 4-element cyclic group generated by the rotation with a right angle, or a Klein group that is generated by the two reflections whose axes are the perpendicular bisectors of the sides of the square.
First assume that the restriction is the Klein group.Then we replace X with three new pairs of elements {1, 2}, {3, 4}, {5, 6}, and define the action of G on this new underlying set as follows.Assign to every non-trivial element of the Klein group one of the permutations (1 2)(3 4), ( 12)(5 6), (3 4)(5 6).Every permutation h ∈ G acts on the union of original pairs as before.On the new pairs, h acts identically iff it acted identically on X.Finally, if h acted as a non-trivial element of the Klein group, then replace this part of the action with the assigned permutation on the new pairs.Note that the degree of every element is the same as before.This way we obtain a new permutation group all of whose orbits are pairs with support of size S = 2n 2 + 6 and maximum degree s = s = n 2 + 4. Hence, S = 2s − 2, and the conditions of Theorem 2.3 apply.Thus the redefined action is the natural action of a punctured Hadamard code, and then G is a compressed punctured Hadamard code.Now assume that the restriction of the action of G to X is either D 4 or the set of rotations in D 4 .Note that every permutation on the pairs and in D 4 moves an even number of elements.In particular, s is even, and then n 2 = s−4 is also even.Pick an element g 4 ∈ G such that g 4 acts as a rotation by a right angle on the square X, and let g 2,2 = g 2 4 .Then g 2,2 ∈ G is the permutation that transposes the endpoints of both diagonals in the square X and acts identically on the union of pairs.Given any h ∈ G that moves the most points in the union of pairs, h or hg 2,2 moves at least two points in X.Thus the maximum number of points moved in the union of pairs by any permutation in G is at most n 2 + 2. Then it must be exactly n 2 + 2, as it is bigger than n 2 , and the maximum and n 2 are both even numbers.Hence, the restriction G of G to the union of pairs contains H k|m for some 1 ≤ m ≤ k by Theorem 3.4.
Maximum degree elements of G must pair up with degree 2 elements of D 4 on X.Thus the restriction of G to X is D 4 , as the group of rotations does not contain elements of degree 2.Moreover, a maximum degree element of G must pair up with both degree 2 elements in D 4 , as multiplying such a permutation in G by g 2,2 maps the transposition of the elements of each diagonal to that of the other.Hence, m = 1, as otherwise there exist two maximum weight codewords in H k|m whose sum also has maximum weight, and pairing up these with the two different elements of degree 2 in D 4 would yield a pair of permutations in G whose product has degree n 2 + 6.Thus n 2 = 2 k .
In D 4 , exactly a quarter of the elements have degree 2, and hence a quarter of the elements in G have such a restriction to X.In particular, at most a quarter of the elements in G have maximum weight.As n 2 = 2 k , we have that G is isomorphic to H k|1 or H k×1 by Proposition 3.3.The ratio of maximum weight elements in these codes are 1− 1 2 k and 1 2 1− 1 2 k , respectively, hence it is at most 1  4 iff the code is H 1×1 , in which case it is exactly 1  4 .Consequently, k = 1, n 2 = 2, S = 8, s = 6.Let ψ : G → G be the restriction homomorphism to the union of pairs.Then |ψ −1 [(1, 1)]| ≤ 2, thus |G| ≤ 8. Hence, G ∼ = D 4 , as the restriction homomorphism to X must be an isomorphism.In particular, |ψ −1 [(1, 1)]| = 2, thus ψ −1 [(1, 1)] consists of the two reflections to the diagonals.As g 2,2 is the square of some element in G, we have ψ −1 [(0, 0)] = {id, g 2,2 }.Each reflection to the perpendicular bisector of a side can be obtained from the other by multiplication with g 2,2 , thus these are in the ψ-preimage of the same element.Without loss of generality, we may assume that this element is (1, 0).Hence, through the process of elimination, the order 4 rotations are the ψ-preimages of (0, 1), and we obtain that G is the intransitive action of D 4 described in Construction 1.6.
Case 3: n 3 = 2, n 4 = 0.If n 2 = 0, then G is a permutation group of degree 6 with maximum degree 5 acting on two 3-element orbits.It is easy to see that no such permutation group exists.So we may assume that n 2 ≥ 1.
Hence, S = 2n 2 + 6 and s = n 2 + 5. We show that there is an element g 3,3 ∈ G that acts as a 3-cycle on both 3-element orbits X 1 , X 2 , and identically on the pairs.First observe that there is an element that acts as a 3-cycle on X 1 .By taking the square, we may assume that it acts identically on the pairs.If the element obtained this way permutes X 2 in a 3-cycle, then we have found g 3,3 ∈ G.If not, then the same argument can be applied switching the roles of X 1 and X 2 .Then there are two 3-cycles in G, one with support X 1 and the other with X 2 , and then their product is a good choice for g 3,3 ∈ G.
Assume that there is an h ∈ G which moves at least n 2 + 2 points in the union of pairs.Then such a permutation can move at most three 2 and the statement holds for smaller values of the length.Puncture the code by omitting the coordinates in the support of a maximum weight codeword c.Let C be the code obtained and : C → C the restriction homomorphism.Clearly, every codeword b ∈ C has at most as many coordinates outside the support of c as inside, as otherwise w(c + b) > D. Thus C has length n = n − D = n−1 2 and maximum weight at most D 2 = n+1 4 = n +1

Lemma 2 . 2 .
Let G be a finite permutation group with no singleton orbits.Denote max g∈G |supp(g)| = s and |supp(G)| = S. Let n i denote the number of orbits of size i.Then

Theorem 2 . 3 .
Let G be a finite permutation group with support of size S and no singleton orbits.Let max g∈G |supp(g)| = s.Then S ≤ 2s − 2, and equality holds if and only if s = 2 k for some k ≥ 1, and G is isomorphic to the natural permutation group action of the punctured Hadamard code H k with parameters [2 k − 1, k, 2 k−1 ] 2 .

Proposition 3 . 1 .
Let G be a finite permutation group with support of size S and no singleton orbits.Let maxg∈G |supp(g)| = s.If S = 2s − 3,then G is isomorphic to S 3 , acting as described in Construction 1.3, or the standard action of S 3 or A 3 .

Proposition 3 . 3 .
Let C ≤ (Z 2 , +) n be a binary linear code all of whose coordinates are essential such that n = 2 or 4|n.Let D be the maximum weight of C, and assume that D = n 2 + 1.Then n = 2 k with k ≥ 1, and C is one of the codes H k×1 , H k|1 in Construction 1.4.Proof: If n = 2, then there are only two codes up to isomorphism with all coordinates essential, namely H 1|1 and H 1×1 .Hence, assume that 4|n.Let c ∈ C be a codeword of maximum weight D = n 2 + 1.Given any other codeword b ∈ C, there are at most as many coordinates of b outside the support of c as inside, otherwise w(c + b) > D. Hence, there are at most n 4 coordinates of b outside the support of c.Thus if we puncture the code by omitting the essential coordinates of c, then we obtain a code with length n := n 2 − 1 and maximum distance at most n 4 = n +1

2 + 1 − 4 =
which is an even number less than n, and maximum weight D .If D were bigger than n 2 + 1 = n+2 4 , then a codeword b ∈ C with maximum weight D in the punctured code would have at most n D essential coordinates in common with c, otherwise w(b) > D. Then w(c + b) ≥ 2 • D > 2 • n+2 D, a contradiction.As n is even and the maximum distance in the punctured code is bigger than n 2 , we have D ≥ n 2 + 1.Hence, D = n 2 + 1.By the induction hypothesis, 3.2 leads to a contradiction.Hence, if a non-maximum weight codeword b ∈ C equals 1 in any of the non-singleton coordinates, then (b) is a maximum weight codeword in C , and then b must have maximum weight in C, a contradiction.Thus non-maximum weight codewords b ∈ C are all zeros in the non-singleton coordinates.Let K be the restriction of C to a set of coordinates X with |X| = p that contains exactly one element from each of the p pairs of equivalent coordinates.Then K consists of the zero vector and all restrictions of maximum weight codewords in C.There are at least 2 m + 1 such restrictions: fixing a maximum weight codeword c ∈ C, 2 m is obtained by the zero vector and maximum weight codewords different from c whose restriction to the complement of the support of c has maximum weight in H k |m , and at least one further element is obtained as the restriction of c.As K is a 2-group, we have |K | ≥ 2 m +1 .Clearly, every coordinate of K is essential, thus the average weight of codewords in K is p 2 .As the same for Y 1 and Y 4 .Finally, by replacing b in the above argument with c + b, we obtain the same result for Y 1 and Y 3 .Thus there are exactly 2 m−2 coordinates N -equivalent to y in Y 1 , Y 2 , Y 3 , and Y 4 , which is a total of 2 m N -equivalent coordinates in Y .Consequently, the weight of any non-maximum weight codeword is divisible by 2 m , and by definition, it is less than D = 2 k−1 + 2 m−1 .Hence, such a weight is at most 2 k−1 .As maximum weight codewords in C have exactly 2 k−1 ones in X ∪ Y , the restriction of C to X ∪ Y has maximum weight exactly 2 k−1 .Since |X ∪ Y | = 2 k − 1, the conditions of Proposition 2.1 apply to the restriction, and then it is isomorphic to H k .The code C is obtained from its restriction to X ∪ Y by repeating the coordinates in X, where the restriction is isomorphic to H m .Hence, C ∼ = H k|m .Theorem 3.5.Let G be a finite permutation group with support of size S and no singleton orbits.Let max g∈G |supp(g)| = s.If S = 2s − 4, then G is isomorphic to a permutation group in Construction 1.6.
Construction 1.4.Let H k be the punctured Hadamard code with parameters [2 k − 1, k, 2 k−1 ] 2 , and let m ≤ k.We define H k×m := H k × H m , i.e., producing all concatenations of codewords in H k and H m .The code H k|m can be obtained from H k by picking 2 m − 1 coordinates such that the restriction of H k to those is isomorphic to H m , and repeating those coordinates simultaneously.It is easy to see that the first 2 m −1 coordinates are always a good choice if we represent the Hadamard code H k as in Definition 1.2.Example 1.5.The standard generating matrices of H 3 and H 2 according to Definition 1.2 are