I want to understand how can the code below shows that $\left(\frac{\frac{-1+\sqrt{5}}{2}+\sqrt{\frac{-\sqrt{5}-5}{2}}}{2}\right)^5=1$
{
V=rnfequation(T^2-5,x^2-Mod((-T-5)/2,T^2-5),1);
a=V[2];
b=x-V[3]*a;
lift(((a-1+2*b)/4)^5)
}
recall :
rnfequation(nf,pol,{flag = 0})
given a number field nf as output by nfinit (or simply a polynomial) and a polynomial pol with coefficients in nf defining a relative extension L of nf, computes the absolute equation of L over Q.
If flag is non-zero, outputs a 3-component row vector [z,a,k], where z is the absolute equation of L over Q, as in the default behaviour, a expresses as an element of L a root alpha of the polynomial defining the base field nf, and k is a small integer such that theta = beta+kalpha where theta is a root of z and beta a root of pol.
By using the property that each side of a regular decagon inscribed in a circumference is the golden part of the radius, we get that
$\cfrac{\text{side}}{\text{radius}}=\cfrac{-1+\sqrt{5}}{2}\;$ and $\;\sin 18^\circ=\cfrac{\text{side / 2}}{\text{radius}}=\cfrac{-1+\sqrt{5}}{4}\;.$
Moreover,
$\cos 18^\circ=\sqrt{1-\sin^218^\circ}=\sqrt{1-\left(\cfrac{-1+\sqrt{5}}{4}\right)^2}=\\=\sqrt{\cfrac{5+\sqrt{5}}{8}}=\cfrac{1}{2}\sqrt{\cfrac{\sqrt{5}+5}{2}}\;.$
Since $\;\cfrac{\cfrac{-1+\sqrt{5}}{2}+\sqrt{\cfrac{-\sqrt{5}-5}{2}}}{2}=\sin 18^\circ+i\cos 18^\circ\;,\;$ then, by applying De Moivre’s formula, we obtain,
$\left(\cfrac{\cfrac{-1+\sqrt{5}}{2}+\sqrt{\cfrac{-\sqrt{5}-5}{2}}}{2}\right)^5=\left(\sin 18^\circ+i\cos 18^\circ\right)^5=\\=\sin 90^\circ+i\cos 90^\circ=1\;.$