Matrix of cosecants appearing in equivariant index computations

As suggested in the comment of JP McCarthy, the Gershgorin circle theorem indeed leads to a solution:

Each row of the matrix $M_p$ is just a permutation of the first row and the entry $\csc^2(\frac{\pi}{p})$ occurs precisely once in each column. So we can permute the rows of $M_p$ to ensure that the entry $\csc^2(\frac{\pi}{p})$ appears on each diagonal position of the matrix. Denote the resulting matrix by $\tilde{M}_p$.

Next, we apply Gershgorin to $\tilde{M}_p$ to show that it is invertible. For this, it suffices to show that in each row the sum of the absolute values of the non-diagonal entries is strictly smaller than the absolute value of the diagonal entry. But since each row is just a permutation of the same vector of positive numbers and we have arranged the diagonal position, this just amounts to $$\sum_{l=2}^{n} \csc^2 \left( \frac{l \pi}{p} \right) < \csc^2\left(\frac{\pi}{p} \right),$$ where $n = \frac{p-1}{2}$. To prove the latter, we use the formula $$\sum_{l=1}^{d-1} \csc^2\left(\frac{l \pi}{d}\right) = \frac{d^2-1}{3},$$ which holds for any $d \in \mathbb{N}$, see the previously mentioned Wikipedia entry on the Basel problem or this Math Stack Exchange question. From this, we conclude \begin{align}\sum_{l=2}^n \csc^2\left(\frac{l \pi}{p} \right) &= \frac{p^2-1}{6} - \csc^2\left(\frac{\pi}{p}\right) \\ &<\frac{p^2}{6} - \csc^2\left(\frac{\pi}{p}\right)\\ &< 2 \frac{p^2}{\pi^2} - \csc^2\left(\frac{\pi}{p}\right)\\ &\leq 2 \csc^2\left(\frac{\pi}{p}\right)- \csc^2\left(\frac{\pi}{p}\right) = \csc^2\left(\frac{\pi}{p}\right), \end{align} where we used $ \frac{\pi^2}{2} < 6 $ for the second inequality and $\frac{1}{x^2} \leq \csc^2(x)$ for the third inequality.

This is what we needed to prove via Gershgorin that $\tilde{M}_p$ is invertible. Hence also $M_p$ is invertible. This answers Question 2 affirmatively.

The same argument also applies to Question 1. Just put the $v_k$ as row vectors into a matrix and reorder it in the same way as before putting $\csc^2(\pi/d)$ in the diagonal position whenever the row index $k$ has $\gcd(k, d)=1$. The additional unit vectors can also be appropriately reordered so that they do not disturb the Gershgorin argument. We have also written up the detailed argument for this on p.12-13 of arXiv:1712.03722v2.


Some sage code for experimental purposes:

def matr(p):
    N = (p - 1) / 2
    return matrix(N, N, lambda i,j: sin(pi/p*(i+1)*(j+1))**-2)

Resulting in

sage: [(p,matr(p).change_ring(QQbar).det()) for p in prime_range(3,19)]
[(3, 4/3),
 (5, 7.155417527999327?),
 (7, -128),
 (11, 281600),
 (13, 2.553445644401557?e7 + 0.?e-8*I),
 (17, -5.4726330292?e11 + 0.?e1*I)]

Is this what you got ?

EDIT

One can see a factor $2^{p-1}$ and $p^{(p-7)/4}$, for example one gets

p=3 : 2^2 * 3^(-1)
p=5 : 2^4 * 5^(-1/2)
p=7 : -1 * 2^7 * 7^0
p=11 : 2^10 * 5^2 * 11^1
p=13 : 2^12 * 7 * 13^(3/2) * 19
p=17 : -1 * 2^21 * 3 * 17^(5/2) * 73
p=19 : 2^18 * 3^3 * 5 * 19^3 * 487
p=23 : -1 * 2^23 * 11^2 * 23^4 * 37181
p=29 : 2^34 * 3 * 5 * 7^2 * 29^(11/2) * 43 * 17837
p=31 : -1 * 2^35 * 5^3 * 7 * 11 * 31^6 * 2302381
p=37 : 2^36 * 3^3 * 5 * 7 * 19^2 * 37^(17/2) * 73 * 577 * 17209

(now including the square root factor, so that the power of $p$ is more regular)

I have found a faster way to compute the determinant, without the main power of 2:

p=43 : 2^2 * 7^2 * 11 * 19 * 29 * 43^9 * 463 * 1051 * 416532733
p=59 : 5 * 29^2 * 59^14 * 9988553613691393812358794271

EDIT

It seems that the square $M_p^2$ of the given matrix $M_p$ is made of positive integers. And that $M_p$ has an eigenvector $(1,1,1,1,...)$ with eigenvalue $(p^2-1)/24$. And that all the lines of $M_p^2$ are permutations of the same sequence of integers.

EDIT

The same matrix with $1/\cos^2$ instead of $1/\sin^2$ seems to have very similar properties.