arbitrage proof question

prove the condition $D<R<U$ is equivalent to the absence of arbitrage:

R = risk free investment rate of return. U and D are returns corresponding to the upward/downward price movements of a risky security.

The basic idea of arbitrage is to buy low, sell high with no risk or initial investment

So Assume R >= U or R<=D (contrapositive)

At time 0

1) We short the security with price S (get +S)

2) We invest the security into the risk free investment (-S) Balance at time 0 = 0

At time 1

1) We get our risk free investment back (+S(1+R))

2) We buy back one share of the stock. There are two scenarios

a) Stock price goes up: (-S(1+U)) Profit = S(1+R)-S(1+U) >= 0 because R>=U (profit is always non negative, there is arbitrage)

b) Stock price goes down: (-S(1+D)) Profit = S(1+R)-S(1+D) <= 0 because R<=D (from assumption), but this shows profit can be negative here-there is no sure risk free profit arbitrage! so i'm stuck here.

When $R < D \ (< U)$, the return of the stock dominates the risk-free return in all states of the world. To benefit from that, just borrow cash and invest in the stock. At $t=0$ this requires no net investment: borrowing cash means your account is credited $S_0$, while subsequently buying the stock suggests it is debited $S_0$. At the end of a period you owe the bank interests on the cash which has been lent to you $S_0 (1+R)$ but being long stock you have a position now worth $S_0 (1+D)$ or $S_0(1+U)$ if you were to sell which is always more than the interests owed, hence positive profit in all states of the world, hence free lunch.
When $(D <) \ U < R$ the risk-free return dominates the stock return in all states of the world. To benefit from that, just short sell the stock and invest in the risk-free money market account. At $t=0$ this requires no net investment (just deposit the proceeds of the short sell on the risk-free account). At the end of the period you receive interests $S_0 (1+R)$ while being short stock costs you $S_0 (1+D)$ or $S_0(1+U)$ (since you sold without possessing the stock before hand, you need to buy to it before you can give it to your counterpaty) which is always less that what you earned, hence positive profit in all states of the world, hence free lunch.