# Prove PSPACE is closed under complement? [duplicate]

How would you prove PSPACE is closed under complement? So far, my thought process is that we can create an algorithm to show that P is closed under complement. I'm struggling with how I can connect that to PSPACE...

• Can you pick one result you want to know about? We discourage asking multiple questions in a single post; usually it is better to post each one separately. Also, what have you tried? What approaches have you already considered for proving it? Where are you stuck? – D.W. Mar 7 '19 at 5:26
• Please see the updated description. – Roger Bresnan Mar 7 '19 at 7:06
• If you can show that P is closed under complement, exactly the same proof shows that any deterministic class is closed under complement. If you can't see how to do that, it suggests that your closure proof for P is more complicated than it needs to be. It's basically one sentence. – David Richerby Mar 7 '19 at 11:24
• I've rolled this back; please don't wipe the content out of a question after it's been answered. There's no real benefit to it, and it means it can't help anyone who searches for it in the future. – Draconis Mar 8 '19 at 3:00

Let $$P$$ be an arbitrary language in PSPACE. In other words, there exists a Turing machine $$T$$ that decides (using polynomial space) whether an arbitrary input $$x$$ is in $$P$$.
Now we can write an algorithm to decide whether $$x$$ is in $$\neg P$$:
• Run $$T$$ on $$x$$
• If $$T$$ accepts, reject
• If $$T$$ rejects, accept
This takes however much space $$T$$ takes, plus a constant. A polynomial plus a constant is still a polynomial. Therefore, $$\neg P$$ is in PSPACE.