semicontinuity of the penalty function, and the complications to prove this property depend on the structure of the probability space.

We first provide a general framework, within a measurable space with a reference probability measure $\mathbb{P}$, and show necessary and sufficient conditions for a penalty function defined in a convex and closed subset of the absolutely continuous measures with respect to the reference measure to be minimal within this subset. The characterization of the form of the penalty functions that are minimal when the probability space supports a Lévy process is then studied. This requires to characterize the set of absolutely continuous measures for this space, and it is done using results that describe the density process for spaces which support semimartingales with the weak predictable representation property. Roughly speaking, using the weak representation property, every density process splits in two parts, one is related with the continuous local martingale part of the decomposition and the other with the corresponding discontinuous one. It is shown some kind of continuity property for the quadratic variation of a sequence of densities converging in  $L^{1}$. From this characterization of the densities, a family of penalty functions is proposed, which turned out to be 