1 Introduction

Due to their simple description, uninvolved algebraic structure and their associated cryptographic properties, linear codes have an ample range of applications in communication, data storage, information security and cryptography (e.g., McEliece cryptosystem [13]). In particular, as a special class of linear codes, minimal linear codes play an important role in designing access structures for secret sharing schemes [1] and secure multi-party computation [16]. The weight distributions of linear codes give more information on their structures and properties. However, in general, it is difficult to determine the weight distributions of linear codes [5, 25, 26]. Therefore, the construction and full specification of new minimal linear codes have become an interesting topic in coding theory and cryptography over the past years.

In 1998, Ashikhmin and Barg [2] proved a sufficient condition for a linear code over a finite field with q elements to be minimal by using the maximum and minimum weight of the code, \(w_{\max }\) and \(w_{\min }\), namely, if \(w_{\min }/w_{\max }>(q-1)/q\) then the code is minimal, which is called the Ashikhmin–Barg condition (or bound). Following the terminology introduced in [23, 24], linear codes satisfying the Ashikhmin–Barg condition are called narrow codes (hence minimal), and otherwise they are referred as wide codes (which may or may not be minimal).

Cohen et al. [6] presented the first example of a wide minimal code, and later, a necessary and sufficient condition for a linear code to be minimal was shown by Ding et al. [7, 9]. They used this condition to build the first examples of infinite families of wide minimal binary codes. As pointed out in [7], infinite families of wide minimal codes are in general harder to construct than their narrow counterpart.

Based on the conclusions of Ding et al. [7], Mesnager et al. [14] proposed a novel method by using characteristic functions to construct minimal codes. More precisely, by applying the Fourier transform and properties of characteristic functions, they developed a coding scheme that achieves better error-correcting capabilities compared to conventional methods. In 2021, Zhang et al. [23] extended the results in [7] to construct several classes of wide binary minimal codes with larger minimum distances or higher dimensions. Very recently, with a similar idea as in [7], Du et al. [8] constructed two classes of wide minimal codes, and determined their weight distributions. Currently, there are many more constructions of infinite families of wide minimal codes based on a large range of techniques and mathematical objects, see for instance [3, 4, 11, 15, 17, 19,20,21,22].

Extending the work of Zhang et al. [23], we construct binary linear codes with larger minimum distances. To this end, we first specify the underlying Boolean function f that belongs to the so-called general Maiorana–McFarland class (GMM). It is important to highlight that the Boolean function f is different from those used in [7, 8, 23]. Then, we show that the resulting codes \(C_{f}\) derived from f are minimal and wide. To fully specify the weight distributions of the obtained codes, we use Krawtchouk polynomials and their good combinatorial properties. Using the method developed in [23, 24] and the code \(C_{D_{\gamma }(f)}\) that is defined via a suitable derivative of the Boolean function \(f\in \textrm{GMM}\), we also construct a class of wide binary minimal codes and determine its weight distribution. Again, the function f used for \(C_{D_{\gamma }(f)}\) is different from the one in [23]. Moreover, our code \(C_{D_{\gamma }(f)}\) possesses a larger minimum distance than those in [23]. Finally, the codewords in \(C_{D_{\gamma }(f)}\) can be adjoined to \(C_{f}\) to increase the dimension of the resulting codes by one. In the second part of this paper, we study in greater detail the Krawtchouk-polynomials method to handle the general case of our constructions. It is noteworthy that this approach not only yields novel classes of linear codes but also produces a great variety of wide minimal codes. We also determine the general scope and limitations of our methods.

This article is structured as follows. In Sect. 2, we introduce some fundamental concepts related to Boolean functions, provide definitions and properties of minimal codes and set the notation that will be used throughout the paper. In Sect. 3, we provide the construction of classes of linear codes using certain functions (with an associated set) in the GMM class of Boolean functions, prove that they are wide and minimal under certain conditions, and fully specify their weight distributions by employing the Krawtchouk method. Additionally, we present the derivative method [23, 24] for a suitable choice of f and its derivative \(D_{\gamma }(f)\), and therewith we obtain wide minimal codes with better parameters than those in [23, 24]. The Krawtchouk method is analysed in depth in Sect. 4, where we address the general case for the choice of the associated set of Boolean functions in GMM. Finally, our research findings are summarized in Sect. 5. All the results and examples in this article have been verified using Mathematica version 11.3 [18].

2 Preliminaries

Let n be a positive integer, and \({\mathbb {F}}^n_2\) denote the n-dimensional vector space over the finite field \({\mathbb {F}}_2\). A binary [nkd] linear code C is a k-dimensional subspace of \({\mathbb {F}}_{2}^{n}\) over \({\mathbb {F}}_{2}\) with minimum (Hamming) distance d. Each vector \({\textbf{c}}\) in the code C is called a codeword. The number of codewords in C with (Hamming) weight i is denoted by \(A_i\). The weight enumerator of C is the polynomial with integer coefficients, \(1+A_1z+\cdots +A_nz^n.\) Accordingly, the sequence \((1,A_1,A_2,\ldots ,A_n)\) is called the weight distribution of C. A code C is said to be a t-weight code if the number of nonzero \(A_i\) in \((A_1,A_2,\cdots ,A_n)\) is equal to t. The support of any \({\textbf{c}}=(c_1,c_2,\ldots ,c_{n})\in C\) is defined as

$$\begin{aligned} \textrm{supp}({\textbf{c}}):=\{i \in \{1,\ldots ,n\} :c_i\ne 0\}, \end{aligned}$$

where \(\{1,\ldots , n\}\) denotes the set of integers from 1 up to n (inclusive). If |S| denotes the number of elements in a set S, then it is easy to see that the Hamming weight \(wt({\textbf{c}})\) of a codeword \({\textbf{c}}\) satisfies \(wt({\textbf{c}})=|\textrm{supp}({\textbf{c}})|.\) For any two vectors \({\textbf{u}},{\textbf{v}}\in {\mathbb {F}}^n_2\), if \(\textrm{supp}({\textbf{v}})\subseteq \textrm{supp}({\textbf{u}})\), then we say \({\textbf{v}}\) is covered by \({\textbf{u}}\) (or \({\textbf{u}}\) covers \({\textbf{v}}\)) and we write \({\textbf{v}}\preceq {\textbf{u}}\). For a code C over \({\mathbb {F}}_2\), a codeword \({\textbf{c}}\in C\) is called minimal if in C it is covered only by itself.

Definition 1

A linear code C is called a minimal linear code (minimal code for short) if every nonzero codeword in C is minimal.

Lemma 1

(the Ashikhmin–Barg condition [2]) Let \(w_{\min }\) and \(w_{\max }\) be the minimum and maximum nonzero weights of the linear code C, respectively. If \(w_{\min }/w_{\max } > 1/2\), then C is minimal.

Now, we introduce some basic facts about Krawtchouk polynomials [10, 12] which will be extensively used for determining the Walsh transform of Boolean functions (which will be defined below). Let m be a positive integer and x be a variable taking non-negative integer values. The Krawtchouk polynomial is defined by

$$\begin{aligned} P_{k}(x, m)=\sum _{j=0}^{k}(-1)^{j}\left( {\begin{array}{c}x\\ j\end{array}}\right) \left( {\begin{array}{c}m-x\\ k-j\end{array}}\right) , \end{aligned}$$
(2.1)

where \(0 \le k \le m\). For the sake of simplicity, we write \(P_{k}(x):=P_{k}(x, m)\) whenever there is no ambiguity. The properties of Krawtchouk polynomials [12] lead to the symmetry property

$$\begin{aligned} P_{k}(i)=(-1)^{i} P_{m-k}(i), 0 \le i \le m, \end{aligned}$$
(2.2)

and the following conclusion.

Lemma 2

[12] For any \({\textbf{u}} \in {\mathbb {F}}_{2}^{m}\) with Hamming weight \(wt({\textbf{u}})=i\), \(1 \le i \le m\), one has

$$\begin{aligned} \sum _{wt({\textbf{v}})=k}(-1)^{{\textbf{u}} \cdot {\textbf{v}}}=P_{k}(i). \end{aligned}$$

To conclude this section, we present some fundamentals on Boolean functions and their connections to minimal linear codes. A mapping \(f:{\mathbb {F}}^m_2\rightarrow {\mathbb {F}}_2\) is called an m-ary Boolean function. Denote by \({\mathcal {B}}_{m}\) the set of all m-ary Boolean functions. The Walsh transform of a function \(f \in {\mathcal {B}}_{m}\) at \({\textbf{w}}\in {\mathbb {F}}^m_2\) is defined by

$$\begin{aligned} W_{f}({\textbf{w}})=\sum _{{\textbf{x}}\in {\mathbb {F}}^m_2}(-1)^{f({\textbf{x}})+{\textbf{w}}\cdot {\textbf{x}}}, \end{aligned}$$

where \({\textbf{x}}=(x_1,x_2,\ldots ,x_m)\in {\mathbb {F}}^m_2\), \({\textbf{w}}=(w_1,w_2,\ldots ,w_m)\in {\mathbb {F}}^m_2\), and “\(\,\cdot \,\)” denotes the standard inner product of these two vectors, that is, \({\textbf{w}}\cdot {\textbf{x}}:=\sum \limits ^m_{i=1}w_ix_i\). The support of f is defined to be

$$\begin{aligned} {\text {supp}}(f)=\left\{ {\textbf{x}} \in {\mathbb {F}}_{2}^{m}: f({\textbf{x}})=1\right\} . \end{aligned}$$

We denote \((0, 0,\ldots , 0)\in {\mathbb {F}}^m_2\) by \({\textbf{0}}_{m}\) and \((1, 1,\ldots , 1)\in {\mathbb {F}}^m_2\) by \({\textbf{1}}_{m}\).

Let \(f\in {\mathcal {B}}_{m}\) be a non-affine function i.e., \(f({\textbf{x}}) \ne {\textbf{v}} \cdot {\textbf{x}}+a\) for each \({\textbf{v}}\in {\mathbb {F}}_{2}^{m}\) and \(a\in {\mathbb {F}}_2\). Define the code \(C_f\) by

$$\begin{aligned} C_{f}=\left\{ (u f({\textbf{x}})+{\textbf{v}} \cdot {\textbf{x}})_{{\textbf{x}} \in {\mathbb {F}}_{2}^{m} }: u \in {\mathbb {F}}_{2}, {\textbf{v}} \in {\mathbb {F}}_{2}^{m}\right\} . \end{aligned}$$
(2.3)

The first lemma below presents the weight distribution of the linear code \(C_f\) constructed in Eq. (2.3) and the second one provides a necessary and sufficient condition to determine whether \(C_f\) is minimal via the Walsh transform of the function f.

Lemma 3

[7] The binary linear code defined by Eq. (2.3) has length \(2^{m}\), dimension \(m+1\), and weight distribution given by the following multiset:

$$\begin{aligned} \left\{ 2^{m-1}-\frac{1}{2} W_{f}(\alpha ): \alpha \in {\mathbb {F}}_{2}^{m}\right\} \cup \left\{ 2^{m-1}: \alpha \in {\mathbb {F}}_{2}^{m *}\right\} \cup \{0\} . \end{aligned}$$

Lemma 4

[7] The code \(C_{f}\) in Eq. (2.3) is minimal if and only if for every pair of distinct \(\lambda _{1}, \lambda _{2} \in {\mathbb {F}}_{2}^{m}\), it holds that

$$\begin{aligned} W_{f}\left( \lambda _{1}\right) \pm W_{f}\left( \lambda _{2}\right) \ne 2^{m}. \end{aligned}$$

2.1 Notation

Throughout this paper, we adopt the following notation unless otherwise stated.

  1. (1)

    We will work on the vector space \({\mathbb {F}}_{2}^r\), where \(r\ge 7\) is an odd integer. We will always identify the Cartesian product of subspaces \({\mathbb {F}}_2^k\times {\mathbb {F}}_2^l\) with \({\mathbb {F}}_2^r\), where \(k=(r+1)/2\) and \(l=(r-1)/2\).

  2. (2)

    The symbol \({\mathbb {Z}}^*\) is reserved for the ring of positive integers and \(S_u=\{s^2+u: s \in {\mathbb {Z}}^* \}\), where u is an odd integer.

  3. (3)

    The function \(\eta _k:{\mathbb {C}}\rightarrow \{0,1\}\) is given by \(\eta _k(a) = 1\) if \(a\in \{1,\ldots ,k\}\), and 0 otherwise.

  4. (4)

    For a given integer i with \(1\le i \le k\) (equivalently, \(i\in \{1,\ldots ,k\}\)), we define

    1. (a)
      $$\begin{aligned} \Gamma _i ={\left\{ \begin{array}{ll} \{i,k+1-i\}, &{} k \text { is odd, }\\ \{i\}, &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$
      (2.4)
    2. (b)

      \(a_{b, i}^{\pm }=\frac{(k+1) \pm \sqrt{ 4i(-i+1+k) -(k^2+b) }}{2},\) \(b={-1,3}\).

    3. (c)

      For a fixed \(b\in \{-1,3\}\),

      $$\begin{aligned} \Delta _i = {\left\{ \begin{array}{ll} \{a_{b, i}^+, a_{b, i}^-\}, &{} k \text { is odd, } \eta _k(a_{b, i}^+)=1, i \not \equiv a_{b, i}^+ \pmod 2, \\ \{a_{b, i}^v\}, &{} k \text { is even, } \eta _k(a_{b, i}^v)=1, i \not \equiv a_{b, i}^v \pmod 2,\\ \emptyset , &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$
      (2.5)

      Note that \(\Delta _i\) is well-defined as there is exactly one value “+" or “–" for v, since \(a_{b, i}^+ \not \equiv a_{b, i}^- \pmod 2\) when k is even.

3 The construction of wide binary minimal codes

In this section, we will use the properties of the general Maiorana–McFarland class of Boolean functions and a derivative of a Boolean function to obtain two classes of wide minimal codes, that is, codes not satisfying the Ashikhmin–Barg condition.

Suppose that rkl are positive integers satisfying \(r=k+l\). The general Maiorana–McFarland class of Boolean functions has the form

$$\begin{aligned} f({\textbf{x}}, {\textbf{y}})=\phi ({\textbf{x}}) \cdot {\textbf{y}}+g({\textbf{x}}), \end{aligned}$$
(3.1)

where \({\textbf{x}} \in {\mathbb {F}}_{2}^{k}, {\textbf{y}} \in {\mathbb {F}}_{2}^{l}\), \(\phi \) is an arbitrary mapping from \({\mathbb {F}}_{2}^{k}\) to \({\mathbb {F}}_{2}^{l}\) and \(g\in {\mathcal {B}}_{k}\).

The derivative of \(f\in {\mathcal {B}}_{m}\) at direction \(\gamma \in {\mathbb {F}}_{2}^{m}\) is defined as

$$\begin{aligned} D_{\gamma }f({\textbf{x}})= f ({\textbf{x}} + \gamma ) + f ({\textbf{x}}). \end{aligned}$$
(3.2)

Throughout this paper, we always denote by f the Boolean function defined in Eq. (3.1) with \(g\equiv 1\) (the constant one function), i.e.,

$$\begin{aligned} f({\textbf{x}}, {\textbf{y}})=\phi ({\textbf{x}}) \cdot {\textbf{y}}+1. \end{aligned}$$
(3.3)

For the specification of weight distributions in this section, we need to study the following quadratic polynomial A(x),

$$\begin{aligned} A(x)=2x^{2} -(2+2k)x+\frac{k(k+1)}{2}+1, \end{aligned}$$
(3.4)

where \(1\le x\le k\). It is clear that \(A(x)=A(k+1-x)\).

3.1 Wide binary minimal codes derived from \(\textrm{GMM}\) class

Set r to be an odd integer with \(r\ge 11\). To compute the sums in the Walsh transform of the proposed Boolean function, we need to show the relation between A(i) and the set \(U_0\) of vectors with weight at most \(k-3\), i.e.,

$$\begin{aligned} U_{0} = \left\{ {\textbf{x}} \in {\mathbb {F}}_{2}^{k}: wt({\textbf{x}}) \le k-3\right\} . \end{aligned}$$
(3.5)

Lemma 5

Let \(k\ge 6\) and \(U_0\) denote the set of vectors in \({\mathbb {F}}_2^k\) with weight at most \(k-3\) given in Eq. (3.5). Consider the quadratic polynomial A(i) in (3.4). Then

$$\begin{aligned} \sum _{{\textbf{x}} \in U_{0}}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}}=\left\{ \begin{array}{ll} |U_{0}|, &{} {\textbf{v}}_{1}={\textbf{0}}_{k}, \\ (-1)^{i+1}A(i), &{} wt\left( {\textbf{v}}_{1}\right) =i, \end{array}\right. \end{aligned}$$
(3.6)

where \({\textbf{v}}_{1}\in {\mathbb {F}}_{2}^{k}\), \(1 \le i \le k\).

Proof

If \({\textbf{v}}_{1}={\textbf{0}}_{k}\), then

$$\begin{aligned} \sum _{{\textbf{x}} \in U_{0}}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}}=|U_{0}|=2^{k}-\left( \left( {\begin{array}{c}k\\ k-2\end{array}}\right) +\left( {\begin{array}{c}k\\ k-1\end{array}}\right) +1 \right) =2^{k}-\frac{k(k+1)}{2}-1. \end{aligned}$$

If \({\textbf{v}}_{1}\ne {\textbf{0}}_{k}\) and \(wt\left( {\textbf{v}}_{1}\right) =i,i=1,2,\ldots ,k\), according to Eqs. (2.1), (2.2) and Lemma 2, we have

$$\begin{aligned} \sum _{{\textbf{x}} \in U_{0}}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}}&=\sum _{{\textbf{x}} \in {\mathbb {F}}_{2}^{k}}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}}-\sum _{{\textbf{x}} \in {\mathbb {F}}_{2}^{k}, wt({\textbf{x}}) \ge k-2}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}} \\&=0-\left( P_{k}(i)+P_{k-1}(i)+P_{k-2}(i)\right) \\&=(-1)^{i+1}\left( 1+k-2 i+\frac{(k-2i)^{2}-k}{2}\right) \\&=(-1)^{i+1}A(i). \end{aligned}$$

The proof is completed. \(\square \)

By analyzing the behaviour of some quadratic equations, it is easy to derive the following properties of A(i).

Lemma 6

The polynomial \(A(x)=2x^{2} -(2+2k)x+\frac{k(k+1)}{2}+1\) satisfies the following.

  1. (1)

    \(A(i) = 0\) if and only if \(k=s^2+1 \in S_{1}\) and \(i = \frac{s^2+2 \pm s }{2}\).

  2. (2)

    \(A(i) = 1\) if and only if \(k=s^2-1 \in S_{-1}\) and \(i = \frac{s^2 \pm s }{2}\).

  3. (3)

    \(A(i) = -1\) if and only if \(k=s^2+3 \in S_{3}\) and \(i = \frac{s^2+4 \pm s }{2}\).

It follows from the relation between k and s given in Lemma 6(1)–(3) that \(1+k\pm s\) is always a positive even number smaller than 2k, thus \(\frac{1 +k \pm s }{2}\) is a positive integer smaller than k.

The next lemma follows also from the definition of A(i) by analyzing some quadratic equations derived therefrom, hence we omit its proof.

Lemma 7

Let \(k\ge 6\). Let ij be two distinct integers in \(\{1,2,\ldots ,k\}\) and let \(B(i) = (-1)^{i}A(i) = (-1)^i(2i^{2} - 2(k+1)i+\frac{k^2+k+2}{2})\).

  1. (1)

    If \(i\equiv j \pmod 2\), then \(B(i) = B(j)\) if and only if \(i + j = k + 1\). In particular, this can only happen when k is odd.

  2. (2)

    If \(i\not \equiv j \pmod 2\), then \(B(i) = B(j)\) if and only if \(j = a_{3, i}^{\pm }\) (see Sect. 2.1).

  3. (3)

    For every i, \(|B(i)|\le \frac{(k+1)(k-4)}{2}+3\).

Observe that the sets \(S_1, S_3\) and \(S_{-1}\) are mutually disjoint. For instance, \(S_1\cap S_3=\emptyset \) since if \(x= s^2+1=t^2+3\) then \((s-t)(s+t)=2\) so that either \(s+t=2\) and \(s-t=1\) or \(s+t=1\) and \(s-t=2\), which yields \(s=3/2\) and \(t=\pm 1/2\). A contradiction to \(s,t\in {\mathbb {Z}}^*\). Similarly, one can prove that \(S_1\cap S_{-1}=\emptyset \) and \(S_{-1}\cap S_3=\emptyset \). To simplify some notation, it will be convenient to define the function \(\chi :\{1,\ldots ,k\} \rightarrow \{0,1\}\) given by \(\chi (i) = 0\) if and only if i is even.

Now we are ready to present the first class of wide minimal binary codes from the GMM class.

Theorem 1

Let \(r\ge 11\) be an odd integer. Let \(f:{\mathbb {F}}_2^k\times {\mathbb {F}}_2^l\rightarrow {\mathbb {F}}_2\) be the Boolean function in GMM defined by Eq. (3.3), where \(\phi \) is an injection from \({\mathbb {F}}_{2}^{k} \backslash U_{0}\) to \({\mathbb {F}}_{2}^{l} \backslash \left\{ {\textbf{0}}_{l}\right\} \) and \(\phi ({\textbf{x}})={\textbf{0}}_{l}\) for any \({\textbf{x}} \in U_{0}\). The code \(C_{f}\) in Eq. (2.3) is a \([2^{r}, r+1,d]\) minimal code, where

$$\begin{aligned} d= {\left\{ \begin{array}{ll} 2^{r-1}-2^{l-2}(k^{2}-7k+10), &{} k \text{ is } \text{ odd, }\\ 2^{r-1}-2^{l-2}(k^{2}-3k+2), &{} k \text{ is } \text{ even. } \end{array}\right. } \end{aligned}$$

Furthermore, if \(r\ge 15\), then \(C_f\) is wide. The weight distributions are given in Table 1 and the relevant parameters related to k are given in Table 2 (see also Sect. 2.1).

Proof

First, we examine the Walsh transform of the function f in Eq. (3.3) at any \(({\textbf{v}}_{1}, {\textbf{v}}_{2})\in {\mathbb {F}}_{2}^{k} \times {\mathbb {F}}_{2}^{l}\). According to Lemma 5, we have

$$\begin{aligned} \sum _{{\textbf{x}} \in U_{0}}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}}=\left\{ \begin{array}{ll} |U_{0}|, &{} {\textbf{v}}_{1}={\textbf{0}}_{k}, \\ -A(i)(-1)^{i}, &{} wt\left( {\textbf{v}}_{1}\right) =i, \end{array}\right. \end{aligned}$$

and then we can get

$$\begin{aligned} W_{f}\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right)&=\sum _{{\textbf{x}} \in {\mathbb {F}}_{2}^{k}} \sum _{{\textbf{y}} \in {\mathbb {F}}_{2}^{l}}(-1)^{\phi ({\textbf{x}}) \cdot {\textbf{y}}+1+{\textbf{v}}_{1} \cdot {\textbf{x}}+{\textbf{v}}_{2} \cdot {\textbf{y}}} \nonumber \\&=\sum _{{\textbf{x}} \in \left( {\mathbb {F}}_{2}^{k} \backslash U_{0}\right) } \sum _{{\textbf{y}} \in {\mathbb {F}}_{2}^{l}}(-1)^{\phi ({\textbf{x}}) \cdot {\textbf{y}}+1+{\textbf{v}}_{1} \cdot {\textbf{x}}+{\textbf{v}}_{2} \cdot {\textbf{y}}}+\sum _{{\textbf{x}} \in U_{0}} \sum _{{\textbf{y}} \in {\mathbb {F}}_{2}^{l}}(-1)^{1+{\textbf{v}}_{1} \cdot {\textbf{x}}+{\textbf{v}}_{2} \cdot {\textbf{y}}} \nonumber \\&=\left\{ \begin{array}{ll} -\left( 2^{k}-\frac{k(k+1)}{2} -1\right) 2^{l}, &{} {\textbf{v}}_{1}={\textbf{0}}_{k}, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ (-1)^{i}A(i) 2^{l}, &{} wt\left( {\textbf{v}}_{1}\right) =i, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ -(-1)^{{\textbf{v}}_{1} \cdot \phi ^{-1}\left( {\textbf{v}}_{2}\right) } 2^{l}, &{} {\textbf{v}}_{2} \in {\text {Im}}(\phi ) \backslash \left\{ {\textbf{0}}_{l}\right\} , \\ 0, &{} {\textbf{v}}_{2} \notin {\text {Im}}(\phi ), \end{array}\right. \end{aligned}$$
(3.7)

where \(i=1,2, \ldots , k\).

Furthermore, combining Lemma 3 and Eq. (3.7) together, we get that the length and dimension of \(C_{f}\) are \(2^{r}\) and \(r + 1\), respectively.

Then, we will determine the weight distribution of the codes and it suffices to determine the frequency of \(W_{f}\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) \), where \(\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) \in {\mathbb {F}}_{2}^{k} \times {\mathbb {F}}_{2}^{l}\), since its corresponding weight can be easily obtained by Lemma 3.

It is clear that the multiplicity of \(-\left( 2^{k}-\frac{k(k+1)}{2} -1\right) 2^{l}\) is 1. To derive the frequencies of other Walsh values in Eq. (3.7), it is necessary to consider the following cardinalities

$$\begin{aligned}&|\{{\textbf{v}}_{1} \in {\mathbb {F}}_{2}^{k}: wt({\textbf{v}}_{1})=i\}|=\left( {\begin{array}{c}k\\ i\end{array}}\right) , \end{aligned}$$
(3.8)
$$\begin{aligned}&|\{{\textbf{v}}_{2} \in {\mathbb {F}}_{2}^{l}: {\textbf{v}}_{2} \in {\text {Im}} (\phi )\}|=|{\mathbb {F}}_{2}^{k} \backslash U_{0}|+1=2+\frac{k(k+1)}{2}, \end{aligned}$$
(3.9)
$$\begin{aligned}&|\{{\textbf{v}}_{2} \in {\mathbb {F}}_{2}^{l}: {\textbf{v}}_{2} \notin {\text {Im}} (\phi )\}|=2^{l}-2-\frac{k(k+1)}{2}. \end{aligned}$$
(3.10)

The exact frequencies of weights in \(C_{f}\) depend on the values of k. We will only present two cases, namely, when \(k\not \in S_1\cup S_{-1} \cup S_3\) and when \(k\in S_1\). Other cases can be proved following similar ideas.

(1) Suppose that \(k\not \in S_1\cup S_{-1} \cup S_3\). Lemma 6 implies that \(A(i)\not \in \{0, 1, -1\}\) for all \(1\le i \le k\). Hence, according to Eqs. (3.9) and (3.10), the multiplicities of 0 and \( \pm 2^{l}\) are given by

$$\begin{aligned} \left| \left\{ \left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) : {\textbf{v}}_{1}\in {\mathbb {F}}_{2}^{k}, {\textbf{v}}_{2} \notin {\text {Im}}(\phi )\right\} \right| =2^{k}\bigg (2^{l}-2-\frac{k(k+1)}{2}\bigg ), \end{aligned}$$

\(2^{k-2} k(k+1) + 2^{k-1}\), respectively. To prove, for instance, the latter, notice there are \(2^{k-1}\) vectors \({\textbf{v}}_{1}\) such that \({\textbf{v}}_{1}\cdot \phi ^{-1}\left( {\textbf{v}}_{2}\right) =0\) for any choice of \({\textbf{v}}_{2}\) in \({\text {Im}}(\phi )\backslash \{{\textbf{0}}_{l}\}\) (thus \(\phi ^{-1}({\textbf{v}}_{2})\not ={\textbf{0}}_{k}\))—a set of size \(\left| {\mathbb {F}}_{2}^{k}\backslash U_{0}\right| =\frac{k(k+1)}{2}+1\).

On the other hand, Lemma 7 yields that the multiplicity of the Walsh value \((-1)^iA(i)2^{l}\) in Eq. (3.7) is \(\sum _{x\in \Gamma _i\cup \Delta _i}\left( {\begin{array}{c}k\\ x\end{array}}\right) \), where the sets \(\Gamma _i\) and \(\Delta _i\) are given by Eqs. (2.4) and (2.5), respectively.

(2) Suppose now that \(k \in S_1\) with \(k=s^2+1\) for some integer s. On the one hand, it follows from Lemma 6 that \(A(i)\not = \pm 1\) and thus the multiplicities of \(\pm 2^{l}\) are \(2^{k-2}k(k+1)+ 2^{k-1}\) by Eq. (3.9). On the other hand, by Eqs. (3.8) and (3.10), one can deduce that the frequency of 0 is then given by

$$\begin{aligned}&\bigg |\bigg \{({\textbf{v}}_{1}, {\textbf{0}}_{l}): wt({\textbf{v}}_{1})=\frac{k+1\pm s}{2}\bigg \}\bigg | +\left| \left\{ \left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) : {\textbf{v}}_{1}\in {\mathbb {F}}_{2}^{k}, {\textbf{v}}_{2} \notin {\text {Im}}(\phi )\right\} \right| \\&\quad =\left( {\begin{array}{c}k\\ \frac{k+1+s}{2}\end{array}}\right) +\left( {\begin{array}{c}k\\ \frac{k+1-s}{2}\end{array}}\right) +2^{k}\bigg (2^{l}-2-\frac{k(k+1)}{2}\bigg ), \end{aligned}$$

since \(A(\frac{k+1\pm s}{2})=0\). The multiplicity of \((-1)^{i}A(i)2^{l}\) for \(i\not = \frac{k+1\pm s}{2}\) can be completed by using a similar approach as above.

Finally, we will examine the wideness and minimality of the code. It is an immediate result from Lemma 4 that \(C_f\) is minimal since Eq. (3.7) leads to

$$\begin{aligned} W_{f}\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) \pm W_{f}\left( {\textbf{w}}_{1}, {\textbf{w}}_{2}\right) \ne 2^{r} \end{aligned}$$

for any pair of distinct \(\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) ,\left( {\textbf{w}}_{1}, {\textbf{w}}_{2}\right) \in {\mathbb {F}}_{2}^{k} \times {\mathbb {F}}_{2}^{l}\).

It can be easily verified (see also Tables 1 and 2) that the maximum weight

$$\begin{aligned} w_{\max }=2^{r-1}+2^{l-1}\left( 2^{k}-\frac{k(k+1)}{2}-1\right) , \end{aligned}$$
(3.11)

corresponding to \(wt\left( {\textbf{v}}_{1}\right) =0, wt\left( {\textbf{v}}_{2}\right) =0\). To compute the minimum weight, note that the quadratic function A(x) has a critical point at \(x=\frac{k+1}{2}\), thus the maximum attained at an integer i must lie near the endpoint (depending on the parity of i). Therefore, when k is odd, \((-1)^iA(i) \le A(2)=A(k-1)\). On the other hand, when k is even, \((-1)^iA(i) \le A(k)\). Thus, the minimum (nonzero) weight is achieved when \(wt\left( {\textbf{v}}_{1}\right) =k,w t\left( {\textbf{v}}_{2}\right) =0\) for k even and when \(wt\left( {\textbf{v}}_{1}\right) = 2 ,w t\left( {\textbf{v}}_{2}\right) =0\) for k odd, which gives

$$\begin{aligned} w_{\min } = 2^{r-1}-2^{l-2}(k^{2}-3k+2), \end{aligned}$$
(3.12)

for even k and

$$\begin{aligned} w_{\min } = 2^{r-1}-2^{l-2}(k^{2}-7k+10), \end{aligned}$$
(3.13)

for odd k. Therefore, combining Eqs. (3.11)–(3.13) together, we get \(w_{\min }/w_{\max } \le 1/2\) for \(k \ge 8\), that is, \(C_f\) is a wide minimal code for \(r\ge 13\). This completes the proof. \(\square \)

Table 1 The weight distribution of \(C_{f}\), where \(1\le i\le k\)
Table 2 Parameters in Table 1

We now give some examples to illustrate the correctness of Theorem 1.

Example 1

  1. (1)

    Let \(r=11\), i.e., \(k=6, l=5\), which implies that \(k\not \in S_1\cup S_{-1}\cup S_3\). Then \(C_f\) described in Theorem 1 is a minimal [2048, 12, 864] code, whose weight enumerator polynomial is \(1+z^{864}+35^{992}+704z^{1008}+2623z^{1024}+704z^{1040}+21z^{1056}+6z^{1184}+z^{1696}.\) Note that in this case, the only solution (ij) of \(j = \frac{(k+1) \pm \sqrt{ 4i(-i+1+k) -(k^2+3) }}{2}\) that is relevant for the computation of the weight distribution is (3, 2) (minus sign) (the other solution (3, 5) (plus sign) leads to \(i\equiv j \pmod 2\)).

  2. (2)

    Let \(r=13\), i.e., \(k=7= 2^2+3\in S_3, l=6\). Then \(C_f\) described in Theorem 1 is a minimal [8192, 14, 3936] code, whose weight enumerator polynomial is \(1+28z^{3936}+1912z^{4064}+ 12543z^{4096}+1856z^{4128}+35z^{4192}+8z^{4576}+ z^{7264}.\)

  3. (3)

    Let \(r=15\), i.e., \(k=8= 3^2-1 \in S_{-1}, l=7\). Then \(C_f\) described in Theorem 1 is a wide minimal [32768, 16, 15040] code, whose weight enumerator polynomial is \(1+z^{15040}+28z^{15808}+56z^{16192}+4764z^{16320}+55807z^{16384}+4792z^{16448}+70z^{16576}+8z^{16960}+8z^{17728}+z^{30400}.\) Observe that indeed \(\frac{15040}{30400} = \frac{47}{95} < \frac{1}{2}.\)

3.2 Wide binary minimal codes from the derivative of a Boolean function

In what follows, we first show that a different characteristic set, i.e., \(U_{1}=\{{\textbf{x}} \in {\mathbb {F}}_{2}^{k}: wt({\textbf{x}}) \ge 3\}\), can actually give rise to wide minimal codes if a suitable derivative \(D_{\gamma }(f)\) of f defined in Eq. (3.3) is used. Then, we combine the codewords of \(C_{D_{\gamma }(f)}\) and of \(C_f\) to increase the dimension of the resulting wide minimal codes.

From Eqs. (2.3) and (3.2), the code \(C_{D_{\gamma }(f)}\) is defined by

$$\begin{aligned} C_{D_{\gamma }(f)}=\left\{ (u (f({\textbf{x}})+f ({\textbf{x}} + \gamma ))+{\textbf{v}} \cdot {\textbf{x}})_{{\textbf{x}} \in {\mathbb {F}}_{2}^{m} }: u \in {\mathbb {F}}_{2}, {\textbf{v}} \in {\mathbb {F}}_{2}^{m}\right\} , \end{aligned}$$
(3.14)

where \(f({\textbf{x}}) \ne {\textbf{v}} \cdot {\textbf{x}}+a.\) For the choice of \(U_1\), we study the polynomial

$$\begin{aligned} B(i) = A(i)+(-1)^{i}A(i) = {\left\{ \begin{array}{ll} 4i^{2} - 4(k+1)i+k^2+k+2, &{} i \text{ is } \text{ even },\\ 0, &{} i \text{ is } \text{ odd }, \end{array}\right. } \end{aligned}$$
(3.15)

for \(1\le i \le k\).

Lemma 8

Consider the polynomial B(i) defined in (3.15). The following statements hold for \(k\ge 6\).

  1. (1)

    \(B(i) = 0\) if and only if i is odd or i is even and \(k=s^2+1 \in S_{1}\) and \(i = \frac{s^2+2 \pm s }{2}\).

  2. (2)

    \(B(i) = -2\) if and only if i is even and \(k=s^2+3 \in S_{3}\) and \(i = \frac{s^2+4 \pm s }{2}\).

  3. (3)

    \(B(i) = 2\) if and only if i is even and \(k=s^2-1 \in S_{-1}\) and \(i = \frac{s^2 \pm s }{2}\).

Similarly as in Sect. 3.1, one can deduce that \(\frac{1 +k \pm s }{2}\) is a positive integer smaller than k and we also have the following lemma.

Lemma 9

Let ij be two distinct even integers in \(\{1,2,\cdots ,k\}\) and B be defined in (3.15). Then \(B(i) = B(j)\) if and only if \(i + j = k + 1\). In particular, this can only happen when k is odd.

For the code \(C_{D_{\gamma }(f)}\) in Eq. (3.14), we have the following.

Theorem 2

Let \(r\ge 11\) be an odd integer, \(U_{1}=\{{\textbf{x}} \in {\mathbb {F}}_{2}^{k}: wt({\textbf{x}}) \ge 3\}\) and \(\phi \) be a mapping such that it is an injection from \({\mathbb {F}}_{2}^{k} \backslash U_{1}\) to \({\mathbb {F}}_{2}^{l} \backslash \left\{ {\textbf{0}}_{l}\right\} \) and \(\phi ({\textbf{x}})={\textbf{0}}_{l}\) for any \({\textbf{x}} \in U_{1}\). Consider \(\gamma =\left( {\textbf{1}}_{k}, {\textbf{0}}_{l}\right) \in {\mathbb {F}}_{2}^{r}\). Then the derivative code \(C_{D_{\gamma }(f)}\) in Eq. (3.14) is a \(\left[ 2^{r}, r+1,2^{l-1}\left( k^{2}+k+2\right) \right] \) minimal code. Furthermore, if \(r\ge 13\), then \(C_{D_{\gamma }(f)}\) is wide. The weight distribution is displayed in Table 3 and the parameters related to k are given in Table 4, where \(\Lambda =\{1 \le j \le k | j \text { is even}\} \cap \{\frac{1+k\pm s}{2}\}\), \(\Omega = \{1 \le j \le k | j \text { is odd}\}\cup \{\frac{1+k\pm s}{2}\}\).

Proof

Similar as the proof of Theorem 1, we first determine the Walsh transform of the function \(D_{\gamma }(f)\) given in Eq. (3.2). Note that \(U_{0}=U_{1}+{\textbf{1}}_{k}\). It is easy to prove (see also [8, Lemma 6])

$$\begin{aligned} \sum _{{\textbf{x}} \in U_{1}}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}}=\left\{ \begin{array}{ll} |U_{1}|, &{} {\textbf{v}}_{1}={\textbf{0}}_{k}, \\ -A(i), &{} wt\left( {\textbf{v}}_{1}\right) =i, \end{array}\right. \end{aligned}$$
(3.16)

where \(|U_{1}|=|U_{0}|=2^{k}-\frac{k(k+1)}{2}-1\) and A(i) is given by Eq. (3.4).

According to Lemma 5 and Eq. (3.16), we get

$$\begin{aligned} W_{D_{\gamma }(f)}({\textbf{v}}_{1}, {\textbf{v}}_{2})&=\sum _{{\textbf{x}} \in {\mathbb {F}}_{2}^{k}} \sum _{{\textbf{y}} \in {\mathbb {F}}_{2}^{l}}(-1)^{\phi ({\textbf{x}}) \cdot {\textbf{y}}+\phi \left( {\textbf{x}}+{\textbf{1}}_{k}\right) \cdot {\textbf{y}}+{\textbf{v}}_{1} \cdot {\textbf{x}}+{\textbf{v}}_{2} \cdot {\textbf{y}}}\nonumber \\&=\sum _{{\textbf{x}} \in ({\mathbb {F}}_{2}^{k} \backslash U_{1})} \sum _{{\textbf{y}} \in {\mathbb {F}}_{2}^{l}}(-1)^{\phi ({\textbf{x}}) \cdot {\textbf{y}}+{\textbf{v}}_{1} \cdot {\textbf{x}}+{\textbf{v}}_{2} \cdot {\textbf{y}}}+\sum _{{\textbf{x}} \in ({\mathbb {F}}_{2}^{k} \backslash U_{0})} \sum _{{\textbf{y}} \in {\mathbb {F}}_{2}^{l}}(-1)^{\phi ({\textbf{x}}+{\textbf{1}}_{k}) \cdot {\textbf{y}}+{\textbf{v}}_{1} \cdot {\textbf{x}}+{\textbf{v}}_{2} \cdot {\textbf{y}}} \nonumber \\&\quad +\sum _{{\textbf{x}} \in (U_{1} \cap U_{0})} \sum _{{\textbf{y}} \in {\mathbb {F}}_{2}^{l}}(-1)^{{\textbf{v}}_{1} \cdot {\textbf{x}}+{\textbf{v}}_{2} \cdot {\textbf{y}}} \nonumber \\&=\left\{ \begin{array}{ll} \left( 2^{k}-k(k+1)-2\right) 2^{l}, &{} {\textbf{v}}_{1}={\textbf{0}}_{k}, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ -\left( A(i)+(-1)^{i}A(i)\right) 2^{l}, &{} wt\left( {\textbf{v}}_{1}\right) =i, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ \left( 1+(-1)^{{\textbf{v}}_{1} \cdot {\textbf{1}}_{k}}\right) (-1)^{{\textbf{v}}_{1}\cdot \phi ^{-1}\left( {\textbf{v}}_{2}\right) } 2^{l}, &{} {\textbf{v}}_{2} \in {\text {Im}}(\phi ) \backslash \left\{ {\textbf{0}}_{l}\right\} , \\ 0, &{} {\textbf{v}}_{2} \notin {\text {Im}}(\phi ), \end{array}\right. \end{aligned}$$
(3.17)

where \(i=1,2,\ldots ,k\).

Now, we are ready to determine the frequencies in the Walsh spectrum of the values given in Eq. (3.17). Although the specification of the weight distribution of the code is similar to that of Theorem 1, we will provide some details for the reader’s convenience. We only present the case when k is of the form \(s^{2}+1\) since the other cases can be proved with the same idea.

Table 3 The weight distribution of \({{C}_{D_{\gamma }(f)}}\), where \(1\le i\le k\)
Table 4 Parameters in Table 3

Note that the function \(-B(i)\) has a maximum at \(\frac{k+1}{2}\). Thus the Walsh value \((2^k-k^2-k-2)2^l\) in Eq. (3.17) is attained only once and it corresponds to the minimum weight in \(C_{D_{\gamma }(f)}\). The number of balanced codewords corresponds to the number of linear functions plus the frequency of the zero Walsh value (determined by Eq. (3.17)), which includes the following four possibilities.

  1. (i)

    \({\textbf{v}}_{2} \in {\mathbb {F}}_2^l\) and \({\textbf{v}}_{2} \not \in {\text {Im}}(\phi ) \) gives \(2^k(2^l -\frac{k^2+k}{2}-2)\) occurrences.

  2. (ii)

    \(B(i)=0\), \(1\le i \le k\), which yields \(2^{k-1}+\sum _{x\in \Lambda }\left( {\begin{array}{c}k\\ x\end{array}}\right) \) codewords according to Lemma 8, where

    $$\begin{aligned} \Lambda =\{j\in \{1,\ldots , k\} | j \text { is even}\}\cap \left\{ \frac{s^2\pm s+2}{2}\right\} . \end{aligned}$$
  3. (iii)

    \({\textbf{v}}_{2} \in {\text {Im}}(\phi ) \backslash \left\{ {\textbf{0}}_{l}\right\} \) and \(1+(-1)^{{\textbf{v}}_{1} \cdot {\textbf{1}}_{k}}=0\), i.e., \({\textbf{v}}_1\) has odd weight.

  4. (iv)

    The case \(u=0\) which corresponds to \(2^r-1\) codewords.

Thus the total number of balanced codewords is

$$\begin{aligned} 2^r-1+ 2^k(2^l-\frac{k(k+1)}{2}-2)+2^{k-1}+\sum _{x\in \Lambda }\left( {\begin{array}{c}k\\ x\end{array}}\right) +2^{k-1}\left( \frac{k(k+1)}{2}+1\right) . \end{aligned}$$

To count the frequency of \(2^{l+1}\), note that \(\left( 1+(-1)^{{\textbf{v}}_{1} \cdot {\textbf{1}}_{k}}\right) (-1)^{{\textbf{v}}_{1}\cdot \phi ^{-1}\left( {\textbf{v}}_{2}\right) }\) equals 2 when \({\textbf{v}}_1\) has even weight and \(\mathbf {v_1}\) is orthogonal to \(\phi ^{-1}({\textbf{v}}_2)\) for \({\textbf{v}}_{2} \in {\text {Im}}(\phi ) \backslash \left\{ {\textbf{0}}_{l}\right\} \). That is, there are \(2^{k-3}k(k+1) + 2^{k-1}\) such values. Similarly, the frequency of \(-2^{l+1}\) equals \(2^{k-2}(\frac{k(k+1)}{2})\).

When \(B(i)\not \in \{0,2,-2\}\), the values \(-\left( A(i)+(-1)^{i}A(i)\right) 2^{l}\) are different from each other for even i with \(1 \le i \le k\), when k is even, thus its multiplicity is \(\left( {\begin{array}{c}k\\ i\end{array}}\right) \). Otherwise, if k is odd, its multiplicity equals \(\sum _{x\in \{i,k+1-i\}}\left( {\begin{array}{c}k\\ x\end{array}}\right) \) by Lemma 9. This completes the description of the weight distribution.

Next, we show \(C_{D_{\gamma }(f)}\) is minimal and wide. From Eq. (3.17), we see that

$$\begin{aligned} W_{D_{\gamma }(f)}\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) \pm W_{D_{\gamma }(f)}\left( {\textbf{w}}_{1}, {\textbf{w}}_{2}\right) \ne 2^{r} \end{aligned}$$

for any pair of distinct \(\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) ,\left( {\textbf{w}}_{1}, {\textbf{w}}_{2}\right) \in {\mathbb {F}}_{2}^{k} \times {\mathbb {F}}_{2}^{l}\). It follows from Lemma 4 that \(C_{D_{\gamma }(f)}\) is minimal. Note that the minimum weight is clearly

$$\begin{aligned} w_{\min }=2^{l-1}(k^{2}+k+2), \end{aligned}$$
(3.18)

corresponding to \(wt\left( {\textbf{v}}_{1}\right) =0,w t\left( {\textbf{v}}_{2}\right) =0\). The maximum weight corresponds to the vectors \(wt\left( {\textbf{v}}_{1}\right) =k, wt\left( {\textbf{v}}_{2}\right) =0\), when k is even, and \(wt\left( {\textbf{v}}_{1}\right) =2, wt\left( {\textbf{v}}_{2}\right) =0\), when k is odd. Thus,

$$\begin{aligned} w_{\max }={\left\{ \begin{array}{ll} 2^{r-1}+2^{l-1}(k^{2}-3k+2), &{} k \text{ is } \text{ even, }\\ 2^{r-1}+2^{l-1}(k^{2}-7k+10), &{} k \text{ is } \text{ odd. } \end{array}\right. } \end{aligned}$$
(3.19)

Therefore, combining Eqs. (3.18) and (3.19) together, we get \(w_{\min }/w_{\max } \le 1/2\) for \(k \ge 7\), i.e., \({{C}_{D_{\gamma }(f)}}\) is wide minimal. This completes the proof. \(\square \)

Example 2

  1. (1)

    Let \(r=11\), i.e., \(k=6\not \in S_1\cup S_{-1}\cup S_3, l=5\). Then \({{C}_{D_{\gamma }(f)}}\) described in Theorem 2 is a minimal [2048, 12, 704] code, whose weight enumerator polynomial is \(1+z^{704}+15z^{960}+368z^{992}+ 3359z^{1024} + 336z^{1056}+15z^{1088}+z^{1344}.\)

  2. (2)

    Let \(r=13\), i.e., \(k=7 \in S_3, l=6\) and \(k\pm s \equiv 1 \pmod 4\). Then \({{C}_{D_{\gamma }(f)}}\) described in Theorem 2 is a wide minimal [8192, 14, 1856] code, whose weight enumerator polynomial is \(1+z^{1856}+35z^{3904}+960z^{4032} + 14463z^{4096}+ 896z^{4160}+28z^{4416}.\)

Now, we use the codewords of the codes specified in Theorem 1 together with those given in Theorem 2 to increase the dimension of the resulting codes by one. Precisely, we define \(C_{f} \oplus C_{D_{\gamma } (f)}\) as

$$\begin{aligned} C_{f} \oplus C_{D_{\gamma } (f)}:=\left\{ \left( a f({\textbf{x}})+b D_{\gamma } f({\textbf{x}})+{\textbf{v}} \cdot {\textbf{x}}\right) _{{\textbf{x}} \in {\mathbb {F}}_{2}^{n}}: a, b \in {\mathbb {F}}_{2}, {\textbf{v}} \in {\mathbb {F}}_{2}^{n}\right\} . \end{aligned}$$
(3.20)

From the results of [8, Theorem 1], Theorems 1 and 2, we can similarly obtain the following theorem. Its proof is lengthy and similar to that of [23, Theorem 5], thus we omit it.

Theorem 3

Let the symbols be given as above. Then the code \(C_{f} \oplus C_{D_{\gamma } (f)}\) given by Eq. (3.20), is a \(\left[ 2^{r}, r+2,2^{l-1}\left( k^{2}+k+2\right) \right] \) wide binary minimal code.

Remark 1

The codes \(C_{D_{\gamma } (f)}\) and \(C_{f} \oplus C_{D_{\gamma } (f)}\), presented in Th. 2 and Th. 3, respectively, attain a larger minimum distance than the ones introduced in [23], obtained using the same method, i.e., Th. 4 and Th. 5 in [23]. Namely, the number \(2^{l-1}\left( k^{2}+k+2\right) \) is always larger than \(2^{l}(k+1)\).

4 The general case

In this section, we present the general construction of (wide) minimal codes using the previously described form. For \(I\subseteq \{1,\ldots , n\}\), define the subset \({\mathcal {U}}_I\) of \({\mathbb {F}}_2^m \) as

$$\begin{aligned} {\mathcal {U}}_I := \{ {\textbf{v}}\in {\mathbb {F}}_2^m : wt({\textbf{v}}) \not \in I\}. \end{aligned}$$
(4.1)

For instance, in \({\mathbb {F}}_2^k\), the sets defined in the previous sections are a special case of this definition, namely, \({\mathcal {U}}_{\{0, 1, 2\}} = U_1\) and \({\mathcal {U}}_{\{k-2,k-1,k\}} = U_0\). Since \({\mathcal {U}}_I\) contains every vector whose weight is not in I, we get the following result.

Lemma 10

Let m be any positive integer and \(I\subseteq \{1,\ldots , m\}\). Consider the subset \({\mathcal {U}}_I\) given in Eq. (4.1). The following holds

$$\begin{aligned} \sum _{{\textbf{x}} \in {\mathcal {U}}_I}(-1)^{{\textbf{v}} \cdot {\textbf{x}}}=\left\{ \begin{array}{ll} |{\mathcal {U}}_I|= 2^m - \sum _{i\in I} \left( {\begin{array}{c}m\\ i\end{array}}\right) , &{} {\textbf{v}}={\textbf{0}}_{m}, \\ -\sum _{j\in I} P_j(i), &{} wt\left( {\textbf{v}}\right) =i, \end{array}\right. \end{aligned}$$
(4.2)

for any \({\textbf{v}}\in {\mathbb {F}}_{2}^{m}\).

For suitable choices of I, one can explicitly obtain the values in the previous sum. For our purposes, it will be enough to consider subsets I for which \(| {\mathcal {U}}_I |>2^{k-1}\). Moreover, since the Krawtchouck polynomials satisfy Eq. (2.2), we will restrict to cases when \(I\subseteq \{0,1,2\}\cup \{k-2,k-1,k\}\). Our previous discussion together with [7, 8, 14, 23] essentially cover the cases when I equals \(\{0,1\}, \{k-1,k\}, \{0,1,2\}, \{k-2, k-1, k\}\) as it will become obvious after the following lemma.

Lemma 11

Let \(r\ge 7\) be an odd integer and \(I\subseteq \{0,1,\ldots , k\}\). Consider the function f defined in Eq. (3.3), where \(\phi \) is an injective mapping from \({\mathbb {F}}_{2}^{k} \backslash {\mathcal {U}}_I\) to \({\mathbb {F}}_{2}^{l} \backslash \left\{ {\textbf{0}}_{l}\right\} \) and \(\phi ({\textbf{x}})={\textbf{0}}_{l}\) for any \({\textbf{x}} \in {\mathcal {U}}_{I}\). Then, the Walsh transform of f takes the following values

$$\begin{aligned} W_{f}\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) = {\left\{ \begin{array}{ll} -2^{l} |{\mathcal {U}}_I|, &{} {\textbf{v}}_{1}={\textbf{0}}_{k}, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ 2^{l}\sum _{j\in I} P_j(i), &{} wt\left( {\textbf{v}}_{1}\right) =i, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ -(-1)^{{\textbf{v}}_{1} \cdot \phi ^{-1}\left( {\textbf{v}}_{2}\right) } 2^{l}, &{} {\textbf{v}}_{2} \in {\text {Im}}(\phi ) \backslash \left\{ {\textbf{0}}_{l}\right\} , \\ 0, &{} {\textbf{v}}_{2} \notin {\text {Im}}(\phi ), \end{array}\right. } \end{aligned}$$

where \(i=1,2, \ldots , k\).

Proof

The result follows immediately from Lemma 10. \(\square \)

Comparing the previous result with Lemma 5 and Theorem 1, one can see that the key for the results in Sect. 3 is that the polynomial \((-1)^{i} A(i) = P_k(i)+P_{k-1}(i)+P_{k-2}(i)\) has degree two, which implies that it is easy to find the critical points for \(A(i) = \pm 1\) or \(A(i) = 0\), thus allowing us to fully describe the weight distribution of the codes. In the following, we will illustrate this general method by considering simple subsets I that yield polynomials of low degree (denoted by \(A_I(i)\)), namely, we will select I to be \(\{0,k-2,k-1\}\), \(\{0,1,k-1\}\) and \(\{0,1,k\}\). Other similar choices of I can be handled analogously and are left as an exercise to the interested reader.

4.1 The case \(I=\{0, k-1, k-2\}\).

Throughout this section, set \(I=\{0,k-1,k-2\}\). The associated polynomial is now the quadratic polynomial

$$\begin{aligned} A_I(i)=(-1)^i(2i^2-2i(k+1)+\frac{k(k+1)}{2})+1, \end{aligned}$$

where \(1\le i \le k\). Similar to Lemma 6, we can easily derive the following properties of \(A_I(i)\).

Lemma 12

For \(1\le i \le k\), we have,

  1. (1)

    \(A_I(i) = 0\) if and only if \(k=s^2-3 \in S_{-3}\), \(i = \frac{s^2-2\pm s}{2}\) is odd, or \(k=s^2+1 \in S_{1}\) and \(i=\frac{s^2+2\pm s}{2}\) is even.

  2. (2)

    \(A_I(i) = -1\) if and only if \(k=s^2-5 \in S_{-5}\) and \(i=\frac{s^2-4\pm s}{2}\) is odd, or \(k=s^2+3 \in S_{3}\) and \(i=\frac{s^2+4\pm s}{2}\) is even.

  3. (3)

    \(A_I(i) = 1\) if and only if \(k=s^2-1\in S_{-1}\) and \(i=\frac{s^2\pm s}{2}\) is odd, or \(k=s^2-1\in S_{-1}\) and \(i=\frac{s^2\pm s}{2}\) is even.

Observe that the sets \(S_u\) are almost always mutually disjoint with the unique exception \(k = 4 \in S_{3}\cap S_{-5}\) giving \(i=2\), \(j=1\) and \(A_I(i)=A_I(j)=-1\). This implies that the conditions are almost always mutually exclusive.

A result similar to Lemma 7 can now be derived.

Lemma 13

Let \(i\not =j\) be two integers in \(\{1,\ldots ,k\}\).

  1. (1)

    If \(i\equiv j \pmod 2\), then \(A_I(i) = A_I(j)\) if and only if \(i + j = k + 1\). In particular, this can only happen when k is odd.

  2. (2)

    If \(i\not \equiv j \pmod 2\), then \(A_I(i) = A_I(j)\) if and only if \(j = a_{-1,i}^{\pm }.\)

We now have all the ingredients to state and prove the following.

Theorem 4

Let \(r\ge 7\) be an odd integer and let \(I=\{0,k-1,k-2\}\). Consider the function f defined in Eq. (3.3) where \(\phi \) is an injective mapping from \({\mathbb {F}}_{2}^{k} \backslash {\mathcal {U}}_I\) to \({\mathbb {F}}_{2}^{l} \backslash \left\{ {\textbf{0}}_{l}\right\} \) and \(\phi ({\textbf{x}})={\textbf{0}}_{l}\) for any \({\textbf{x}} \in {\mathcal {U}}_{I}\). Then the code \(C_{f}\) in Eq. (2.3) is a \([2^{r}, r+1, d]\) minimal code, where

$$\begin{aligned} d= {\left\{ \begin{array}{ll} 2^{r-1}-2^{l-2}(k^2 -7k + 10), &{} k \text{ is } \text{ odd, }\\ 2^{r-1}-2^{l-2}(k^{2}-3k+2), &{} k \text{ is } \text{ even. } \end{array}\right. } \end{aligned}$$

Furthermore, if \(r\ge 15\), then \(C_f\) is wide. The weight distributions are given in Table 5, whose parameters related to k and the set \(\Lambda _s\) are shown in Tables 6 and 7, respectively.

Proof

The proof is similar to that of Theorem 1, so we only present a sketch here. Lemma 11 implies that

$$\begin{aligned} W_{f}\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right)&=\left\{ \begin{array}{ll} -\left( 2^{k} -\frac{k(k+1)}{2} - 1\right) 2^{l}, &{} {\textbf{v}}_{1}={\textbf{0}}_{k}, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ 2^{l}A_I(i), &{} wt\left( {\textbf{v}}_{1}\right) =i, {\textbf{v}}_{2}={\textbf{0}}_{l}, \\ -(-1)^{{\textbf{v}}_{1} \cdot \phi ^{-1}\left( {\textbf{v}}_{2}\right) } 2^{l}, &{} {\textbf{v}}_{2} \in {\text {Im}}(\phi ) \backslash \left\{ {\textbf{0}}_{l}\right\} , \\ 0, &{} {\textbf{v}}_{2} \notin {\text {Im}}(\phi ), \end{array}\right. \end{aligned}$$
(4.3)

for \(i=1,2, \ldots , k\).

Table 5 The weight distribution of \(C_{f}\), where \(1\le i\le k\)
Table 6 Parameters in Table 5
Table 7 The values of the set \(\Lambda _s\) in Table 6

The exact frequencies of weights in \(C_{f}\) depend on the values of k. We will describe the case when \(k\not \in \cup _{j\in \{\pm 1, \pm 3,-5\}} S_j\) and when \(k\in S_{-3}\) since the other cases can be proved using a similar reasoning.

(1) Suppose that \(k\not \in \cup _{j\in \{\pm 1, \pm 3,-5\}} S_j\). Lemma 12 implies that there is no solution for \(A_I(i) = 0, 1, -1\). Hence the multiplicities of \(0, 2^{l},\) and \(-2^l\) are given by \(2^{k}\bigg (2^{l}-2-\frac{k(k+1)}{2}\bigg ),\) \(2^{k-2} k(k+1)\) and \(2^{k-2} k(k+1) + 2^k\), respectively. Lemma 13, Eqs. (2.4) and (2.5) yield the frequency of \(2^{l}A_I(i)\) in Eq. (4.3) to be \(\sum _{x\in \Gamma _i\cup \Delta _i}\left( {\begin{array}{c}k\\ x\end{array}}\right) .\)

(2) If \(k \in S_{-3}\) with \(k=s^2-3\), then by Lemma 12, \(A_I(i)\not = \pm 1\). This implies that the multiplicities of \(2^{l}\) and \(-2^l\) are \(2^{k-2}k(k+1)\) and \(2^{k-2} k(k+1) + 2^k\), respectively. Now, to compute the frequency of 0, we define

$$\begin{aligned} \Lambda _s := {\left\{ \begin{array}{ll} \{\frac{s^2 \pm s - 2}{2}\}, &{} s \equiv 0 \pmod 4,\\ \{\frac{s^2 - s - 2}{2}\}, &{} s \equiv 1 \pmod 4,\\ \emptyset , &{} s \equiv 2 \pmod 4,\\ \{\frac{s^2 + s - 2}{2}\}, &{} s \equiv -1 \pmod 4. \end{array}\right. } \end{aligned}$$

Thus, the multiplicity of 0 in the Walsh spectrum is given by \(\sum _{\rho \in \Lambda _s}\left( {\begin{array}{c}k\\ \rho \end{array}}\right) + 2^{k}\bigg (2^{l}-2-\frac{k(k+1)}{2}\bigg ).\) Finally, the multiplicity of \(A_I(i)2^{l}\) for \(i\not \in \Lambda _s\) is attained \(\sum _{j\in \Gamma _i\cup \Delta _i}\left( {\begin{array}{c}k\\ j\end{array}}\right) \) times.

Following the same reasoning as in the proof of Theorem 1, we can obtain that \(C_f\) is minimal using the equation below

$$\begin{aligned} W_{f}\left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) \pm W_{f}\left( {\textbf{w}}_{1}, {\textbf{w}}_{2}\right) \ne 2^{r}, \left( {\textbf{v}}_{1}, {\textbf{v}}_{2}\right) \ne \left( {\textbf{w}}_{1}, {\textbf{w}}_{2}\right) \in {\mathbb {F}}_{2}^{k} \times {\mathbb {F}}_{2}^{l}. \end{aligned}$$

Clearly, the maximum weight is

$$\begin{aligned} w_{\max }=2^{r-1}+2^{l-1}\left( 2^{k}-\frac{k(k+1)}{2}-1\right) . \end{aligned}$$

If \(wt\left( {\textbf{v}}_{1}\right) =k\) is even and \(w t\left( {\textbf{v}}_{2}\right) =0\), we have

$$\begin{aligned} w_{\min } = 2^{r-1}-2^{l-2}(k^{2}-3k+2). \end{aligned}$$

If k is odd and \(wt\left( {\textbf{v}}_{1}\right) = 2, w t\left( {\textbf{v}}_{2}\right) =0\), we have

$$\begin{aligned} w_{\min } = 2^{r-1}-2^{l-2}(k^{2}-7k+10). \end{aligned}$$

Thus, the code is wide and minimal for \(k \ge 8\). \(\square \)

Example 3

  1. (1)

    Let \(r=11\), i.e., \(k=6= 3^2-3\in S_{-3},\ l=5\). Then \(C_f\) described in Theorem 4 is a wide minimal [2048, 12, 864] code, whose weight enumerator polynomial is \(1+z^{864}+20z^{960}+15z^{992}+ 672z^{1008}+2629^{1024}+736z^{1040}+15z^{1056}+6z^{1152}+z^{696}.\)

  2. (2)

    Let \(r=13\), i.e., \(k=7=2^2+3\in S_3,\ l=6\). Then \(C_f\) described in Theorem 4 is a minimal [8192, 14, 3936] code, whose weight enumerator polynomial is \(1+28z^{3936}+56z^{4000}+1792z^{4064} + 12543^{4096}+ 1920^{4128}+35z^{4192}+8z^{4512}+ z^{7264}.\)

We have fully derived similar approaches for \(I=\{0,1,k\}\) and \(I=\{0,1,k-1\}\). These theorems can be handled in a similar fashion as for the cases above. They are lengthy but simple, thus we present such detailed proofs in the appendix.

4.2 The case \(I=\{0,1,k\}\).

We now study the case \(I=\{0,1,k\}\), where the associated polynomial \(A_I(i)\) is the linear polynomial \(-2i+k+(-1)^i+1\) and \(A_I(0)= 2^k- |{\mathcal {U}}_I|\).

Theorem 5

Let \(r\ge 7\) be an odd integer and let \(I=\{0,1,k\}\). Consider the function f defined in Eq. (3.3), where \(\phi \) is an injective mapping from \({\mathbb {F}}_{2}^{k} \backslash {\mathcal {U}}_I\) to \({\mathbb {F}}_{2}^{l} \backslash \left\{ {\textbf{0}}_{l}\right\} \) and \(\phi ({\textbf{x}})={\textbf{0}}_{l}\) for any \({\textbf{x}} \in {\mathcal {U}}_{I}\). Then the code \(C_{f}\) in Eq. (2.3) is a \([2^{r}, r+1, 2^{r-1}- 2^{l-1}(k-2)]\) minimal code. Furthermore, if \(r\ge 11\), then \(C_{f}\) is wide. The weight distributions are displayed in Table 8, where the parameters related to k are given in Table 9.

Table 8 The weight distribution of \(C_{f}\), where \(1\le i\le k-1\) is odd
Table 9 Parameters in Table 8

Example 4

  1. (1)

    Let \(r=7\), i.e., \(k=4\equiv 0 \pmod 4,\) \(l=3\). Then \(C_f\) described in Theorem 5 is a minimal [128, 8, 56] code, whose weight enumerator polynomial is \(1+10z^{56}+40z^{60}+143z^{64}+56z^{68}+5z^{72}+z^{104}.\)

  2. (2)

    Let \(r=9\), i.e., \(k=5\equiv 1 \pmod 4,\ l=4\). Then \(C_f\) described in Theorem 5 is a minimal [512, 10, 232] code, whose weight enumerator polynomial is \(1+15z^{232}+96z^{248}+767z^{256}+143z^{264}+z^{296}+z^{456}.\)

  3. (3)

    Let \(r=11\), i.e., \(k=6\equiv 2 \pmod 4,\ l=5\). Then \(C_f\) described in Theorem 5 is a wide minimal [2048, 12, 960] code, whose weight enumerator polynomial is \(1+21z^{960}+224^{1008}+3554z^{1024}+288z^{1040}+7z^{1088}+z^{1920}.\) Note that indeed \(C_f\) is wide as \(\frac{960}{1920}=\frac{1}{2}\).

  4. (4)

    Let \(r=13\), i.e., \(k=7\equiv -1 \pmod 4,\ l=6\). Then \(C_f\) described in Theorem 5 is a minimal [8192, 14, 3936] code, whose weight enumerator polynomial is \(1+28z^{3936}+582^{4064} + 15103^{4096}+640z^{4128}+28z^{4192}+z^{4320}+ z^{7904}.\)

4.3 The case \(I=\{0,1,k-1\}\).

Consider \(I=\{0,1,k-1\}\). This case is similar to the one described in the previous section, however, some care must be taken when specifying all details. The associated polynomial \(A_I(i)\) is the linear polynomial \(((-1)^i+1)(-2i+k)+1\) and, again, \(A_I(0)= 2^k- |{\mathcal {U}}_I|\).

Theorem 6

Let \(r\ge 9\) be an odd integer and let \(I=\{0,1,k-1\}\). Consider the function f defined in Eq. (3.3), where \(\phi \) is an injective mapping from \({\mathbb {F}}_{2}^{k} \backslash {\mathcal {U}}_I\) to \({\mathbb {F}}_{2}^{l} \backslash \left\{ {\textbf{0}}_{l}\right\} \) and \(\phi ({\textbf{x}})={\textbf{0}}_{l}\) for any \({\textbf{x}} \in {\mathcal {U}}_{I}\),. Then the code \(C_{f}\) in Eq. (2.3) is a \([2^{r}, r+1, 2^{r-1}- 2^{l-1}(2k -7)]\) minimal code. Furthermore, if \(r\ge 15\), then \(C_f\) is wide. Its weight distribution is given in Table 10, where the parameters related to k are given in Table 11.

Table 10 The weight distribution of \(C_{f}\), where \(1\le i\le k\) is even
Table 11 Parameters in Table 10

Example 5

  1. (1)

    Let \(r=9\), \(k=5\equiv 1 \pmod 4,\ l=4\). Then \(C_f\) described in Theorem 6 is a minimal [512, 10, 232] code, whose weight enumerator polynomial is \(1+10z^{232}+176z^{248}+639z^{256}+192z^{264}+5z^{296}+z^{424}.\)

  2. (2)

    Let \(r=11\), \(k=6\equiv 2 \pmod 4,\ l=5\). Then \(C_f\) described in Theorem 6 is a wide minimal [2048, 12, 944] code, whose weight enumerator polynomial is \(1+15z^{944}+416z^{1008}+3199z^{1024}+448z^{1040}+15z^{1072}+z^{1200}+z^{1840}.\)

  3. (3)

    Let \(r=13\), i.e., \(k=7\equiv -1 \pmod 4,\ l=6\). Then \(C_f\) described in Theorem 6 is a minimal [8192, 14, 3872]-code, whose weight enumerator polynomial is \(1+21z^{3872}+960^{4064} + 14335z^{4096}+1059z^{4128}+7z^{4384}+z^{7712}.\)

  4. (4)

    Let \(r=15\), i.e., \(k=8\equiv 0 \pmod 4,\ l=7\). Then \(C_f\) described in Theorem 6 is a wide minimal [32768, 16, 15808] code, whose weight enumerator polynomial is \(1+28z^{15808}+2246z^{16320}+60927z^{16384}+2304z^{16448}+28z^{16832}+z^{17344}+z^{31680}\). Note that indeed \(\frac{15808}{31680} = \frac{247}{495} < \frac{1}{2}.\)

Remark 2

The code \(C_f\) in Theorem 5 has the largest minimum distance (for the given parameters), i.e., \(2^{r-1}-2^{l-1}(k-2)\), among the explicit binary codes constructed using the method of Krawtchouk polynomials ([7, 8, 14, 23]) except for \(U=\{k,k-1\}\) when k is even, which yields a minimum distance of \(2^{r-1}-2^{l-1}(k-3)\) [23, Theorem 2].

5 Conclusion

In this paper, we have constructed several classes of new wide binary minimal codes by selecting appropriate Boolean functions in the GMM class. The methods used in this paper are based on [7, 8, 23], namely, we employed Krawtchouk polynomials to compute the Walsh distributions of the chosen Boolean functions. The lengths, dimensions and weight distributions of these codes have been determined. Our results show that some of the new codes achieve a larger minimum distance than other constructions of binary codes that utilize Krawtchouk polynomials [7, 8, 14, 23] (see Remarks 1 and 2). Furthermore, we used the derivative method devised in [23] to increase the dimension of our codes. To deepen the understanding of the Krawtchouk-polynomials method, we have studied the general case by using suitable choices for subsets in \(\{1,\ldots , k\}\). We have described some feasible choices for which we were able to study the minimality and wideness properties of such codes. While these subsets of \(\{1,\ldots , k\}\) give simple descriptions of the codes, other more involved selections may give rise to possibly better codes (e.g., having a larger minimum distance). However, the difficulty lies in the analysis of specific cubic or quartic polynomials. We leave this as a research challenge.