I am studying the theorem: Let $D$ be a domain. If $D$ is Noetherian and $D_P$ is a discrete valuation ring for every maximal ideal $P$ in $D$, then $D$ is Dedekind.
Assume that $D$ is Noetherian and that $D_P$ is a discrete valuation ring for every maximal ideal $P$ of $D$. Then $D_P$ is a p.i.d. and hence $D_P$ is Dedekind. Let $I$ be a fractional ideal in $D$. I have to show that $I$ is invertible. Since $D$ is Noetherian, $I$ is finitely generated. Hence $I_P^{-1}$=$(I^{-1})_P$. Then $(II^{-1})_P$=$I_P$$I_P^{-1}$=$D_P$ for every maximal ideal $P$ of $D$.
I am not understanding why do we have the injection $i$ such that $i(II^{-1})=D$. Where is this injection defined?
Furthermore, why the injection $i_P$ such that $i_P(II^{-1})_P=D_P$ is surjective for all $P$? How can we conclude from here that $I$ is invertible, i.e., $II^{-1}$=$D$?
Help, please. Thank you in advance.
Bernard's answer gives you everything you need to know. If it helps, I will write down more details of the proof. When I first learned algebraic number theory, I had trouble because I was weak in commutative algebra.
Let $M$ be a (unitary) module over a ring $R$. Let $S \subseteq R$ be multiplicatively closed. Then $S^{-1}M$ is a module over the localized ring $S^{-1}R$. If $N$ is an $R$-submodule of $M$, then $S^{-1}N$ is naturally an $S^{-1}R$-submodule of $S^{-1}M$. If $\mathfrak p$ is a prime ideal of $R$, then $M_{\mathfrak p}$ is defined to be $(R - \mathfrak p)^{-1}M$.
Lemma 1: There is a canonical isomorphism of $S^{-1}R$ modules $S^{-1}(M/N) \cong S^{-1}M/S^{-1}N$
Proof: Check that applying $S^{-1}(-)$ retains the exactness of the sequence $0 \rightarrow N \rightarrow M \rightarrow M/N \rightarrow 0$.
Lemma 2: $M = 0$ if and only if $M_{\mathfrak m} = 0$ for all maximal ideals $\mathfrak m$ of $R$.
Proof: Assume $M \neq 0$, so there is a nonzero $m \in M$. The annihilator $I$ of $m$, defined to be the set of $r \in R$ such that $rm =0$, is an ideal of $R$. It is proper, since $1 \not\in I$, and so it is contained in some maximal ideal $\mathfrak m$. But then $\frac{m}{1}$ is not zero in the localized module $M_{\mathfrak m}$; if it were, there would exist an $r \in R$, not in $\mathfrak m$, such that $rm = 0$, and this is impossible.
Corollary: Let $N$ be a submodule of $M$. For each maximal ideal $\mathfrak m$ of $R$, $N_{\mathfrak m}$ is a submodule of $M_{\mathfrak m}$. Then $N_{\mathfrak m} = M_{\mathfrak m}$ for all $\mathfrak m$ if and only if $N = M$.
We have $N = M$ if and only if the quotient module $M/N$ is zero, if and only if $(M/N)_{\mathfrak m} \cong M_{\mathfrak m}/N_{\mathfrak m}$ is zero for all $\mathfrak m$, if and only if $N_{\mathfrak m} = M_{\mathfrak m}$ for all $\mathfrak m$.$\blacksquare$
Returning to the proof that $D$ is a Dedekind domain if $D$ is Noetherian, and $D_{\mathfrak m}$ is a discrete valuation ring for all maximal ideals $\mathfrak m$ of $D$: we need to show that every fractional ideal $I$ of $D$ is invertible ($II^{-1} = D$).
By definition, a fractional ideal $I$ is a $D$-submodule of the quotient field $K$ of $D$ with the property that $xI \subseteq D$ for some $0 \neq x \in D$. Since $D$ is Noetherian, this is equivalent to $I$ being finitely generated. The set $I^{-1} = \{ x \in K : xI \subseteq D \}$ is a fractional ideal of $D$, as is $II^{-1}$, the submodule generated by the products $ab$ ($a \in I, b \in I^{-1}$).
Fix a maximal ideal $\mathfrak m$ of $D$. One can check that $(II^{-1})_{\mathfrak m} = I_{\mathfrak m} (I^{-1})_{\mathfrak m}$, and as $D$ is Noetherian and $I, I^{-1}$ are finitely generated modules over $D$, you can check easily that $I_{\mathfrak m}^{-1} = (I^{-1})_{\mathfrak m}$ as $D_{\mathfrak m}$-modules. Here we are changing our base ring: $I_{\mathfrak m}^{-1}$ is by definition the set of $x \in K$ such that $xI_{\mathfrak m} \subseteq D_{\mathfrak m}$.
Since $D_{\mathfrak m}$ is a discrete valuation ring, it is in particular a Dedekind domain, so every fractional ideal of $D_{\mathfrak m}$ is invertible, and in particular, $D_{\mathfrak m} = I_{\mathfrak m} I_{\mathfrak m}^{-1} = (II^{-1})_{\mathfrak m}$.
We have that $II^{-1} \subseteq D$ as $D$-modules. Applying the corollary above gives you $II^{-1} = D$.