• No results found

The Mizar FPS version of the CML to full Mizar

5.2 An example of Computerisation Path Following MathLang Approach

5.2.4 The Mizar FPS version of the CML to full Mizar

Previous section shows how a user transforms the MathLang computerised version of the original document into the the Mizar FPS version. To complete our proposed gradual path of formalisation mathematical documents, the user needs to fill out missing parts of the proof in the Mizar FPS version of the document. The user needs to fill the proof up to the level that the Mizar system accepts a document without errors.

To do this, the user needs to possess more expert knowledge of Mizar and the MML than it was required while building the Mizar FPS. The essential knowledge is the ability to find definitions, theorems and clusters within the MML that are mandatory to full fill some justification holes within the proof. At this level, the user also needs to fill in appropriate directives in the environment, which is not an easy task, especially filling in the “notations” directive, where the order of articles can make a big difference for the Mizar system/checker.

Figure 5.16 presents the Mizar FPS proof (left hand side of the Figure) together with the full formalised version of the proof (right hand side of the Figure), where lines of the Mizar FPS proof version match lines of the full proof version.

There are number of important issues that has to be discussed of this full version of the Mizar FPS proof.

Firstly, the Mizar FPS version shows places where the Mizar system labelled its errors, mainly justification holes. On the Mizar full formalisation of the proof, those holes have been filled out with justifications. Most of those justifications are actually “simple justifications” as called in the Mizar jargon or Straightforward- Justification as indicated in the Mizar syntax. In Mizar a “simple justification” (or Straightforward-Justification) is presented as a reference to the previously proved statement, either local or taken from the MML. The structure of “simple justi- fication” is the keyword “by ...” followed by the label of the statement referred to.

Secondly, a reasoning logic of the CML version of the proof is intuitive and contains holes considered to be trivial and not worth mentioning from the human- being perspective. However, if we aim to provide a representation of the proof for

Figure 5.16: A comparison view of two representations of a proof of the Pythagoras’ theorem shown in Figure 5.2. On the left hand side of the figure is the Mizar FPS proof, whereas on the right hand side is the full Mizar proof of the theorem.

a computer to verify its logic in the reasoning steps, we have to fill out all possi- ble reasoning holes and provide a fully formalised version of the proof. Therefore some of the Mizar FPS holes requires additional statements being proved prior their usage in simple justifications. As a good example lets take a statement (1) 4*c^2 = 2*b^2. Such statement required some arithmetic calculation and refer- ences to existing statements from the MML. This is due the fact that the Mizar is a proof assistant and proof checker, and is able to derive only some of reasoning steps (e.g., simple arithmetic, see article [NB04]) whereas most of them has to be made and written explicit by the user. As presented in the example, see right hand side of Figure 5.16, we provided additional 3 steps for the Mizar to be able to get it fully formalised and verified by the system.

Thirdly, we introduced two additional local theorems that are needed for this proof:

LocalTH1 :

f o r k , l being I n t e g e r s t not k , l a r e r e l a t i v e p r i m e holds ex x being I n t e g e r s t x = k gcd l & x <> 1

LocalTH2 :

f o r p being R a t i o n a l holds

ex a , b being I n t e g e r s t b <> 0 & p = a /b & a , b a r e r e l a t i v e p r i m e

The first local theorem LocalTH1 is used inside a proof of the second local theorem LocalTH2. This theorem, LocalTH1, could actually be moved inside the proof of the theorem LocalTH2. However, for clarity of the proof we have placed this outside the proof.

The proof of the Pythagoras’ theorem is a reductio ad absurdum (i.e., proof by contradiction). So it assumes that the thesis is false and that “√2 is rational”. From such an assumption we conclude the information that is actually presented in theorem LocalTH2, which makes the theorem the base of the proof. However, this local theorem requires a proof itself. For this reason, we have placed it outside the original proof of the Pythagoras’ theorem, see Listing A.3. It is also important to note, that the proof of the local theorem LocalTH2 can have at least two different approaches, as presented on Listing A.3 and Listing A.4. The second Listing A.4 presents the proof proposed by A. Naumowicz during discussion of the author of the thesis and A. Naumowicz on the Mizar “developer-forum”. This proof has been optimised to 3 lines! and uses different notations and definitions than those presented on Listing A.3.

Figure 5.17: A comparison view of two representations of the environment for the Mizar representation of the Pythagoras’ theorem shown in Figure 5.2. On the left hand side of the Figure is the Mizar FPS environment, whereas on the right hand side is the environment of the full formalisation of the proof of the theorem.

Fourthly, the environment for the full formalisation differs from the environ- ment of the Mizar FPS version. Although, both contain the same parts (as shown on Figure 5.17 with the same line numbers and splits of the lines for both presen- tations), the fully formalised version is a bit more complicated. Moreover, the fully formalised environment contains a “theorems” directive and a “definitions” direc-

tive, which were not introduced in the Mizar FPS environment. In these directives the fully formalised version contains names of articles from which theorems and definitions where used to justify the reasoning of the proof.

At this level, it could sometimes appear that previously built Mizar FPS and choices of formalisation have to be reviewed, verified and changed to fit to the final goal and destination of the full formalisation. Moreover, as this simple example shows, in most of the cases, while transforming the Mizar FPS to the full formali- sation, a user has to introduce additional definitions and theorems that are not yet introduced in MML. All that makes the transformation process from Mizar FPS to full Mizar very labor intensive and time consuming, especially for unexperienced Mizar users. Therefore, we recommend that at this stage a Mizar expert performs the transformation and full formalisation.