[proofplan]
We prove the two implications separately. If $D$ is injective, we apply the extension property to the inclusion $n\mathbb{Z} \subset \mathbb{Z}$ and a homomorphism sending $n$ to a chosen element $d \in D$; the image of $1$ under the extension is an $n$-th divisor of $d$. Conversely, assuming divisibility, we verify the hypotheses of [Baer's criterion](/theorems/4203) for $\mathbb{Z}$ by extending every homomorphism from an ideal of $\mathbb{Z}$ to $D$ over all of $\mathbb{Z}$.
[/proofplan]
custom_env
admin
[step:Use injectivity to solve the divisibility equation]Assume that $D$ is an injective $\mathbb{Z}$-module. Let $d \in D$ and let $n \geq 1$ be an integer. Define the inclusion homomorphism
\begin{align*}
\iota_n : n\mathbb{Z} &\to \mathbb{Z} \\
nk &\mapsto nk
\end{align*}
and define the $\mathbb{Z}$-[linear map](/page/Linear%20Map)
\begin{align*}
f_d : n\mathbb{Z} &\to D \\
nk &\mapsto kd.
\end{align*}
The expression $nk$ determines $k \in \mathbb{Z}$ uniquely because $n \neq 0$, so $f_d$ is well-defined. Since $D$ is injective and $\iota_n$ is an injective $\mathbb{Z}$-module homomorphism, there exists a $\mathbb{Z}$-linear map
\begin{align*}
F : \mathbb{Z} &\to D
\end{align*}
such that $F \circ \iota_n = f_d$.
Set $x := F(1) \in D$. By $\mathbb{Z}$-linearity of $F$,
\begin{align*}
nx = nF(1) = F(n) = f_d(n) = d.
\end{align*}
Thus for every $d \in D$ and every integer $n \geq 1$, there exists $x \in D$ with $nx = d$. Hence $D$ is divisible.[/step]
custom_env
admin
[guided]Assume that $D$ is an injective $\mathbb{Z}$-module. To prove divisibility, we must solve the equation $nx = d$ for an arbitrary element $d \in D$ and an arbitrary integer $n \geq 1$.
The injectivity of $D$ says that homomorphisms into $D$ extend across injective homomorphisms. We therefore encode the desired equation into a homomorphism defined on the submodule $n\mathbb{Z} \subset \mathbb{Z}$. Define
\begin{align*}
\iota_n : n\mathbb{Z} &\to \mathbb{Z} \\
nk &\mapsto nk
\end{align*}
to be the inclusion map, and define
\begin{align*}
f_d : n\mathbb{Z} &\to D \\
nk &\mapsto kd.
\end{align*}
This map is well-defined because $n \geq 1$: if $nk = n\ell$, then $k=\ell$. It is $\mathbb{Z}$-linear because for all $a,k,\ell \in \mathbb{Z}$,
\begin{align*}
f_d(a(nk)+n\ell)
= f_d(n(ak+\ell))
= (ak+\ell)d
= a(kd)+\ell d
= a f_d(nk)+f_d(n\ell).
\end{align*}
Since $\iota_n$ is injective and $D$ is injective, the map $f_d$ extends to a $\mathbb{Z}$-linear map
\begin{align*}
F : \mathbb{Z} &\to D
\end{align*}
satisfying $F \circ \iota_n = f_d$. Now define $x := F(1)$. The value of $F$ at $1$ is the candidate divisor of $d$. Using $\mathbb{Z}$-linearity and the extension identity,
\begin{align*}
nx = nF(1) = F(n) = (F \circ \iota_n)(n) = f_d(n) = d.
\end{align*}
Thus $d$ has an $n$-th divisor in $D$. Since $d$ and $n$ were arbitrary, $D$ is divisible.[/guided]
custom_env
admin
[step:Extend homomorphisms from all ideals of $\mathbb{Z}$ using divisibility]Assume that $D$ is divisible. Let $I \trianglelefteq \mathbb{Z}$ be an ideal and let
\begin{align*}
f : I &\to D
\end{align*}
be a $\mathbb{Z}$-linear map.
Since every ideal of $\mathbb{Z}$ has the form $n\mathbb{Z}$ for a unique integer $n \geq 0$, choose $n \geq 0$ such that $I = n\mathbb{Z}$. If $n=0$, then $I=\{0\}$ and the zero homomorphism
\begin{align*}
F : \mathbb{Z} &\to D \\
k &\mapsto 0
\end{align*}
extends $f$.
Now suppose $n \geq 1$. Set $d := f(n) \in D$. Since $D$ is divisible, choose $x \in D$ such that $nx=d$. Define
\begin{align*}
F : \mathbb{Z} &\to D \\
k &\mapsto kx.
\end{align*}
Then $F$ is $\mathbb{Z}$-linear. For every $k \in \mathbb{Z}$,
\begin{align*}
F(nk) = nkx = k(nx) = kd = kf(n) = f(kn),
\end{align*}
where the last equality uses $\mathbb{Z}$-linearity of $f$. Hence $F|_{n\mathbb{Z}} = f$.[/step]
custom_env
admin
[guided]Assume that $D$ is divisible. We want to prove injectivity, and Baer's criterion reduces this to extending homomorphisms from ideals of $\mathbb{Z}$ into $D$. Thus we fix an arbitrary ideal $I \trianglelefteq \mathbb{Z}$ and an arbitrary $\mathbb{Z}$-linear map
\begin{align*}
f : I &\to D.
\end{align*}
Every ideal of $\mathbb{Z}$ is principal, so there is a unique integer $n \geq 0$ with $I = n\mathbb{Z}$. There are two cases.
If $n=0$, then $I=0\mathbb{Z}=\{0\}$. Since any $\mathbb{Z}$-linear map sends $0$ to $0$, the map $f$ is the zero map on $\{0\}$. Define
\begin{align*}
F : \mathbb{Z} &\to D \\
k &\mapsto 0.
\end{align*}
This map is $\mathbb{Z}$-linear and satisfies $F|_I=f$.
Now suppose $n \geq 1$. The homomorphism $f$ is determined by the single value $f(n)$, because every element of $n\mathbb{Z}$ has the form $nk$ and $f(nk)=kf(n)$. Define $d := f(n) \in D$. Since $D$ is divisible, there exists $x \in D$ such that
\begin{align*}
nx=d.
\end{align*}
This element $x$ tells us what the extension should do to $1 \in \mathbb{Z}$. Define
\begin{align*}
F : \mathbb{Z} &\to D \\
k &\mapsto kx.
\end{align*}
The map $F$ is $\mathbb{Z}$-linear by the module axioms for $D$. For every $k \in \mathbb{Z}$, we compute
\begin{align*}
F(nk) = nkx = k(nx) = kd = kf(n) = f(kn).
\end{align*}
Since $kn=nk$, this shows $F(nk)=f(nk)$ for every element $nk \in n\mathbb{Z}$. Therefore $F|_{n\mathbb{Z}}=f$, so $f$ extends from $I$ to all of $\mathbb{Z}$.[/guided]
custom_env
admin
[step:Apply Baer's criterion to conclude injectivity]
We have shown that for every ideal $I \trianglelefteq \mathbb{Z}$ and every $\mathbb{Z}$-linear map $f:I \to D$, there exists a $\mathbb{Z}$-linear map $F:\mathbb{Z}\to D$ such that $F|_I=f$. By Baer's criterion for injective modules over a ring (citing a result not yet in the wiki: Baer's criterion for injective modules), applied to the ring $\mathbb{Z}$ and the $\mathbb{Z}$-module $D$, this extension property implies that $D$ is injective as a $\mathbb{Z}$-module.
Combining this implication with the first step proves that $D$ is injective if and only if $D$ is divisible.
[/step]