Solution (source code)

= Solution

An <almost complex structure> $J$ is compatible with $\omega$ if $J^2=-I$, $\omega(Ju,Jv)=\omega(u,v)$, and $g_J(u,v)=\omega(u,Jv)$ is a positive-definite <inner product>. To construct one, choose a <Riemannian metric> $h$ and define $A$ by $h(Au,v)=\omega(u,v)$. The map $A$ is invertible and <skew-adjoint>, so $-A^2$ is positive definite. Its positive square root $P=(-A^2)^{1/2}$ commutes with $A$, and
$$
J=AP^{-1},\qquad
J^2=-I,\qquad
\omega(u,Jv)=h(u,Pv)>0\quad(u=v\ne0).
$$
The same identities show that $J$ preserves $\omega$. The positive square root depends smoothly on $A$, giving a smooth <compatible almost complex structure>.

For a compatible $J$, applying this <metric construction of a compatible almost complex structure> to $g_J$ returns $J$. Given $J_0,J_1$, apply it to $(1-t)g_{J_0}+tg_{J_1}$ to obtain a path joining them. In fact interpolation to any fixed auxiliary metric gives a contraction. Thus \b[the space is nonempty and connected], and even <contractible>, by <contractibility of compatible almost complex structures>.

<Regularity of a J-holomorphic curve> $u$ means that its linearized <Cauchy–Riemann operator> $D_u$ is <surjective>. Differentiating in coordinates gives
$$
D_u\xi=\partial_s\xi+J(u)\partial_t\xi
+(dJ)_u(\xi)\partial_tu,
$$
up to the harmless factor $1/2$ in the convention for $\bar\partial_J$. For constant $u$, the last term vanishes, $J(u)$ is constant, and the pulled-back tangent bundle is $\mathbb{CP}^1\times T_{u}M$. Identifying $T_uM$ with $\mathbb C^n$, this is a direct sum of $n$ copies of the <Dolbeault operator> on the trivial line bundle. Its cokernel is $H^{0,1}(\mathbb{CP}^1,\mathcal O)=0$, by <Dolbeault cohomology of the projective line>. Hence constant maps are regular for every compatible $J$.

The <Energy identity for a J-holomorphic curve> says that the energy is $\int_{\mathbb{CP}^1}u^*\omega$. If the <homology class> is zero, this integral is zero, forcing $du=0$. Thus \b[every zero-class sphere is constant and regular].

In real dimension four, the <Fredholm index> of the parametrized sphere operator is $4+2c_1(A)$. At a regular nonconstant sphere, quotienting by the six-dimensional <Möbius transformation> group gives a local moduli space, or an orbifold for finite stabilizers, of real dimension
$$
\boxed{2c_1(A)-2}.
$$
This is the <dimension formula for regular J-holomorphic spheres>.

For a <simple J-holomorphic sphere> in class $A$, the <adjunction inequality for a simple J-holomorphic sphere> gives $c_1(A)\leq A^2+2$. If $A^2\leq-2$, the displayed moduli dimension is negative, so such a regular <simple J-holomorphic sphere> cannot exist. To cover nonsimple maps as well, interpret regularity here as regularity for all nonconstant maps under discussion. A degree-$m$ cover, $m\geq2$, of a <simple J-holomorphic sphere> in class $B$ has $A=mB$, with $B^2\leq-1$ and $c_1(B)\leq1$. Its local family of <rational covering maps of the projective line> modulo domain reparametrization has real dimension $4m-4$, while the predicted dimension is
$$
2m\,c_1(B)-2\leq2m-2<4m-4.
$$
It therefore cannot be regular. This proves \b[there are no regular spheres in a class with square at most minus two], by <negative-square exclusion under full sphere regularity>. Regularity only for simple curves would not suffice: multiple covers of an exceptional minus-one sphere are the counterexample.