1 \documentclass[a4paper, 10pt, pagesize, smallheadings]{article}
3 %\usepackage[latin1]{inputenc}
4 \usepackage{amsmath, amsthm, amssymb}
7 \usepackage{algorithmic}
11 \title{Theory I, Sheet 8 Solution}
13 \renewcommand{\familydefault}{\sfdefault}
14 \newcommand{\Pos}{\mathcal{P}os}
15 \include{pythonlisting}
21 \section*{Exercise 8.1}
22 Let $s, t \in T(\Sigma, X)$ be terms over $X$ and $p, q$ be strings over the natural numbers. We provide proofs by induction.
23 \subsection*{1. $pq \in \Pos(s) \implies p \in \Pos(s)$ }
24 $(IH): pq \in \Pos(s) \implies p \in \Pos(s)$\\\\
26 From $s \in X$ or $s \in \Sigma^{(0)}$ follows $\Pos(s) = \{\epsilon\}$.\\
27 Trivially it follows that $pq \in \Pos(s) \iff pq = \epsilon$ and $pq \in \Pos(s) \implies p \in \Pos(s)$ with $pq \notin \Pos(s) \lor pq = p = \epsilon$. \\
29 \noindent \emph{Inductive case:}\\
30 Let $s = f(t_1, ...,t_n) \in T(\Sigma, X)$ it follows $\Pos(s) = \{\epsilon\} \cup \bigcup_{i = 1}^{n}\{ip \mid p \in \Pos(t_i)\}$.\\
32 pq \in \Pos(s) &\implies p \in \Pos(s)\\
33 \iff pq \in \{\epsilon\} \cup \bigcup_{i = 1}^{n}\{ip \mid p \in \Pos(t_i)\} &\implies p \in \{\epsilon\} \cup \bigcup_{i = 1}^{n}\{ip \mid p \in \Pos(t_i)\}\\
36 \section*{Exercise 8.2}
37 \subsection*{1. $t = \neg (x \land (\top \lor y)), \sigma = \{x \mapsto \bot, y \mapsto \top \land x\}, \tau = \{z \mapsto \top, x \mapsto \top\}$}
39 \sigma(t) &= \neg (\bot \land (\top \lor ( \top \land x)))\\
40 \tau \sigma(t) &= \tau(\neg (\bot \land (\top \lor ( \top \land x)))) = \neg (\bot \land (\top \lor (\top \land \top)))\\
43 \subsection*{2. $t = \neg(\top \land (\bot \lor y)), s = \neg(x \land (\bot \lor (x \land \bot)))$}
44 \[\sigma(t) = \sigma(s) \text{ with } \sigma = \{x \mapsto \top, y \mapsto \top \land \bot \} \]
47 Substitution composition is \emph{not} commutative, we give a counterexample.
48 Let $t = x$, $\sigma = \{x \mapsto \bot\}$ and $\tau = \{x \mapsto \top\}$, it follows:
49 \[\tau\sigma(t) = \bot\]
50 \[\sigma\tau(t) = \top\]
51 We see that $\tau\sigma(t) \neq \sigma\tau(t)$.