First return time (source code)

= First return time

The first return time to a state $i$ is
$$
T_i^+=\inf\{n\geq1:X_n=i\}.
$$