# For episodic tasks with an absorbing state, why can't we both have $\gamma=1$ and $T= \infty$ in the definition of the return?

For episodic tasks with an absorbing state, why can't $$\gamma=1$$ and $$T= \infty$$?

In Sutton and Barto's book, they say that, for episodic tasks with absorbing states that becomes an infinite sequence, then the return is defined by:

$$G_t=\sum_{k=t+1}^{T}\gamma^{k-t-1}R_k$$

This allows the return to be the same whether the sum is over the first $$T$$ rewards, where $$T$$ is the time of termination or over the full infinite sequence, with $$T=\infty$$ xor $$\gamma=1$$.

Why can't we have both? I don't see how they can both be set to those parameters. It seems like, if you have an absorbing state, the rewards from terminal onward will just be 0 and not be affected by $$\gamma$$ or $$T$$.

Here's the full section of the book on page 57 in the 2nd edition

I think the reasoning behind this also leads to why for policy evaluation where

$$v_\pi(s)=\sum_a\pi(a|s)\sum_{s',r}p(s',r|s,a)[r+\gamma v_\pi(s')]$$

"Has an existence and uniqueness guarantee only if $$\gamma < 1$$ or termination is guaranteed under $$\pi$$"(page 74). This part I'm also a bit confused by, but seems related.

$$T = \infty$$ and $$\gamma = 1$$ cannot be both true at the same time because the return defined in equation 3.11 is supposed to be a unified definition of the return for both continuing and episodic tasks. In the case of continuing tasks, $$T = \infty$$ and $$\gamma = 1$$ cannot be true at the same time, because the return may not be finite in that case (as I think you already understood).
Moreover, note that, in that specific example of the book, they assume that the agent ends up in an absorbing state, so this specific sum is finite, no matter whether $$T$$ is finite or $$\infty$$, given that, once you enter the absorbing state, you will always get a reward of $$0$$. Of course, if you discount those specific rewards, the sum will still be finite. However, in general, if you had a different MDP where the absorbing state is not reachable (i.e. the episode never ends), then the return could not be finite.