Do a là nghiệm của pt nên
\(a^2-a-1=0\Leftrightarrow a^2=a+1\Leftrightarrow a^6=\left(a+1\right)^3=a^3+3a^2+3a+1\)
Và \(a^2-a-1=0\Leftrightarrow a^2-a=1\)
\(P=\dfrac{a^6-3a^3\left(a^2-a\right)-a^3+2018}{a^6-\left(a^3+3a^2+3a+1\right)+2020}=\dfrac{\left(a+1\right)^3-4a^3+2018}{\left(a+1\right)^3-\left(a+1\right)^3+2020}\)
\(P=\dfrac{-3a^3+3a^2+3a+2019}{2020}=\dfrac{-3a\left(a^2-a-1\right)+2019}{2020}=\dfrac{2019}{2020}\)