[proofplan]
We first verify that the signed ranks are well-defined with probability one: continuity excludes zeros and ties among the absolute values. Next we show that, for each observation, symmetry about $0$ makes the sign a fair Bernoulli [random variable](/page/Random%20Variable) independent of the magnitude. Independence of the observations then implies that, after conditioning on all magnitudes and their ranks, the positive-sign indicators remain independent fair Bernoulli variables. Relabelling the observations by increasing absolute value turns the statistic into $\sum_{i=1}^n iB_i$, and since this conditional law does not depend on the observed magnitudes, the same law holds unconditionally.
[/proofplan]
[step:Show that the absolute ranks are defined with probability one]
For each $j \in \{1,\dots,n\}$, continuity of the distribution of $Y_j$ gives
\begin{align*}
\mathbb{P}(Y_j = 0)=0.
\end{align*}
For distinct indices $j,k \in \{1,\dots,n\}$, the random variables $|Y_j|$ and $|Y_k|$ are independent and have continuous distributions on $[0,\infty)$. Hence
\begin{align*}
\mathbb{P}(|Y_j|=|Y_k|)=0.
\end{align*}
Define the full-probability event
\begin{align*}
A := \{\omega \in \Omega : Y_j(\omega)\neq 0 \text{ for every } j,\text{ and } |Y_j(\omega)|\neq |Y_k(\omega)| \text{ for } j\neq k\}.
\end{align*}
On $A$, the ranks $R_1,\dots,R_n$ are uniquely defined and take the values $1,\dots,n$ in some order. Since $\mathbb{P}(A)=1$, changing $W_{n,+}$ arbitrarily on $\Omega \setminus A$ does not affect its distribution.
[/step]
[step:Prove that each sign is fair and independent of its magnitude]
For each $j \in \{1,\dots,n\}$, define the sign indicator $S_j:\Omega \to \{0,1\}$ by $S_j(\omega)=\mathbb{1}_{\{Y_j(\omega)>0\}}$. Let $C \subset [0,\infty)$ be a Borel set. Since $Y_j$ has a continuous distribution, $\mathbb{P}(Y_j=0)=0$. Because $C$ is a Borel subset of $[0,\infty)$, the event $\{S_j=1,\ |Y_j|\in C\}$ is the same as $\{Y_j \in C \cap (0,\infty)\}$. Symmetry of the distribution of $Y_j$ about $0$ gives equal probability to the positive and negative parts of this magnitude event, while the possible contribution at $0$ has probability $0$; hence
\begin{align*}
\mathbb{P}(S_j=1,\ |Y_j|\in C)=\mathbb{P}(Y_j \in C \cap (0,\infty))=\frac{1}{2}\mathbb{P}(|Y_j|\in C).
\end{align*}
Therefore $S_j$ is independent of $|Y_j|$ and
\begin{align*}
\mathbb{P}(S_j=1)=\frac{1}{2}.
\end{align*}
Thus $S_j \sim \operatorname{Ber}(1/2)$.
[guided]
The point of this step is to separate the magnitude information from the sign information. Fix an index $j \in \{1,\dots,n\}$ and define the measurable map $S_j:\Omega \to \{0,1\}$ by $S_j(\omega)=\mathbb{1}_{\{Y_j(\omega)>0\}}$. We must show two facts: $S_j$ is fair, and knowing $|Y_j|$ gives no information about $S_j$.
Let $C \subset [0,\infty)$ be a Borel set. The event $\{|Y_j|\in C\}$ records only the magnitude of $Y_j$, while the event $\{S_j=1\}$ records that $Y_j$ is positive. Since the distribution of $Y_j$ is continuous, there is no atom at $0$, so the positive and negative parts of a magnitude shell account for the whole event $\{|Y_j|\in C\}$ up to a null set. Symmetry about $0$ gives equal probability to the positive and negative parts. Hence
\begin{align*}
\mathbb{P}(S_j=1,\ |Y_j|\in C)=\mathbb{P}(Y_j \in C \cap (0,\infty))=\frac{1}{2}\mathbb{P}(|Y_j|\in C).
\end{align*}
This is exactly the [factorisation criterion for independence](/theorems/1137) of $S_j$ and $|Y_j|$, because it holds for every Borel set $C \subset [0,\infty)$. Taking $C=[0,\infty)$ gives
\begin{align*}
\mathbb{P}(S_j=1)=\frac{1}{2}.
\end{align*}
Therefore $S_j$ is independent of $|Y_j|$ and $S_j \sim \operatorname{Ber}(1/2)$.
[/guided]
[/step]
[step:Condition on the magnitudes and keep independent fair signs]
Define the magnitude vector $M:\Omega \to [0,\infty)^n$ by $M(\omega)=(|Y_1(\omega)|,\dots,|Y_n(\omega)|)$. Since $Y_1,\dots,Y_n$ are independent, the pairs $(S_1,|Y_1|),\dots,(S_n,|Y_n|)$ are independent. From the preceding step, each $S_j$ is independent of $|Y_j|$ and has distribution $\operatorname{Ber}(1/2)$.
We verify the joint factorisation on cylinder events. Let $\varepsilon=(\varepsilon_1,\dots,\varepsilon_n)\in \{0,1\}^n$, and let $C_1,\dots,C_n \subset [0,\infty)$ be Borel sets. Independence of the pairs and the one-dimensional sign-magnitude independence give
\begin{align*}
\mathbb{P}(S_1=\varepsilon_1,\dots,S_n=\varepsilon_n,\ |Y_1|\in C_1,\dots,|Y_n|\in C_n)=2^{-n}\prod_{j=1}^n \mathbb{P}(|Y_j|\in C_j).
\end{align*}
The rectangles $C_1\times \cdots \times C_n$ generate the Borel $\sigma$-algebra on $[0,\infty)^n$, so the [monotone class theorem](/theorems/4925) extends this factorisation to every Borel event determined by $M$. Therefore the sign vector $(S_1,\dots,S_n)$ is independent of $M$ and has product $\operatorname{Ber}(1/2)$ distribution.
Equivalently, for every vector $\varepsilon=(\varepsilon_1,\dots,\varepsilon_n)\in \{0,1\}^n$,
\begin{align*}
\mathbb{P}(S_1=\varepsilon_1,\dots,S_n=\varepsilon_n \mid M)=2^{-n}
\end{align*}
almost surely.
[/step]
[step:Relabel by increasing absolute value]
Let $S_n$ denote the symmetric group of all permutations of $\{1,\dots,n\}$. On the event $A$, define the permutation $\pi:\Omega \to S_n$ by requiring
\begin{align*}
|Y_{\pi(1)}| < |Y_{\pi(2)}| < \cdots < |Y_{\pi(n)}|.
\end{align*}
Then $R_{\pi(i)}=i$ for each $i \in \{1,\dots,n\}$. Therefore, on $A$,
\begin{align*}
W_{n,+}(Y_1,\dots,Y_n)=\sum_{j=1}^n R_j S_j=\sum_{i=1}^n R_{\pi(i)}S_{\pi(i)}=\sum_{i=1}^n i S_{\pi(i)}.
\end{align*}
Since $\pi$ is determined by $M$, conditioning on $M$ makes $\pi$ fixed. The conditional distribution of $(S_{\pi(1)},\dots,S_{\pi(n)})$ is therefore still the product distribution of $n$ independent $\operatorname{Ber}(1/2)$ random variables. Hence, conditionally on $M$,
\begin{align*}
W_{n,+}(Y_1,\dots,Y_n) \overset{d}{=} \sum_{i=1}^n iB_i,
\end{align*}
where $B_1,\dots,B_n$ are independent $\operatorname{Ber}(1/2)$ random variables.
[/step]
[step:Remove the conditioning and identify the null law]
The conditional distribution obtained in the preceding step does not depend on the realised value of $M$. Therefore the unconditional distribution is the same distribution:
\begin{align*}
W_{n,+}(Y_1,\dots,Y_n) \overset{d}{=} \sum_{i=1}^n iB_i.
\end{align*}
The right-hand side depends only on $n$ and not on the particular continuous symmetric distributions of $Y_1,\dots,Y_n$. Consequently, the signed-rank test calibrated using the exact law of $\sum_{i=1}^n iB_i$ is distribution-free under the null hypothesis.
[/step]