Given [Formula: see text], [Formula: see text], [Formula: see text] and [Formula: see text] compact metric spaces, we consider two iterated function systems [Formula: see text] and [Formula: see text], where [Formula: see text] and [Formula: see text] are contractions. Let [Formula: see text] be the set of probabilities [Formula: see text] with [Formula: see text]-marginal being holonomic with respect to [Formula: see text] and [Formula: see text]-marginal being holonomic with respect to [Formula: see text]. Given [Formula: see text] and [Formula: see text], let [Formula: see text] be the set of probabilities in [Formula: see text] having [Formula: see text]-marginal [Formula: see text] and [Formula: see text]-marginal [Formula: see text]. Let [Formula: see text] be the relative entropy of [Formula: see text] with respect to [Formula: see text] and [Formula: see text] be the relative entropy of [Formula: see text] with respect to [Formula: see text]. Given a cost function [Formula: see text], let [Formula: see text]. We will prove the duality equation: [Formula: see text] In particular, if [Formula: see text] and [Formula: see text] are single points and we drop the entropy, the equation above can be rewritten as the Kantorovich duality for the compact spaces [Formula: see text] and a continuous cost function [Formula: see text].