There is a classical exercise in elementary number theory or abstract algebra (cf. this question or this question):
Let $ d, n \in \mathbb{Z}_+ $.
- For integers $a \ge 2$, we have: $a^d - 1 \mid a^n - 1 \iff d \mid n$.
- In a polynomial ring $R[x]$ where $R$ is an integral domain, we have: $ x^d - 1 \mid x^n - 1 \iff d \mid n $.
$\impliedby$ are tivial. For $\implies$, consider $ n = dq + r $, then we have $$ x^d - 1 \mid x^r - 1 $$ or $ a^d - 1 \mid a^r - 1 $. Then we may use $0 \le r < d$ to get the conclusion.
The proof on $\mathbb{Z}$ and the one on $R[x]$ seems similar but not completely the same. I want to generalize this conclusion to some abstract ring $A$ and give a general proof.
Some of my observation: For $\mathbb{Z}$, we use the fact that $a \mid b \implies |a| \le |b|$; for $R[x]$, we use the fact that $f(x) \mid g(x) \implies \deg(f) \le \deg(g)$. So it seems that the essence of the proof is a map $$ v : A \longrightarrow \mathbb{Z}_{\ge 0}, $$ such that $\forall \, x, y \in A$, we have $x \mid y \implies v(x) \le v(y)$. Is there a name of such a property? Or is there a general kind of rings such that such a property holds?