1 Introduction

Let \([n]=\{1,2,\dots , n\}\). Suppose that each \(i\in [n]\) is assigned a weight \(w_i\) such that \(\sum _{i=1}^n w_i\ge 0\). For each \(S\subseteq [n]\), let \(w(S)=\sum _{s\in S} w_s\). Let

$$\begin{aligned} \mathcal P([n], k, w)=\{ S\subseteq [n]\ :\ \vert S\vert =k\ \ and \ \ w(S)\ge 0\}. \end{aligned}$$

Theorem 1.1

If \(n\ge 4k\), then

$$\begin{aligned} \vert \mathcal P([n], k, w)\vert \ge \left( {\begin{array}{c}n-1\\ k-1\end{array}}\right) , \end{aligned}$$
(1.1)

for all w.

The above theorem was first conjectured by Manickam, Miklós and Singhi [8, 9]. Chowdhury [3] showed that Theorem 1.1 is true for \(k=3\) and with an improved bound of \(n\ge 11\). Marino and Chiaselotti [10] showed that the theorem is true for \(k\le 3\) and Manickam and Singhi [9] showed that the theorem is true when \(n\equiv 0 \mod k\). Some authors are able to show that Eq. (1.1) holds if n is large compared to k. In fact, Manickam and Miklós [8] showed that Eq. (1.1) holds if \(n\ge (k-1)(k^k+k^2) +k\). Tyomkyn [12] improved the bound to \(n\ge k(4e \ln k)^k\). The first polynomial bound \(n\ge 33k^2\) was obtained by Alon et al. [1]. The bound was improved to \(n\ge 8k^2\) by Chowdhury et al. [4]. Frankl [5] gave a short proof with a bound of \(n\ge 3k^3/2\). A linear bound \(n\ge 10^{46}k\) was obtained by Pokrovskiy [11]. Finally, the theorem was proved by Blinovsky [2].

An analogue of Theorem 1.1 for vector spaces has been proved by Chowdhury et al. [4], Huang and Sudakov [6] and Ihringer [7]. In this paper, we will consider a version of the problem for certain function.

For each \(i\in [k]\) and \(j\in [n]\), let \(w_{i}(j)\) be a real number. The w is called a weight assignment for ([k], [n]). Suppose that the weight assignment satisfies \(\sum _{i\in [k],j\in [n]} w_{i}(j)\ge 0\). Let \(\mathcal F\) be the set of all functions with domain [k] and codomain [n]. For each \(f\in \mathcal F\), let

$$\begin{aligned} w(f)=w_1(f(1))+w_2(f(2))+\cdots +w_k(f(k)). \end{aligned}$$

A function \(f\in \mathcal F\) is said to be nonnegative if \(w(f)\ge 0\). Let \(\mathcal F^+(w)\) be set of all nonnegative functions, i.e.,

$$\begin{aligned} \mathcal F^+(w) =\{ f\in \mathcal F\ :\ w(f)\ge 0\}. \end{aligned}$$

Theorem 1.2

If \(n\ge 3(k-1)^2\), then

$$\begin{aligned} \vert \mathcal F^+(w)\vert \ge n^{k-1}, \end{aligned}$$

for all weight assignment w for ([k], [n]) satisfying \(\sum _{i\in [k],j\in [n]} w_{i}(j)\ge 0\). Moreover, equality holds if and only if there is a \(i_0\in [k]\) and \(j_0\in [n]\) such that

$$\begin{aligned} \mathcal F^+(w)=\{ f\in \mathcal F\ :\ f(i_0)=j_0\}. \end{aligned}$$

It is noticed that by the result of Huang and Sudakov [6], we can deduce the lower bound \(n^{k-1}\). In fact, let \(\mathcal {H}\) be the hypergraph with the vertex set V and the edge set E given as follows:

$$\begin{aligned} V = \{(i,j): i \in [k] , j \in [n]\}, ~~E = \{\{(1,j_{1}),...,(k,j_{k})\}: j_{i} \in [n]\}. \end{aligned}$$

Then the number of nonnegative edges is at least \(\delta (H) = n^{k-1}\). However, the result for hypergraphs holds only for \(n \ge 10k^{3}\) which is larger than the present bound \(3(k-1)^{2}\).

2 Proof of Theorem 1.2

For each \(i\in [k]\), let \(\{a_{i1},a_{i2},\dots , a_{in}\}=[n]\) be arranged such that

$$\begin{aligned} w_i(a_{i1})\ge w_i(a_{i2})\ge \cdots \ge w_i(a_{in}). \end{aligned}$$

Case 1 Suppose that there is an \(i_0\in [k]\) such that

$$\begin{aligned} w_{i_0} (a_{i_01})+\sum _{i\in [k], i\ne i_0} w_i(a_{in})\ge 0. \end{aligned}$$

Let \(\mathcal H_0=\{ f\in \mathcal F \ : \ f(i_0)=a_{i_01}\}\). For each \(g\in \mathcal H_0\), \(w_{i_0}(g(i_0))=w_{i_0} (a_{i_01})\) and \(w_i(g(i))\ge w_i(a_{in})\) for all \(i\in [k], i\ne i_0\) Therefore,

$$\begin{aligned} w(g)&=w_{i_0} (a_{i_01})+\sum _{i\in [k], i\ne i_0} w_i(g(i))\\&\ge w_{i_0} (a_{i_01})+\sum _{i\in [k], i\ne i_0} w_i(a_{in})\ge 0. \end{aligned}$$

Hence, \(\mathcal H_0\subseteq \mathcal F^+(w)\), and equality holds if and only if \(\mathcal H_0= \mathcal F^+(w)\), because \(\vert \mathcal H_0\vert =n^{k-1}\).

Case 2 We may assume that for all \(i'\in [k]\)

$$\begin{aligned} w_{i'} (a_{i'1})+\sum _{i\in [k], i\ne i'} w_i(a_{in})<0. \end{aligned}$$
(2.1)

We will show that \(\vert \mathcal F^+(w)\vert >n^{k-1}\).

Let

$$\begin{aligned} T =\sum _{i\in [k]} w_i(a_{i1})+\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij}). \end{aligned}$$

Case 2.1 Suppose \(T\ge 0\).

Assume at the moment that

$$\begin{aligned} w_{i'}(a_{i'1})+\sum _{i\in [k], i\ne i'} w_i(a_{i(n-k+2)})<0,\ \ \forall i'\in [k]. \end{aligned}$$
(2.2)

We will show that \(T<0\), and this contradicts our assumption. Let the column vectors \(\mathbf b_1,\mathbf b_2,\dots , \mathbf b_k\in \mathbb R^k\) be defined as

$$\begin{aligned} \mathbf b_1 =\begin{pmatrix} w_1(a_{11})\\ w_1(a_{1(n-k+2)})\\ w_1(a_{1(n-k+3)})\\ \vdots \\ w_1(a_{1n}) \end{pmatrix}, \mathbf b_2 =\begin{pmatrix} w_2(a_{2(n-k+2)})\\ w_2(a_{21})\\ w_2(a_{2(n-k+3)})\\ w_2(a_{2(n-k+4)})\\ \vdots \\ w_2(a_{2n}) \end{pmatrix}, \cdots \\ \mathbf b_i =\begin{pmatrix} w_i(a_{i(n-k+2)})\\ w_i(a_{i(n-k+3)})\\ \vdots \\ w_i(a_{i(n-k+i)})\\ w_i(a_{i1})\\ w_i(a_{i(n-k+i+1)})\\ \vdots \\ w_i(a_{in}) \end{pmatrix},\cdots , \mathbf b_k =\begin{pmatrix} w_k(a_{k(n-k+2)})\\ w_k(a_{k(n-k+3)})\\ \vdots \\ w_k(a_{kn})\\ w_k(a_{k1}) \end{pmatrix}. \end{aligned}$$

For each \(i,j\in [k]\), let \(\mathbf b_{i}(j)\) be the element in the jth row of \(\mathbf b_i\). Note that \(\mathbf b_{i}(i)=w_i(a_{i1})\) and if \(j\ne i\), then

$$\begin{aligned} \mathbf b_{i}(j)\le w_i(a_{i(n-k+2)}). \end{aligned}$$
(2.3)

Let

$$\begin{aligned} B=[c_{ij}]=[ \mathbf b_1 \ \ \mathbf b_2 \ \ \cdots \ \ \mathbf b_k]. \end{aligned}$$

Note that B is a \(k\times k\) matrix and

$$\begin{aligned} \sum _{1\le i,j\le k} c_{ij}= T. \end{aligned}$$

Now consider the ith row sum of the matrix B. Note that

$$\begin{aligned} \sum _{j=1}^k c_{ij}&=\sum _{j=1}^k \mathbf b_j(i)\\&=\mathbf b_i(i)+\sum _{j\in [k], j\ne i} \mathbf b_j(i)\\&=w_i(a_{i1})+\sum _{j\in [k], j\ne i} \mathbf b_j(i)\\&\le w_i(a_{i1}) +\sum _{j\in [k], j\ne i} w_j(a_{j(n-k+2)})<0, \end{aligned}$$

where the last inequality follows from equation (2.2). By summing up all the row in B, we have \(T=\sum _{1\le i,j\le k} c_{ij}<0\), a contradiction.

Thus, there is an \(i_0\in [k]\) such that

$$\begin{aligned} w_{i_0}(a_{i_01})+\sum _{i\in [k], i\ne i_0} w_i(a_{i(n-k+2)})\ge 0. \end{aligned}$$
(2.4)

We will show that there is another \(i_1\in [k]\setminus \{i_0\}\) with

$$\begin{aligned} w_{i_1}(a_{i_11})+\sum _{i\in [k], i\ne i_1} w_i(a_{i(n-k+2)})\ge 0. \end{aligned}$$
(2.5)

Assume at the moment that

$$\begin{aligned} w_{i'}(a_{i'1})+\sum _{i\in [k], i\ne i'} w_i(a_{i(n-k+2)})<0,\ \ \forall i'\in [k]\setminus \{i_0\}. \end{aligned}$$
(2.6)

We will show that \(T<0\), and this contradicts our assumption.

If \(i_0=k\), then let \(\overline{B}=B\), and if \(i_0\ne k\), then let

$$\begin{aligned} \overline{B}=[\overline{c}_{ij}]=[ \overline{\mathbf b}_1 \ \ \overline{\mathbf b}_2 \ \ \cdots \ \ \overline{\mathbf b}_k], \end{aligned}$$

where \(\overline{\mathbf b}_i=\mathbf b_i\) for \(i\notin \{i_0,k\}\),

$$\begin{aligned} \overline{\mathbf b}_{i_0} =\begin{pmatrix} w_{i_0}(a_{i_0(n-k+2)})\\ w_{i_0}(a_{i_0(n-k+3)})\\ \vdots \\ w_{i_0}(a_{i_0n})\\ w_{i_0}(a_{i_01}) \end{pmatrix},\ \ and \ \ \overline{\mathbf b}_k =\begin{pmatrix} w_k(a_{k(n-k+2)})\\ w_k(a_{k(n-k+3)})\\ \vdots \\ w_k(a_{k(n-k+i_0)})\\ w_k(a_{k1})\\ w_k(a_{k(n-k+i_0+1)})\\ \vdots \\ w_k(a_{kn}) \end{pmatrix}. \end{aligned}$$

For each \(i,j\in [k]\), let \(\overline{\mathbf b}_{i}(j)\) be the element in the jth row of \(\overline{\mathbf b}_i\). Note that \(\overline{\mathbf b}_{i_0}(k)=w_{i_0}(a_{i_01})\) and if \(j\ne k\), then

$$\begin{aligned} \overline{\mathbf b}_{i_0}(j)\le w_{i_0}(a_{i_0(n-k+2)}). \end{aligned}$$

Furthermore, \(\overline{\mathbf b}_{k}(i_0)=w_{k}(a_{k1})\) and if \(j\ne i_0\), then

$$\begin{aligned} \overline{\mathbf b}_{k}(j)\le w_{k}(a_{k(n-k+2)}). \end{aligned}$$

By Eq. (2.1), the kth row sum of the matrix \(\overline{B}\) is

$$\begin{aligned} \sum _{j=1}^k \overline{c}_{kj}&=w_{i_0}(a_{i_01})+\sum _{j\in [k], j\ne i_0} \overline{\mathbf b}_j(n)\\&= w_{i_0}(a_{i_01})+\sum _{j\in [k], j\ne i_0} w_j(a_{jn})<0. \end{aligned}$$

If \(i\notin \{i_0, k\}\), then the ith row sum of the matrix \(\overline{B}\) is

$$\begin{aligned} \sum _{j=1}^k \overline{c}_{ij}&=w_{i}(a_{i1})+\sum _{j\in [k], j\ne i} \overline{\mathbf b}_j(i)\\&\le w_{i}(a_{i1})+\sum _{j\in [k], j\ne i} w_j(a_{j(n-k+2)})<0. \end{aligned}$$

Finally, the \(i_0\)-th row sum of the matrix \(\overline{B}\) is

$$\begin{aligned} \sum _{j=1}^k \overline{c}_{i_0j}&=w_{k}(a_{k1})+\sum _{j\in [k], j\ne k} \overline{\mathbf b}_j(i_0)\\&\le w_{k}(a_{k1})+\sum _{j\in [k], j\ne k} w_j(a_{j(n-k+2)})<0. \end{aligned}$$

Therefore, \(T=\sum _{1\le i,j\le k} \overline{c}_{ij}<0\), a contradiction.

Hence, Eqs. (2.4) and (2.5) hold. For each \(i\in [k]\), let \(U_i=\{ a_{i2}, a_{i3},\dots , a_{i(n-k+2)}\}\) and

$$\begin{aligned} \mathcal H_1&=\{ f\in \mathcal F\ :\ f(i_0)=a_{i_01} \ \ \text {and}\ \ f(x)\in U_x\ \ \forall x\ne i_0\};\\ \mathcal H_2&=\{ f\in \mathcal F\ :\ f(i_1)=a_{i_11} \ \ \text {and}\ \ f(x)\in U_x\ \ \forall x\ne i_1\}. \end{aligned}$$

Note that \(\vert \mathcal H_1\vert =\vert \mathcal H_2\vert =(n-k+1)^{k-1}\). Let \(f\in \mathcal H_1\). Then, by Eq. (2.4),

$$\begin{aligned} w(f)&=\sum _{i\in [k]} w_i(f(i))=w_{i_0}(a_{i_01})+\sum _{x\in [k], x\ne i_0} w_x(f(x))\\&\ge w_{i_0}(a_{i_01})+\sum _{x\in [k], x\ne i_0} w_x(a_{x(n-k+2)})\ge 0. \end{aligned}$$

So, \(f\in \mathcal F^+(w)\) and \(\mathcal H_1\subseteq \mathcal F^+(w)\). Similarly, by using Eq. (2.5), \(\mathcal H_2\subseteq \mathcal F^+(w)\). Note that \(\mathcal H_1\cap \mathcal H_2=\varnothing \). Therefore,

$$\begin{aligned} \vert \mathcal F^+(w)\vert&\ge 2(n-k+1)^{k-1}=\left( 2^{1/(k-1)}(n-k+1)\right) ^{k-1}\\&=\left( (e^{\ln 2})^{1/(k-1)}(n-k+1)\right) ^{k-1}\\&> \left( \left( 1+\frac{\ln 2}{k-1} \right) (n-k+1) \right) ^{k-1}\\&= \left( n+\frac{n\ln 2}{k-1}-(k-1)\left( 1+\frac{\ln 2}{k-1} \right) \right) ^{k-1}\\&\ge \left( n+\frac{n\ln 2}{k-1}-2(k-1) \right) ^{k-1}. \end{aligned}$$

Hence, \(\vert \mathcal F^+(w)\vert >n^{k-1}\) provided that \(n\ge 3(k-1)^2\).

Case 2.2 Suppose \(T< 0\).

We will show that \(\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})<0\). Assume at the moment that

$$\begin{aligned} \sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})\ge 0. \end{aligned}$$

Then, there is a \(n-k+2\le j_0\le n\) such that \(\sum _{i\in [k]} w_i(a_{ij_0})\ge 0\). This implies that

$$\begin{aligned} \sum _{i\in [k]} w_i(a_{i1})\ge \sum _{i\in [k]} w_i(a_{ij_0})\ge 0. \end{aligned}$$

Thus, \(T=\sum _{i=1}^k w_i(a_{i1})+\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})\ge 0\), a contradiction. Hence,

$$\begin{aligned} \sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})<0. \end{aligned}$$

Since \(\sum _{i\in [k],j\in [n]} w_{i}(j)\ge 0\),

$$\begin{aligned} \sum _{i\in [k], 1\le j\le n-k+1} w_i(a_{ij})> 0. \end{aligned}$$
(2.7)

Let \(V_i=\{ a_{i1}, a_{i2},\dots , a_{i(n-k+1)}\}\) and

$$\begin{aligned} \mathcal B=V_1\times V_2\times \cdots \times V_k. \end{aligned}$$

Let

$$\begin{aligned} \mathcal H=\{ f\in \mathcal F\ :\ f(x)\in V_x\ \ \forall x\in [k]\}. \end{aligned}$$

Note that each \(f\in \mathcal H\) can be represented in the following form

$$\begin{aligned} f=(b_1,b_2,\dots ,b_k)\in \mathcal B, \end{aligned}$$

where \(f(i)=b_i\) for all i. This is an one-to-one correspondence between \(\mathcal H\) and \(\mathcal B\).

A subset \(\{f_1,f_2,\dots ,f_{n-k+1}\}\subseteq \mathcal H\) is said to be a partition of \(\mathcal B\) if

$$\begin{aligned} \{f_1(i),f_2(i),\dots ,f_{n-k+1}(i)\}=V_i,\ \ \forall i\in [k]. \end{aligned}$$

Claim 1If\(\{f_1,f_2,\dots ,f_{n-k+1}\}\)is a partition of\(\mathcal B\), then there exist two integers\(j_0, j_1\in [n-k+1]\)with\(w(f_{j_0}), w(f_{j_1})> 0\).

Proof

Note that

$$\begin{aligned} \sum _{j\in [n-k+1]} w(f_j) =\sum _{j\in [n-k+1], i\in [k]} w_i(f_j(i))=\sum _{i\in [k], 1\le j\le n-k+1} w_i(a_{ij})> 0, \end{aligned}$$

where the last inequality follows from Eq. (2.7). Therefore, there is an \(j_0\in [n-k+1]\) with \(w(f_{j_0})>0\). Next,

$$\begin{aligned} w(f_{j_0})+\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})&=\sum _{i\in [k]} w_i(f_{j_0}(i))+\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij}) \\&\le \sum _{i\in [k]} w_i(a_{i1})+\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})=T<0. \end{aligned}$$

Since

$$\begin{aligned}&\sum _{j\in [n-k+1]} w(f_j)+\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})\\ {}&\quad =\sum _{i\in [k], 1\le j\le n-k+1} w_i(a_{ij})+\sum _{i\in [k], n-k+2\le j\le n} w_i(a_{ij})\\&\quad =\sum _{i\in [k],j\in [n]} w_{i}(j)\ge 0, \end{aligned}$$

it follows that

$$\begin{aligned} \sum _{j\in [n-k+1], j\ne j_0} w(f_j)>0. \end{aligned}$$

Hence, there is an \(j_1\in [n-k+1]\setminus \{j_0\}\) with \(w(f_{j_1})>0\). This completes the proof of Claim 1. \(\square \)

The number of partitions of \(\mathcal B\) is

$$\begin{aligned} l=\frac{(\vert V_1\vert !)(\vert V_2\vert !)\cdots (\vert V_k\vert !)}{(n-k+1)!}=((n-k+1)!)^{k-1}. \end{aligned}$$

Let \(\mathcal A_1, \mathcal A_2, \dots , \mathcal A_l\) be all the partitions of \(\mathcal B\). Note that each \(f\in \mathcal H\) is contained in exactly \(((n-k)!)^{k-1}\) number of \(\mathcal A_i\). Let \({\mathcal {H}}\cap {F}^+(w)=\{g_1,g_2,\dots , {g}_{s}\}\). Since each \(\mathcal A_i\) contains at least 2 \(g_j\)’s (Claim 1) and each \(g_j\) is contained in exactly \(((n-k)!)^{k-1}\) number of \(\mathcal A_i\), we conclude that

$$\begin{aligned} 2((n-k+1)!)^{k-1} \le s((n-k)!)^{k-1}. \end{aligned}$$

So,

$$\begin{aligned} \vert \mathcal F^+(w)\vert \ge s\ge 2(n-k+1)^{k-1}>n^{k-1}, \end{aligned}$$

provided that \(n\ge 3(k-1)^2\). This completes the proof of Theorem 1.2. \(\square \)