This is proposition 13.2.5 from Ireland and Rosen's "A Classical Introduction to Modern Number Theory". $D$ is the ring of algebraic integers of a cyclotomic field extension $\mathbb Q (e^{\frac{2\pi i}m})/\mathbb Q$.
Which $n$ is the proof of the proposition using, how is it concluded that $w\in P^2$?

