• No results found

The development of Mizar started with the proposition of a formal language for editing mathematical papers. This Mizar language, on its early days (November 1973), was intended to be a formal language for recoding mathematics in such a way that [MR05]:

• the papers could be stored in a computer and later, at least partially, trans- lated into natural languages,

• the papers would be formal and concise,

• it would form a basis for the construction of an automated information system for mathematics,

• it would facilitate detection of errors, verification of references, elimination of repeated theorems, etc.,

• it would open a way to machine assisted education of the art of proving theorems,

• it would enable automated generation of input into typesetting systems. Summarising, the main goal for the original Mizar language design was to be close to the mathematical vernacular used in publications with the requirements

2

statistics are taken from the web: http://merak.pb.bialystok.pl/ – last accessed on 2008- 08-15, MML version: 4.100.1011.

that the language has to be simple enough to enable computerised processing, in particular mechanical verification of correctness [BR02].

Therefore, the goals and the main stress placed on editorial work resulted in the development of the Mizar language to its current state where it mimics the Common Mathematical Language and provides a way that mathematicians work. The language is based on first-order logic and proofs are written in a style of natural deduction as proposed by Ja´skowski [Ja´s34]. Moreover, the Mizar language is the most accessible of the formal languages, in terms of readability and write-ability, by mathematicians, as expressed by the author A. Trybulec:

Experience has shown that many people with some mathematical training develop a good idea about the nature of the Mizar language just by browsing through a sample article. This is no big surprise, since one of the original goals of the project was to build an environment which supports the traditional ways that mathematicians work. [RT99, pp.2] In summary, the Mizar language is a tiny subset of English words frequently used in the CML. It consists of 102 reserved words like: define, let, be, if, where, assume, which form a lexicon of basic tokens of the language. Further tokens are defined by the author in vocabularies and are shared among a number of Mizar articles in the Mizar Mathematical Library (MML). Similarly, common words in mathematical texts, like assume, consider and exists are part of the Mizar language. Words that link sentences like then, thus and hence are part of the Mizar language as well. All these reserved words are used in an intuitive way when writing Mizar article.

As an example of the Mizar language let us look at the following CML theorem from Set Theory.

Theorem 1. For any sets X and Y , it holds that X ∪ Y = ∅ =⇒ X = ∅.

The above sentence can be translated into the Mizar language and represented in the following manner:

r e s e r v e x ,A ,B ,X ,X ’ ,Y ,Y ’ ,Z , V for set ; t h e o r e m :: X B O O L E _ 1 :15 :: BOOLE ’59:

X \/ Y = {} i m p l i e s X = {};

A more complex example of the CML fragment shown in Figure 3.1 is taken from the work [Tho00] by S. Thomasse. This fragment introduces the definition of binary relations embeding.

A binary relation R = (V, E) is embedded into another binary relation D = (W, F ) (or S embeds R) if there is an injective mapping f from V into W such that (x, y)∈ E if and only if (f(x), f(y)) ∈ F .

Figure 3.1: A more complex example of the definition written in CML and taken from [Tho00].

The definition from Figure 3.1 could be represented in the Mizar language as follows (Listing 3.2):

d e f i n i t i o n

let R , S be RelStr ; pred S embeds R means :: N E C K L A C E : d e f 2

ex f being F u n c t i o n of R , S st f is one - to - one & for x , y being E l e m e n t of R holds

[x , y ] in the I n t e r n a l R e l of R iff

[ f .x , f . y ] in the I n t e r n a l R e l of S ; end ;

Listing 3.2: A translation of the original text from Figure 3.1 in the Mizar Lan- guage. This is taken from the Mizar article written by K. Retel and published in the MML [Ret03a]

The definition presented in Listing 3.2 is part of the Mizar article written by K. Re- tel, which is the first article of the series of articles [Ret03a, Ret03b, Ret04] attempt- ing to formalise the original paper [Tho00]. Further description of this attempt and other examples of the formalisations done by K. Retel are discussed in Section 3.6. As we can see from the above Mizar text fragments, the Mizar language mimics the common mathematical language and more importantly it matches all the goals of the formal language Mizar (stated at the beginning of this section). Moreover, the Mizar Language could be read and understand by an average mathematician without requiring an exhaustive knowledge of Mizar. One of the visible differences between the Mizar and the CML representations of the same fragment are: (1) the usage of different notions for a number of identifiers and operations, (2) the rigid structure of formalised text. Some of those identifiers are reserved words, like definition, let, be, means, pred, implies, holds, where others are intro-

duced and defined in other Mizar articles, like Function of R,S, one-to-one, Internal Rel of R, [, f., {}.

Table 3.1 presents the notation of some common symbols found in mathematical documents, and expresses them against their Mizar counterparts. This provides quite generic view over the Mizar language symbols used to construct statements.

Mizar: CML: Mizar: CML: & ∧ in ∈ or {} implies = c= iff ⇐⇒ = = not ¬ c<<

for a being A st P[a] holds R[a] ∀a : A(P.a =⇒ P.b)) \/

ex a being A st P[a] ∃a : A(P.a) /\ ∩

\ \

Table 3.1: Comparison of some common mathematical symbols and their presen- tation layout in the Mizar language

.

In the Mizar language we have some blocks of text that are named in the same way as compared to the CML counterparts. For instance, we have a

Definitional-Block, as expressed in Listing 3.2, or a theorem as shown in List- ing 3.1. Similarly to any proof system or programming language, the Mizar lan- guage has also comments. Comments in Mizar are expressed as texts displayed after the symbol “::”. For instance, in Listing 3.1 string: XBOOLE_1:15 :: BOOLE’95 is treated as a comment, although it also expresses the article name from which the theorem is taken, i.e., XBOOLE_1 and the number of the theorem from that file, i.e., 15. We can refer to that theorem in other articles by using this name in the justification reference list, for instance: by XBOOLE_1:15.

The Mizar language is easy to read and write, due to the goals and aims of the project. Furthermore, we can state that the language itself is easy to learn. It was proved in many occasions and by many people trying to learn and understand Mizar. Furthermore, the Mizar language and its declarative approach is the base for development of a number of “modes”, so called “Mizar Mode” for different procedural proof systems/checkers [Har96, GW03].

The difficult part of writing a Mizar article is to find existing notions and theorems as well as the right justifications and how to use and find references in the MML.