The coarea formula