Solution (source code)

= Solution

<Dedekind factorization theorem> states that if $K=\mathbb Q(\theta)$ with integral $\theta$ and $p$ does not divide $[\mathcal O_K:\mathbb Z[\theta]]$, then a factorization $\overline f=\prod_i\overline f_i^{e_i}$ of its <minimal polynomial of an algebraic element> into distinct monic <irreducible polynomials> over $\mathbb F_p$ gives
$$
p\mathcal O_K=\prod_iP_i^{e_i},\qquad
P_i=(p,f_i(\theta)),\qquad N(P_i)=p^{\deg f_i}.
$$
The factors are distinct <prime ideals>; the residue degrees and ramification indices satisfy $\sum_i e_i\deg f_i=[K:\mathbb Q]$. Unique <prime ideal factorization> holds in the <ring of integers>.

For a <square-free integer> $d\equiv1\pmod4$, $\mathcal O_K=\mathbb Z[\sqrt{-d}]$, so the index condition is automatic. If $p_i\mid d$, the <polynomial> $X^2+d$ reduces to $X^2$ modulo $p_i$. Hence
$$
p_i\mathcal O_K=P_i^2,\qquad P_i=(p_i,\sqrt{-d}),\qquad N(P_i)=p_i.
$$
Therefore $d\mathcal O_K=(\prod_iP_i)^2=(\sqrt{-d})^2$. By unique <prime ideal factorization>, $\prod_iP_i=(\sqrt{-d})$.

Let $S$ be a nonempty proper subset and put $m=\prod_{i\in S}p_i$. For $d>1$, $1<m<d$ and $m$ is a <square-free integer>. If $\prod_{i\in S}P_i=(u+v\sqrt{-d})$, its <ideal norm> gives
$$
m=u^2+dv^2.
$$
The inequality $m<d$ forces $v=0$, leaving $m=u^2$, impossible for a <square-free integer> greater than one. Thus every such subproduct is nonprincipal.

These are <ramified prime classes for discriminant minus four d>. The <ideal classes> $[P_i]$ have order dividing two. Their product is the identity, and the preceding proof rules out every other nonempty subset relation. The <homomorphism> $\mathbb F_2^k\to\operatorname{Cl}(K)$ defined by these classes consequently has kernel exactly $\{0,(1,\ldots,1)\}$. Its image is therefore
$$
\boxed{C_2^{\,k-1}.}
$$
The boundary case $d=1$ has $k=0$ and makes the printed exponent $k-1$ meaningless; its <field> is $\mathbb Q(i)$ with trivial <ideal class group>. The subgroup statement is understood for $d>1$, while the prime-factor and proper-subset statements are empty for $d=1$.