How does this prove the memoisation?