|
6 | 6 |
|
7 | 7 | %% Show notes on other screen |
8 | 8 | \usepackage{pgfpages} |
9 | | -% \setbeameroption{show notes on second screen=right} |
| 9 | +%notes%\setbeameroption{show notes on second screen=right} |
10 | 10 |
|
11 | 11 | %% Use overlays for enum and item environments. |
12 | 12 | % \beamerdefaultoverlayspecification{<+->} |
|
51 | 51 | \begin{document} |
52 | 52 | \begin{frame}[plain] |
53 | 53 | \titlepage{} |
| 54 | + \note{Hi, I'm Alexander Cox. Today I'm going to tell you about my COMP3710 project which I have been doing as part of my Bachelor of Science.} |
54 | 55 | \end{frame} |
55 | 56 |
|
56 | 57 | \section{Introduction} |
57 | | -\subsection{Introduction} |
58 | 58 | \begin{frame} |
59 | 59 | \frametitle{Introduction} |
60 | 60 | Over the summer, I have been formalising some proof theory in the HOL4 theorem prover. |
| 61 | + \note[item]{This summer I have been using the HOL interactive theorem prover to formalise some mathematical logic.} |
61 | 62 |
|
62 | 63 | \bigskip |
63 | 64 | The proof I have been formalising is the equivalence between Natural Deduction and Sequent Calculus, for intuitionistic propositional logic. |
| 65 | + \note[item]{I wanted to formalise the proof of the equivalence between two propositional logic calculi, Natural Deduction and Sequent Calculus. } |
64 | 66 |
|
65 | 67 | \bigskip |
66 | 68 | I have been working from \textcite{bpt}, with some small deviations which I shall explain along the way. |
| 69 | + \note[item]{I have been working from the book "basic proof theory" by Troelstra and Schwichtenburg. I will note any differences from the book when relevant.} |
67 | 70 | \end{frame} |
68 | 71 |
|
69 | 72 | \section{Theorem Proving} |
70 | | -\subsection{Introduction} |
71 | 73 | \begin{frame}{Theorem Provers} |
72 | 74 | \begin{itemize} |
73 | 75 | \item{I assume you already have some knowledge of theorem provers, but I include this brief definition for completeness.} |
| 76 | + \note[item]{I am guessing that you have seen many of the definitions I am going to give, but I will include the important ones for completeness.} |
74 | 77 | \item An \emph{Interactive Theorem Prover} or \emph{Proof Assistant} is software used to formalise and verify the correctness of proofs. |
| 78 | + \note[item]{A Theorem Prover is a software environment in which you can formalise and check the correctness of proofs.} |
75 | 79 | \item Proving a proposition in a theorem prover usually takes significantly more time than proving an informal proof on paper. |
| 80 | + \note[item]{Using a theorem prover to formalise something usually takes more time and effort than it would on paper.} |
76 | 81 | \end{itemize} |
77 | 82 | \end{frame} |
78 | 83 |
|
79 | | -\subsection{HOL4} |
80 | | -\begin{frame}{The HOL Theorem Prover} |
81 | | - I have been using the HOL theorem prover (HOL4), a theorem prover which implements a Higher Order Logic which is a variant of Church's Simple Theory of Types. |
82 | | - |
83 | | - \bigskip |
84 | | - HOL is engineered so that theorems can only be produced under the control of a small trusted kernel. This small trusted kernel consists of a handful of axioms and some basic inference rules. Larger, more complicated, inference rules are constructed using this small trusted kernel. |
85 | | -\end{frame} |
86 | | - |
87 | 84 | \subsection{Motivation} |
88 | 85 | \begin{frame}{Why Bother?} |
| 86 | + \note{So why have I chosen to use a theorem prover, given that it takes so much time and effort? } |
89 | 87 | \begin{enumerate} |
90 | 88 | \item Once a theorem is proved in a theorem prover, you can trust that it is a correct proof, provided that the theorem prover itself is sound. |
| 89 | + \note[item]{Well, given that your theorem prover is sound, proving a proposition in the theorem prover gives you a guarantee of correctness for your proof.} |
91 | 90 | \item Proving a theorem formally can reveal problems with the informal proof in some cases, since details cannot be skimmed over like they sometimes are in informal proofs. |
| 91 | + \note[item]{Also, sometimes when mathematicians prove something informally, they make small mistakes, or skim over details which appear trivial. In a theorem prover this is not possible, every step needs to be justified.} |
92 | 92 | \item I wanted to learn about theorem provers, and this seemed like a good project for that. |
| 93 | + \note[item]{Another reason I wanted to do this project is because I wanted to learn to use a theorem prover, and this project seemed like a good fit for that purpose.} |
93 | 94 | \end{enumerate} |
94 | 95 | \end{frame} |
95 | 96 |
|
| 97 | +\subsection{HOL4} |
| 98 | +\begin{frame}{The HOL Theorem Prover} |
| 99 | + I have been using the HOL theorem prover (HOL4), a theorem prover which implements a Higher Order Logic which is a variant of Church's Simple Theory of Types. |
| 100 | + \note[item]{The theorem prover I have been using is HOL4, which I will refer to as just HOL. It implements a variant of Church's Simple Theory of Types, which is a Higher Order Logic.} |
| 101 | + |
| 102 | + \bigskip |
| 103 | + HOL is engineered so that theorems can only be produced under the control of a small trusted kernel. This small trusted kernel consists of a handful of axioms and some basic inference rules. Larger, more complicated, inference rules are constructed using this small trusted kernel. |
| 104 | + \note[item]{HOL theorems can only be constructed using a small trusted kernel. This kernel consists of just a few axioms and inference rules which are considered correct by the HOL community. All higher level inference relies on only this small trusted kernel.} |
| 105 | +\end{frame} |
| 106 | + |
96 | 107 | \section{Proof Theory and Logic} |
97 | 108 |
|
98 | 109 | \subsection{Proof Theory} |
99 | 110 | \begin{frame}{Proofs about proofs} |
100 | 111 | I have been talking about proofs in HOL, now I'm going to talk about proof theory in HOL, i.e., proofs about proofs in HOL. This discussion is syntactical, and not semantic. |
| 112 | + \note[item]{Before I proceed, I'd like to make sure I don't confuse you. I have just been talking about proving mathematical propositions in HOL, these could be any mathematical proofs.} |
| 113 | + \note[item]{I'm about to talk about proof theory in HOL, which involves proofs about proofs.} |
101 | 114 |
|
102 | 115 | \bigskip |
103 | | - HOL is the meta-logic used to formalise the (object-)logic which is used in the proof systems I am analysing. |
| 116 | + HOL is the meta-logic used to formalise the (object-)logic which is used in the proof systems I am analysing. The object-logic is intuitionistic propositional logic. |
| 117 | + \note[item]{HOL is the meta-logic I am using to formalise the object-logic of the proof calculi I have studied. These calculi use intuitionistic propositional logic.} |
104 | 118 |
|
105 | 119 | \bigskip |
106 | 120 | Standard ML is the meta-language of HOL and the interface to the logic. |
| 121 | + \note[item]{HOL is written in the functional programming language Standard ML, which is also the main interface of HOL. This makes Standard ML the meta-language of HOL.} |
107 | 122 |
|
108 | 123 | \bigskip |
109 | 124 | English is the language and meta-language of this talk. |
| 125 | + \note[item]{English is both the language and meta-language of this talk.} |
110 | 126 | \end{frame} |
111 | 127 |
|
112 | 128 | \subsection{Logic} |
113 | 129 |
|
114 | 130 | \begin{frame}[fragile] |
115 | 131 | \frametitle{Propositional Logic Syntax} |
| 132 | + \note[item]{The formulae of propositional logic are defined inductively. Here is the definition in Backus-Naur Form:} |
116 | 133 | Propositional logic formulae are defined inductively as follows: |
| 134 | + \note[item]{A formula phi is either a variable, a disjunction of formulae, a conjunction of formulae, a implication between formulae, or the falsity operator.} |
117 | 135 | \[ \varphi ::= a~|~\varphi \lor \varphi~|~\varphi \land \varphi~|~\varphi \to \varphi~|~\bot \] |
118 | 136 |
|
119 | 137 | \bigskip |
120 | 138 | In HOL: |
| 139 | + \note[item]{Here is the definition of formulae as I formalised it in HOL, which is much the same as in mathematical notation above, but defines a datatype named formula, which above I called phi, and the logical operators are given in prefix notation rather than infix as they are in the mathematical form.} |
121 | 140 | \begin{HOLmath} |
122 | 141 | \HOLthm{FormulaSyntax.datatype_formula} |
123 | 142 | \end{HOLmath} |
124 | | - \note{These connectives are defined in prefix even though they are used as infix later.} |
| 143 | + \note[item]{These connectives are defined in prefix here due to the way datatypes are defined in HOL, but are used in infix later.} |
125 | 144 |
|
126 | 145 | I'm using typeset definitions and theorems exported from HOL. |
127 | 146 | \end{frame} |
|
130 | 149 | \begin{notn} |
131 | 150 | I use $A,B,C$ for arbitrary formulae. |
132 | 151 | \end{notn} |
| 152 | + \note[item]{The remainder of propositional logic syntax is defined by abbreviation.} |
| 153 | + \note[item]{The following lines beginning with a turnstile are definitions exported from HOL.} |
133 | 154 | \begin{notn} |
134 | 155 | Lines beginning with $\vdash$ are `theorems' (the \texttt{thm} type), from HOL. |
135 | 156 | \end{notn} |
136 | 157 |
|
| 158 | + \note[item]{Negation is defined as implication of falsity.} |
| 159 | + \note[item]{Bi-implication is defined as the conjunction of the implication and it's converse.} |
| 160 | + \note[item]{Truth is defined as falsity implying itself} |
137 | 161 | \begin{defn} |
138 | 162 | \begin{HOLmath} |
139 | 163 | \HOLthm[tt]{FormulaSyntax.Not_def}\\ |
|
147 | 171 | \subsection{Inference Rules} |
148 | 172 |
|
149 | 173 | \newcommand{\bs}{\char`\\} |
150 | | -\begin{frame}[fragile] |
151 | | - \frametitle{Inference Rules} |
152 | | - An inference rule in a system $S$ is a condition under which a conclusion can be inferred from hypotheses: |
153 | | - \[ |
154 | | - \AxiomC{$\Gamma_0 \vdash_S \varphi_0$} |
155 | | - \AxiomC{$\dots$} |
156 | | - \AxiomC{$\Gamma_n \vdash_S \varphi_n$} |
157 | | - \RightLabel{(rule)} |
158 | | - \TrinaryInfC{$\Delta \vdash_S \psi$} |
159 | | - \DisplayProof |
160 | | - \] |
161 | | - Presented with hypotheses above and conclusion below. |
| 174 | +\begin{frame}[fragile]{Inference Rules} |
| 175 | + \note[item]{I use inference rules to define my calculi, so I will first define inference rules.} |
| 176 | + An inference rule in a system $S$ is a condition under which a conclusion can be inferred from hypotheses: |
| 177 | + \note[item]{An inference rule in a system is a condition under which a conclusion can be inferred from hypotheses.} |
| 178 | + \[ |
| 179 | + \AxiomC{$\Gamma_0 \vdash_S \varphi_0$} |
| 180 | + \AxiomC{$\dots$} |
| 181 | + \AxiomC{$\Gamma_n \vdash_S \varphi_n$} |
| 182 | + \RightLabel{(rule)} |
| 183 | + \TrinaryInfC{$\Delta \vdash_S \psi$} |
| 184 | + \DisplayProof |
| 185 | + \] |
| 186 | + Presented with hypotheses above and conclusion below. |
| 187 | + \note[item]{The hypotheses are presented above the line, the rule name to the right, and the conclusion below.} |
162 | 188 |
|
163 | | - \bigskip |
164 | | - In HOL I type: |
165 | | - \begin{alltt} |
166 | | - S \(\Gamma_0\) \(\varphi_0\) /\bs{} ... /\bs{} S \(\Gamma_n\) \(\varphi_n\) ==> S \(\Delta\) \(\psi\) |
167 | | - \end{alltt} |
| 189 | + \bigskip |
| 190 | + In HOL I type: |
| 191 | + \begin{alltt} |
| 192 | + S \(\Gamma_0\) \(\varphi_0\) /\bs{} ... /\bs{} S \(\Gamma_n\) \(\varphi_n\) ==> S \(\Delta\) \(\psi\) |
| 193 | + \end{alltt} |
| 194 | + \note[item]{And here is how it is typed in HOL, as a conjunction of hypotheses implying a conclusion.} |
| 195 | + \note[item]{Note that in my project code I used a prefix relation for each calculi, and in this presentation I use and infix turnstile with the system name as a subscript.} |
168 | 196 |
|
169 | | - In HOL, I represent the infix binary relation ($\vdash_S$) as a prefix \texttt{S} relation, for no particular reason. |
| 197 | + In HOL, I represent the infix binary relation ($\vdash_S$) as a prefix \texttt{S} relation, for no particular reason. |
170 | 198 | \end{frame} |
171 | 199 |
|
172 | 200 | \subsection{Natural Deduction} |
173 | 201 | \begin{frame}{Natural Deduction} |
| 202 | + \note[item]{The first Calculus I will talk about is Natural Deduction, which I present in sequent style.} |
| 203 | + \note[item]{I represent the open assumptions as a set of hypotheses to the left of the turnstile.} |
| 204 | + \note[item]{Natural Deduction has one axiom in addition to introduction and elimination rules for each operator except falsity, which only has an elimination rule.} |
174 | 205 | In Natural Deduction (\textbf{N}) the hypotheses are a represented as a set of formulae (\textbf{N} is in sequent style). \textbf{N} has introduction and elimination rules, as well as one axiom. |
175 | 206 | \begin{defn}[Some \textbf{N} rules] |
176 | 207 | \begin{HOLmath} |
|
185 | 216 | \begin{remk} |
186 | 217 | I will only present some of the rules in this talk, there are introduction and elimination rules for each formula connective. |
187 | 218 | \end{remk} |
| 219 | + \note[item]{There are more rules than these, please ask at the end of the talk if you'd like to see them.} |
188 | 220 |
|
189 | 221 | \end{frame} |
190 | 222 |
|
191 | 223 | \begin{frame}{Weakening in Natural Deduction} |
192 | 224 | You can add additional assumptions if you like, this is called weakening. |
| 225 | + \note[item]{Weakening is permitted in Natural Deduction, here is the proof} |
193 | 226 |
|
194 | 227 | \begin{lemma}[\textbf{N} weakening] |
195 | 228 | \begin{HOLmath} |
|
213 | 246 | \end{corl} |
214 | 247 | \end{frame} |
215 | 248 |
|
216 | | -\begin{frame}{Discharge deviation from book} |
| 249 | +\begin{frame}{Discharge difference from book} |
217 | 250 | \begin{remk} |
218 | 251 | In the book, the hypotheses are labelled. In my formalisation I keep them unlabelled (Complete Discharge Convention, permissible). |
219 | 252 | \end{remk} |
| 253 | + \note[item]{The standard formulation in the book uses labelled assumptions, which are discharged separately even if they are the same formula. I use the complete discharge convention from the book, which is equivalent to the labelled discharge for my purposes.} |
220 | 254 |
|
221 | 255 | \bigskip |
| 256 | + \note[item]{The inference rules I use which have a discharge are slightly different from those in the book.} |
| 257 | + \note[item]{My rules have a set union above the line, the book has a set difference below the line. Here are the rules which differ.} |
222 | 258 | \begin{defn}[\textbf{Nd} discharge rules] |
223 | 259 | The book has different rules for discharge, which I formalised as \textbf{Nd}: |
224 | 260 | \begin{HOLmath} |
|
230 | 266 |
|
231 | 267 | \end{frame} |
232 | 268 |
|
233 | | -\begin{frame}{The deviation is equivalent} |
| 269 | +\begin{frame}{The difference is equivalent} |
| 270 | + \note[item]{I prove that the two formulations are equivalent, that is, they derive the same formulae from the same assumptions.} |
234 | 271 | \begin{thm}[\textbf{N} is equivalent to \textbf{Nd}] |
235 | 272 | Both formulations derive the same formulae from the same hypotheses: |
236 | 273 | \begin{HOLmath} |
237 | 274 | \HOLthm{IntuitionisticProof.N_Nd} |
238 | 275 | \end{HOLmath} |
239 | 276 | \end{thm} |
240 | 277 |
|
| 278 | + \note[item]<1>{First I prove from my formulation to theirs.} |
241 | 279 | \begin{onlyenv}<1> |
242 | 280 | \begin{proof}[Proof (only if).] |
243 | 281 | By rule induction on \textbf{N}. |
@@ -549,6 +587,26 @@ rw[SUBSET_DEF] |
549 | 587 | \end{alltt} |
550 | 588 | \end{frame} |
551 | 589 |
|
| 590 | +\subsection{Primary Theorem} |
| 591 | +\begin{frame}[fragile]{Proof Of The Primary Theorem} |
| 592 | + |
| 593 | +\begin{thm}[Equivalence of \textbf{G} and \textbf{N}] |
| 594 | + |
| 595 | + \begin{HOLmath} |
| 596 | + \HOLthm{IntuitionisticProof.G_iff_N} |
| 597 | + \end{HOLmath} |
| 598 | +\end{thm} |
| 599 | +\begin{proof} |
| 600 | + \begin{alltt} |
| 601 | + rw[] >> |
| 602 | + EQ_TAC >- rw[G_N] >> |
| 603 | + rw[] >> |
| 604 | + `G (unibag \HOLtm{Gamma}) A` by metis_tac[N_G] >> |
| 605 | + metis_tac[G_unibag] |
| 606 | + \end{alltt} |
| 607 | +\end{proof} |
| 608 | +\end{frame} |
| 609 | + |
552 | 610 | \section{Conclusion} |
553 | 611 |
|
554 | 612 | \subsection{Future Work} |
|
0 commit comments