Extension of subcopulas to copulas This question is about the extension of subcopulas to copulas, shown  in Sklar, A. (1996), "Random variables, distribution functions, and copulas: A personal look backward and forward." Institute of Mathematical Statistics Lecture Notes-Monograph Series, 28, 1–14. [106, 133]. A proof for the 2-D case is in Nelsen (2006) "An introduction to copulas" (see p.16-17 here).

Let me first review the result For simplicity, let $n=2$.
Let $\mathcal{S}\equiv \mathcal{S}_1\times \mathcal{S}_2  \subseteq [0,1]^2$, where  each $\mathcal{S}_i$ is such that $\{0,1\}\in \mathcal{S}_i$ for each $i=1,2$.
A  $2$-D subcopula is a function $\bar{C}:\mathcal{S}\rightarrow [0,1]$ such that:
1. $\bar{C}$ is non decreasing. That is, the volume under $\bar{C}$ of each $2$-D box whose vertices are elements of $\mathcal{S}$ is $\geq 0$.

*

*For example,   take $(a_1,b_1)\in \mathcal{S}$  and $(a_2,b_2)\in \mathcal{S}$ with $a_1\leq a_2$ and $b_1\leq b_2$. These 2 elements of $\mathcal{S}$ form the box with 4 vertices  $$(a_1,b_1)\in \mathcal{S}, (a_2,b_1)\in \mathcal{S}, (a_1,b_2)\in \mathcal{S}, (a_2,b_2)\in \mathcal{S}$$  Condition 1 requires that $$\bar{C}(a_1,b_1)+\bar{C}(a_2,b_2)-\bar{C}(a_1,b_2)-\bar{C}(a_2,b_1)\geq 0$$


*As another example, take $(0,0)\in \mathcal{S}$ and $(a,b)\in  \mathcal{S}$. These 2 elements of $\mathcal{S}$ form the box with 4 vertices  $$(0,0)\in \mathcal{S}, (a,0)\in \mathcal{S}, (0,b)\in \mathcal{S}, (a,b)\in \mathcal{S}$$  Condition 1 requires that $$\bar{C}(a,b)+\bar{C}(0,0)-\bar{C}(a,0)-\bar{C}(0,b)\underbrace{=}_{\text{See condition 2 below}} C(a,b)\geq 0$$
2. $\bar{C}(u) = 0$ for any $u \in \mathcal{S}$ that has at least one component equal to 0.
3. $\bar{C}(u) = u_i$ for any $u \in  \mathcal{S}$ that has all components, except the $i$-th, equal to 1.
A $2$-D copula  is a $2$-D subcopula for which $\mathcal{S}=[0,1]^2$.
"Extension Lemma": Let $\bar{C}:\mathcal{S}\rightarrow [0,1]$ be a $2$-D subcopula with domain $\mathcal{S}$. Then, there exists a   proper $2$-D copula $C$ such that $C(u) = \bar{C}(u)$ for all $u\in \mathcal{S}$.

My question is about whether some specific constraints can be enforced while constructing   a copula $C$  extending a subcopula $\bar{C}$.
More precisely, let us consider a subcopula $\bar{C}: \underbrace{\mathcal{S}_1\times \mathcal{S}_2}_{\equiv \mathcal{S}}\rightarrow[0,1]$.
Let us consider the simple setting where $\mathcal{S}_1$ and $\mathcal{S}_2$ are finite.
Consider the  box with vertices $(a,b),(c,b), (a,d), (c,d)$, which we call $B$.
Assume that at least one of the following four conditions holds: $a\notin \mathcal{S}_1$; $b\notin \mathcal{S}_2$; $c\notin \mathcal{S}_1$; $d\notin \mathcal{S}_2$. That is, the vertices of $B$ are not all elements of $\mathcal{S}$.
Further, assume that if $B$ contains any box $D$ whose 4 vertices    are all elements of $\mathcal{S}$, then the volume of $D$ under $\bar{C}$ is equal to 0.
Can we construct a copula $C$ that extends $\bar{C}$ and such that
$$
C(a,b)+C(c,d)-C(a,d)-C(c,b)=0 \quad ?
$$
I've tried to tweak the traditional proof of the above "Extension Lemma" to achieve my result (see p.16-17 here with $n=2$), but I haven't been successful. The proof of the lemma is based on a bilinear interpolation procedure which just ensures that $C(a,b)+C(c,d)-C(a,d)-C(c,b)\geq 0$ and not $C(a,b)+C(c,d)-C(a,d)-C(c,b)= 0$. Do you have suggestions on how to proceed?

I'm reporting here some questions on the answer below. In this picture I consider 7 possible cases. Each quadrant is $[0,1]^2$. The pink dots are the elements of $\mathcal{S}\equiv \mathcal{S}_1\times \mathcal{S}_2$ (recall that in my simplified setting $\mathcal{S}$ is finite).

Consider case 1, where there is only one box, $B$, whose volume we want to be zero (small black quadrant in the middle). Associated with box $B$, there is only one atomic box, $D$, from the sub-copula. The answer's proposal consists of uniformly redistributing mass from $B$ to $D\setminus B$ (yellow area), without modifying the value of the copula at the pink dots (because otherwise we would modify the sub-copula $\bar{C}$ which is instead fixed).
Consider case 2, where again there is only one box, $B$, whose volume we want to be zero (black rectangle in the middle). Associated with box $B$, there are 6 atomic boxes, $\{D_i\}_{i=1}^6$, from the sub-copula. For each $i=1,...,6$, let $B_i\equiv B\cap D_i$. The answer's proposal consists of uniformly redistributing mass from $B_i$ to $D\setminus B_i$ for each $i=1,...,6$ (yellow areas), without modifying the value of the copula at the pink dots.
Case 4 seems similar to cases 1,2.
Consider now case 3. Here there are two boxes, $B_1,B_2$, whose volume we want to be zero. Associated with box $B_1$, there are 4 atomic boxes, $\{D_{i,1}\}_{i=1}^4$, from the sub-copula. Associated with box $B_2$, there are also 4 atomic boxes, $\{D_{i,2}\}_{i=1}^4$, from the sub-copula. $B_1$ and $B_2$ share one atomic box. This means that the blue region should accommodate part of the mass coming from both $B_1$ and $B_2$.
Cases 5 and 6 seem similar to case 3.
Now, let's move to the problematic case, which is case 0 on top. In this case an atomic box is contained in the union of the two shaded boxes. Since such atomic box may not have volume equal to $0$ under $\bar{C}$, then when swapping masses we violate the "extension" feature.
Q1: Is the above interpretation of the answer correct?
Q2: Suppose I can exclude the problematic case 0. Then, can we formally show that the swapping of masses can be done in all the 6 cases above? How?
 A: So in that case (of a single zero-measure box, all of whose sub-boxes lying in the sub-copula have measure zero), you can do it.
One way to do it is to take a copula extending the sub-copula and then adjust. The way that I would do this is consider each atomic box $D$ from the sub-copula that intersects $\partial B$ [ by atomic, I mean a box of the form $[a,b]\times [c,d]$ with $a,b$ consecutive elements of $\mathcal S_1$ and $c,d$ consecutive elements of $\mathcal S_2$ ]. I would then uniformly the distribute mass from $D$ to $D\setminus B$. This gives a new copula which agrees with the previous copula on all of the atomic boxes, hence is an extension of the copula.
This can also be made to work by induction if there are a number of boxes to be assigned zero measure with gaps between. But it's not hard to see it can fail if one of the atomic boxes lies in the union of the zero-measure boxes, but not in any single zero-measure box.
More generally, I think you need a version of Hall's "Marriage Lemma". This is sometimes stated in terms of "men" marrying "women" (or points on the $x$-axis being coupled with points on the $y$-axis). I will use that language here, as it is easy to read, even though it suffers from lacking societal awareness. If there are the same number of men and women (corresponding to there being a probability distribution on the $x$- and $y$-axes), then there is a matching (corresponding to a copula) if and only if each subset $A$ of the men is collectively friendly with (i.e. the pair lies outside the zero-measure boxes) at least $|A|$ women; and each subset $B$ of the women is collectively friendly with at least $|B|$ men.
I would have to think in a bit more detail to see if I could formulate the precise condition analogous to the marriage condition in terms of copulae. Also, the Hall Marriage Lemma deals with two axes. One way to think of this in terms of the Hall Marriage Lemma is in terms of bipartite graphs: there are edges between a man and a woman if they are compatible. One is looking for a bijection. There are hypergraph versions of the Hall Marriage Lemma, which might allow one to deal with $n$-dimensional copulae, but for the moment, I have no idea how this would work.
EDIT: More details added in response to Q2 added in OP
Yes. I agree with your interpretation of my answer. One way to understand a copula is as a probability measure $\mu$ on $[0,1]^2$ such that $\mu(A\times [0,1])=\mu_1(A)$ and $\mu([0,1]\times B)=\mu_2(B)$ for any subsets $A$ and $B$ of $[0,1]$ where $\mu_1$ and $\mu_2$ are the probability distributions on the first and second coordinates respectively. (This is also called a coupling of the two measures). To recover the copula from the measure, you define $C(a,b)=\mu([0,a]\times[0,b])$.
In this language a subcopula is a measure on $[0,1]^2$ which is only defined on a sub-algebra $\mathcal B_1\otimes \mathcal B_2$ where $\mathcal B_1$ is the $\sigma$-algebra generated by intervals with your endpoints $\mathcal S_1$ and $\mathcal B_2$ is the $\sigma$-algebra generated by intervals with intervals with your endpoints $\mathcal S_2$. Another way to say this (at least in the case of finite $\mathcal S_1$ and $\mathcal S_2$) is that this $\sigma$-algebra consists of all unions of atomic rectangles. A subcopula is then extended to a copula if there is a measure on $[0,1]^2$ that agrees with the subcopula measure on the $\sigma$-algebra $\mathcal B_1\otimes \mathcal B_2$.
If $\bar\mu$ is a copula extending the subcopula $\mu$; and if the union of the zero measure rectangles does not contain any atomic rectangle, let $Z$ denote the union of the zero measure rectangles. You can then define a new copula extension by
$$
\lambda(S)=\sum_{A\text{ atomic}}
\bar\mu(S\cap A)\frac{\text{Area}(A\cap S\cap Z^c)}{\text{Area}(A\cap Z^c)}.
$$
The condition ensures that you are not dividing by zero.
To see that $\lambda$ is a copula, it suffices to check that it agrees with $\bar\mu$ on the atomic rectangles.
If $R$ is an atomic rectangle, the only contribution to the sum comes from $A=R$. and that term is $\bar\mu(R)\text{Area}(R\cap Z^c)/\text{Area}(R\cap Z^c)$, which is equal to $\bar\mu(R)$.
To see that no mass is put on $Z$, if you substitute $S=Z$, then the numerator of the fraction is zero, so that $\lambda(Z)=0$. This finishes the proof.
There is nothing about this proof that is two-dimensional, so as long as the union of your zero-measure boxes does not contain any atomic boxes, this argument is fine.
