The local index formula in noncommutative geometry