Solution (source code)

= Solution

For $R=\mathcal O_k$ and $S=\mathcal O_K$, define the <inverse different>, or <codifferent>, by the <trace-dual lattice>
$$
\mathfrak D_{K/k}^{-1}=\{x\in K:\operatorname{Tr}_{K/k}(xS)\subseteq R\}.
$$
The <trace pairing> is nondegenerate in this <separable field extension>, so this is a full <fractional ideal> of $S$. The relative <different ideal> is its inverse:
$$
\boxed{\mathfrak D_{K/k}=(\mathfrak D_{K/k}^{-1})^{-1}.}
$$
Every integral $x$ has integral traces against $S$, so $S\subseteq\mathfrak D^{-1}$ and $\mathfrak D\subseteq S$.

For $k=\mathbb Q$, take an <integral basis> $b_1,\ldots,b_n$ and its <trace pairing> matrix $T=(\operatorname{Tr}(b_ib_j))$. In these coordinates the <codifferent> is $T^{-1}\mathbb Z^n$, and
$$
[\mathfrak D^{-1}:S]=|\det T|=|d_K|.
$$
The <ideal norm> of $\mathfrak D$ equals this index, by inversion of fractional ideal norms. Therefore the <norm of the different ideal> relation is
$$
\boxed{N_{K/\mathbb Q}(\mathfrak D_{K/\mathbb Q})=|d_K|,\qquad d_K=(-1)^{r_2}N_{K/\mathbb Q}(\mathfrak D_{K/\mathbb Q}).}
$$
Here $r_2$ is the number of conjugate pairs of complex embeddings. The different is an ideal of the upper field, whereas the relative <discriminant ideal> is its ideal norm in the base field; over $\mathbb Q$ the ordinary signed <field discriminant> also records the signature.