If you think about what inflation is (in very simple terms, the price of goods going up) and what index funds are (in very simple terms, a small part ownership of all the businesses), you'll see that it has to match inflation (those goods that cost more... who is selling them? the businesses you own, which = more profits which = worth more = higher index fund price), or beat it if the companies/economy is growing.
Too much inflation is bad for business, and I doubt the stock market wouldn't match inflation in the long term if high levels of inflation (say, 10%+) were the norm. I wouldn't call stocks an inflation hedge, because inflation can very well destroy the value of the companies you own shares in.
Stocks are a good way to share in the prosperity of the economy, because a good proportion of companies you're invested in are providing for people's wants, rather than their needs - and when people are doing well, they meet all their needs and also spend a bunch of their wants. However, when people can't afford their wants because their wages are lagging behind inflation, your stock index funds will do poorly. To hedge against inflation, invest in needs - housing, for example.