Integral basis for a number field I need some help in solving the following problem:
Suppose $K$ is a number field and $K=\mathbb{Q}(\theta)$ where $\theta\in\mathfrak{O}_K$, the ring of integers of $K$. Now among the elements in $\mathfrak{O}_K$ of the form $$\frac{1}{d}(a_0+\cdots+a_i\theta^i)$$($0\ne a_i$; $a_0,\ldots a_i\in\mathbb{Z})$, where $d$ is the discriminant of $K$, pick one with the minimum value of $|a_i|$ and call it $x_i$. Do this for $i=1,\ldots ,n=\dim_{\mathbb{Q}}K$. I need to show that $\lbrace x_1,\ldots ,x_n\rbrace$ is an integral basis for $K$.
Here are my thoughts: If we can show that the discriminant of $\lbrace x_1,\ldots ,x_n\rbrace$, which can be shown to be a $\mathbb{Q}$-basis, is less than or equal to $d$ then we are done; I tried to show this but have not succeed. I have to somehow use the fact that $|a_i|$ is the minimum which I am unable to see how. Any help will be appreciated.
 A: Can you show that $|\Delta(x_1,\dots,x_n)|$ is minimal amongst all integers? If so, suppose that this isn't an integral basis, so that there is some $\alpha\in\mathfrak{O}_K$ such that $\alpha=b_1x_1+\cdots+b_nx_n$, for $b_1,\dots,b_n\in\mathbb{Q}$, but at least one is not in $\mathbb{Z}$, say $b_1\notin\mathbb{Z}$. Then $b_1=b+r$, where $b\in\mathbb{Z}$, and $0<r<1$, and we can construct a new set of integers, $y_1=\alpha-bx_1$, and $y_i=x_i$, for $i=2,\dots,n$. Can you then show that $|\Delta(y_1,\dots,y_n)|<|\Delta(x_1,\dots,x_n)|$?

Edit. Sorry, scratch the method I was thinking of. Although I still think that you can do it that way, it would be considerably more involved than I think is necessary.

Let $G=\mathbb{Z}x_1+\cdots+\mathbb{Z}x_n\subseteq\mathfrak{O}$. Clearly $x_1,\dots,x_n$ span $K/\mathbb{Q}$, so we can write $\alpha=b_1x_1+\cdots+b_nx_n$, for some $b_1,\dots,b_n\in\mathbb{Q}$. Write each $b_i=c_i+r_i$, where $c_i\in\mathbb{Z}$, and $0\le r_i<1$. Then
$$
\alpha-\underbrace{c_1x_1+\cdots+c_nx_n}_{\in~G}=r_1x_1+\cdots+r_nx_n
$$
Now look at the coefficients of the powers of $\theta$, and don't forget that $[\mathfrak{O}_K/\mathbb{Z}[\theta]]$ divides $d$.
