Merge branch 'mob'
[arxana.git] / org / farm-2017.org
blob901cb50bed99a8aa131824b59337788645760903
1 #+TITLE:     Functional models of mathematical reasoning
2 #+AUTHOR:    Joseph Corneli and Raymond Puzio
3 #+EMAIL:     contact@planetmath.org
4 #+DATE:      May 27, 2017 for Thursday 1 June, 2017 deadline
5 #+DESCRIPTION: Outline and draft of 12 page paper on math text analysis for FARM workshop at ICFP 2017
6 #+KEYWORDS: arxana, hypertext, inference anchoring theory
7 #+LANGUAGE: en
8 #+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil -:t f:t *:t <:t
9 #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
10 #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
11 #+EXPORT_SELECT_TAGS: export
12 #+EXPORT_EXCLUDE_TAGS: noexport
13 #+LINK_UP:
14 #+LINK_HOME:
15 #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://metameso.org/~joe/solarized-css/build/solarized-light.css" />
16 #+BIBLIOGRAPHY: farm-refs plain
17 #+LATEX_HEADER: \usepackage[backend=bibtex,sorting=none]{biblatex}
18 #+LATEX_HEADER: \addbibresource{farm-refs}
19 #+STARTUP: showeverything
22 #+BEGIN_QUOTE
23 Functional Programming has emerged as a mainstream software
24 development paradigm, and its artistic and creative use is booming. A
25 growing number of software toolkits, frameworks and environments for
26 art, music and design now employ functional programming languages and
27 techniques. FARM is a forum for exploration and critical evaluation of
28 these developments, for example to consider potential benefits of
29 greater consistency, tersity, and closer mapping to a problem domain.
31 FARM encourages submissions from across art, craft and design,
32 including textiles, visual art, *music*, 3D sculpture, animation, GUIs,
33 video *games*, 3D printing and architectural models, choreography,
34 *poetry*, and even VLSI layouts, GPU configurations, or
35 *mechanical engineering designs*.  *Theoretical foundations*, *language design*,
36 *implementation issues*, and *applications* in industry or the arts are
37 all within the scope of the workshop.  The language used need not be
38 purely functional (“mostly functional” is fine), and may be manifested
39 as a domain specific language or tool.  Moreover, submissions focusing
40 on questions or issues about the use of functional programming are
41 within the scope.
42 #+END_QUOTE
44 * 0 Introduction
46 #+BEGIN_QUOTE
47 ``To get to the moon, we needed crashes and endless fiddling.'' Gabriel and Goldman, "Mob Software: The Erotic Life of Code" \cite{gabriel2000mob}
48 #+END_QUOTE
50 ** 0.1 CONTEXT OF APPLICATION
51 - modelling mathematical dialogues, people don't just write their things in metamath, ghilbert, HOL, etc.
52 - mathematical text contains argumentation and narrative in addition to logic and calculations
53 - if you /were/ using a formal system, there's approximately one way to write it down; in normal text there are lots of different expository choices you can make.  A popular book or an article.
54 ** 0.2 FORCES
55 - push to make everything formal (QED, Tarski, LCF)
56 - push to make everything understandable (Alexander).  Halmos has a book on exposition, e.g. "How to write mathematics" essay.  Thurston "Proof and Progress".
57 ** 0.3 PROBLEM
58 - because each different user will have a different "way in", depending on their background knowledge, we need to intelligently use our expository choices, e.g., so we can tailor a given formal content to a given reader.
59 - how to get behind the scenes to see why things work the way they do, or why they fail?; adding more intuition is another thing besides more clarity: building bridges from the way people think to the new question.  We often think in terms of diagrams!  Peirce said: "all mathematical reasoning is diagrammatic."  How can a computer be useful in such a circumstance?
60 ** 0.4 SOLUTION (STRATEGY)
61 - thought: what we need is a computer system that's based on diagrammatic reasoning
62 - focus on expressivity
63 - focus on representing process
64 - formalization and efficiency are important, but will be left for later or forked off to something else.
65 - diagrammatic reasoning and functional programming go hand in hand
66 ** 0.5 RATIONALE
67 - objective: understand mathematics as people do it (literary criticism, rhetoric, argumentation)
68 - objective: learn from these methods to build new mathematical texts, towards math AI!
69 - build on intuitive diagrams
70 - build on the idea of parsing natural language (complementary to Mohan's work; graph grammars?)
71 ** 0.6 RESOLUTION of FORCES
72 - philosophical: bridging 'two cultures' (proof checkers and artists/designers/hackers).  Cf. Gowers's "two cultures"
73 - outcome: sharing diagrams with people who can use them
74 - potential: draw new diagrams?
76 * 1 THEORETICAL FOUNDATIONS Informal mathematical language is more general, and  the reasoning involved may be abductive, inductive, or heuristic. :RAY:
78 Even though a mathematical result and its proof involve strict logic,
79 the process of formulating, motivating proving and explaining go
80 beyond strict formality. (Pierce, Lautman)
82 # ** <<1.1>> 1.1 Examples of actual texts (different registers)
84 # *** TODO Pull up examples from real texts.
86 # - E.g. Artin's Galois theory book
87 # - E.g. Gowers's "Eventually this is something a computer can solve"
89 # ** <<1.2>> 1.2 A formal language doesn't do anything with this ("Proofs and Prologues")
91 # - (Conclusion from inductive reasoning in 1.1.)
93 # ** Text
95 Since our purpose is to understand mathematical reasoning as practiced
96 by mathematicians, we will begin by studying examples of mathematical
97 texts.  We would like to characterize the use of language
98 gramatically and rhetorically, describe the logic and argumentation
99 structures used so as to develop our formalism for representing
100 mathematical knowledge in an informed matter.  For the purposes of
101 illustration, we will examine four short texts:
103 - *MPM* :: Mini-polymath 3, threads 3, 11, and 14 - selected portions
104            of a collaborative online effort to solve a problem from
105            the 2011 International Mathematics Olympiad.[fn::
106            https://polymathprojects.org/2011/07/19/minipolymath3-project-2011-imo/]
108 - *GCP* :: Timothy Gowers's - What is the 500th digit of
109            $(\sqrt{2}+\sqrt{3})^{2012}$? from his Maxwell Institute
110            Lecture "Modelling the mathematical discovery process"
112 - *AGT* :: Section II.H, ``Normal Extensions'' of ``Galois Theory'' by
113            Emil Artin.
115 - *HHS* :: Section 22, ``Adjoints'' of ``Introduction to Hilbert
116            Space'' by P. R. Halmos.
118 One of the first features which leaps to the eye when reading these
119 texts is that much of the text is written in a fashion which employs a
120 precise technical vocabulary, logical idioms, and symbolic notation to
121 state mathematical propositions.  We will refer to this as the /formal
122 register/ of mathematical discourse.  Here are two typical instances
123 from our sample texts:
125 - If, conversely, $\varphi$ is a bounded linear functional, then
126   there exists a unique operator $A$ such that $\varphi (x,y) = (Ax,
127   y)$ for all $x$ and $y$.  (HHS, statement of theorem 1)
129 - The intermediate field $B$ is a normal extension of $F$ if and only
130   if the subgroup $G_B$ is a normal subgroup of $G$. (AGT, statement
131   of theorem 16)
133 Semantically, such statements are assumed to be equivalent to symbolic
134 expressions in formal logic (in whatever formal system one is
135 working).  For the examples above, the following might be formal
136 equivalents:
137 \begin{align*}
138   &\varphi \in \mathrm{BLF} \Rightarrow (\exists ! A) (\forall x,y)
139   \varphi (x,y) = (Ax,y) \\
140   &\mathrm{norm\_ext} (B, F) \Leftrightarrow \mathrm{norm\_subgp} (G_B,
141   G)
142 \end{align*}
144 While statements in the formal register are an important part of
145 mathematical writing, a text consisting only of formal statements
146 would be frustrating to read because, while it might contain all the
147 technical information, it would offer no guidance to the reader as to
148 where the statements came from, why they are interesting, and how to
149 go about understanding them.[fn:lamport-reviewer:Lamport \cite[p.~20]{lamport2012write21st} quotes a referee who had read one of his structured proofs (see Section [[2.3][2.3, below]]): "The proofs ... are lengthy, and are presented in a style which I find very tedious. I think the readers ... are going to be more interested in understanding the techniques and how they can apply them, than they will be in reading the formal proofs. A problem with the proofs is that they do not clearly distinguish the trivial manipulations from the nontrivial or surprising parts. ... My feeling is that informal proof sketches ... to explain the crucial ideas in each result would be more appropriate."] To offer this
150 guidance, a mathematical text will also contain expository statements
151 such as the following:
153 + We begin the proper business of this section by showing that the
154   connection between linear transformations and bilinear functionals
155   goes quite deeper than these superficial remarks. (HHS, first
156   paragraph)
158 + We come now to a theorem known as the /Fundamental Theorem of Galois
159   Theory/ which gives the relation between the structure of a
160   splitting field and its group of automorphisms.  (AGT, right before
161   statement of theorem 16)
163 + Is it possible to prove that any point and any line will do? (MPM)
165 + Can we do this for $x+y$? For $e$? Rationals with small denominator?
166   (GCP)
168 The /expository register/ has several salient features which work
169 together and which distinguish it from the formal register.
171 While the subject matter of expository statements is also mathematical
172 objects and propositions, the language is not only descriptive, but
173 also narrative and argumentative.  For instance, the phrases ``we
174 begin'' and ``we come now'' in the first two examples are indicative
175 of a narrative structure; the former serves to introduce and motivate
176 the theory of adjoint operators in terms of a few observations and the
177 latter motivates the theorem by describing its purpose in general
178 terms.  The third example is argumentative, asking whether an earlier
179 proposal might be generalizable.
181 Whereas in formal logic, only the strictest deductive reasoning is
182 allowed, mathematical exposition also makes use of inductive and
183 abductive reasoning, and even looser reasoning by analogy.  For
184 instance, the fourth example illustrates an inductive mode of
185 reasoning in which the questioner is looking for a general result of
186 which the problem posed would be a special case.  In the first
187 example, an analogy is being set up between the remarks which precede
188 that statement and the propositions which follow it.
190 A related point is that, whereas formal statements only make use of
191 the truth values and predicates of formal logic, the expository
192 register also makes use of looser judgements of plausibility and
193 heuristics.  For instance, in the first example, the adjectives
194 ``superficial'' and ``deeper'' appear.  Terms such as these are not
195 formally definable but refer to approximate notions which inform
196 heuristic choices.
198 Allowing such loose notions and non-deductive reasoning serves an
199 important purpose because, quite often, the exact deduction of some
200 result might be lengthy and/or opaque.  When that happens, it is
201 helpful to the reader to augment the formal reasoning with informal
202 reasoning which is shorter and easier to understand.  Moreover, it
203 not infrequently happens that such informal reasoning can serve to
204 guide the construction of a formal proof, as in GCP and MPM.
206 Finally, the expository register is metamathematical, discussing not
207 only objects and propositions, but also inference and proofs.  For
208 instance, the third example asks about the provability of a
209 statement.  Furthermore, this is not just strict metamathematics, but
210 also may involve approximate and heuristic elements.  In particular,
211 when setting out to prove a theorem, one may first assess different
212 possible proof strategies using heuristic notions such as difficult
213 vesrus easy or by making analogies with techniques used to
214 successfully prove similar results.
216 In this essay, our main focus will be to construct a theory of
217 mathematical exposition which will account for the features noted
218 above and provide a semantics for utterances in the expository
219 register which can be implemented and queried algorithmically.  Our
220 focus here will be on the representation and what can be done with it
221 as opposed to parsing natural language.  This is a matter of
222 specialization, not of trivializing the latter.  We also note that
223 there has been progress by Mohan in parsing the formal register and
224 will later note that there exist natural language parsers for related
225 AI problems in order to suggest that it is plausible that one could
226 build a parser.
228 ** Urban explorer metaphor
230 As a way of illustrating the formal and expository registers, we offer
231 the following analogy.  Instead of mathematical objects and
232 propositions, consider locations and buildings in a city.  Instead of
233 inferences, roads and paths and, instead of theoroes, neighborhoods
234 and districts.
236 Now consider guides to that city.  A basic feature of a guide is
237 description --- ``The exchange building is built of red brick and has
238 a gabled roof''; ``The memorial fountain is made of white marble and
239 has a stream of water coming out of the lion's mouth into an octagonal
240 basin filled with goldfish.''  This corresponds to the formal
241 register.  The most utilitarian form of a guidance is a list of
242 directions --- ``Go straight three blocks, turn left, go another two
243 blocks.  In the middle of the third block, there will be a building
244 with yellow clapboard siding.''  This kind of statement corresponds to
245 formal mathematical proofs.
247 However, there is much more to city guides than just straightforward
248 descriptions and directions.  They may contain value judgements ---
249 ``For a more scenic view, take this detour''; ``To avoid nasty taxi
250 traffic, go under the intersection through the tunnel.''  While a
251 straightforward set of directions might suffice for a business person
252 passing through town, for someone with more leisure a single route or
253 tree-like transportation map may be dissatisfying since that person
254 would like to learn about all the different ways around together with
255 their historical, cultural, and aesthetic associations.  A newcomer
256 might appreciate a book which not only says what there is and how to
257 get there, but also provides a higher level guidance as to what are
258 some prominant landmarks and important sites and have things laid out
259 in some order that makes it possible to assimilate information
260 gradually rather than be barraged with everything at once.  Three
261 comrades going out for a night together might start out by having a
262 debate on which way to go is the best, weighing different concerns
263 such as travel time versus convenience.  This is like the expository
264 register.
266 Since a city is not a tree \cite{alexander1964city}, any guide to it
267 which lays things out in a straightforward tree-like fashion will
268 necessarily leave things out and be of limited use.  Likewise, for
269 math, in order to go beyond the superficial, we will want some more
270 rhizomatic sort of description which enables one to wander along a
271 dérive along quirky winding roads.
273 * 2 LANGUAGE DESIGN The presentation here will describe a strategy we have been developing for representing mathematical dialogues and other informal texts. :JOE:
275 Bundy has argued that finding the right representation is the key to
276 successful reasoning \cite[p.~16]{Bundy20130194}.  Since we cannot
277 simply build on formal theorem proving for our current purposes, we
278 need to look further afield for foundations.  We are concerned in
279 particular with building representations \emph{of} reasoning
280 \cite{corneli2017towards}.  This helps guide our search for useful
281 paradigms.  McCarthy \cite{mccarthy2008well} posited several high-level
282 features of a "language of thought", highlighting in particular the
283 ways in which such a language would not be like spoken language:
285 #+BEGIN_QUOTE
286 - Much mental information is represented in parallel and is processed in parallel.
287 - Reference to states of the senses and the body has to be done by something like pointers. Natural languages use descriptions, because one person can’t give another a pointer to his visual cortex. (A robot might tell another robot, “Look through my eyes, and you’ll see it.”)
288 - We don’t think in terms of long sentences.
289 - Much human thought is contiguous with the thought of the animals from which we evolved.
290 - For robots, logic is appropriate, but a robot internal language may also include pointers.
291 - A language of thought must operate on a shorter time scale than speech does. A batter needs to do at least some thinking about a pitched ball, and a fielder often needs to do quite a bit of thinking about where to throw the ball. Pointers to processes while they are operating may be important elements of its sentences.
292 #+END_QUOTE
294 While we won't directly accommodate all of these features, but we can
295 find languages that deal with several of them.
297 ** <<2.1>> 2.1 Inference Anchoring Theory + Content (IATC)
299 Our modelling approach builds on /argumentation theory/; in particular
300 Inference Anchoring Theory (IAT), which was devised by Budzynska et al
301 \cite{budzynska2014model} to model the pro-and-contra logical
302 structure of dialogical arguments.  IAT has since been adapted to
303 model mathematical arguments \cite{gabi-iatc, corneli2017towards}.
304 The primary features of this adaptation are: (1) to introduce more
305 explicit relationships between pieces of mathematical content; and (2)
306 to describe a range of intermediate relations that model the way these
307 objects fit together in discourse.  These include inferential
308 structure, judgements of validity or usefulness, and reasoning
309 tactics.  Later in this article we will describe "IAT+Content" (IATC)
310 in more detail .
312 ** <<2.2>> 2.2 Conceptual Dependence (CD)
314 Conceptual Dependence was initially introduced as a tool for
315 understanding natural language \cite{schank1972conceptual}.  However,
316 it is also used to represent knowledge about actions
317 \cite{lytinen1992conceptual,sowa2008conceptual}.  The basis of the
318 theory is a set of /primitives/ which describe basic types of actions
319 such as "=PTRANS= — transfer of location" or "=MBUILD= — construction
320 of a thought or new information".  Each primitive comes with a set of
321 /slots/ which accept objects of certain types.  By filling in the
322 slots of a primitive, one obtains the most elementary form of a
323 /conceptual dependency graph/.  By combining such basic graphs, one
324 can build up more complicated CD graphs which describe actions in
325 greater detail.  Later, we will show that CD primitives are
326 analogous to IAT performatives, and what follows from this.
328 ** <<2.3>> 2.3 Structured proofs
330 Although we are not focusing on formal proofs, at the level of
331 mathematical content we are talking about similar things: mathematical
332 objects and mathematical propositions.  Formal mathematics models the
333 same universe of discourse, but the discourse itself is not
334 necessarily formal.  Accordingly, we can derive a useful sanity check from
335 Lamport's notion of a ``structured proof'' \cite{lamport1995write}.
336 In essence, a structured proof combine a summary (or ``proof sketch'')
337 with a mode of writing out details so way that each step is made clear
338 and each assumption and assertion is a label.  We emphasize that
339 structured proofs are trees.  As first introduced, there were just a
340 few keywords: =assume=, =prove=, =let=, and =case=.  In a more recent
341 reassessment \cite{lamport2012write21st}, Lamport states "The way I
342 now write proofs has profited by my recent experience designing and
343 using a formal language for machine-checked proofs."  In line with
344 this, additional keywords =new=, =suffices=, and =pick= are imported
345 from his "Temporal Logic of Actions+" (TLA$^{+}$) language
346 \cite{lamport1999specifying}, along with a shorthand for equational
347 proofs.  More recently, a second version of this language,
348 TLA$^{+2}$, has been made available, with new keywords (and now with
349 lambda expressions) \cite{lamport2014tla2}.[fn:1] Lamport's structured
350 proof is an interesting example of a ``missing link'' between informal
351 and formal mathematics.  The TLA\(^+\) language seems in our opinion
352 to be reasonably well aligned with typical mathematical style.  The
353 history of its development helps show which features can be considered
354 most essential.  We note that in principle it should be possible to
355 coherently map to any formal mathematical language from our content
356 layer.
358 [fn:1] In full, TLA\(^{+2}\)'s keywords are: =action=, =assumption=, =axiom=, =by=, =corollary=, =def=, =define=, =defs=, =have=, =hide=, =lambda=, =lemma=, =new=, =obvious=, =omitted=, =only=, =pick=, =proof=, =proposition=, =prove=, =qed=, =recursive=, =state=, =suffices=, =take=, =temporal=, =use=, =witness=.
360 ** <<2.4>> 2.4 The Lakatos Game (LG)
362 Lakatos \cite{lakatos1976proofs} developed an abstract, dialectical,
363 model of mathematical creativity which has recently been formalised as
364 a \emph{dialogue game} \cite{pease2017lakatos}.  In the "Lakatos
365 Game", assertions are made and then adjusted: for instance, a
366 statement may be sharpened so that it applies to a restricted class of
367 objects ("Strategic Withdrawal"), or a putative counterexample may be
368 shown not to be a counterexample at all ("Monster Barring"). Lakatos's
369 theory is limited, first, because it commits almost exclusively to
370 Hegelian dialectic.  Secondly, when we zoom in and look at concrete
371 details of mathematical objects, it should be no surprise that there
372 are a range of issues that an abstract model will not cover.  In
373 short, as a representation of reasoning the Lakatos Game is at least
374 somewhat descriptive, but not explicitly runnable.  We hope to
375 overcome these limitations.
377 * 3 IMPLEMENTATION ISSUES (REQUIREMENTS) :JOE:
379 An informal proof is in general not a tree, even if a structured proof
380 -- or the trace of the moves made in a dialogue game -- does rather
381 satisfactorily /describe/ the proof as a tree.  In the limit of full
382 formality, tree-shaped descriptions are machine checkable -- and by
383 the Curry-Howard correspondence, proofs-as-programs are even runnable.
384 However, by default these objects give very little information about
385 the proof's (or program's) genesis.  Indeed, as we shall see, we soon
386 run into problems even with a still-more-general network model.
388 ** <<3.1>> 3.1 Look, it's a graph; no it's a hypergraph!
390 Figure [[fig:gcp-implements]] is an excerpt from a larger diagram[fn:2]
391 that analyses Gowers's walk-through of the solution to the problem
392 "What is the 500th digit of $(\sqrt{2}+\sqrt{3})^{2012}$?" Figure
393 [[fig:iatc-key]] provides a graphical key to the color-coding of IATC
394 operations.  We focus in on this step of the proof:
395 #+BEGIN_QUOTE
396 And $(\sqrt{3}-\sqrt{2})^{2012}$ is a very small number. Maybe the final answer is "9"?
397 #+END_QUOTE
399 #+CAPTION: GCP (detail)
400 #+NAME: fig:gcp-implements
401 [[./gowers-example-selection.png]]
403 #+CAPTION: IATC (key)
404 #+NAME: fig:iatc-key
405 [[./iatc-key.png]]
407 In IATC, utterances expand to performatives: here, in Figure
408 [[fig:gcp-implements]], simply a list of assertions (two of which are only
409 implied by the quoted utterance).  Performatives, in turn, expand to
410 nodes that convey inferential structure (in pink), reasoning tactics
411 (in blue), and judgements of validity or usefulness -- which often
412 take the form of heuristics (in green), as well as content-level
413 relations (colorless; as, for example, the relation "contains as
414 summand").  Intermediate nodes typically have targets in the content
415 layer.  For example, the assertion that
416 "\((\sqrt{3}-\sqrt{2})^{2012}\)" =has_property= "is small" is typical
417 in this regard.  However, the =implements= node poses some difficulty,
418 since its outbound arrow does not have another node as a target.  What
419 it means to say is that the subgraph implements a heuristic idea that
420 was proposed earlier: "The trick might be: it is close to something we
421 can compute."  Without the =implements= certificate, we would see a
422 proliferation of heuristic suggestions without any sense of which ones
423 are actually used.  And yet, it is clear that this is an assertion
424 about a subgraph, and not a specific piece of logic.  Recall
425 McCarthy's assertion about the language of thought: "Pointers to
426 processes while they are operating may be important elements of its
427 sentences."  Whereas a structured proof would presumably just give the
428 indicated subgraph a name and push it down the hierarchy into a lemma,
429 we can see from the diagram that such a representation strategy poses
430 problems with locality: /vide/ the inbound links to =sums= (from a
431 previous assertion) and to "some integer" (from a subsequent step in
432 the reasoning).  These reflections suggest the need for /hypergraphs/,
433 not just graphs.[fn:3] With a hypergraph, pointing to a subset of
434 nodes is straightforward.  Actually, we want one of the standard
435 generalizations of hypergraphs: the ability for an edge to point to another edge.
436 This way we can lasso the "lemma" as an object of interest, and point to
437 it, without the need to bracket it off from the rest of the proof.
439 [fn:2] http://metameso.org/ar/gowers-example.pdf.
440 [fn:3] Edges are first class objects and can be linked to; e.g., ``Mom resents the fact that John disapproves of Jane and Jim's marriage.'' Cf. https://www.slideshare.net/delaray/knowledge-extraction-presentation
442 ** <<3.2>> 3.2 The search for the `quantum of progress'
444 There is a further issue here, which the =implements= certificate
445 hints at.  Just how does the person working through a proof attempt
446 decide which step to take next?  In another setting, Gowers provides
447 some very helpful guidance.
449 The Polymath project aimed to answer the question "is massively
450 collaborative mathematics possible?" This project was convened by
451 Gowers in 2009, and he developed 15 rules to address the "questions of procedure"
452 that he anticipated would arise in the project.[fn:: http://gowers.wordpress.com/questions-of-procedure/ ] The basic premise was that people would work together on a
453 shared blog to discuss a given mathematical problem in the open,
454 and jointly work out a solution.[fn:: Incidentally, the answer to the main motivating question was at least a tentative ``yes'' \cite{gowers2009massively}. New collaborative Polymath research projects continue to be run to the present day. Four Minipolymath projects (the third of which we refer to here as "MPM") have been convened in the same spirit, focusing on competition problems rather than research problems. However, these projects cannot be said to be "massive," if we use collaborations in other scientific disciplines as our standard.]
456 Gowers carefully explicated the imperative to share comments that are
457 "not fully thought out."[fn:UMEM] A good contribution to the project
458 would comprise what he called a "quantum of progress."  Continuing
459 with this metaphor, as the KRR strategy we are developing comes more
460 fully into focus, it should be clear that we need to better understand
461 the "fields" that generate these quanta!  That is, in order to build a
462 functional representation of mathematical reasoning, we need to model
463 both what's there at any given step, and also how it evolves -- noting
464 that such evolution is generally heuristic.
466 Here one can compare Gowers's work with Ganesalingam on a
467 ``human-oriented theorem proving'' system \cite{Ganesalingam2016}.
468 First, we will comment that this work motivated the presentation of
469 GCP.  However, Ganesalingam and Gowers's system was only able to solve
470 more straightforward "textbook" problems, in which the next step is
471 always more or less "obvious".  Under the hood, there is a Logic of
472 Computable Functions (LCF) style inference system.  Because the system
473 generates proofs in natural language /and/ also makes its internal
474 processing explicit, it is quite straightforward to diagram its
475 operations in IATC (Figure [[fig:robotone-selection]]).[fn::
476 http://metameso.org/ar/robotone-example.pdf.]  In Figure
477 [[fig:robotone-selection]] the heuristics -- which in this case correspond
478 to pre-programmed LCF moves -- are disconnected from both the natural
479 language and content.  This could be rectified in a revision: the main
480 point being that a careful study of the relationship between the
481 underlying logic and the IATC representation would need to be
482 developed.  Clearly, this applies to more informal proof systems as
483 well. *Possibly comment here about how this variant is not "driven" by
484 the natural language, but the NL is sort of an epiphenomenon.*
486 #+CAPTION: ROBOTONE example (detail)
487 #+NAME: fig:robotone-selection
488 [[./robotone-example-selection.png]]
491 [fn:UMEM] Ursula Martin had commented ten years earlier, with regard
492 to the emerging field of "experimental mathematics," that the growth
493 of experimentation requires the "development of community standards as
494 to experimental methodology," emphasizing not only technical matters,
495 but also "the early sharing of insights" \cite{martin1999computers}.
497 * 4 APPLICATIONS Our latest efforts produce more detailed models of mathematical arguments. :JOE:
499 One example Sussman gives of modelling "`how to' as well as `what is'"
500 \cite{sussman2005programming} is a LISP program that he wrote with
501 Richard Stallman that can replicate the process of analyzing a circuit
502 \cite{sussman2011programming}.  The program explains /why/ it comes up
503 with the answers it does.  The "why question" is even more important
504 (and interesting) when nontrivial ``creativity'' is involved in the
505 reasoning process \cite{gucklesberger2017addressing}.  In the case of
506 Ganesalingam and Gowers's ROBOTONE, described above, the answer will
507 always be more or less the same: /because this is what LCF tells me to
508 do./ In other words, the program has little or nothing in the way of
509 context sensitivity.  This is, let's say, fine, given its limited
510 scope of application, but it would not work for a system that was
511 supposed to participate in mathematical dialogues, nor (presumably)
512 for a system that was exploring some entirely new area of mathematics
513 instead of "textbook" problems.  Here, we aim to describe a language
514 that can (in principle) reason equally well about both monological
515 "textbook" and dialogical Polymath-style discussions.
517 We are aided by the fact that CD has already been used to reason about
518 informally-constructed scenarios.  For instance given a description of
519 a restaurant in the form of a script, and a CD representation of a
520 story such as 
521 #+BEGIN_QUOTE
522 John went to a restaurant.  He sat down. He got mad. He left.
523 #+END_QUOTE
524 SAM can produce a paraphrase and make inferences such as concluding
525 that John was upset because the waiter did not come.
526 \cite{barr1981handbook}.  Furthermore, by augmenting the knowledge
527 base with goals and plans, it is possible to explain actions.  For
528 instance, given the narrative fragment 
529 #+BEGIN_QUOTE
530 Willa was hungry.  She picked up the Michelin guide.
531 #+END_QUOTE
532 one could explain why she picked up the guide as follows: The first
533 sentence suggests the goal of finding food, the resaurant script
534 describes a way of satisfying this goal but requires that one know the
535 location of a restaurant, hence the guide.
537 #+CAPTION: MPM example (detail)
538 #+NAME: fig:mpm-selection
539 [[./mpm-example-selection.png]]
541 Given the relation between goals, values, and performatives and the
542 way these are similar to what goes on in game playing and story
543 understanding systems, it should be possible to have the system look
544 at a transcribed dialogue from MPM, for instance (compare Figure
545 [[fig:mpm-selection]]),[fn::
546 http://metameso.org/ar/minipolymath-example.pdf.] and
547 answer questions like:
549 - "Why does Thomas agree with Anonymous?"
550 - "Why does Gal says the suggestion is beautiful?"
551 - "Why did Anonymous suggest `perhaps even the line does not matter'?"
553 The premise here is that the dynamics at work are based on
554 performatives being chosen based upon current valuations, goals, and
555 other contextual features.  We discuss both kinematics and dynamics
556 below.
558 ** <<4.1>> 4.1 Kinematics (IATC+CD)
560 Lytinen \cite{lytinen1992conceptual} gives the following example which
561 schematizes the sentence "John gave Mary a book" as an s-expression,
562 rooted on the =ATRANS= primative:
564 #+BEGIN_SRC lisp
565 (ATRANS ACTOR  (PERSON NAME JOHN)
566         OBJECT (PHYS-OBJ TYPE BOOK)
567         RECIP  (PERSON NAME MARY))
568 #+END_SRC
570 We would like to do the same sort of thing here, using IATC
571 performatives as our primatives.  Like the standard CD primatives,
572 these performatives have slots, described as follows:[fn:: See \cite{gabi-iatc} for further details.]
574 - =Assert= (/s/ [, /a/ ]): Assert belief that statement /s/ is true, optionally because of /a/.
575 - =Agree= (/s/ [, /a/ ]): Agree with a previous assertion.
576 - =Challenge= (/s/ [, /a/ ]): Assert belief that statement /s/ is false, optionally because of /a/.
577 - =Retract= (/s/ [, /a/ ]): Retract a previous assertion /s/, optionally because of /a/.
578 - =Define= (/o/, /p/): Define (name) object /o/ by property /p/.
579 - =Judge= (/s/): Apply a heuristic value judgement /s/ to some statement.
580 - =Suggest= (/s/): Advance a tactical reasoning move, /s/.
581 - =Query= (/s/): Ask for the truth value of /s/.
582 - =QueryE= ({/pi/(/X/)} . /i/): Ask for the class of objects /X/ for which all of the properties /pi/ hold.
584 Similarly, the statements that are introduced via these performatives
585 also have slots, for example:
587 - =has_property= (/o/, /p/): Object /o/ has property /p/.
588 - =strategy= (/m/, /s/): Method /m/ may be used to prove statement /s/.
589 - =beautiful= (/s/): Statement /s/ is mathematically elegant.
591 As we've seen in our examples we may want to point to a subgraph
592 rather than a "statement", as with the =implements= relation in Figure
593 [[fig:gcp-implements]].  Assertions that are fully unfolded generally bottom
594 out in the content layer: assertions can be made directly about objects
595 and propositions, or relationships between , as in Figure
596 [[fig:gcp-implements]]'s =contains as summand= relation; content
597 they can be addressed through other intermediate assertions, such as
598 "\((\sqrt{3}-\sqrt{2})^{2012}\)" =has_property= "is small" in the same
599 figure.  In effect, s-expressions parse statements in natural language
600 and use the resulting structures to build graphs like the ones shown
601 in our figures.  The assertions from Figure [[fig:gcp-implements]]
602 (along with a few pieces of text that are off-screen in that image)
603 may be represented thusly:
605 #+BEGIN_SRC lisp
606 (Assert
607  "contains as summand"
608  "(sqrt(2)+sqrt(3))^2012+(sqrt(3)-sqrt(2))^2012"
609  "(sqrt(3)-sqrt(2))^2012")
611 (Assert (has_property "(sqrt(3)-sqrt(2))^2012"
612                       "is small"))
614 (Suggest (strategy "numbers that are very close
615                     to integers have \"9\"
616                     in many places of their
617                     decimal expansion"))
619 (Assert (implements #SUBGRAPH
620                     "the trick might be: it
621                      is close to something
622                      we can compute"))
623 #+END_SRC
625 We defer the somewhat technical matter of indexing a specific subgraph
626 to Section [[5.2]].
628 ** <<4.2>> 4.2 Dynamics
629 # (Lytinen's stuff with goals and scripts)
631 Static graphical representations of mathematical reasoning do not by
632 themselves live up to promise of /functional/ models.  We need to be
633 able to reason about structure: answering "why" questions, as above,
634 or introducing new reasoned statements into a dialogue.  Here we are
635 inspired by Sowa and Majumdar's treatment of reasoning by analogy
636 \cite{sowa2003analogical}.  For example, early in GCP, Gowers asks:
638 #+BEGIN_QUOTE
639 Can we do this for $x+y$? For $e$? Rationals with small denominator?
640 #+END_QUOTE
642 One linguistically tricky issue here is the resolution of the anaphora
643 "this".  We can see that "this" refers to /computing the 500th digit
644 of X/.  The anaphoristic relation is grounded in several proposed
645 analogies:
647 #+BEGIN_SRC lisp
648 (Assert
649  (analogy
650   "compute 500th digit of (sqrt(2)+sqrt(3))^2012"
651   "compute 500th digit of (x+y)^2012"))
653 (Assert
654  (analogy
655   "compute 500th digit of (sqrt(2)+sqrt(3))^2012"
656   "compute 500th digit of e^2012"))
658 (Assert
659  (analogy
660   "compute 500th digit of (sqrt(2)+sqrt(3))^2012"
661   "compute 500th digit of r^2012,
662    where r is a rational with small denominator"))
663 #+END_SRC
665 We can see the analogies even more clearly when the content is
666 represented in graphical form, i.e., when the constituent objects and
667 functions have been fully expanded.  Figure [[fig:qa-fig]] shows an
668 example from \cite{corneli2017towards} that describes an analogy
669 between a known theorem for finite groups, and a structurally
670 related conjecture for infinite groups.
672 #+CAPTION: Q&A example (lightly adapted from \cite[Fig. 1]{corneli2017towards})
673 #+NAME: fig:qa-fig
674 [[./revised-qa-question.png]]
676 The analogy between the two clusters is clear: in one case $G$ is a
677 finite group, in the other $G$ is an infinite group.  Naturally, this
678 is not the same "\(G\)".  Using a typed formalism we could be more
679 specific about the difference between the two sides, while retaining a
680 structural similarity on the two sides of the analogy:[fn:: Something
681 along the lines of clojure.spec may be useful these purposes; it
682 provides a "standard, expressive, powerful and integrated system for
683 specification and testing"; see https://clojure.org/about/spec.]
685 #+BEGIN_SRC c
686 G: group           -> X: group
687 G has_card finite  -> X has_card infinite
688 #+END_SRC
690 In short, if we can expand the statements in sufficient detail, we can
691 start to see the specific analogies between them.  We can then form
692 hypotheses like "Anonymous suggests `perhaps even the line does not
693 matter' by strict analogy with Nemanja's immediately previous
694 assertion "we can start with any point and `just' need to choose a
695 second point through which we will draw a line."  Here, Nemanja has
696 described a specific simplification, and Anonymous wonder if things
697 can be simplified again.
699 Given sufficently detailed representations - sometimes requiring
700 background theories (like group theory in the Q&A example, or plane
701 geometry in MPM), we expect analogical reasoning to serve as the main
702 explanatory mechanism.  Sowa and Majumdar describe three ways of doing
703 analogical reasoning about conceptual graphs:
705 #+BEGIN_QUOTE
706 The first compares two nodes by what they contain in themselves
707 independent of any other nodes; the second compares nodes by their
708 relationships to other nodes; and the third compares the mediating
709 transformations that may be necessary to make the graphs comparable.
710 #+END_QUOTE
712 Pushing the reasoning problem "back" to the natural language
713 processing layer by suggesting that sufficiently rich representations
714 are the main thing we need to proceed with reasoning may seem like it
715 is dodging the issue.  However, there is in fact a (high-order)
716 analogy between what goes on in parsing and reasoning.  Lytinen
717 \cite{lytinen1992conceptual} summarises Schank and Birnbaum
718 \cite{schank-and-birnbaum} on semantic parsing, again, referring to
719 three aspects of the parser:
721 #+BEGIN_QUOTE
722 ... its /control structure/, or the processes that occur during
723 parsing; its /representational structures/, or the representations
724 which it builds during the parsing process; and its /knowledge base/,
725 or the set of rules which the parser draws on and which drive the
726 parse of a text.
727 #+END_QUOTE
729 Functional reasoning moves also have a control structure,
730 representational structures, and a knowledge base, though they start
731 from pre-parsed content.  Sowa and Majumdar refer to a "graph
732 grammar"; this topic developed in more detail by Ehrig et al
733 \cite{ehrig1992introduction}.  We will show a example relevant to our
734 setting in the following section.
736 Having described some systems of knowledge representation and some of
737 the reasoning which can be done with these representations, we now
738 turn our attention to implemenation.  Originally, the various systems
739 were implemented in different sofwtware pakages such as SA, PAM, and
740 VAE.  Rather then adapt these packages and interface them, we will
741 take a different approach.  Since our systems are based upon
742 hypergraphs, we will start with a general framework for computing with
743 hypergraphs and implement our representations there.
745 * 5 MECHANICAL ENGINEERING DESIGNS A graphical formalism and a corresponding prototype implementation will be described. :RAY:
747 ** <<5.1>> 5.1 Import and improve technical stuff on Arxana (cf. Nemas doc)
748 ** <<5.2>> 5.2 Example
750 In order to store graphical representations of knowledge in memory and
751 query them, we will make use of a system called /Arxana/ which we have
752 been developing in LISP.  The basis of this system is higher-order
753 nested semantic networks.  By ``higher order'', it is meant that links
754 can point to other links.  By ``nested'', it is meant that the nodes
755 which make up a network may contain other networks, which themselves
756 may have nodes containing yet other networks, etc.  In addition, all
757 the links are bidirectional and no fundamental distinction is made
758 between links and nodes.
760 For convenience and flexibility, this package has been designed in a
761 modular and extensible fashion.  Basic functionality is provided by a
762 back-end which manages the data of the network.  Higher-level access
763 to the data is mediated by means of a handful of primitive commands
764 and, as long as these commands behave similarly, it does not matter to
765 the end user how they are implemented or how the data is represented
766 internally.
768 The basic unit from which we will construct our networks is called a
769 ``nema''.  Nemas are data objects which serve to encode both links and
770 nodes and are characterized by the following components:
772 - Identifier
773 - Source
774 - Sink
775 - Content
777 The identifier comes in two forms, a unique numerical identifier which
778 the computer assigns to it when it is entered into the database and
779 human-readable aliases which may be assigned by the user.  Source and
780 sink are pointers to other articles and content is a place in which to
781 store a lisp object, which might be some text, or an expression, or
782 maybe a number or maybe something else depending on what intends to
783 represent with one's network and how one intends to use it.  In
784 particular, the content of an article can even be another network
785 constructed out of more articles.
787 Bidirectional linking means that the links are stored and accessed in
788 a manner which makes it no more costly to find and traverse links in
789 the backwards than the forward direction.  Storing content is what
790 allows nemata to serve as a distinct carrier of information and can be
791 quite useful.  In the case of links, this room for extra information
792 can be used to do things like, say, encode a representation of the
793 inference used in a link which asserts that some statement implies
794 another.
796 By choosing suitable conventions, one can build up more complex
797 functionalisty from the basic features. For instance, one can
798 introduce typing by designating a certian nema as the ``home nema''
799 for that type and interpreting a link whose source is the home nema
800 and whose sink is some other nema as stating that the sink nema is of
801 that type.  Likewise, one can encode subhypergraphs by designating a
802 nema as a representative the subhypergraph and specifying the
803 components of the hypergraph by links from that representative nema.
804 For instance, we could use this construction to make the *implements*
805 relation [???] point to a subgraph by pointing making the sink of the
806 implements arrow be a nema which represents the subgraph in question.
808 In order to make this respresentation actionable, we will use two main
809 facilities: hypergraph matching and hypergraphs as programs.
811 Given a hypergraph, we can query it for subhypergraphs which match
812 some suitable criterion.  A query consists of a hypergraph whose
813 articles contain predicates and a match consists of a mapping of
814 hypergraphs from the query onto a subhypergraph such that, for every
815 article in the query, the predicate it contains is true of the
816 contents of the corresponding database article.  Since the predicate
817 can be any lisp function, perhaps one which is nested and recursive,
818 this feature can be quite powerful.
820 By modelling various structures as hypergraphs, we can search for
821 instances of them.  For instance, if we implement subcollections by
822 using representative nemata as described above, we can use hypergraph
823 matching to restrict operations to subcollections.  Or, if we
824 represent logical inferences in terms of a hypergraph for the premise
825 and a hypergraph for the conclusion which share subgraphs, then we can
826 use hypergraph matching to find and verify reasoning.
828 Since the content of a node is a lisp object, it can potentially be a
829 piece of executable code.  To make the most of this possibility, we
830 have a utility which runs this code in a context which is determined
831 by links out of the node containing the code.
833 An important use of this facility is handling /clusions/.  The basic
834 feature of clusions is that, rather than simply looking at the text of
835 a node, one instead generates a text from that node by processing that
836 text in its network context.  For instance, if we wanted to represent
837 something like the left-hand side of an equation which is found in
838 some node then, rather than copying the left-hand side into another
839 node, we could point a link to the original node whose content is
840 code for extracting the left-hand side.
842 This is also a mechanism which allows us to operationalize our
843 graphical representations.  Given a node corresponding to a
844 performative of predicate, as content we can take a routine which
845 verifies that the predicate indeed holds of the content to which the
846 node points.  Then running that node would carry out the verification.
848 * 6 RELATED WORK (GAMES, POETRY): parallels between dialogues and discursive Q&A, traditional proofs. :JOE:
850 # No one would insist that a nonlinear film like /Amores Perros/ or
851 # /Pulp Fiction/ needs to be represented as a tree.  Propp-style
852 # theories of storytelling tell us how stories are "supposed" to be
853 # written, but in general these models don't stand up to scrutiny.  The
854 # title of Robbe-Grillet's short novel /Dans le labyrinthe/, in a way,
855 # says it all.
857 # ** <<6.1>> 6.1 prior art: board games, story stuff; table that compares between.
858 # ** <<6.2>> 6.2 Alexander: "a city is not a tree"; compare Lamport
860 # ** Text
862 The formal register of discourse has been studied by de Bruijn, Ranta,
863 Mohan and others and there exist parsers which can translate between
864 natural language and formal expressions.  Once we have formal
865 representations, we can reason about them using tools from Frege and
866 others.
868 In order to build a computational theory of the expository register,
869 we will draw upon several well-studied topics in AI which deal with
870 situations that have common features, namely the block world, board
871 games, and story comprehension (Table [[tab:comparison]]).
873 #+CAPTION: Comparison between computation in different domains
874 #+NAME: tab:comparison
875 | /Level/               | *Block World*     | *Board Games*         | *Story Comprehension* |
876 |-----------------------+-------------------+-----------------------+-----------------------|
877 | universe of discourse | blocks on a table | game pieces on board  | everyday life         |
878 | reasoning             | instructions      | rules & strategy      | analogy               |
879 | value                 | consistency?      | prediction of winning | costs and benefits    |
880 | role of disagreement  | trivial           | multiple strategies   | ethical dilemmas      |
882 According to David Moshman \cite{moshman2004inference},
883 /inference/, /thinking/, and /reasoning/ are defined as follows:
885 #+BEGIN_QUOTE
886 - *Inference*---going beyond the data---is elementary and ubiquitous.
887 - *Thinking* is the deliberate application and coordination of one’s inferences to serve one’s purposes
888 - *Reasoning* is epistemically self-constrained thinking [...] with the intent of conforming to what they deem to be appropriate inferential norms.
889 #+END_QUOTE
891 Reasoning is particularly effective in social settings, according to
892 Sperber & Mercier \cite{mercier2017enigma}.  Even if we are not
893 interacting directly with others, "appropriate inferential norms" are
894 social constructions. Indeed, Minsky saw thought as inherently social.
896 Quite contrary to the sentiment conveyed by the
897 misattributed quote ``Mathematics is a game played according to
898 certain simple rules with meaningless marks on paper,'' David Hilbert,
899 an early and important proponent of mathematical formalism, emphasised
900 the role of intuition and experience, and discussed conjectural
901 thinking and the fallibility of mathematical reasoning
902 \cite{hilbert1992natur,corry1997origins}.[fn:thomae]
904 [fn:thomae] The actual source of the quote appears to be Carl Johannes
905 Thomae, /Elementare Theorie der analytische Functionen einer complexen
906 Veraenderlichen/ (1898), p. 3: ``For the formalist, arithmetic is a game
907 with signs, which are called empty. That means they have no other
908 content (in the calculating game) than they are assigned by their
909 behaviour with respect to certain rules of combination (rules of the
910 game).'' It is worth noting that Thomae nevertheless continues on to
911 remark on the difference between arithmetic and chess, insofar as
912 ``numbers can be related to concrete manifolds by means of simple
913 axioms.''  Cf. this discussion in the ``Foundations of Mathematics''
914 mailing list:
915 https://www.cs.nyu.edu/pipermail/fom/2005-April/008889.html.
917 # * 7 PART TWO In our planned next steps we plan to bring in explicit type-theoretic representations of mathematical objects within a service-oriented architecture. :onhold:
919 # ** <<7.1>> 7.1 There is a degree of formality in the specifications, but also informality in the heuristics.
921 # * 8 MOB PROGRAMMING :onhold:
923 # ** <<8.1>>
924 # ** <<8.2>>
926 # * 9 RELATED WORK music from corneli, pease, stefanou survey ("Chapter 6"); NNexus project; Socratic :onhold:
928 # ** <<9.1>>
929 # ** <<9.2>>
931 # * 10 CONCLUSION :onhold:
933 # ** <<10.1>>
934 # ** <<10.2>>