A question on liftings of supersingular elliptic curves over the prime fields Let $p$ be a fixed prime number $>3$. The motivation for asking the question below is the coincidence of the following two numbers. Namely, the number $h_p^{(1)}$ of supersingular $j$-invariants belonging to the prime field $F_p$, and half of the number $\Sigma_p$ of isomorphism classes classes of complex elliptic curves $E$ so that the imaginary quadratic order $\mathbf{Z}[\sqrt{-p}]$ embeds in the ring $\textrm{End}_\mathbf{C}(E)$.
Explicitly, if $h(\sqrt{-p})$ denotes the class number of $Q(\sqrt{-p})$, then
$h_p^{(1)}=\Sigma_p/2=h(\sqrt{-p})/2$, when $p\equiv 1\bmod 4$;
$h_p^{(1)}=\Sigma_p/2=2h(\sqrt{-p})$, when $p\equiv 3\bmod 8$;
$h_p^{(1)}=\Sigma_p/2=h(\sqrt{-p})$, when $p\equiv 7\bmod 8$.
Proving that $\Sigma_p/2$ is equal to the function of $h(\sqrt{-p})$ above is elementary. On the other hand, the fact that $h_p^{(1)}$ is also given by the same function of $h(\sqrt{-p})$ is harder, and a possible proof follows from Eichler's trace formula relating traces of Hecke operators on $S_2(\Gamma_0(p),\mathbf{C})$ to those of Brandt matrices (cf. Gross, Heights and the Special Values of L-series, formula (1.10)).
My question is: is there a direct way of showing that $h_p^{(1)}=\Sigma_p/2$?
My naive thought about it is that one could try to study the reduction mod $p$ of suitable models of the elliptic curves $E$ with complex multiplication by $\sqrt{-p}$ and see what kind of (supersingular?) elliptic curves do arise, hoping that the map on $j$-invariants is 2-to-1. One could ask even more: for any supersingular elliptic curve $E$ over $F_p$ with Frobenius satisfying $X^2+p$, can we find a lifting to an elliptic curve $E'$ over an extension of $Q_p$ that depends functorially on $E$? (The functoriality requirement is not perhaps an "a-priori" nonsense since the endomorphism ring of $E$ over $F_p$ is just an imaginary quadratic order (containing $\sqrt{-p}$)). I do not know enough about lifting of elliptic curves to say how reasonable these questions are. If some of you has more structured and elaborated thoughts on the matter, then I would like to hear them! Thanks in advance.
 A: This question is addressed as part of the proof of Theorem 14.18 (attributed to Deuring) given by Cox in "Primes of the Form $x^2 +ny^2$," see pp. 321-322.  Cox counts curves rather than $j$-invariants, but for $p > 3$ there are exactly $p-1$ elliptic curves for each of the $p$ possible $j$-invariants of an elliptic curve over $\mathbb{F}_p$ (see Ex. 14.19).  He first shows that the number of elliptic curves with trace $a\ne 0$ is exactly
$$
\frac{p-1}{2}H(a^2-4p),
$$
where $H(D)$ is the Hurwitz class number of the quadratic order with discriminant $D<0$ (NB: many authors negate $D$).  Cox then notes that the total number of elliptic curves over $F_p$ is
$$
p(p-1) = N + \sum_{0<|a|\le 2\sqrt{p}}\frac{p-1}{2}H(a^2-4p),
$$
where $N$ counts the number of supersingular elliptic curves over $\mathbb{F}_p$ (so $N=(p-1)h_p^{(1)}$ in your notation).  He then applies the class number formula
$$
2p = \sum_{0\le|a|\le2\sqrt{p}}H(a^2-4p),
$$
to obtain $N=(p-1)/2H(-4p)$.  Dividing by $p-1$ gives $h_p^{(1)} = H(-4p)/2$, which covers all three of the cases you list above.
This argument may not be as direct as you would like, but it is fairly simple.
A: You might consult the following paper
John Brillhart & Patrick Morton
'Class numbers of quadratic fields, Hasse invariants of elliptic curves,
and the supersingular polynomial',
Journal of Number Theory 106 (2004) Pages 79-111
which may do what you want. They prove the class-number formula for
the number of supersingular $j$-invariants using the Deuring lifting
theorem.
A: I don't know a result that says what you want, but I'll give you some pointers that might help. The "number" of elliptic curves over $\mathbb{F}_p$ with $p-t+1$ points is the "number" of binary quadratic forms with discriminant $H(t^2-4p)$. I put number in quotes because, on both sides of the formula, one must weight the objects being counted by one over the size of their automorphism group. (This will usually be $2$, in both cases.) I got this from section 1 of Lenstra's paper Factoring Integers with Elliptic Curves, which is very readable, he says that the result is essentially due to Deuring.
In chapter 13, section 5, of Lang's Elliptic Functions, I find the following statement, again attributed to Deuring: Given an elliptic curve $E_0$ over $\mathbb{F}_p$, and an endomorphism $a_0$ of $E_0$, there is a number field $K$, an elliptic curve $E$ over $K$, an endomorphism $a$ of $E$ and a place $\mathfrak{p}$ of $\mathcal{O}_K$, lying over $p$, such that the reduction of $(E, a)$ modulo $\mathfrak{p}$ is the base change of $(E_0, a_0)$ to $\mathcal{O}_K/\mathfrak{p}$. (Lang doesn't mention this base change explicitly, so maybe I am missing something; it seems to me to be what he is proving.) So, in particular, if $E_0$ has $p-t+1$ points, it can be lifted to a curve with complex multiplication by $\mathbb{Z}[F]/(F^2-tF+p)$.
What Lang doesn't say, though, is anything about the uniqueness of this lift. And, indeed, there are some issues here, because any quadratic twist of $E$, by a $D$ for which $\left( \frac{D}{p} \right) =1$, would have the same properties.
