I'm not familiar with housing costs in SF, so I'm not sure how considering surrounding areas would change the data, but I know in DC that the surrounding areas are by-and-large as expensive (and in many cases more expensive) than DC-proper.
The point being that whether you consider DC-proper, or DC/Arlington/Bethesda/Silver Spring/McLean doesn't really change things too drastically. Expensive cities tend to be expensive everywhere. I know that in Atlanta, for example, you can live in the city center in a nice place roughly for what it costs to rent an apartment of comparable quality pretty much anywhere in Northern VA. There is a floor (a very high floor) beneath which you will not find quality housing and really not much of a ceiling.