1405.5956v1
1405.5956v1
1405.5956v1
1
Computing and Software, McMaster University
http://www.cas.mcmaster.ca/~carette
http://imps.mcmaster.ca/wmfarmer
2
Computer Science, Jacobs University Bremen
http://kwarc.info/kohlhase
1 Introduction
In [Far11] the second author calls for the establishment of a “universal digital
library of mathematics” (UDLM). In our joint work it is understood that the
UDLM will be organized as a theory graph, i.e., a set of theories (collections of
symbol declarations, definitions, assertions, and their proofs) interconnected by
meaning-preserving views (morphisms). The “little/tiny theories approach” first
put forward in [FGT92] has been very fruitful for formal developments of math-
ematical knowledge, but it has not found its way into mainstream mathematics.
One reason may be that there is a mismatch with the way mathematicians —
the supposed users of the UDLM — think about and work with theories. [CF08]
argues for the development of “high-level theories” that better mesh with these
expectations. We will re-examine the issues involved and propose a solution.
In the mathematical community the term “theory” is used to describe mul-
tiple ideas, from the axiomatic theory of the algebraic structure of a group
to “Group Theory” as an entire discipline, and various gradations in between.
⋆
Work partially supported by NSERC. Final publication is available at
http://link.springer.com
Looked at more closely, this implies a multi-scale organizational structure to
the basic components of mathematics, ranging from individual concepts (e.g., a
group) to whole subareas of mathematics (e.g., Group Theory). Here our interest
in this structure is purely pragmatic: how can it be leveraged to build a better
mechanized mathematics systems and, ultimately, a better UDLM.
We will consider this in a bottom-up manner: what is the most natural struc-
ture on theories that allows us to abstract away from irrelevant details, yet still
allow us to get some practical work done? One such structure is that of mu-
tual interpretability between theories. Basically this is the case when we have
two equivalent theories T1 and T2 (in a sense to be made precise later) with
presentations that can be markedly different.
But why should theory presentations matter at all? Studies of “theories” in
mathematics (e.g., Lawvere theories [Law04; LR11]) or in logic focus on entities
that are complete in some sense. But such completeness generally also implies
that the object at hand is effectively infinite, and thus cannot be directly rep-
resented in software. Hence we are immediately forced to work with finite rep-
resentations of these infinite objects. Furthermore, by Gödel’s incompleteness
theorem, most of the interesting theories will be fundamentally incomplete, in
that no finite representation will be able to adequately represent the complete
whole. The relevance here is that we are forced to deal with (syntactic) repre-
sentations, which will generally be incomplete. As this is forced on us, we need
to gracefully adapt to dealing with theory presentations in place of the theories
they represent.
case, T and T ′ are called the bottom theory and the top theory, respectively.
An axiomatic development is thus a lattice of theories in which the top theory
is the join of the members of the lattice.
Let T1 and T2 be theories in G. A view of T1 in T2 is a homomorphic
mapping Φ of the language of T1 to the language of T2 such that, for each
formula ϕ of T1 , T1 |= ϕ implies T2 |= Φ(ϕ). We denote a view by Φ : T1 T2 . A
view is thus a meaning preserving mapping that shows how T1 can be embedded
in T2 . It also provides a mapping from the models of T2 to the models of T1
(note the reversal of order). T1 and T2 are equivalent if there is a view in both
directions. A view Φ : T1 T2 is faithful if for each formula ϕ of T1 , T2 |= Φ(ϕ)
implies T1 |= ϕ. Views give a second (oriented, multi) graph structure on G,
making it into a bigraph. It is important to note that the base theory graph
(with edges but not views) is always acyclic.
Let T and T ′ be theories. T ′ is an extension of T , and T is a subtheory of
T , if there exists a sequence S such that T ′ = T ⋉ S. In this case, there is a view
′
The user of a UDLM can play three different roles. As a developer, the user creates
new representations of mathematical knowledge or modifies existing ones in the
library. As a student, the user studies the mathematical knowledge represented in
the library. And, as a practitioner, the user applies the mathematical knowledge
in the library to problems, both theoretical and practical. A user may play
different roles at different times and may even sometimes combine roles.
A theory graph does not fully support all three of the user’s roles. In fact, it
lacks the structure that is necessary to satisfy the following requirements:
R1 There can be many equivalent theories in a theory graph that represent dif-
ferent axiomatizations of the same mathematical topic. As a result, concepts
and facts about this mathematical topic, possibly expressed in different lan-
guages, may be widely distributed across a theory graph. The developer and
the student would naturally want to have these different axiomatic develop-
ments and the set of concepts and facts that are produced by them in one
convenient place and in one convenient language.
R2 Developers prefer developments that start with minimal bottom theories and
are built as much as possible using conservative extensions. This approach
minimizes the chance of introducing inconsistencies (which would render the
developments pointless) and maximizes the opportunities for reusing the de-
velopment in other contexts. While these two benefits may not be of primary
concern for the student and the practitioner, such a careful development is
usually easier to understand and produces concepts and facts that can be
more reliably applied.
R3 The developer would like to create a view from one theory to another in
a convenient manner by starting with a view of a minimal axiomatization
of the theory and then building up the view as needed using conservative
extensions. Also, there is a desire to use the most convenient axiomatization
amongst equivalent presentations.
R4 The application of a mathematical fact usually does not require an under-
standing of how concepts and facts were derived from first principles. Hence
the parts of the theory graph which were needed by the developer may not
be useful to the practitioner, and may well get in the way of the practi-
tioner’s work. The practitioner would naturally want the concept or fact to
be lifted out of this tangled development bramble.
R5 Languages are introduced in a theory graph for the purpose of theory de-
velopment. They may employ vocabulary that is inconvenient for particular
applications. The practitioner would naturally like to have vocabulary cho-
sen for applications instead of development.
In summary, the developer, the student, and the practitioner have different con-
cerns that are not addressed by the structure of a theory graph. These different
concerns lead us to propose putting some additional structure on a theory graph,
a notion we call a “realm”, to meet these five requirements.
4 Realms
5.1 Groups
It is well known that groups can alternatively be described in two ways:
Definition 1 [KM79]. A group1 is a set G together with an
associative binary operation ◦ : G × G → G, such that there is
a unit element e for ◦ in G, and all elements have inverses.
Definition 2 [Hal59]. A group2 is a set G, together with a
(not necessarily associative) binary operation / : G × G → G,
such that a/a = b/b, a/(b/b) = a, (a/a)/(b/c) = c/b, and
(a/c)/(b/c) = a/b for all a, b, c ∈ G.
For any group1 (G, ◦), we can define a binary operation /◦ by a/◦ b := a ◦ b−1
that shows that (G, /◦ ) is a group2 , and vice versa — using a ◦/ b := a/b/−1 with
b/−1 := (b/b)/b. Practitioners want to use both group multiplication and division
but are usually indifferent to how and where they are introduced.
In Figure 3, we have assembled this situation into a two-pillar realm with face
group. The two bottom theories group1 and group2 are equivalent via the views
v1 and v2 and the back views of c1 and c1 , respectively.4 Note that the views
v1 = ◦ 7→ ◦/ , e 7→ e/ , i 7→ i/ and v2 = / 7→ /◦ carry proof obligations that show
that the newly defined extensions slash1 and circ-i2 behave as expected by the
group3−i . The face group contains “new” symbols, for which we use underlined
symbols, to distinguish them from the ones in the pillars of the realm. The
interface views Ii pick out the respective “original operators” /, ◦, and i, together
with the corresponding axioms (and any theorems that may have been proven
along the way). Here we have
I1 = ◦ 7→ ◦, e 7→ e, i 7→ i, / 7→ /◦ and I2 = ◦ 7→ ◦/ , e 7→ e/ , i 7→ i/ , / 7→ /
I1
I2
circ-i2
slash1 ◦/ : G2 → G
/◦ : G2 → G e/ : G, i/ : G → G
a/◦ b := a ◦ i(b) a ◦/ b := a/i/ (b)
v2 e/ := b/b, i/ (a) := e/ /a
v1
c1
c2
group1 group2
G : set, ◦ : G2 → G G : set, / : G2 → G
e : G, i : G → G a/a = b/b, a/(b/b) = a
(a ◦ b) ◦ c = a ◦ (b ◦ c) (a/a)/(b/c) = c/b
a ◦ e = a, a ◦ i(a) = e (a/c)/(b/c) = a/b
The theory of the real numbers covers the algebraic and topological structure
of the real numbers. Rich in concepts and facts, it is one of the most important
theories in all of mathematics. It is important to developers since real numbers
are needed in most mathematical developments. It is important to students since
it includes many of the most important ideas of mathematics. It is important
to practitioners since most mathematical problems involve the real numbers in
some way.
A realm R of the real numbers could be used to consolidate and organize all
the knowledge about the real numbers that resides in a UDLM. R would have
a structure similar to the realm of natural number arithmetic. It would contain
two kinds of conservative developments. The first kind are axiomatizations of a
complete ordered field – all complete ordered fields are isomorphic. The second
kind are constructions of the real numbers, of which there are many. Some ex-
amples are Dedekind cuts in the field of rational numbers, Cauchy sequences of
rational numbers, infinite decimal expansions, the quotient of the finite hyperra-
tionals by the infinitesimal hyperrationals, and as a substructure of the surreal
numbers. It is worth remarking that most of these constructions leverage N, so
that constructing realms is also a modular process.
The realm R would be a foundational realm like N for developers and stu-
dents. There should also be a high-level realm R′ like N′ for practitioners. The
face of R would only contain the basic concepts and facts about the real num-
bers, while the face of R′ would contain all the useful concepts and facts about
the real numbers that have been derived someplace in the theory graph. The
prominent role of the real numbers would mean that R or R′ would be the basis
of many of the more sophisticated theories in a UDLM.
5.4 Monads
Category theorists and (advanced) Haskell programmers are familiar with the
expressive power of monads. Most know that there are in fact two equivalent
presentations of the theory of monads, one using a multiplication operation µ
(called join in Haskell) and unit η (return), the other using Kleisli triples with
a lifting operation −∗ (called bind or >>= in Haskell). From there, one can define
a large list of generic combinators that work for any monad.
These two presentations are equivalent, and are again similar in flavor to the
previous ones: one is more convenient for proofs, the other for computational
purposes. Again, these basic theories tend to be followed by a substantial tower of
conservative extensions. In other words, Haskell’s Control.Monad should really
be seen as the face of a realm of monads.
Our work on OMDoc/MMT [MMT; KRZ10] and the MathScheme [CFO11] sys-
tems have given us a decent intuition (or so we feel) regarding the services that
a theory-graph based system should provide. We now extent this to realms.
F1 ∪ F2
I1+w I2+v
v
F1 F2 ⊤1 ∪ w(⊤2 ) ⊤2 ∪ v(⊤1 )
w
I1 I2 v
⊤1 ⊤2 ⊤1 w(⊤2 ) v(⊤1 ) ⊤2
w
v v
⊥1 ⊥2 ⊥1 ⊥2
w w
8 Conclusion
We have presented an extension of the theory graph approach to representing
mathematical knowledge. Realms address the mismatch between the successful
practice of the little/tiny theory approach natural for developing theory graphs
and the high-level theories most useful for practitioners utilizing such mathemat-
ical knowledge representations. We have proposed a formal definition for realms
that is conservative over theory graphs and shown its adequacy by applying it
to examples from various areas of mathematics and computation.
As a step towards an implementation we have investigated a set of realm-
level operations that can serve as a basis for system support of realm manage-
ment. The next step in our investigation will be to realize and test such support
in the OMDoc/MMT [MMT; KRZ10] and the MathScheme [CFO11] systems,
fully develop the examples sketched in this paper, and test the interactions on
developers, students, and practitioners (see section 3).
References
[CF08] Jacques Carette and William M. Farmer. “High-Level Theories”. In:
Intelligent Computer Mathematics. Ed. by Serge Autexier et al. LNAI
5144. Springer Verlag, 2008, pp. 232–245.
[CFO11] Jacques Carette, William M. Farmer, and Russell O’Connor. “Math-
Scheme: Project description”. In: Intelligent Computer Mathematics.
Ed. by James Davenport et al. LNAI 6824. Springer Verlag, 2011,
pp. 287–288. isbn: 978-3-642-22672-4.
[CO12] Jacques Carette and Russell O’Connor. “Theory Presentation Com-
binators”. In: Intelligent Computer Mathematics. Ed. by Johan Jeur-
ing et al. LNAI 7362. Berlin and Heidelberg: Springer Verlag, 2012,
pp. 202–215. isbn: 978-3-642-31373-8.
[Far07] William M. Farmer. “Biform Theories in Chiron”. In: Towards Mech-
anized Mathematical Assistants. MKM/Calculemus. Ed. by Manuel
Kauers et al. LNAI 4573. Springer Verlag, 2007, pp. 66–79. isbn: 978-
3-540-73083-5.
[Far11] William M. Farmer. “Mathematical Knowledge Management”. In: En-
cyclopedia of Knowledge Management. Ed. by David Schwartz and
Dov Te’eni. 2nd ed. Idea Group Reference, 2011, pp. 1082–1089.
[FGT92] William M. Farmer, Josuah Guttman, and Xavier Thayer. “Little
Theories”. In: Proceedings of the 11th Conference on Automated De-
duction. Ed. by D. Kapur. LNCS 607. Saratoga Springs, NY, USA:
Springer Verlag, 1992, pp. 467–581.
[Hal] John Halleck. http://home.utah.edu/~nahaj/logic/structures/systems/s4.html.
Accessed: 14 March 2014.
[Hal59] Marshal Hall. The Theory of Groups. New York: The Macmillan Com-
pany, 1959.
[KI12] Michael Kohlhase and Mihnea Iancu. “Searching the Space of Mathe-
matical Knowledge”. In: DML and MIR 2012. Ed. by Petr Sojka and
Michael Kohlhase. in press. Masaryk University, Brno, 2012. isbn:
978-80-210-5542-1.
[KM79] M. I. Kargapolov and J. I. Merzljakov. Fundamentals of the Theory
of Groups. Graduate Texts in Mathematics. Springer Verlag, 1979.
[KRZ10] Michael Kohlhase, Florian Rabe, and Vyacheslav Zholudev. “Towards
MKM in the Large: Modular Representation and Scalable Software
Architecture”. In: Intelligent Computer Mathematics. Ed. by Serge
Autexier et al. LNAI 6167. Springer Verlag, 2010, pp. 370–384. isbn:
3642141277. arXiv:1005.5232v2 [cs.OH].
[Law04] William F. Lawvere. “Functorial Semantics of Algebraic Theories”. In:
Reprints in Theory and Applications of Categories 4 (2004), pp. 1–
121.
[LR11] Stephen Lack and Jiří Rosický. “Notions of Lawvere Theory”. En-
glish. In: Applied Categorical Structures 19.1 (2011), pp. 363–391.
issn: 0927-2852. doi: 10.1007/s10485-009-9215-2.
[MMT] Florian Rabe. The MMT Language and System. url:
https://svn.kwarc.info/repos/MMT (visited on 10/11/2011).
[Pea89] Giuseppe Peano. Arithmetices principia nova methodo exposita.
Turin, Italy: Bocca, 1889.
[RK13] Florian Rabe and Michael Kohlhase. “A Scalable Module System”. In:
Information & Computation 0.230 (2013), pp. 1–54.