Algorithm and top-points. Problem: For an array $A[1],\dots,A[n]$, with $n\geq 3$, it holds that $$A[i+1]>\frac{A[i]+A[i+2]}{2},\qquad i\in \{1,2,\dots, n-2\}$$
That is, it holds that
$$A[2]>\frac{A[1]+A[3]}{2},\dots, A[n-1]>\frac{A[n-2]+A[n]}{2}.$$
i) Prove that if all numbers $A[1],\dots, A[n]$ are different, then the array has at most one top-point.
ii) Prove that the array has at most two top-points, and give an example where it has two top-points.
My attempt: i) Let $X[i]:=\frac{A[i]+A[i+2]}{2}$. I can start to assume that $A[1]\neq \dots \neq A[n]$. Then there are many cases to find it out. I think it's suitable to prove for each cases, 


*

*$A[1]<\dots <A[n]$,

*$A[1]>\dots >A[n]$,

*$A[1]<\dots<A[n-j]$ and $A[n-j]>\dots >A[n]$ for $3\leq j\leq n$.


Assume  that $A[1]< \dots <A[n]$. Then 
$$A[i+2]>A[i+1]>X[i]\implies A[i+2]>A[i].$$
We see that
$$A[i+1]>X[i]\iff A[i+2]<2A[i+1]-A[i]\implies A[i+1]>X[i]>A[i].$$
Hence it implies that 
$$A[n-1]>X[n-2]>\dots >A[i+2]>X[i+1]>A[i+1]>X[i]>A[i].$$
This shows that it is an increasing sequence, so $A[n-1]$ must be a  top-point.
Assume that $A[1]>\dots >A[n]$. Then 
$A[i+2]<A[i+1]>X[i]$, which shows that $A[i+1]$ is a top-point.
Assume that $A[1]<\dots<A[n-j]$ and $A[n-j]>\dots >A[n]$. As we have seen above, there must be one top-points. (QED ?).
ii) Dividing the third cases into many cases, there must be at most two top-points. (QED ?)
I feel like the proofs are too weak, so I just want to know what you think about them. I need some corrections or better proofs, if possible.

Definition: Let $A=[ A[0],A[1],\dots,A[n]]$ be an array. The entry $A[i]$ is a top-point if $A[i]$ is at least as large as its neighbors:
  
  
*
  
*$A[i]$ is a top-point if $A[i-1]\leq A[i]\geq A[i+1]$ for $i\in \{1,2,\dots, n-2\}$.
  
*$A[0]$ is a top-point if $A[0]\geq A[1]$ and $A[n-1]$ is a top-point if $A[n-2]\leq A[n-1]$. 
  

Example: Let $B=[1,3,7,15,17,11,2,3]$. We see that $B[4]$ and $B[7]$ are top-points. 
 A: Your attempt for (i) shows that you correctly identified the three possible cases and showed that any of these three cases has only a single top-point. However, you also have to show that your three possibilities are the only ones.
(i) Assume that $A[i]$ is a top-point. If $i \neq 0$ this implies that $A[i-1] \leq A[i]$ and, since the $A[i]$ are different, even $A[i-1] < A[i]$. But then it holds that
$$
  A[i-1] > \frac{A[i-2] + A[i]}{2} > \frac{A[i-2] + A[i-1]}{2} \tag{1}
$$
which implies $A[i-2] < A[i-1]$. By induction you can show that $A[0] < A[1] < \ldots < A[i]$. This shows that none of the elements $A[0], \ldots, A[i-1]$ can be a top-point.
Similarly, if $A[i]$ is a top-point and $i \neq n - 1$ then $A[i] > A[i+1]$ and
$$
  A[i+1] > \frac{A[i] + A[i+2]}{2} > \frac{A[i+1] + A[i+2]}{2} \tag{2}
$$
which implies $A[i+2] > A[i+1]$ and by induction $A[i] > A[i+1] > \ldots > A[n-1]$. Again, this shows that none of the elements $A[i+1], \ldots, A[n-1]$ can be a top-point.
Combining these two arguments you get that if $A[i]$ is a top-point then no other element of the sequence can be a top-point.
(ii) Note that the above inequality chains (1) and (2) also hold with strict inequality if $A[i-1] \leq A[i]$ and $A[i+2] \geq A[i+1]$. However, in this case this only shows $A[0] < A[1] < \ldots < A[i-1] \leq A[i]$ and $A[i] \geq A[i+1] > \ldots > A[n-1]$. Thus, if $A[i]$ is a top-point only its direct left and right neighbors can be top-points as well. It is not possible, though, that both are a top-point, since then $A[i-1] = A[i] = A[i+1]$ and
$$
  A[i] > \frac{A[i-1] + A[i+1]}{2} = \frac{A[i] + A[i]}{2} = A[i]
$$
which is a contradiction. Therefore, there can be at most two top-points and these two elements must be next to each other. An example sequence would be $B = [1, 3, 3, 1]$.
