  It is well-known that an $\mathbb{R}$-valued random vector $(X_1, X_2,
\cdots, X_n)$ is comonotonic if and only if $(X_1, X_2, \cdots, X_n)$ and
$(Q_1(U), Q_2(U),\cdots, Q_n(U))$ coincide \emph{in distribution}, for
\emph{any} random variable $U$ uniformly distributed on the unit interval
$(0,1)$, where $Q_k(\cdot)$ are the quantile functions of $X_k$, $k=1,2,\cdots,
n$. It is natural to ask whether $(X_1, X_2, \cdots, X_n)$ and $(Q_1(U),
Q_2(U),\cdots, Q_n(U))$ can coincide \emph{almost surely} for \emph{some}
special $U$. In this paper, we give a positive answer to this question by
construction. We then apply this result to a general behavioral investment
model with a law-invariant preference measure and develop a universal framework
to link the problem to its quantile formulation. We show that any optimal
investment output should be anti-comonotonic with the market pricing kernel.
Unlike previous studies, our approach avoids making the assumption that the
pricing kernel is atomless, and consequently, we overcome one of the major
difficulties encountered when one considers behavioral economic equilibrium
models in which the pricing kernel is a yet-to-be-determined unknown random
variable. The method is applicable to many other models such as risk sharing
model.
