How do I prove this cosine inequality?

Let n>6 positive integer and $$A_1A_2...A_n$$ a convex polygon. Prove that there exist i and j such that $$|\cos(A_i)-\cos(A_j)|<{1\over 2(n-6)}$$

My trials: I tried by contradiction but it didn’t work. I also tried supposing WLOG that angles A1>A2>A3>...>An. I also tried factoring cos(Ai)-cos(Aj) but it didn’t work for me either.

• @MariaMazur I suppose $\cos\angle A_{i-1}A_iA_{i+1}$? – Hagen von Eitzen May 30 at 17:17
The angles $$A_i$$ are between $$0$$ and $$\pi$$ and we know that $$\sum(\pi-A_i)=2\pi$$. If the claim is false, then for each integer $$k$$, there is at most one $$i$$ with $$1-\frac{k+1}{2(n-6)}<\cos A_i\le 1-\frac{k}{2(n-6)}.$$ It follows that the $$k$$th largest angle has cosine $$\le 1-\frac{k-1}{2(n-6)}$$. Then the six smallest angles have cosine $$\le 1-\frac{n-1}{2(n-6)}$$, $$\le1-\frac{n-2}{2(n-6)}$$, $$\le1-\frac{n-3}{2(n-6)}$$, $$\le1-\frac{n-4}{2(n-6)}$$, $$\le1-\frac{n-5}{2(n-6)}$$, and $$\le1-\frac{n-6}{2(n-6)}=\frac 12$$, respectively. We conclude that the $$6$$th smallest angle is $$\le \frac23\pi$$ and the five smaller angles are $$<\frac23\pi$$. Therefore, $$\sum(\pi-A_i)>6\cdot \frac\pi3=2\pi,$$ contradiction
• Could you please explain this statement: “It follows that the $k$th largest angle has cosine $\le 1-\frac{k-1}{2(n-6)}$. ” – furfur May 30 at 17:48