expected payoff of an American put option I am reading about the American option and sources got me confused in the part where the American put option is considered on a non-dividend paying asset.

I understand that the payoff of an American put option at maturity is given by $$\max\left\{K-S(T),0\right\}$$ where $K$ is the exercise price and $S(T)$ is the price of the underlying at maturity.

Some sources state that considering n-arbitrage, the American put option problem aims to find the option value $$P(S,t)=\sup_\tau EG_\tau$$ where $G_\tau$ is the gain function and E is expectation. 

In my understanding, the gain function is equivalent to the payoff function, hence $$V(S,t)=\sup_\tau E[max\left\{K-S(\tau),0\right\}]$$ for all stopping times $\tau$.

However, I also stumbled upon sources that say that $$(S,t)=\sup_\tau E[e^{-r(\tau-t)}\max\left\{K-S,0\right\}]$$ for all stopping times $\tau$.

What could be an explanation behind this?
An explanation behind this could be that, as you mention


  [...] the payoff of an American put option at maturity is given by
  $$\max\left\{K-S(T),0\right\}$$


and 


  [...] sources [...] say that $$(S,t)=\sup_\tau E[e^{-r(\tau-t)}\max\left\{K-S(\tau),0\right\}]$$


Thus the difference between the two appears to be the discounting factor considering how far (in time) we are from the exercising/stopping date (which is the same as the maturity date if $\tau=T$), which implies to compute (continuously) the present value of this futur payoff. If  $(\tau-t \rightarrow0) \land (\tau=T \lor t \rightarrow T)$, both equations become equal.

If one decides (for some reasons) that the option will be exercised at maturity, i.e. $\tau=T$ and that "now", $t$, is "turning into this futur date $T$", i.e. $t \rightarrow T$, one gets

$T-t \rightarrow 0 \implies \sup_T e^{-r(T-t)} \rightarrow 1$ 

$\implies \sup_T E[e^{-r(T-t)}\max\left\{K-S(T),0\right\}]$

$\rightarrow  E[\max\left\{K-S(T),0\right\}]\rightarrow\max\left\{K-S(T),0\right\}$

Where the last above row shows that the expected payoff becomes certain.