mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-03-14 17:00:05 +01:00
[FMFP] Mostly summarized formal reasoning
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
\newsection
|
||||
\subsection{First-Order Logic}
|
||||
\subsubsection{Syntax}
|
||||
\inlinedefinition[Signature] consists of a set of function symbols $\cF$ and a set of predicate symbols $\cP$, as well as their arities.
|
||||
|
||||
We write $f^k$ (or $p^k$, for predicates) to indicate that it has \textit{arity} $k \in \N$.
|
||||
Constant functions have arity $0$, linear functions have arity $1$, thus, the arity of a given function (or predicate) is given by
|
||||
the number of parameters to uniquely describe it, minus one.
|
||||
|
||||
\inlinedefinition[Term] is the terms of first-order logic is smallest set, where (with $\cV$ again a set of variables)
|
||||
\begin{enumerate}
|
||||
\item $x \in \textit{Term}$ if $x \in \cV$
|
||||
\item $f^n(t_1, \ldots, t_n) \in \textit{Term}$ if $f^n \in \cF$ and $t_i \in \textit{Term}$, $\forall 1 \leq i \leq n$ (description of form of formulas)
|
||||
\end{enumerate}
|
||||
|
||||
\inlinedefinition[Form] is the formulas of first-order logic, is the smallest set where
|
||||
\begin{enumerate}
|
||||
\item $\bot \in \textit{Form}$
|
||||
\item $p^n(t_1, \ldots, t_n) \in \textit{Form}$ if $p^n \in \cP$ and $t_j \in \textit{Term}$, $\forall 1\leq j \leq n$ (description of form of predicates)
|
||||
\item $A \circ B \in \textit{Form}$ if $A \in \textit{Form}$, $B \in \textit{Form}$ and $\circ \in \{ \land, \lor, \rightarrow \}$ (i.e. formulas with logic symbols)
|
||||
\item $Qx.A \in \textit{Form}$ if $A \in \textit{Form}$, $x \in \cV$ and $Q \in \{ \forall, \exists \}$ (i.e. formulas with quantifiers)
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
\paragraph{Binding}
|
||||
\inlinedefinition[Bound variable] A variable that occurs in a quantifier in scope ({\color{blue} blue in example below})
|
||||
|
||||
\inlinedefinition[Free variable] A variable that is not bound by a quantifier in scope ({\color{red} red in example below})
|
||||
|
||||
\inlineexample $(q({\color{red} x}) \lor \exists {\color{blue} x}.\forall {\color{blue} y}. p(f({\color{blue} x}), {\color{red} z}) \land q({\color{red} a}))
|
||||
\lor \forall {\color{blue} x}.r({\color{blue} x}, {\color{red} z}, g({\color{blue} x}))$
|
||||
|
||||
\inlinedefinition[$\alpha$-conversion] A \bi{bound} variable can be renamed at any time, but must preserve binding structure.
|
||||
|
||||
|
||||
\paragraph{Precedences}
|
||||
$\neg > \land > \lor > \rightarrow$, with $>$ a total order of precedences.
|
||||
Quantifiers extend as far right as possible, bounded by the end of line or a going out of scope by closing parenthesis.
|
||||
@@ -0,0 +1,40 @@
|
||||
\subsubsection{Semantics}
|
||||
\inlinedefinition[Structure] is a pair $\cS = \langle U_\cS, I_\cS \rangle$, where $U_\cS$ is the universe and it is a non-empty set and $I_\cS$ is a mapping with
|
||||
\begin{enumerate}
|
||||
\item $I_\cS(p^n)$ is an $n$-ary relation on $U_\cS$ for $p^n \in \cP$ (short $p^\cS$)
|
||||
\item $I_\cS(f^n)$ is an $n$-ary (total) function on $U_\cS$ for $f^n \in \cF$ short ($f^\cS$)
|
||||
\end{enumerate}
|
||||
\inlineintuition The $I_\cS$ is essentially assigning to each predicate and formula its definition in the universe of the structure, noted as a relation.
|
||||
|
||||
\inlinedefinition[Interpretation] is a pair $\cI = \langle \cS, v \rangle$, with $v : \cV \rightarrow U_\cS$ a valuation\\
|
||||
\inlineintuition it assigns definitions to the formulas and predicates (through the structure), as well as values to the variables (through the valuation).
|
||||
|
||||
\inlinedefinition[Value] of a term $t$ under $\cI$ is written as $\cI(t)$ and defined by $\cI(x) = v(x)$ for $x \in \cV$ and\\
|
||||
$\cI(f(t_1, \ldots, t_n)) = f^\cS(\cI(t_1), \ldots, \cI(t_n))$
|
||||
|
||||
\inlinedefinition[Satisfiability] $\models \subseteq$ Interpretations $\times$ \textit{Form} is the smallest relation satisfying
|
||||
\begin{align*}
|
||||
& \langle \cS, v \rangle \models p(t_1, \ldots, t_n) & & \text{ if } (\cI(t_1), \ldots, \cI(t_n)) \in p^\cS \text{ where } \cI = \langle \cS, v \rangle \\
|
||||
& \langle \cS, v \rangle \models \forall x. A & & \text{ if } \langle \cS, v[x \mapsto a] \rangle \models A, \text{ for all } a \in \U_\cS \\
|
||||
& \langle \cS, v \rangle \models \exists x. A & & \text{ if } \langle \cS, v[x \mapsto a] \rangle \models A, \text{ for some } a \in \U_\cS \\
|
||||
\end{align*}
|
||||
|
||||
\inlinedefinition[Model] When $\langle \cS, v \rangle \models A$, then $\langle \cS, v \rangle$ is a \bi{model} for $A$.
|
||||
If $A$ does not have free variables, the satisfaction does not depend on the valuation $v$ and we write $\cS \models A$
|
||||
|
||||
\inlinedefinition[Validity] When every interpretation is a model, we write $\models A$, and we say that $A$ is \bi{valid}
|
||||
|
||||
\inlinedefinition[Satisfiability] $A$ is \bi{satisfiable}, if there exists at least one model for $A$.
|
||||
|
||||
\inlineexample Given $\forall x.p(x, s(x))$, we a model would be
|
||||
\begin{align*}
|
||||
U_\cS & = \N \\
|
||||
p^\cS & = \{ (m, n) \divider m, n \in U_\cS \text{ and } m < n \} \\
|
||||
s^\cS & = \text{ successor function on } U_\cS, \text{ i.e. } s^\cS(x) = x + 1
|
||||
\end{align*}
|
||||
|
||||
|
||||
\paragraph{Substitution}
|
||||
\inlinedefinition[Substitution] Replace all occurrences of a free variable $x$ with some term $t$ in $A$.
|
||||
To denote a substitution, we write $A[x \mapsto t]$. \hl{Important} All free variables in $t$ must still be free in $A[x \mapsto t]$.
|
||||
If that would not be true anymore, do a $\alpha$-conversion first.
|
||||
@@ -0,0 +1,31 @@
|
||||
\subsubsection{Quantifiers}
|
||||
\paragraph{Universal quantification}
|
||||
Additional rules are needed for the universal quantifier. * side condition is that $x$ is not free in any assumption of $\Gamma$
|
||||
\begin{align*}
|
||||
\begin{prooftree}
|
||||
\hypo{\Gamma \vdash A}
|
||||
\infer1[$\forall$-I*]{\Gamma \vdash \forall x.A}
|
||||
\end{prooftree}
|
||||
\qquad
|
||||
\begin{prooftree}
|
||||
\hypo{\Gamma \vdash \forall x.A}
|
||||
\infer1[$\forall$-E]{\Gamma \vdash A[x \rightarrow t]}
|
||||
\end{prooftree}
|
||||
\end{align*}
|
||||
Again here be mindful not to capture free variables.
|
||||
|
||||
\paragraph{Existential quantification}
|
||||
Additional rules are needed for the existential quantifier. ** side condition is that $x$ is neither free in B nor free in $\Gamma$
|
||||
\begin{align*}
|
||||
\begin{prooftree}
|
||||
\hypo{\Gamma \vdash A[x \mapsto t]}
|
||||
\infer1[$\exists$-I]{\Gamma \vdash \exists x.A}
|
||||
\end{prooftree}
|
||||
\qquad
|
||||
\begin{prooftree}
|
||||
\hypo{\Gamma \vdash \exists x.A}
|
||||
\hypo{\Gamma, A \vdash B}
|
||||
\infer2[$\exists$-E**]{\Gamma \vdash A[x \rightarrow t]}
|
||||
\end{prooftree}
|
||||
\end{align*}
|
||||
Again here be mindful not to capture free variables.
|
||||
Reference in New Issue
Block a user