Prove 2 identical uniform's are independent by computing the joint distribution Let $A,B,C$ be iid Unif(0,1). Let $X,Y$ be random variables:

*

*$X=(A-B)1_{A-B>0}+(1+(A-B))1_{A-B<0}$


*$Y=(C-B)1_{C-B>0}+(1+(C-B))1_{C-B<0}$
I am able to show that $X,Y$ are id Unif(0,1). My problem is showing they are iid (i.e. I'm missing the independent).
(I'm not allowed to use measure theory here, but I actually don't see how I would anyway since both $X$ and $Y$ have a '$B$' in the formula.)
Okay so elementary probability stuff only. Let's compute joint cdf and hope it's uniform on unit square. This is
$$P(X \le x, Y \le y) = 1_{x,y > 1} + x1_{0 < x < 1, y > 1} + y1_{0 < y < 1, x > 1} + xy1_{0 < x,y < 1}$$
I believe I get everything except the $xy1_{0 < x,y < 1}$ part.
It seems we have to take cases

*

*Case 1:$ X=A-B, Y=C-B$

*Case 2: $X=(A-B)+1, Y=C-B$

*Case 3: $X=A-B, Y=(C-B)+1$

*Case 4: $X=(A-B)+1, Y=(C-B)+1$
Okay let's try Case 1. (Update: The bounds are wrong, but the questions in re the tags are still valid, I believe.)
$$P(0 < X = A - B \le x, 0 < Y = C - B \le y)$$
What I think is conditional probability but of 2 random variables conditioned on 1. Instead of the usual $$P(z_1 < Z < z_2 | B=b) := \int_{z_1}^{z_2} f_{Z|B=b}(z) dz,$$ with $f_{Z|B=b}(z)=\frac{f_{Z,B}(z,b)}{f_B(b)},$ it looks like we'll have like $$P(z_1 < Z < z_2, u_1 < U < u_2 | B=b) := \int_{u_1}^{u_2} \int_{z_1}^{z_2} f_{(Z,U)|B=b}(z,u) dz du,$$ with $f_{(Z,U)|B=b}(z,u) = $, I think, $\frac{f_{Z,U,B}(z,b,u)}{f_B(b)}$

*

*Note: if any of the definitions ':=' are in fact not definitions, then you'll have to explain conditioning on an event of probability zero to me please.

So here's what I think is next:
$$P(0 < X = A - B \le x, 0 < Y = C - B \le y) = P(B < A \le x+B, B < C \le y+B)$$
$$ = \int_{b=0}^{b=1} P(B < A \le x+B, B < C \le y+B | B=b) f_B(b) db \tag{1?}$$
$$ = \int_{b=0}^{b=1} P(b < A \le x+b, b < C \le y+b | B=b) f_B(b) db \tag{2????}$$
$$ = \int_{b=0}^{b=1} \int_{b}^{x+b} \int_{b}^{y+b} f_{(A,C)|B=b}(a,c) dc da f_B(b) db \tag{3 part 1?}$$
$$ = \int_{b=0}^{b=1} \int_{b}^{x+b} \int_{b}^{y+b} \frac{f_{(A,C,B)}(a,c,b)}{f_B(b)} dc da f_B(b) db \tag{3 part 2?}$$
$$ \text{[details omitted because actually the bounds are wrong]}$$
$$ \text{[details omitted because actually the bounds are wrong]}$$
$$ \text{[details omitted because actually the bounds are wrong]}$$
$$ = xy $$
And then assuming all of the above is correct and all the question mark parts are justified, repeat for the other 3 cases and it looks like we have $xy$ in each. Are these cases supposed to be added up and so I'm missing $\frac14$? Or what?

*

*Case 2: $b-1<A<x+b-1, b<C<y+b$, so again just $xy$


*Case 3: $b<A<x+b, b-1<C<y+b-1$, so again just $xy$


*Case 4: $b-1<A<x+b-1, b-1<C<y+b-1$, so again just $xy$
About the question marks:

*

*For $(1?)$, I think the rule is like for an event $E$ and continuous random variable $B$, we have $P(E)=\int_{\mathbb R} P(E|B=b) f_B(b) db$. Is this correct?

*

*Oh wait a minute wiki says we can't quite do this. What I understand is that we can't do it for arbitrary $E$, but we can do it when (but not only when I guess) $E=\{Y \in \ \text{some interval or Borel set I guess}\}$, for some continuous random variable $Y$ s.t. the joint pdf $f_{X,Y}$ is well-defined? (I forgot if any 2 continuous random variables necessarily have a well-defined joint pdf.)



*For $(2????)$, I think we're doing something like for events $E$, $H$ and $G$ and continuous random variable $B$: we have $P(E|H)=P(E \cap H|H)$, but $P(G|H)$ is defined only for $P(H)>0$. What is being done here when technically $P(H)=0$? I mean of course in the 1st place when we say like '$P(E|B=b)$', this is notational, we're not really conditioning on the $P$-null event $\{B=b\}$. But I still don't get exactly what's being done here.


*For $(3 \ \text{parts 1 and 2})$, I'm actually just guessing here, what's the definition of conditional joint cdf of 2 random variables given a 3rd? And please provide a reference.

*

*Wiki just says $F_{(X,Y)|Z=z}(x,y):=P(X \le x, Y \le y|Z=z)$, but it doesn't quite define $P(X \le x, Y \le y|Z=z)$.


*For just 1 continuous random variable conditioned on 1 continuous random variable, it's $P(X \le x, |Z=z) := \int_{-\infty}^{x} f_{X|Z=z}(t) dt$, where $f_{X|Z=z}(t) := \frac{f_{(X,Z)}(x,z)}{f_{Z}(z)}$.


*For 2 continuous random variables conditioned on 1 continuous random variable, I think it's $P(X \le x, Y \le y|Z=z) := \int_{-\infty}^{x} \int_{-\infty}^{y} f_{(X,Y)|Z=z}(t,u) du dt$, but then...


*What's $f_{(X,Y)|Z=z}(t,u)$? (I guess we do the elementary probability way of thinking: define the pdf before the cdf...) According to this site (see problems 1 and 16), it's $f_{(X,Y)|Z=z}(t,u): = \frac{f_{(X,Y,Z)}(t,u,z)}{f_Z(z)}$. So, I guess I'm right about joint cdf/pdf stuff. I'm just hoping for a reference please.
 A: I would like the share the results of staring at a diagram.  I promise to do almost no calculation (and the calculations that are performed involve only multiplications by $0,$ $1,$ and $-1$ along with additions).
Start by re-expressing $X$ as
$$X = A-B \mod 1,$$
which is just the fractional part of $A-B.$  This function is defined on the entire $(A,B)$ plane, where its contours look like those in the first figure.

On this figure I have outlined the unit square.  This is a fundamental domain for the group of unit translations of the square in the plane.  The group has other fundamental domains, though, such as this one:

These domains differ by two congruent regions in which the variables $A\mod 1,$ $B \mod 1,$ and $A-B \mod 1$ have matching values:

Therefore the distributions of $A-B \mod 1$ are the same on both domains.
However, there's an area (=probability)-preserving map between the domains.  The linear transformation defined by the matrix
$$\pmatrix{1 & -1\\0 & 1}$$
is a skew transformation that tilts the second domain (the parallelogram) sideways back into the first domain (the unit square).  Because it is a one-to-one area-preserving transformation and does not change the values of $A \mod 1$ or $B \mod 1,$ it does not change their distribution.  But the image of $A-B \mod 1$ under this transformation is just $A:$

We may perform a similar set of operations in the $(C,B)$ plane where $Y=C-B\mod 1,$ and achieve a comparable result.  The conclusion?  The combined transformation
$$\pmatrix{1 & -1 & 0 \\ 0 & 1 & 0 \\0 & 0 & 1} \pmatrix{1 & 0 & -1\\0 & 1 & 0 \\ 0 & 0 & 1} = \pmatrix{1 & -1 & -1\\0 & 1 & 0\\0 & 0 & 1}$$
is a one-to-one distribution-preserving transformation that maps $(X,B,Y)$ into $(A,B,C).$  Since the latter is a set of iid uniform$(0,1)$ variables, so is the former.  In particular,

$X$ and $Y$ have uniform distributions on $[0,1)$ and are independent (as well as being independent of $B$).

As a check, here's a scatterplot matrix based on 1,000 realizations of $(A,B,C).$
A <- seq(0,1, length.out=11)[-1]
X <- expand.grid(A=A, B=A, C=A) + runif(length(A)^3*3, A[1]-A[2], 0)
X$X <- with(X, (A-B) %% 1)
X$Y <- with(X, (C-B) %% 1)
pairs(subset(X, select=c(X,B,Y)), pch=19, col="#00000010")


All bivariate marginal distributions, at least, appear to be uniform on the square, supporting these results.
A: 
I am able to show that $X,Y$ are id Unif(0,1). My problem is showing they are iid (i.e. I'm missing the independent).

Intuitively:
Besides $X \sim U(0,1)$ and $Y \sim U(0,1)$ you can also show the independence from $B$ like $X|B \sim U(0,1)$ and $Y|B \sim U(0,1)$.

*

*$B$ is the only common variable in the equations for $X$ and $Y$

*The distributions of $X$ and $Y$ are independent from this $B$
This leads to

*

*the $X$ and $Y$ are also independent from each other.


I believe that this intuitive view is sufficient. The rest, computing a joint distribution, is more like an awkward exercise that obscures the insight.
You could compute the joint distribution conditional on $B$ as a 2D uniform variable $X,Y|B \sim U(0,1) \times U(0,1)$ to show independence of the joint distribution from $B$ to conclude that also $X,Y \sim U(0,1) \times U(0,1)$
(I am using the symbol $\times$ to indicate the product of the pdf's, I do not know if there's an official notation or standard)
