@Simon It really depends if you are a retail trader or an institutional hedge fund, as the way margin is calculated changes significantly.
If you are a retail trader and go long $1mil AAPL & short $1mil SPY, then you will be margined based on a $2mil position, i.e. your broker uses a very unrealistic model of the world (just because it's cheaper and safer being a more conservative assumption) and doesn't care about correlation between AAPL & SPY.
On the institutional side though, funds that have accounts with prime brokers (MS, Goldman, Citi, etc) are being margined through the use of much more realistic models which in fact would in this case say that by doing long AAPL short SPY you have less risk compared to being long only $1mil AAPL. So they would charge less margin.
Now in terms of short-selling a stock, funds would locate a borrow from a broker (i.e. they would borrow the stock from someone and pay borrow cost on that) and then sell the position and receive cash. That cash needs to be invested at least in an overnight rate facility to mitigate the cost of borrowing the stock.
So to summarise if you are building a strategy for your personal account you are right, but if this is a strategy meant to be run by an institutional fund there is more to it.
Also i forgot to make one final point: That prime brokers are quite flexible with the use of collateral. That is if you are a fund and have an account with a prime broker and receive cash from a stock sale and go buy bonds with that cash, if and when more collateral is required you can post those bonds with the prime broker. (no need to liquidate and post cash only as margin)