Suppose P is a set of balanced parentheses. Balanced parentheses is defined inductively and recursively as such:
- $\lambda$ is an empty balanced parentheses
- $\lambda\in P$
- if $w\in P$, then $(w)\in P$.
- if $w_1\in P$, $w_2\in P$, then $w_1w_2\in P$.
As a human, by common sense, since ))(() has a ) at front, it violates the definition of balanced parentheses.
But my question is, how to use the definition above rigorously to prove this proposition since I am so troubled by can't using both direct and contrapositive proof?