N=1: Proof 2 (proof of unit structure)

Define the fundamental solution $$(x_0,y_0)$$ to $$x^2-Dy^2=1$$ to be the one that: Then we show that all solutions $$(x,y)$$ satisfies $$x+y\sqrt{D}=(x_0+y_0 \sqrt{D})^n$$ for some $$n\in\mathbb{Z}$$. For suppose $$(x,y)$$is such a solution, and let $$k=\log_{x_0+y_0\sqrt{D}}(x+y\sqrt{D})$$. Consider $$(x',y')$$ with $$x'+y'\sqrt{D}=(x+y\sqrt{D})(x_0-y_0\sqrt{D})^{[k]}=(x_0+y_0\sqrt{D})^{\{k\}}$$. From the first equality, $$x',y'\in\mathbb{Z}$$, and from the second equality, $$x'+y'\sqrt{D}=(x_0+y_0\sqrt{D})^{\{k\}}<x_0+y_0 \sqrt{D}$$, a contradiction unless $$\{k\}=0$$ or $$k\in\mathbb{Z}$$.
 * 1) has positive integer x,y;
 * 2) yields the smallest $$x_0+y_0 \sqrt{D}$$.