TITLE: Most general maximum principle for non-integrable almost complex structures
QUESTION [8 upvotes]: Let $H\subseteq\mathbb C^n$ be a smooth co-oriented real codimension one hypersurface.  If $H$ is weakly pseudo-convex, then holomorphic maps $u:\Delta\to\mathbb C^n$ ($\Delta$ denotes the unit disk) satisfy the following maximum principle with respect to $H$:

If $u(0)\in H$ and $u$ maps a neighborhood of $0$ to the "inside" of $H$, then in fact $u$ maps a neighborhood of $0$ to $H$.

Moreover, my understanding is that this result is sharp: if $H$ is not weakly pseudo-convex, then there are maps $u$ violating the maximum principle.
Question: Is there a sharp maximum principle for pseudo-holomorphic maps $u:\Delta\to(X^{2n},J)$ where $J$ is a (not necessarily integrable) almost complex structure and $H\subseteq X$ is as before?
I know of various sufficient conditions on $H$ which imply a maximum principle, however they generally require rather special assumptions on the local geometry of $J$ (such as the existence of a Liouville $1$-form) which seem far from the most general possible.  It would be very nice to know what the "right" assumptions are here.

REPLY [5 votes]: You may already know this, and this is not the most general statement, probably, but it does work for all almost complex structures (integrable or not):
First, some notation:  Using the almost complex structure $J$ on $X$, split the exterior derivative into graded pieces $d^{s,t}:\Omega^{p,q}(X)\to\Omega^{p+s,q+t}(X)$, where $(s,t)\in\{(2,-1),(1,0),(0,1),(-1,2)\}$.  Of course, $d^{2,-1}$ and $d^{-1,2}$ are tensorial (i.e., zeroth order linear differential operators) and vanish when $J$ is integrable.  Maintain the standard abbreviations $d^{1,0}=\partial$ and $d^{0,1}=\overline\partial$.  [Note that, because pseudo-holomorphic mappings preserve bi-degree (and, of course, 'commute' with the exterior derivative), these operators commute with pullback via pseudo-holomorphic maps.]
Given a (say, smooth) function $f:X\to\mathbb{R}$ define the Levi form of $f$ to be
$$
{\mathsf L}(f) = i\,\partial\overline{\partial}\,f \in \Omega^{1,1}(X).
$$
Then ${\mathsf L}(f)$ is a real-valued $(1,1)$-form on $X$.  One says that $f$ is plurisubharmonic on $X$ if ${\mathsf L}(f)\ge0$ (in the sense that it is nonnegative on all (oriented) $1$-dimensional complex subspaces of $TX$).
Proposition:  Let $f:X\to\mathbb{R}$ be plurisubharmonic. If $u:\Delta\to X$ is $J$-holomorphic and $f\bigl(u(z)\bigr)\le f\bigl(u(0)\bigr)$ for all $z\in\Delta$, then $f\bigl(u(z)\bigr) =f\bigl(u(0)\bigr)$ for all $z\in \Delta$.
The relation with the OP's question is this:  If $X\subset\mathbb{C}^n$ and $c$ is a regular value of $f:X\to\mathbb{R}$, where $f$ is plurisubharmonic, then $H_c=f^{-1}(c)$ is weakly pseudo-convex.  
It's not clear to me that a smooth weakly pseudo-convex hypersurface in $X$ is locally a level set of a plurisubharmonic function $f$, but it seems plausible.  (See the comment below, which asserts that this is true in the integrable case, by a result of Diederich-Fornæss.)
The proof of the above proposition follows from the (usual) maximum principle on $\Delta$ and the formula
$$
\frac{\partial^2(f{\circ}u)}{\partial z\,\partial \overline z}
= \frac1i \,u^*\bigl({\mathsf L}(f)\bigr)\left(\frac{\partial}{\partial z},\frac{\partial}{\partial \overline{z}}\right) \ge0,
$$
which is a consequence of the fact that the Levi form operator commutes with pullback under pseudo-holomorphic maps.  (Note, in particular, that the Nijnhuis tensor does not affect the formula.)