The Cohen-Lenstra measure on the set of abelian p-groups assigns $\mathbb{P}(G) = \prod\_{i \geq 1} \left( 1 - \frac{1}{p^i}\right) \cdot |\mathrm{Aut}(G)|^{-1} $. Apparently, this is equivalent to taking cokernels of random maps $f: (\mathbb{Z}\_p)^N \to (\mathbb{Z}\_p)^N$ and letting $N \to \infty$. These are the p-adics and there is a Haar measure on this linear space of maps. Alternatively, choose random maps between the finite groups: $f: (\mathbb{Z}/p^k\mathbb{Z})^N \to (\mathbb{Z}/p^k \mathbb{Z})^N$ and let $k, N \to \infty$.


**Q**: If G is a random abelian p-group according to the Cohen-Lenstra measure and A is a deterministic, why is the expected number of surjections $\phi: G \to A$ equal to 1? In fact, if G were deterministic I don't think this number could ever be 1 unless |G| = 1.


For references see Section 8 of [Homological stability for Hurwitz spaces and the Cohen-Lenstra conjecture over function fields](https://arxiv.org/abs/0912.0325) by Ellenberg, Venkatesh and Westerland or Terry Tao's blog entry [At the AustMS conference](http://terrytao.wordpress.com/2009/10/02/at-the-austms-conference/).



An Expectation of Cohen-Lenstra Measure
Let me spell out the cokernel description of the Cohen-Lenstra distribution in more detail, as my answer will depend on it.


A map $(\mathbb{Z}\_p)^N \to (\mathbb{Z}\_p)^N$ is given by an $N \times N$ matrix of $p$-adic integers. Choose such a map by picking each of the digits of each integer uniformly at random from $\{ 0, 1, ..., p-1 \}$; this is the same as using the additive Haar measure on $\mathrm{Hom}((\mathbb{Z}\_p)^N, (\mathbb{Z}\_p)^N)$. With probability $1$, this map does not have determinant $0$, so its cokernel is a finite abelian $p$-group. Let $\mu\_N$ be the probability measure on isomorphism classes of abelian $p$-groups which assigns each $p$-group the probability that it arises as this cokernel.


The Cohen-Lenstra distribution is the limit as $N \to \infty$ of $\mu\_N$. As shown in several of the references you link to, it is given by the formula
$$\lim\_{N \to \infty} \mu\_N(G) = \frac{1}{ |\mathrm{Aut}(G)|} \prod\_{i=1}^{\infty} (1-1/p^i) .$$


For notational convenience, it will help to distinguish between the domain and range of a map in $\mathrm{Hom}((\mathbb{Z}\_p)^N, (\mathbb{Z}\_p)^N)$. I will call the former $U^N$ and the latter $V^N$.




---


Now, to answer your question. Let $A$ be a fixed finite abelian $p$-group. Let $e\_N(A)$ be the expected number of surjections from an abelian $p$-group $G$, picked according to measure $\mu\_N$, to $A$. Ignoring issues about interchanging limits, we want to show that $\lim\_{N \to \infty} e\_N(A)=1$.


Lets start by considering $H\_N(A) := \mathrm{Hom}(V^N, A)$. The set $H\_N(A)$ has cardinality $|A|^N$, as any map is specified by giving the image of a basis for $V^N$. Inside this set, let $S\_N(A)$ be the surjective maps and $C\_N(A)$ the nonsurjective maps.


For any map $f \in S\_N(A)$, let's consider the possibility that it extends to the cokernel of a random map $U^N \to V^N$. This will occur if and only if the $N$ generators of $U^N$ land in the kernel of $f$. Since $f$ is in $S\_N(A)$, its kernel has index $|A|$. So the probability that $U^N$ is mapped into the kernel of $f$ is $1/|A|^N$. 


We want to compute
$$e\_N(A) = |S\_N(A)| \cdot (1/|A|^N) = 1 - |C\_N(A)|/A^N.$$


If $A$ can be generated by $r$ elements, then $|C\_N(A)|/A^N \leq (1-1/|A|^r)^{\lfloor N/r \rfloor}$, so the second term drops out as $N \to \infty$. (To see this bound, group the basis elements of $V^N$ into $N/r$ groups of size $r$; the probability that these $r$ basis elements are not sent to the $r$ generators of $A$ is $(1-1/|A|^r)$. This bound is probably much weaker than the true rate of convergence.)


