1. 1. 1. We see that $([<>])\mapsto [<>]\mapsto <> \mapsto \epsilon$, so $([<>])\stackrel{!}{\mapsto}\epsilon$ and we see that $$\frac{\frac{\frac{\epsilon}{<>N}}{[<>]N}}{([<>])N}$$ 2. We can show that there is no string in language $N$ that has a closing bracket before an opening bracket. We see that the induction basis is true, because $\epsilon$ has no brackets. If we assume that $e N$, and that $e$ has no closing bracket before an opening bracket we see that $(e)$ only adds a opening bracket at the front and a closing bracket at the end, hence we see that $(e)$ also has no closing bracket before an opening bracket. The same can be said for $N$, $[e]N$, hence we have proven the induction basis and therefore we see that $[]()[]$ cannot be in language $N$. We see that $[]()[]\mapsto]()[$. We see that there are only transitions defined if the string starts with an opening bracket and ends with a closing bracket, hence $]()[$ has no transition and is therefore a stuck state. 3. 1. We will prove this with induction. For the induction basis assume that $s=\epsilon$. We see by Refl* that $s\stackrel{!}{\mapsto} \epsilon$. Now assume that $e N$ and that $e\stackrel{!}{\mapsto} \epsilon$. We see that $(e)N$ and that $(e)\mapsto e$, so by Trans* we see that $(e)\stackrel{!}{\mapsto} \varepsilon$. We see the same for $[e]$ and $$. 2. We will prove this with induction. For the induction basis assume that $s=\varepsilon$. We see that $\epsilon N$. Now assume that $e \stackrel{*}{\mapsto} \epsilon$ and that $e N$. We see by N-1 that $(e) N$. we see the same for $[e]$ and $$. 2. 1. $$\circ \mid [(<>)]\mapsto B\triangleright\circ \mid(<>)]\mapsto P\triangleright B\triangleright\circ \mid<>)]\mapsto A\triangleright P\triangleright B\triangleright\circ \mid>)]\mapsto P\triangleright B\triangleright\circ \mid)]\mapsto B\triangleright\circ \mid]\mapsto \circ \mid \epsilon$$ 1. We will prove a more general claim. We will define the string of a stack as $\text{Str}(\circ)=\epsilon$,$\text{Str}(P\triangleright s)=)\text{Str}(s)$ ,$\text{Str}(A\triangleright s)=>\text{Str}(s)$,$\text{Str}(B\triangleright s)=]\text{Str}(s)$. Then we will show that if $e N$ then $s\mid e \text{Str}(s) \stackrel{*}{\mapsto} s \mid \text{Str}(s)$. We will prove this with induction. For $e=\epsilon$ this is true because of Refl*. Now assume $e N$ and that $s\mid e \text{Str}(s) \stackrel{*}{\mapsto} s \mid \text{Str}(s)$ for all states $s$. We see that $s \mid (e)\text{Str}(s) \mapsto P \triangleright s \mid e)\text{Str}(s))$ which is equal to $P \triangleright s \mid e\text{Str}(P\triangleright s))$. Because of our induction hypothesis we get $P \triangleright s \mid e\text{Str}(P\triangleright s))\stackrel{*}{\mapsto}P \triangleright s \mid \text{Str}(P\triangleright s))$ which is equal to $P\triangleright s\mid ) \text{Str}(s) \mapsto s \mid \text{Str}(s)$, hence because of our lemma $s\mid (e) \text{Str}(s) \stackrel{*}{\mapsto} s \mid \text{Str}(s)$. For $<>$ and $[]$ the proof is the same. The lemma was already proven in an earlier exercise. 2. We will prove a more general case: $s \mid e\text{Str}(s) \stackrel{*}{\mapsto} s \mid \text{Str}(s)\implies e N$. If $s \mid e\text{Str}(s) = s \mid \text{Str}(s)\implies e N\forall s$ we see that $e=\epsilon$, so $e N$. We will now assume that $P \triangleright s \mid e \text{Str}(P \triangleright s) \mapsto P\triangleright s \mid \text{Str}(P\triangleright s)$ and our induction hypothesis will be that $eN$. We see that $s \mid (e\text{Str}(P\triangleright s) \mapsto P\triangleright s \mid$