From Statistical Inference by Casella and Berger:
$(1)$ $T$ is a statistic for $X$,
$(2)$ $q(T(x) | \theta)$ is the pmf of $T(X)$ and $\theta$ is a parameter,
$(3) $$A_{T(x)} = \{y : T(y) = T(x)\}$,
$(4)$ There exist functions $g(t|\theta)$ and $ h(x)$ such that for each $(x, \theta)$, $f(x|\theta) = g(T(x)|\theta)h(x)$,
Then, by the definition of the pmf of $T$, $$q(T(x) | \theta) = \sum_{A_{T(x)}}g(T(y)|\theta)h(y)$$
Can someone explain how the definition of the pmf of $T$ shows this equality? I can't figure out a way to show that these two are equal.
What I figure is:
$$q(T(x) | \theta) = P_{\theta}(T(X) = T(x)) = P_{\theta}(\{w : T(X(w) ) = T(X(w_x))\}) = \sum_{w : T(X(w)) = T(X(w_x))}P_{\theta}(\{w\})$$
where $w_x$ is the value of $w$ in the sample space that gives $X(w_x) = x$, and
$$g(T(y)|\theta)h(y) = f_X(y) = P_{\theta}(X = y) = P_{\theta}(\{s : X(s) = X(s_y)\}) = \sum_{s : X(s) = X(s_y)}P_{\theta}(\{s\})$$
where $s$ is defined as above, and
$$\sum_{A_{T(x)}} = \sum_{y \in A_{T(x)}} = \sum_{y: T(y) = T(x)} = \sum_{a \in \Omega: T(X(a)) = T(X(a_x))}$$
but from here I can't see the relationship.
For the discrete case : Let $X_i$ follow a distribution with P.M.F $P_{\theta}{(X)}$. And let $T(X)$ be a function of $X_i's$ . Now define $A_j$ as the event that $T(X_1,X_2,X_3,...X_n)=t$ for each possible combination of $(X_1,X_2,X_3,...X_n)$ such that $T(X_1,X_2,X_3...X_n)=t$. i.e according to your definition $j$ goes from $1$ to $|A_{T(x)}|$. Note that the events $A_j$ are mutually exclusive hence,
$P[T(X)=t] = P_\theta(\cup A_j) = \sum_{i}{P_\theta(A_j)} = \sum_{x : T(x)=t}{P_\theta(x)}$
Hence the result.