Extension of copulas Let $(X,Y)$ be a random vector. Suppose that the marginal distribution functions of $X$ and $Y$ are known (say $F_1$ and $F_2$). Then the joint law of $(X,Y)$ is given by the following formula: 
$$F_{X,Y}(x,y)=C(F_1(x),F_2(y)),$$
where C is some copula function. It means, that if the distributions of $X$ and $Y$ are given, we can construct (at least one) joint distribution of $(X,Y)$ conforming with given distributions (e.g. one can set $F_{X,Y}(x,y)=F_1(x)F_2(y)$.
I wonder whether is it possible to extent this property to the case when the distribution of $X+Y$ is known as well (say $F_3$).  
My question is: if the distributions of $X$, $Y$ and $X+Y$ are given how can I construct (at least one) joint distribution of $(X,Y)$, conforming with univariate distributions?
Is there any closed-form solution like we have in case when only the marginals are given?
Thank you for the answers!
 A: You can not prescribe the distribution of the sum. 
Counterexample: Let X and Y be uniform on [0,1]. Now choose the distribution for X+Y so that P(X+Y < 0.5) = 1. This means P(X > 0.5) = 0 a contradiction to uniform.
A way to visualize this might be looking at mass distributions on the square [0,1]x[0,1]. Prescribing the margins (here uniform) is a restriction on the projections to the axes (i.e. 0x[0,1] and [0,1]x0) and the remaining freedom is distributing the mass in the square.
A: OK then another answer to another problem:
An easy and practical way might be discretizing all functions. Then your conditions are linear constraints which can be solved for $C$.
Since one can always transform with the inverse cdf we can assume without loss of generality that both marginal distributions are uniform [0,1]. Let $F$ be the distribution of the sum of the marginals.
Now partition the interval [0,1] into n intervals [k-1/n, k/n]. By taking products you arrive at a partition of the square $[0,1]x [0,1]$ into $n^2$ squares.
Let $C_{i,j}$ be the mass of $C$ on each of the squares of the grid. You arrive at 3 different types of constraints for $C_{i,j}$:
(1) $\sum_{i,j} C_{i,j} = 1$ this is the condition that the copula is a probability distribution
(2) $\sum_{i} C_{i,j} = 1/n$,  $\sum_{j} C_{i,j} = 1/n$ this is the condition that the marginals are uniform
(3) With $I_d = \{(i,j)| i+j = d\}$ the d-th diagonal with d = 2,...,2n the condition on the distribution of the sum is $\sum_{I_d} C_{i,j} = \sum_{I_d} F(1/i + 1/j)$.
These are 1 + n + n + (2n - 1) linear equations for the $n^2$ unknowns.
I guess this will give a numeric solution, a continous solution could be derived by a proper limit argument.
This should work not only for sums but also other functions of X and Y as well.
I hope this helps
