Kosaraju's algorithm proof