An example of a matrix in $\mathrm{SL}(4, \mathbb{Z})$ with the following properties I am looking for a matrix $M\in \mathrm{SL}(4, \mathbb{Z})$, with all eigenvalues equal to $1$, and with the following properties:
Write $M=\begin{bmatrix}
A_1&A_2\\
A_3&A_4 
\end{bmatrix}, 
$ where the $A_i$ are $2$ by $2$ sumbatrix of $M$.
Let $d_i$ be the dot product of two rows of $A_i$, i.e. if $A_i = \begin{bmatrix}
a&b\\
c&d 
\end{bmatrix}$, then $d_i = ac +bd$.
Let $a_i = \mathrm{det}(A_i) - d_i$.
For example if  $A_1 =\begin{bmatrix}
1&2\\
3&4
\end{bmatrix}$,  then  $d_1 = 11$ and $a_1 = - 2 - 11 = -13$.
Consider the matrix $A =  \begin{bmatrix}
a_1&a_2\\
a_3&a_4 
\end{bmatrix}$,  I would like to find $M$ such that $A$ is in $\mathrm{GL}(2, \mathbb{Z})$, and has one eigenvalue with absolute value not equal to $1$.
The matrices I have tried so far: since $M$ needs to have eigenvalues all equal to $1$, I tried the matrices consisting of just Jordan blocks, unfortunately, they didn't work. I also tried the matrix in the form $M=\begin{bmatrix}
A_1&A_2\\
0&A_4 
\end{bmatrix}, 
$ where $A_1$ and $A_4$ have all eigenvalues all equal to $1$, but in this case $A$ will have all eigenvalues with absolute values $1$. I am a bit stuck as I can't think of other $4$ by $4$ matrices that have all eigenvalues equal to $1$.
Any idea to construct such matrices will be really appreciated.
 A: I have no difficulties to come up with several types of matrices
$A\in SL_4(\Bbb Z)$ having all eigenvalues equal to $1$. For example, take
$$
M=\begin{pmatrix} 0 & 0 & -1 & 0 \cr 
1 & 0 & 0 & 1 \cr 1 & 0 & 0 & 2 \cr 0 & 1 & -3 & 4 \end{pmatrix}. 
$$
Then the matrix of determinants minus dot products is
$$
A=\begin{pmatrix} 0 & -1 \cr 1 & 2 \end{pmatrix}\in SL_2(\Bbb Z).
$$
However, this one has also only eigenvalues $1$.
The polynomial system for finding $M$ is indeed solvable with Groebner, however adding the condition $\det(A)=\pm 1$ is far too much for Groebner in my case. So one has to choose a certain form to reduce the complexity.
Edit: I found solutions over $\Bbb Q$, namely
$$
M=\begin{pmatrix} 0 & \frac{3}{2} & -1 & 0 \cr 
0 & 0 & \frac{1}{3} & 0 \cr 2 & -3 & 3 & 0 \cr 
-5\eta-3 & \eta & 0 & 1 \end{pmatrix} \in SL_4(\Bbb Q).
$$
for all $\eta\in \Bbb Q$. Then the matrix $A$ is given by
$$
A=\begin{pmatrix} 0 & \frac{1}{3} \cr -3 & 3 \end{pmatrix}\in SL_2(\Bbb Q).
$$
and has characteristic polynomial $t^2-3t+1$.
Edit: Finally, by the same procedure, I found infinitely many integral solutions:
$$
M=\begin{pmatrix} 0 & 2 & -1 & 0 \cr 
1 & 0 & 1 & 0 \cr 2 & -3 & 3 & 0 \cr 
-5\eta-7 & \eta & 0 & 1 \end{pmatrix} \in SL_4(\Bbb Z).
$$
Then we obtain
$$
A=\begin{pmatrix} -2 & 1 \cr -7 & 3 \end{pmatrix}\in SL_2(\Bbb Z),
$$
which has characteristic polynomial $t^2-t+1$.
A: More of a long comment over a full answer.
If this question does not have a solution in $\mathbb{C}$, then it cannot have a solution in $\mathbb{Z}$.  Therefore, I wrote the following Macaulay2 code to study the problem over $\mathbb{C}$:
R = QQ[r_0..r_3,s_0..s_3,t_0..t_3,u_0..u_3]
S = R[lambda]

M = matrix{{r_0,r_1,s_0,s_1},
           {r_2,r_3,s_2,s_3},
           {t_0,t_1,u_0,u_1},
           {t_2,t_3,u_2,u_3}}
L = lambda*id_(S^4)

D = det (M-L)
C = coefficients D

-- dot products of the matrices
d1 = r_0*r_2+r_1*r_3
d2 = s_0*s_2+s_1*s_3
d3 = t_0*t_2+t_1*t_3
d4 = u_0*u_2+u_1*u_3

-- determinants of the matrices
e1 = r_0*r_3-r_1*r_2
e2 = s_0*s_3-s_1*s_2
e3 = t_0*t_3-t_1*t_2
e4 = u_0*u_3-u_1*u_2

-- values of a's
a1 = e1 - d1
a2 = e2 - d2
a3 = e3 - d3
a4 = e4 - d4

T = QQ[first entries vars R|{w},MonomialOrder=>Eliminate 16]

-- Conditions to be eigenvalues 1.
f1 = sub((C_1)_(1,0)-(-1)^1*binomial(4,1),T)
f2 = sub((C_1)_(2,0)-(-1)^2*binomial(4,2),T)
f3 = sub((C_1)_(3,0)-(-1)^3*binomial(4,3),T)
f4 = sub((C_1)_(4,0)-(-1)^4*binomial(4,4),T)

-- w is value of trace of A

I = ideal(f1,f2,f3,f4,w-sub(a1+a3,T),1-sub(a1*a4-a2*a3,T))
G = gb I
selectInSubring(1,G)

J = ideal(f1,f2,f3,f4,w-sub(a1+a3,T),1+sub(a1*a4-a2*a3,T))
H = gb J
selectInSubring(1,H)

The code first computes the coefficients of the characteristic polynomial for M and the polynomials $f1,\dots,f4$ force those coefficients to be the coefficients of $(\lambda-1)^4$.  The $d1,\dots,d4$ are the dot products and the $e1,\dots,e4$ are the determinants of the $A_i$'s.  Then, the $a$'s are calculated as you described.
Finally, we make a new ring where $w$ is the value of the trace of $A$.  We make an ideal whose elements restrict the coefficients of the characteristic polynomial of $M$ to be correct, the determinant of $A$ to be $1$, and set $w$ to be the trace of $A$.  If we eliminate all variables except for $w$, then we get the possible values for the trace.
If the trace has only finitely many values, then one can hope that these cases can be studied individually.
