1 Introduction

According to the famous Lyapunov inequality [22], for a continuous function \(a=a(x)\) on the interval \([b,c]\subset {\mathbb {R}} ,\) the validity of

$$\begin{aligned} \int _{b}^{c}\left| a(x)\right| \ dx>\frac{4}{c-b} \end{aligned}$$
(1)

is a necessary condition for the existence of a non-trivial solution u to the boundary value problem

$$\begin{aligned} \left\{ \begin{array}{ll} u^{\prime \prime }+a(x)u=0, &{} \text {in }(b,c), \\ u(b)=0=u(c). &{} \end{array} \right. \end{aligned}$$

Many generalizations of (1) have been established in the literature. For our purposes, the generalization to second-order half-linear equation

$$\begin{aligned} \begin{array}{ll} (\phi _{p}(u^{\prime }))^{\prime }+a(x)\phi _{p}(u)=0,&x\in (b,c), \end{array} \end{aligned}$$
(2)

is important. Here \(p>1\) and \(\phi _{p}(u)=\left| u\right| ^{p-2}u.\) From Zhang [28] we can read the following optimal Lyapunov-type inequalities for problem (2):

  1. 1.

    if (2) with Dirichlet, Neumann or anti-periodic boundary conditions has a non-trivial solution, then

    $$\begin{aligned} \int _{b}^{c}a^{+}(x)\ dx>\frac{2^{p}}{(c-b)^{p-1}} \end{aligned}$$
    (3)
  2. 2.

    if (2) with periodic boundary conditions has a non-trivial solution, then

    $$\begin{aligned} \int _{b}^{c}a^{+}(x)\ dx>\frac{4^{p}}{(c-b)^{p-1}}. \end{aligned}$$
    (4)

Here, and in what follows, \(a^{+}(x)=\max \{a(x),0\}.\)

The Lyapunov-type inequalities have proved to be useful tools in the oscillation theory, eigenvalue problems, disconjugacy, and numerous other applications for theories of differential and difference equations (we refer the reader to some survey articles and books [8, 10, 23, 25] and the references therein). Compared to the large number of references to continuous Lyapunov-type inequalities, little has been done for discrete Lyapunov-type inequalities. Let us list the works in which the Lyapunov-type inequality appears in a discrete context: for difference equations see [9,10,11, 18,19,20,21, 31], for discrete systems see [15, 16, 26, 27, 29, 30, 32], for fractional discrete problems see [12,13,14] and for problems on time scales (as these kind of problems include difference equations) see [1,2,3,4,5,6, 17, 24].

The aim of this paper is to give sharp Lyapunov-type inequalities for the second-order difference problem with p-laplacian

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta (\phi _{p}(\Delta u(k-1)))+a(k)\phi _{p}(u(k))=0, &{} \quad k\in [1,T] \\ B_{l}(u)=0, &{} \end{array} \right. \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \textit{(}{{P}_{l}}) \end{aligned}$$

where

$$\begin{aligned} B_{D}(u)= & {} 0\quad \text {is an abbreviation for}\quad u(0)=0=u(T+1), \\ B_{N}(u)= & {} 0\quad \text {is an abbreviation for}\quad \Delta u(0)=0=\Delta u(T), \\ B_{DN}(u)= & {} 0\quad \text {is an abbreviation for}\quad u(0)=0=\Delta u(T) \\ B_{ND}(u)= & {} 0\quad \text {is an abbreviation for}\quad \Delta u(0)=0=u(T+1), \\ B_{P}(u)= & {} 0\quad \text {is an abbreviation for}\quad u(0)-u(T+1)=0=\Delta u(0)-\Delta u(T), \\ B_{AP}(u)= & {} 0\quad \text {is an abbreviation for}\quad u(0)+u(T+1)=0=\Delta u(0)+\Delta u(T), \end{aligned}$$

i.e. the problem \(({{P}_{l}})\) is considered with Dirichlet (D), Neumann (N), mixed (DN and ND), periodic (P) and anti-periodic (AP) boundary conditions. Here \(1<p<\infty ,\), \(T\in {\mathbb {N}} ,\) \(T\ge 2\), \([1,T]=\{1,\ldots ,T\},\ \) \(a:[1,T]\rightarrow {\mathbb {R}} ,\) i.e. \(a\in {\mathbb {R}} ^{T}\), \(u:[0,T+1]\rightarrow {\mathbb {R}} \) and \(\Delta \) denotes the forward difference operator, that is, \(\Delta u(k)=u(k+1)-u(k).\)

Partial results can be found in the literature. In 1983, Cheng [9] first obtained the following Lyapunov-type inequality, which is an optimal discrete analogue of (1):

$$\begin{aligned} \sum _{k=1}^{T}a(k)\ge \left\{ \begin{array}{ll} \frac{2}{T}+\frac{2}{T+2} &{} \quad \text {if }T\text { is even,} \\ \frac{4}{T+1} &{} \quad \text {if }T\text { is odd,} \end{array} \right. \end{aligned}$$

for problem \(( P _{D})\) with \(p=2\) and nonnegative \(a\in {\mathbb {R}} ^{T}\). Since the second-order difference equation \(( P _{D})\) can be expressed as an equivalent Hamiltonian system, we can deduce new Lyapunov-type inequalities from Lyapunov-type inequalities obtained for discrete systems. Such results can be found in [15, 16, 26, 27, 29, 30, 32]. From [16, Corollary 2.5], we can read the following Lyapunov-type inequality for problem \(( P _{D})\):

$$\begin{aligned} \sum _{k=1}^{T}a^{+}(k)\ge \frac{2^{p}}{(T+1)^{p-1}}, \end{aligned}$$

which is optimal only if T is odd.

Problems on time scales include difference equations. In [3, Corrolary 4.1.7], we find the following Lyapunov-type inequality:

$$\begin{aligned} \sup _{n\in [1,T]}\left| \sum _{k=1}^{n}a(k)\right| >\frac{1}{ T+1} \end{aligned}$$

for problem \(( P _{DN})\) with \(p=2\) and

$$\begin{aligned} \sup _{n\in [1,T]}\left| \sum _{k=n}^{T}a(k)\right| >\frac{1}{ T+1} \end{aligned}$$

for problem \(( P _{ND})\) with \(p=2\).

Lyapunov-type inequalities for higher order difference equations can be found in [19,20,21, 31]. In [21], the second order case reads as follows

$$\begin{aligned} \left\{ \begin{array}{ll} \left| \Delta ^{2}u(k)\right| ^{p-2}\Delta ^{2}u(k)+a(k)\left| u(k)\right| ^{p-2}u(k)=0, &{} \quad k\in [0,T-1] \\ u(0)+u(T)=0,\,\Delta u(0)+\Delta u(T)=0, &{} \end{array} \right. \end{aligned}$$
(5)

which differs from \(( P _{AP})\) even for \(p=2\). By [21, Corollary 3], the existence of non-trivial solution for problem (5) implies

$$\begin{aligned} \sum _{k=0}^{T-1}\left| a(k)\right| ^{p^{\prime }}\ge \frac{2^{2p}}{ T^{(2p-1)}}, \end{aligned}$$

where \(p^{\prime }\) is a conjugate exponent, i.e. \(1/p+1/p^{\prime }=1.\)

The structure of the paper is the following: in Sect. 2, we formulate our main result in which we give the sharp Lyapunov-type inequalities for problems \(({{P}_{l}})\). In Sect. 3, we prove our main theorem. The proof is based on finding a minimum of some especial minimization problems, see [8] for the use of such methods.

2 The main result

In this section, we state our main result. By solution space of problem \(({{P}_{l}})\) we mean T-dimensional vector space

$$\begin{aligned} X_{l}=\{u:[0,T+1]\rightarrow {\mathbb {R}} :B_{l}(u)=0\} \end{aligned}$$

for \(l=D,N,DN,ND,P\) and AP,  respectively.

Theorem 1

Let \(1<p<\infty \) and \(a\in {\mathbb {R}} ^{T}.\) The following statements hold.

  1. 1.

    If \(( P _{D})\) has a non-trivial solution in \(X_{D}\), then

    $$\begin{aligned} \sum _{k=1}^{T}a^{+}(k)\ge \left\{ \begin{array}{ll} \left( \frac{2}{T}\right) ^{p-1}+\left( \frac{2}{T+2}\right) ^{p-1} &{} \text { if }T\text { is even,} \\ \frac{2^{p}}{(T+1)^{p-1}} &{} \text {if }T\text { is odd.} \end{array} \right. \end{aligned}$$
  2. 2.

    If \(( P _{N})\) with a nonnegative \(a\in {\mathbb {R}} ^{T}\) has a non-trivial solution in \(X_{N}\), then

    $$\begin{aligned} \sum _{k=1}^{T}a(k)\ge \frac{2^{p}}{(T-1)^{p-1}}. \end{aligned}$$
  3. 3.

    If \(( P _{DN})\) or \(( P _{ND})\) has a non-trivial solution in \(X_{DN}\) and \(X_{ND}\), respectively, then

    $$\begin{aligned} \sum _{k=1}^{T}a^{+}(k)\ge \frac{1}{T^{p-1}}. \end{aligned}$$
  4. 4.

    If \(( P _{P})\) with a nonnegative \(a\in {\mathbb {R}} ^{T}\) has a non-trivial solution in \(X_{P}\), then

    $$\begin{aligned} \sum _{k=1}^{T}a(k)\ge \left\{ \begin{array}{ll} \frac{1}{2}\left( \frac{4^{p}}{T^{p-1}}+\frac{4^{p}}{(T+2)^{p-1}}\right) &{} \quad \text {if }T\text { is even,} \\ \frac{4^{p}}{(T+1)^{p-1}} &{} \quad \text {if }T\text { is odd.} \end{array} \right. \end{aligned}$$
  5. 5.

    If \(( P _{AP})\) has a non-trivial solution in \(X_{AP}\), then

    $$\begin{aligned} \sum _{k=1}^{T}a^{+}(k)\ge \frac{2^{p}}{(T+1)^{p-1}}. \end{aligned}$$

    Moreover, the inequalities are sharp in the sense that there are \(a\in {\mathbb {R}} ^{T}\) satisfying above conditions with equality and the corresponding problems have a non-trivial solution.

Let us make a point of the important difference between the discrete and the continuous case: in the optimal Lyapunov-type inequalities (3) and (4), the inequality is strict (see [28] and [8, Remark 2.4]).

3 Proof of the main result

Using the summation by parts formula:

$$\begin{aligned} \sum _{k=1}^{T+1}u(k-1)\Delta v(k-1)=u(T)v(T+1)-u(0)v(0)-\sum _{k=1}^{T}\Delta u(k-1)v(k) \end{aligned}$$

we have

$$\begin{aligned} \sum _{k=1}^{T+1}\phi _{p}(\Delta u(k-1))\Delta v(k-1)= & {} \phi _{p}(\Delta u(T))v(T+1)-\phi _{p}(\Delta u(0))v(0)\\&-\sum _{k=1}^{T}\Delta (\phi _{p}(\Delta u(k-1)))v(k). \end{aligned}$$

Then, it is easy to check that \(u\in X_{l}\) is a solution to problem \(({{P}_{l}})\) if and only if \(u\in X_{l}\) satisfies

$$\begin{aligned} \sum _{k=1}^{T+1}\phi _{p}(\Delta u(k-1))\Delta v(k-1)=\sum _{k=1}^{T}a(k)\phi _{p}(u(k))v(k)\quad \text {for every }v\in X_{l}. \end{aligned}$$
(6)

On \(X_{l},\) \(l=D,N,DN,ND,P,AP,\) we define norm

$$\begin{aligned} \left\| u\right\| _{\infty }=\max _{k\in [1,T]}\left| u(k)\right| . \end{aligned}$$

We will also use the following notation

$$\begin{aligned} \left\| \Delta u\right\| _{p}=\left( \sum _{k=1}^{T+1}\left| \Delta u(k-1)\right| ^{p}\right) ^{\frac{1}{p}} \end{aligned}$$

for \(p>1\) and \(u\in X_{l}.\)

To prove our main result, we define some numbers:

$$\begin{aligned} \lambda _{l}=\inf _{u\in X_{l}\smallsetminus \{0\}}\frac{\left\| \Delta u\right\| _{p}^{p}}{\left\| u\right\| _{\infty }^{p}} \end{aligned}$$

if \(l=D,DN,ND,AP\) and

$$\begin{aligned} \lambda _{l}=\inf _{u\in X_{l}\smallsetminus C }\sup _{r\in {\mathbb {R}} }\frac{\left\| \Delta u\right\| _{p}^{p}}{\left\| u+r\right\| _{\infty }^{p}} \end{aligned}$$
(7)

if \(l=N,P\), where \( C \) denotes the set of constant functions on \( [0,T+1].\)

First, we find the values of numbers \(\lambda _{l}.\)

Lemma 2

Let \(1<p<\infty .\) The following statements hold.

  1. (i)
    $$\begin{aligned} \lambda _{D}=\left\{ \begin{array}{ll} \left( \frac{2}{T}\right) ^{p-1}+\left( \frac{2}{T+2}\right) ^{p-1} &{} \quad \text { if }T\text { is even,} \\ \frac{2^{p}}{(T+1)^{p-1}} &{} \quad \text {if }T\text { is odd} \end{array} \right. \end{aligned}$$

    and \(\lambda _{D}\) is attained by \(u_{D}(k)=\left\{ \begin{array}{ll} \frac{k}{n_{0}} &{} \quad \text {if }k\in [0,n_{0}]\text {,} \\ \frac{T+1-k}{T+1-n_{0}} &{} \quad \text {if }k\in [n_{0}+1,T+1]\text {,} \end{array} \right. \) where \(n_{0}=\frac{T}{2}\)    if T is even and \(n_{0}=\frac{T+1}{2} \) if T is odd.

  2. (ii)
    $$\begin{aligned} \lambda _{N}=\frac{2^{p}}{(T-1)^{p-1}} \end{aligned}$$

    and \(\lambda _{N}\) is attained by \(u_{N}(k)=\left\{ \begin{array}{ll} -1 &{} \quad \text {if }k=0\text {,} \\ -1+\frac{2(k-1)}{T-1} &{} \quad \text {if }k\in [1,T]\text {,} \\ 1 &{} \quad \text {if }k=T+1. \end{array} \right. \)

  3. (iii)
    $$\begin{aligned} \lambda _{DN}=\lambda _{ND}=\frac{1}{T^{p-1}} \end{aligned}$$

    and \(\lambda _{DN}\) is attained by \(u_{DN}(k)=\left\{ \begin{array}{ll} \frac{k}{T} &{} \quad \text {if }k\in [0,T]\text {,} \\ 1 &{} \quad \text {if }k=T+1\text {,} \end{array} \right. \) and \(\lambda _{ND}\) is attained by \(u_{ND}(k)=\left\{ \begin{array}{ll} 1 &{} \quad \text {if }k=0\text {,} \\ \frac{T+1-k}{T} &{} \quad \text {if }k\in [0,T]\text {.} \end{array} \right. \)

  4. (iv)
    $$\begin{aligned} \lambda _{P}=\left\{ \begin{array}{ll} \frac{1}{2}\left( \frac{4^{p}}{T^{p-1}}+\frac{4^{p}}{(T+2)^{p-1}}\right) &{} \quad \text {if }T\text { is even,} \\ \frac{4^{p}}{(T+1)^{p-1}} &{} \quad \text {if }T\text { is odd.} \end{array} \right. \end{aligned}$$

    and \(\lambda _{P}\) is attained by \(u_{P}(k)=\left\{ \begin{array}{ll} -1+\frac{2}{T+1-n_{0}} &{} \quad \text {if }k=0\text {,} \\ -1+\frac{2(k-1)}{n_{0}} &{} \quad \text {if }k\in [1,n_{0}+1]\text {,} \\ 1-\frac{2(k-1-n_{0})}{T+1-n_{0}} &{} \quad \text {if }k\in [n_{0}+2,T+1], \end{array} \right. \) where \(n_{0}=\frac{T}{2}\) if T is even and \(n_{0}=\frac{T+1}{2} \) if T is odd.

  5. (v)
    $$\begin{aligned} \lambda _{AP}=\frac{2^{p}}{(T+1)^{p-1}} \end{aligned}$$

    and \(\lambda _{AP}\) is attained by \(u_{AP}(k)=\left\{ \begin{array}{ll} 1-\frac{2}{T+1} &{} \quad \text {if }k=0\text {,} \\ 1-\frac{2(k-1)}{T+1} &{}\quad \text {if }k\in [1,T+1]\text {.} \end{array} \right. \)

Proof

(i) For the proof see [7, Lemma 4].

(ii) First, we observe that the supremum in (7) with respect to r is attained whenever

$$\begin{aligned} \max _{k\in [1,T]}(u(k)+r)=-\min _{k\in [1,T]}(u(k)+r), \end{aligned}$$

since, if \(\max (u+r)\ne -\min (u+r)\) we can change r a little and decrease the norm \(\left\| u+r\right\| _{\infty }.\) Moreover, since for any \(u\in X_{N}\) and \(r\in {\mathbb {R}} \) we have \(\Delta (u+r)=\Delta u\) and functions in the numerator and denominator in (7) are homogeneous of degree p,  we have

$$\begin{aligned} \lambda _{N}=\inf _{u\in X_{N}\smallsetminus C }\sup _{r\in {\mathbb {R}} }\frac{\left\| \Delta (u+r)\right\| _{p}^{p}}{\left\| u+r\right\| _{\infty }^{p}}=\inf _{u\in Z_{N}}\left\| \Delta u\right\| _{p}^{p}, \end{aligned}$$

where

$$\begin{aligned} Z_{N}=\{u\in X_{N}:\max _{k\in [1,T]}u(k)=-\min _{k\in [1,T]}u(k)=1\}. \end{aligned}$$

Next, since \(Z_{N}\) is compact, there exists \(u_{N}\in Z_{N}\) which minimizes \(\left\| \Delta \cdot \right\| _{p}^{p}\) over \(Z_{N}\) and there are \(1\le k_{1}<k_{2}\le T\) such that \(\left| u_{N}(k_{1})\right| =\left| u_{N}(k_{2})\right| =1,\) \( u_{N}(k_{1})=-u_{N}(k_{2})\) and \(\left| u_{N}(k)\right| <1\) on \( [k_{1}+1,k_{2}-1]\) if \([k_{1}+1,k_{2}-1]\ne \emptyset .\) There is no loss of generality in assuming \(u_{N}(k_{1})=-1\) and \(u_{N}(k_{2})=1.\)

Now, the minimality property of \(u_{N}\) allows us to infer about the geometry of such a function.

First, we deduce that

$$\begin{aligned} u_{N}(k-1)\le u_{N}(k)\quad \text {for all }k\in [k_{1}+1,k_{2}]. \end{aligned}$$
(8)

Suppose, to derive a contradiction, that there is \(i\in [k_{1}+1,k_{2}]\) such that \(u_{N}(i-1)>u_{N}(i).\) Then we can find some \( j\in [i,k_{2}-1]\) fulfilling

$$\begin{aligned} u_{N}(j)\le u_{N}(i-1)\le u_{N}(j+1). \end{aligned}$$

Thus, setting

$$\begin{aligned} w(k)=\left\{ \begin{array}{l@{\quad }l} u_{N}(k) &{} \text {if }k\in [0,i-1]\text {,} \\ u_{N}(i-1) &{} \text {if }k\in [i,j]\text {,} \\ u_{N}(k) &{} \text {if }k\in [j+1,T+1] \end{array} \right. \end{aligned}$$

we obtain \(w\in Z_{N}\) such that

$$\begin{aligned} \left\| \Delta u_{N}\right\| _{p}^{p}-\left\| \Delta w\right\| _{p}^{p}= & {} \sum _{k=1}^{T+1}\left[ \left| \Delta u_{N}(k-1)\right| ^{p}-\left| \Delta w(k-1)\right| ^{p}\right] \\= & {} \sum _{k=i}^{j}\left| \Delta u_{N}(k-1)\right| ^{p}+\left[ u_{N}(j+1)-u_{N}(j)\right] ^{p} \\&-\left[ u_{N}(j+1)-u_{N}(i-1)\right] ^{p}\ge \sum _{k=i}^{j}\left| \Delta u_{N}(k-1)\right| ^{p}>0, \end{aligned}$$

i.e. \(\left\| \Delta w\right\| _{p}^{p}<\left\| \Delta u_{N}\right\| _{p}^{p},\) a contradiction.

Next, we note that \(u_{N}=-1\) on \([0,k_{1}]\) and \(u_{N}=1\) on \( [k_{2},T+1],\) since otherwise we could define \(w\in Z_{N}\) by putting \( w(k)=-1\) on \([0,k_{1}],\) \(w(k)=1\) on \([k_{2},T+1]\) and \(w\left( k\right) =u_{N}(k)\) on \([k_{1}+1,k_{2}-1],\) thus getting \(\left\| \Delta w\right\| _{p}^{p}<\left\| \Delta u_{N}\right\| _{p}^{p},\) which is impossible.

Now, we prove that

$$\begin{aligned} k_{1}=1, \end{aligned}$$
(9)

arguing by contradiction. So, assume that \(k_{1}>1.\) Since we have \( u_{N}(k_{1}+1)=-1+\alpha \) for some \(\alpha >0\), we define \(w\in Z_{N}\) by putting \(w(k_{1})=-1+\alpha /2\) and \(w(k)=u_{N}(k)\) for \(k\ne k_{1}\) and we get

$$\begin{aligned} \left\| \Delta u_{N}\right\| _{p}^{p}-\left\| \Delta w\right\| _{p}^{p}=\alpha ^{p}-\left( \frac{\alpha }{2}\right) ^{p}-\left( \frac{ \alpha }{2}\right) ^{p}=\left( \frac{\alpha }{2}\right) ^{p}\left( 2^{p}-2\right) >0, \end{aligned}$$

a contradiction.

Similar arguments lead to

$$\begin{aligned} k_{2}=T. \end{aligned}$$
(10)

Relations (8), (9) and (10) give us \( \Delta u_{N}(k)\ge 0\) for \(k\in [1,T-1],\) \(u_{N}(1)=-1\) and \( u_{N}(T)=1.\) Hence

$$\begin{aligned} \sum _{k=1}^{T-1}\Delta u_{N}(k)=2. \end{aligned}$$

By the Hölder inequality, we have

$$\begin{aligned} 2=\sum _{k=1}^{T-1}\Delta u_{N}(k)\le (T-1)^{\frac{1}{p^{\prime }}}\left( \sum _{k=1}^{T-1}(\Delta u_{N}(k))^{p}\right) ^{\frac{1}{p}}=(T-1)^{\frac{p-1 }{p}}\left\| \Delta u_{N}\right\| _{p} \end{aligned}$$

where the equality holds if \(\Delta u_{N}(k)=\frac{2}{T-1}\) for \(k\in [1,T-1],\) by the equality condition for the Hölder inequality. Hence, by the minimality property of \(u_{N},\) we must have \(\left\| \Delta u_{N}\right\| _{p}^{p}=\frac{2^{p}}{(T-1)^{p-1}}\) and \(\Delta u_{N}(k)=\frac{2}{T-1}\) for \(k\in [1,T-1].\) Now, we can easily establish the formula on \(u_{N}.\) This proves (ii).

(iii) Let \(Z_{DN}=\{u\in X_{DN}:\left\| u\right\| _{\infty }=1\}.\) Then

$$\begin{aligned} \lambda _{DN}=\inf _{u\in Z_{DN}}\left\| \Delta u\right\| _{p}^{p} \end{aligned}$$

and, by compactness, \(\lambda _{DN}\) is attained by, say, \(u_{DN}.\) There is no loss of generality in assuming \(u_{DN}(k_{0})=1\) for some \(k_{0}\in [1,T].\) Arguing in the similar way as in (ii), we can see that \( k_{0}=T\) and \(u_{DN}\) is nondecreasing on [1, T],  i.e. \(\Delta u_{DN}(k-1)\ge 0\) for \(k\in [1,T].\) Since \(u_{DN}(0)=0,\) we have \( \sum _{k=1}^{T}\Delta u_{DN}(k-1)=1\) and the Hölder inequality gives us

$$\begin{aligned} 1\le T^{\frac{p-1}{p}}\left\| \Delta u_{DN}\right\| _{p}, \end{aligned}$$

where the equality holds if \(\Delta u_{DN}(k-1)=\frac{1}{T}\) for \(k\in [1,T].\) Hence, by the minimality property of \(u_{DN}\), we must have \( \left\| \Delta u_{DN}\right\| _{p}^{p}=\frac{1}{T^{p-1}}\) and \(\Delta u_{DN}(k-1)=\frac{1}{T}\) for \(k\in [1,T].\) Now, the formula on \( u_{DN}\) follows easily. Similar arguments we can apply to \(\lambda _{ND}.\)

(iv) As in the proof of (ii), we show that \(\lambda _{P}=\inf _{u\in Z_{P}}\left\| \Delta u\right\| _{p}^{p},\) where \(Z_{P}=\{u\in X_{P}:\max _{k\in [1,T]}u(k)=-\min _{k\in [1,T]}u(k)=1\}\). There exists \(u_{P}\in Z_{P}\) which minimizes \(\left\| \Delta \cdot \right\| _{p}^{p}\) over \(Z_{P}\) and there are \(1\le k_{1}<k_{2}\le T\) such that \(\left| u_{P}(k_{1})\right| =\left| u_{P}(k_{2})\right| =1,\) \(u_{P}(k_{1})=-u_{P}(k_{2})\) and \(\left| u_{P}(k)\right| <1\) on \([k_{1}+1,k_{2}-1]\) if \([k_{1}+1,k_{2}-1]\ne \emptyset .\) Without restriction of generality, we can assume that \( u_{P}(k_{1})=-1\) and \(u_{P}(k_{2})=1.\) The analysis similar to that in the proof of (ii) shows first that \(u_{P}\) is nondecreasing on \([k_{1},k_{2}],\) next that \(u_{P}\) is nonincreasing on \([1,k_{1}]\) and \([k_{2},T],\) and finally that \(u_{P}\) is nonincreasing on \([0,k_{1}]\) and \([k_{2},T+1],\) where in the last step we have to simultaneously change the function at the ends of the intervals. So, we have \(\Delta u_{P}(k)\ge 0\) for \(k\in [k_{1},k_{2}-1]\) and \(\Delta u_{P}(k)\le 0\) for \(k\in [0,k_{1}-1]\cup [k_{2},T].\) Since \(u_{P}(0)=u_{P}(T+1),\) we have

$$\begin{aligned} \sum _{k\in [k_{1},k_{2}-1]}\Delta u_{P}(k)=2\text { and } \sum _{k\in [0,k_{1}-1]\cup [k_{2},T]}\Delta u_{P}(k)=-2. \end{aligned}$$

Let \(n=k_{2}-k_{1}.\) By Hölder inequality we have

$$\begin{aligned} 2=\sum _{k\in [k_{1},k_{2}-1]}\Delta u_{P}(k)\le n^{\frac{p-1}{p} }\left( \sum _{k\in [k_{1},k_{2}-1]}\left| \Delta u_{P}(k)\right| ^{p}\right) ^{\frac{1}{p}}, \end{aligned}$$

where the equality holds if

$$\begin{aligned} \Delta u_{P}(k)=\frac{2}{n},\quad k\in [k_{1},k_{2}-1]\ \end{aligned}$$
(11)

and

$$\begin{aligned} 2=\sum _{k\in [0,k_{1}-1]\cup [k_{2},T]}\left( -\Delta u_{P}(k)\right) \le (T+1-n)^{\frac{p-1}{p}}\left( \sum _{k\in [0,k_{1}-1]\cup [k_{2},T]}\left| \Delta u_{P}(k)\right| ^{p}\right) ^{\frac{1}{p}}, \end{aligned}$$

where the equality holds if

$$\begin{aligned} \Delta u_{P}(k)=\frac{2}{T+1-n},\quad k\in [0,k_{1}-1]\cup [k_{2},T]. \end{aligned}$$
(12)

Hence, by the minimality property of \(u_{P}\), we must have

$$\begin{aligned} \left\| \Delta u_{P}\right\| _{p}^{p}=\frac{2^{p}}{n^{p-1}}+\frac{2^{p} }{(T+1-n)^{p-1}} \end{aligned}$$

and (11) and (12) are satisfied. Observe that the function

$$\begin{aligned}{}[1,T]\ni n\longmapsto \frac{2^{p}}{n^{p-1}}+\frac{2^{p}}{(T+1-n)^{p-1}} \end{aligned}$$

attains its minimum at \(n_{0}=\frac{T+1}{2}\) if T is odd and at \(n_{0}= \frac{T}{2}\) or, equivalently, \(n_{0}=\frac{T+2}{2}\) if T is even. This gives \(\lambda _{P}\) in (iv). Moreover, to give an explicit formula for \( u_{P}\) we can arbitrarily choose \(k_{1}\) from \([1,n_{0}-1],\) so if \( k_{1}=1,\) \(u_{P}\) is given by the formula in (iv).

(v) Let \(Z_{AP}=\{u\in X_{AP}:\left\| u\right\| _{\infty }=1\}.\) Then \(\lambda _{AP}=\inf _{u\in Z_{AP}}\left\| \Delta u\right\| _{p}^{p}\) and there exists \(u_{AP}\in Z_{AP}\) which minimizes \(\left\| \Delta \cdot \right\| _{p}^{p}\) over \(Z_{AP}.\) So we can find \(1\le k_{0}\le T \) such that \(\left| u_{AP}(k_{0})\right| =1.\) Without any loss of generality, we may assume that \(u_{AP}(k_{0})=1.\) The analysis similar to that in the proof of (ii) shows first that \(u_{AP}\) is nondecreasing on \( [1,k_{0}]\) and nonincreasing on \([k_{0},T]\) and next that \(u_{AP}\) is nondecreasing on \([0,k_{0}]\) and nonincreasing on \([k_{0},T+1].\) So, we have \(\Delta u_{AP}(k)\ge 0\) for \(k\in [0,k_{0}-1]\) and \(\Delta u_{AP}(k)\le 0\) for \(k\in [k_{0},T].\) Since \( u_{AP}(0)=-u_{AP}(T+1),\) we have

$$\begin{aligned} 2= & {} 1-u_{AP}(0)+1-u_{AP}(T+1)=\sum _{k\in [0,k_{0}-1]}\Delta u_{AP}(k)+\sum _{k\in [k_{0},T]}(-\Delta u_{AP}(k)) \\= & {} \sum _{k\in [0,T]}\left| \Delta u_{AP}(k)\right| \le (T+1)^{\frac{p-1}{p}}\left( \sum _{k\in [0,T]}\left| \Delta u_{AP}(k)\right| ^{p}\right) ^{\frac{1}{p}}, \end{aligned}$$

where the equality holds if

$$\begin{aligned} \Delta u_{AP}(k)=\frac{2}{T+1}\text { for }k\in [0,k_{0}-1]\text { and }\Delta u_{AP}(k)=-\frac{2}{T+1}\quad \text { for }k\in [k_{0},T],\nonumber \\ \end{aligned}$$
(13)

by the equality condition for the Hölder inequality. Hence, by the minimality property of \(u_{AP},\) we must have \(\left\| \Delta u_{AP}\right\| _{p}^{p}=\frac{2^{p}}{(T+1)^{p-1}}\) and (13). This gives \(\lambda _{AP}\) in (v). Moreover, to give an explicit formula for \( u_{AP}\) we can arbitrarily choose \(k_{0}\) from [1, T],  so if \(k_{0}=1,\) \(u_{AP}\) is given by the formula in (v). \(\square \)

We will also need the following lemma.

Lemma 3

Let \(1<p<\infty ,\) \(a\in {\mathbb {R}} ^{T}\) be nonnegative and let \(u\in X_{l}\) be any solution of \(({{P}_{l}})\) for \(l=N\) or \(l=P\). Then

$$\begin{aligned} \sum _{k=1}^{T}a(k)\left| u(k)\right| ^{p}\le \sum _{k=1}^{T}a(k)\left| u(k)+r\right| ^{p} \end{aligned}$$

for every \(r\in {\mathbb {R}}.\)

Proof

Let \(\sigma : {\mathbb {R}} \rightarrow {\mathbb {R}} \) be a function defined by \(\sigma (r)=\sum _{k=1}^{T}a(k)\left| u(k)+r\right| ^{p}.\) Then \(\sigma \) is differentiable with

$$\begin{aligned} \sigma ^{\prime }(r)=p\sum _{k=1}^{T}a(k)\left| u(k)+r\right| ^{p-2}\left( u(k)+r\right) . \end{aligned}$$

As u is the solution of \(({{P}_{l}})\), taking a constant test function in (6), we obtain \(\sigma ^{\prime }(0)=0.\) Since \(t\mapsto \left| t\right| ^{p-2}t\) is increasing on \( {\mathbb {R}} \) and a is a nonnegative and non-trivial function, we see that the function \(\sigma \) attains its unique minimum at \(r=0,\) and this is precisely the assertion of the lemma. \(\square \)

Now we are ready to give the proof of the main theorem.

Proof of Theorem 1

First, let us note that for any l,  if \(u\in X_{l}\) is a non-trivial solution to problem \(({{P}_{l}})\), then taking in the formula (6) the test function \(v=u\), we get

$$\begin{aligned} \sum _{k=1}^{T+1}\left| \Delta u(k-1)\right| ^{p}=\sum _{k=1}^{T}a(k)\left| u(k)\right| ^{p}. \end{aligned}$$
(14)

Let \(l=N\) or \(l=P.\) Assume \(a\in {\mathbb {R}} ^{T}\) be nonnegative and let \(u\in X_{l}\) be a non-trivial solution to problem \(({{P}_{l}})\) . From (14) and Lemma 3, we obtain

$$\begin{aligned} \left\| \Delta u\right\| _{p}^{p}=\sum _{k=1}^{T+1}\left| \Delta u(k-1)\right| ^{p}=\sum _{k=1}^{T}a(k)\left| u(k)\right| ^{p}\le \sum _{k=1}^{T}a(k)\left| u(k)+r\right| ^{p}\le \left\| a\right\| _{1}\left\| u+r\right\| _{\infty }^{p} \end{aligned}$$

for any \(r\in {\mathbb {R}} \), where \(\left\| a\right\| _{1}=\sum _{k=1}^{T}\left| a(k)\right| .\) As u is a nonconstant solution, \(u+r\) is a non-trivial function. Consequently

$$\begin{aligned} \left\| a\right\| _{1}\ge \frac{\left\| \Delta u\right\| _{p}^{p}}{\left\| u+r\right\| _{\infty }^{p}} \end{aligned}$$

for any \(r\in {\mathbb {R}} \), i.e. \(\left\| a\right\| _{1}\ge \lambda _{l}.\)

In the cases \(l=D,\) \(l=DN,\) \(l=ND\) and \(l=AP,\) if \(u\in X_{l}\) is a non-trivial solution to problem \(({{P}_{l}})\), we have

$$\begin{aligned} \left\| \Delta u\right\| _{p}^{p}=\sum _{k=1}^{T}a(k)\left| u(k)\right| ^{p}\le \sum _{k=1}^{T}a^{+}(k)\left| u(k)\right| ^{p}\le \left\| a^{+}\right\| _{1}\left\| u\right\| _{\infty }^{p}, \end{aligned}$$

which gives \(\left\| a^{+}\right\| _{1}\ge \lambda _{l}.\)

Now, applying Lemma 2, we obtain inequalities in Theorem 1. To prove the sharpness of inequalities, we again use Lemma 2. It is easy to check that:

  1. (i)

    \(u_{D}\) from Lemma 2 (i) is a non-trivial solution to problem \(( P _{D})\) if \(a\in {\mathbb {R}} ^{T}\) is defined by \(a(n_{0})=\) \(\lambda _{D}\) and \(a(k)=0\) in other cases. Then, we have \(\left\| a\right\| _{1}=\lambda _{D};\)

  2. (ii)

    \(u_{N}\) from Lemma 2 (ii) is a non-trivial solution to problem \(( P _{N})\) if \(a\in {\mathbb {R}} ^{T}\) is defined by \(a(1)=a(T)=\frac{1}{2}\) \(\lambda _{N}\) and \(a(k)=0\) in other cases. Then, we have \(\left\| a\right\| _{1}=\lambda _{N};\)

  3. (iii)

    \(u_{DN}\) from Lemma 2 (iii) is a non-trivial solution to problem \(( P _{DN})\) if \(a\in {\mathbb {R}} ^{T}\) is defined by \(a(T)=\) \(\lambda _{DN}\) and \(a(k)=0\) in other cases. Then, we have \(\left\| a\right\| _{1}=\lambda _{DN};\)

  4. (iv)

    \(u_{ND}\) from Lemma 2 (iii) is a non-trivial solution to problem \(( P _{ND})\) if \(a\in {\mathbb {R}} ^{T}\) is defined by \(a(1)=\) \(\lambda _{ND}\) and \(a(k)=0\) in other cases. Then, we have \(\left\| a\right\| _{1}=\lambda _{ND};\)

  5. (v)

    \(u_{P}\) from Lemma 2 (iv) is a non-trivial solution to problem \(( P _{P})\) if \(a\in {\mathbb {R}} ^{T}\) is defined by \(a(1)=a(n_{0}+1)=\frac{1}{2}\) \(\lambda _{P}\) and \( a(k)=0\) in other cases. Then, we have \(\left\| a\right\| _{1}=\lambda _{P}.\)

  6. (vi)

    \(u_{AP}\) from Lemma 2 (v) is a non-trivial solution to problem \(( P _{AP})\) if \(a\in {\mathbb {R}} ^{T}\) is defined by \(a(1)=\) \(\lambda _{AP}\) and \(a(k)=0\) in other cases. Then, we have \(\left\| a\right\| _{1}=\lambda _{AP}.\)

This completes the proof. \(\square \)