  A subequation on an open subset $X\subset \mathbb R^n$ is a subset $F$ of the
space of $2$-jets on $X$ with certain properties. A smooth function is said to
be $F$-subharmonic if all of its $2$-jets lie in $F$, and using the viscosity
technique one can extend the notion of $F$-subharmonicity to any
upper-semicontinuous function. Let $\mathcal P$ denote the subequation
consisting of those $2$-jets whose Hessian part is semipositive.
  We introduce a notion of product subequation $F\#\mathcal P$ on $X\times
\mathbb R^{m}$ and prove, under suitable hypotheses, that if $F$ is convex and
$f(x,y)$ is $F\#\mathcal P$-subharmonic then the marginal function $$ g(x):=
\inf_y f(x,y)$$ is $F$-subharmonic.
  This generalises the classical statement that the marginal function of a
convex function is again convex. We also prove a complex version of this result
that generalises the Kiselman minimum principle for the marginal function of a
plurisubharmonic function.
