CAPÍTULO I: DISEÑO TEÓRICO
1.1. Antecedentes de la investigación
In this section we illustrate the use of MathLang’s CGa-TSa on concrete examples taken from the mathematical literature. All examples presented here were input using the MathLang-TSa plugin for TEXmacs. The customised views (i.e., without annotations, with annotations and with printed interpretation) are instantaneously accessible via the plugin menu. See Appendix C for the plugin’s documentation. See Section 6.3.1 for a presentation of the plugin.
We start in Section 5.3.1 with examples from E. Landau’s Foundations of Anal- ysis [Lan51]. Section 5.3.2 continues with the annotations of examples taken from Euclid’s Elements [Hea56]. We finish in Section 5.3.3 with another encoding exam- ple, namely the proof of irrationality of √2 used by F. Wiedijk in his comparison of theorem provers [Wie06].
5.3.1
Examples from E. Landau’s Foundations of Analysis
In 1930, E. Landau’s Foundations of Analysis [Lan51] was published in its original German version [Lan30]. The whole book was encoded by L.S. van Benthem Jut- ting [vBJ77a] in Automath (see Section 2.1.1). We present here the TSa-CGa encoding of some passages of the first chapter of Foundations of Analysis.
First example We start with the definition of the Axiom 2 [Lan51, Chapter 1]. The original version is as follows.
Axiom 2.
For each
xthere exists exactly one natural number , called the
successor of
x, which will be denoted by
x0
.
This passage defines an axiom which could be interpreted as a CGa definition of a statement identifier (we name this identifier Ax2). This axiom is applied to any x (as the first phrase states), we decided therefore to parametrise the Ax2 identifier by x (we assume this variable to be declared in the context of this example). This choice depends on the manner one wants to refer to the axiom later in the document. The rest of the definition is a statement that, for such x, there exists a unique natural number called the “successor of x”. The TSa annotation version of this example is as follows.
Axiom 2.
For each
xthere exists exactly one natural number , called the
successor of
x, which will be denoted by
x0
.
And the TSa annotation version with printed CGa interpretations is as follows.
<> <>
<Ax2>
Axiom 2.
<x>For each
x
<exists_unique>
there exists exactly one
<> <y> <natural_number>natural number , called
<is>the
<y> <successor>successor of
<x>x
,
which will be denoted by
x 0.
[Lan51, Chapter 1]
We note the parametrisation of Ax2 and the use of an existential quantifier (exists_unique) to reason about the existence of a successor of x. The identi- fiers exists_unique, natural_number and successor were declared prior to the axiom’s definition. The following CGa plain syntax code is the interpretation of the whole example.
{
Ax2 ( x ) := e x i s t s _ u n i q u e( y : natural_number , is (y , s u c c e s s o r( x ))) }
It is important to notice that this encoding is one possible encoding of this example. One can argue that the “Axiom” label commonly means that the statement is admitted throughout the document, a line forall(x:natural_number,Ax2(x)) might therefore be added. Such precision is left to the author’s decision and their logical correctness is to be analysed by future aspects (see Section 7.1). The concern of the CGa aspect is only to capture the grammatical meaning of the document’s argumentation.
Second example Let us now consider the definition of “plus” taken from the same chapter. The definition is as follows.
Theorem 4, and at the same time
Denition 1:
To every pair of numbers
x; y, we may assign in exactly one way a natural
number, called
x+y(
+to be read plus), such that
x+1=x 0
for every
x x+y 0 =(x+y) 0for every
xand every
yx+y
is called the sum of
xand
y, or the number obtained by addition of
yto
x.
[Lan51, Chapter 1]
We already used this example in Example 11 of Section 4.3.1.2 for the same purpose as here which is to illustrate the use of definition by cases. This definition is split in two cases: x + 1 = x′ and x + y′ = (x + y)′. We represent each one by a definition case in a step. A case of a definition by cases differs in TSa from a traditional definition by the presence of the symbol # as interpretation for the definition box. Additionally, one can consider the first sentence of the definition as a prelim- inary declaration of the symbol “+”. We therefore annotated this sentence as a declaration.
In this particular example, E. Landau uses two labels “Theorem” and “Defini- tion” for the same paragraph. In our encoding of this example, we make use of the CGa labelling to identify both (i.e., labels Th4 and Def1 in the following version with printed interpretations of the example).
The TSa annotation version of this example is as follows.
Theorem 4, and at the same time
Denition 1:
To every pair of numbers
x; y, we may assign in exactly one way a natural
number, called
x+y(
+to be read plus), such that
x+1=x 0
for every
x x+y 0 =( x+y) 0for every
xand every
yx+ y
is called the sum of
xand
y, or the number obtained by addition of
yto
x.
The following is the annotation version with printed interpretations.
<Th4>
Theorem 4, and at the same time
<Def1>
Denition 1:
<>
To every pair of numbers
x;y
, we may assign in exactly one way a natural
number, called
<+><#>x+
<#>
y
(
+to be read plus), such that
<><#><+><x> x+ <1> 1= <S><x> x 0 <><>
for every
<x> x <><#><+><x> x+ <S><y> y 0 = <S> ( <+><x> x+ <y> y) 0 <><>for every
<x> x<>
and every
<y>y
x+y
is called
<>
the
<sum>sum of
<#>x
and
<#>
y
, or the number obtained by addi-
tion of
yto
x.
Third example We consider here a larger example with the definition and proof of Theorem 29 taken from the first chapter of E. Landau’s Foundations of Analy- sis. The Theorem 29 defines the commutative law of multiplication. The original version and the TSa annotation version of this example are as follows.
Theorem 29
(Commutative Law of Multiplication):
xy = yx:
Proof.
Fix
y, and let
Mbe the set of all
xfor which the assertion holds.
I. We have
y1= y;and furthermore, by construction in the proof of The-
orem 28,
1y=y;hence
1y=y1, so that 1 belongs to
M.
II. If
xbelongs to
M, then
xy= yx, hence
xy+y=yx+ y =yx
0
. By the
construction in the proof of Theorem 28, we have
x0 y=xy+ y
, hence
x 0 y= yx 0, so that
x 0belongs to
M.
The assertion therefore holds for all
x.
[Lan51, Chapter 1]
Theorem 29
(Commutative Law of Multiplication):
xy = yx :Proof.
Fix
y, and let
Mbe the set of all
xfor which the assertion holds.
I. We have
y1= y;and furthermore, by construction in the proof of The-
orem 28,
1y=y;hence
1y=y1, so that 1 belongs to
M.
II. If
xbelongs to
M, then
xy=yx, hence
xy+y= yx+ y= yx0
. By the
construction in the proof of Theorem 28, we have
x0 y=xy+y
, hence
x 0 y= yx 0, so that
x 0belongs to
M.
The following is the annotation version with printed interpretations. <>
<T h29 >
Theorem 29
(Commutative Law of Multiplication):
<x > <y >< =><* ><x> x < y> y = <* ><y> y <x> x : <Pr oof- Th2 9>
Proof.
< >Fix
<> <y>y
, and
< >
let
<M>M
be the set of
< for all >
all
<> <x > x<M>
for
<Th 29> <x >which
<y >the assertion holds.
<P roo f-T h29- I>
I. We have
<= >< *> <y> y <1 > 1= < y> y;and furthermore,
<# refPr oof -Th 28- I>
by construc-
tion in the proof of Theorem 28,
< => <*> < 1>1 < y> y= <y> y;
hence
<= >< *> <1> 1 <y> y= <*> <y > y < 1> 1, so that
<i n> <1>1 belongs to
<M > M.
<P roo f-T h29- II>II.
< >< >If
<x> xbelongs to
<M> M, then
<= >< *> <x> x <y> y = < *> <y> y <x > x, hence
< => <+> <* >< x> x < y> y + <y> y = <sh are d><+> <* >< y> y <x> x + < y> y <=> = <*> < y> y <S> <x > x 0.
< #re fP roo f-T h28- II>By the construction in the proof of Theorem 28, we have
< => <*> <S >< x> x 0<y> y= <+> < *> <x> x < y> y + <y> y, hence
< => <*> <S >< x> x 0 < y> y = <*> <y > y < S> <x> x 0, so
that
< in> <S > <x> x 0belongs to
<M > M.
<f ora ll>< 2><Th 29> <x > <y >
The assertion therefore holds
< 1><>for all
<x > x<N >
.
We mention four particular exposures of this encoding.
1. Our annotation of Theorem 29’s definition uses parameters similarly to the annotation of Axiom 2 in our previous example.
2. In this example, E. Landau uses two notations representing multiplication: a notation without any symbol to mark the multiplication (e.g., xy) and a dot “·” notation (e.g., x · y). In the annotated example, each use of multiplication
is consistently associated with a unique interpretation symbol “*”.
3. The proof of the Theorem 29 as written by E. Landau contains an aggregated equation: xy + y = yx + y = yx′. We use the sharing souring annotation we presented in Section 5.2.3.2.1 to annotate this equation. As a result the
interpretation of this equation duplicates the middle element. The result of the de-souring of this equation is equivalent to having both xy + y = yx + y and yx + y = yx′.
4. Finally, E. Landau refers to the construction of the proof of Theorem 28 because his manner to prove Theorem 29 is identical to the manner he already proved Theorem 28. We indicate this relation by a reference to the step- labels Proof-Th28-I and Proof-Th28-II respectively. These labels were attributed to the sub-parts of the proof of Theorem 28 in the same fashion as the Proof-Th29-I and Proof-Th29-II labelling here.
Former encoding During our first year of PhD studies, we translated the whole first chapter of [Lan51] into MWTT (see Section 3.4.1). The MWTT encoding of the whole first chapter of E. Landau’s Foundations of Analysis [Lan51] is presented in an appendix 2 to [KMW04b].
5.3.2
Examples from The 13 Books of Euclid’s Elements
In this section we give some examples taken from the first book of Euclid’s Ele- ments [Hea56]. In contrast with the examples from Section 5.3.1, these ones are written in a less formal style. We have used these examples in Section 4.3 but we then only gave their CGa’s plain syntax version.
First example We present here the TSa-CGa encoding of the six first definitions of the first book of Euclid’s Elements. For this purpose, we use the object-oriented nature of CGa language (see Section 4.3.2.1). The definitions are as follows.
1.
A
pointis that which has no part.
2.
A
l ineis breadthless length.
3.The extremities of a line are points.
4.
A
s traight li neis a line which lies evenly with the points on itself.
5.
A
s urfaceis that which has length and breadth only.
6.The extremities of a surface are lines.
[Hea56, Book I]
Among those six definitions, Euclid defines three kinds of objects: the points, the lines and the surfaces. The three other so-called definitions introduce specific features of points and surfaces for the third and sixth definitions respectively, and they introduce a specific kind (or sub-kind) of lines (fourth definition). We interpret and annotate these definitions as follows:
• The kinds of objects are CGa nouns, • The specific features are CGa characters, • And the sub-kinds are CGa adjectives.
The TSa annotation version of this example is as follows.
1.
A
pointis that which has no part.
2.
A
li neis breadthless length.
3 .The extremities of a line are points.
4.
A
straight lin eis a line which lies evenly with the points on itself.
5.
A
su rfaceis that which has length and breadth only.
6 .The extremities of a surface are lines.
And the TSa annotation version with printed CGa interpretations is as follows.
<>
1.
<point>
A
point
is
<> <> <has_no_part> <self>
that which has no part.
<>2.
<line>
A
lin e
is
<><> <has_no_breadth>
breadthless
<self> <> <length>length.
3 .
<> <extremities>
The extremities of
<#>a line are
<point>points.
<> <points> <>4.
<straight>
A
strai ght lin e
is
<> <line>
a line
<>which
<lies_on_evenly>lies evenly
<points>with the points on itself.
<>
5.
<surface>
A
su rface
is
<> <> <>
that which has
<length>length and
<> <breadth>breadth
only.
6 .<> <extremities>
The extremities of
<#>a surface are
<line>lines.
In these annotation versions we see that the second and third definitions and the fifth and sixth are merged two-by-two as they define the “line” and “surface” nouns respectively. In both cases we use the noun description construction (a step anno- tation box inside a noun annotation box which corresponds to the CGa’s abstract syntax Noun construction, see Table 5.2). Alternatively, we could use a CGa sub re- finement for the definitions which add new characters (third and sixth definitions). Summarising, the first definition states the absence of part3 for “points”. The second and third definitions define three characters for “lines”: length, extremities and points. The fourth definition defines that the “straight” adjective characterise a line by stating that its points (character defined in the third definition) lies on evenly (we used specific statement identifier, which we named lies_on_evenly, to represent this characteristic). The fifth and sixth definitions defines the following characters for the “surface” noun: length, breadth and extremities.
Second example This example is concerned with the twentieth definition in Book I of Euclid’s Elements. We illustrated the use of adjectives in CGa’s plain syntax with this definition as example. The listing on page 105 is the CGa in- terpretation of the twentieth definition. The original version, the TSa annotation
version and the TSa annotation version with printed interpretations are as follows.
20 . Of trilateral gur es, an eq uil ateral trian gle is th at wh ich has its
th ree sides
equ al,
an iso scele s triang le that wh ich has
two
of i ts
sides alon e
equ al,
a s cal ene trian gle thatwh ich h as its th reesides
un equal .
[Hea56, Book I]
20 . Of trilateral gur es, an equ ilateral trian gle is th at wh ich has its
three sid es
equal,
an isos cele s triang le that wh ich has
two
of its
sid es al one
equal,
as cal ene tri an gle that wh ich h as i ts threesid es
un equal.
20 . Of trilateral gures, <>
an
<e quil ate ral >
eq uil ateral < > <tr ian gle > triangl e is < > that whi ch has
<f old -ri ght > <f ora ll> i ts < > <li st> <s1 > <s 2> <s ide s> th ree sid es < bas e> < => < s1> equal, < s2> <> an
<iso sce les >
is osce les
<> < tri ang le>
tri an gle <>
that wh ich has
<f old -ri ght >
<ex ist s_u niq ue> < >
<l ist > two <s 1> <s2 > of its <sid es> si des al one <ba se> < => <s 1> equal, <s 2> <> a
<sca len e>
s cal ene
<> <tr iang le>
tri an gle < >
that wh ich has
<fo ld- righ t> <fo ral l> i ts <> <l ist > < s1> <s2 > <si des > three sides < bas e> < !=> < s1> u nequal . <s2 >
5.3.3
Pythagoras’ proof of irrationality of
√2
This section contains a TSa-CGa encoding of the Pythagoras’ proof of irrationality of √2. The proof we use is due to G.H. Hardy and E.M. Wright [HW80]. It was used by F. Wiedijk in [Wie06] for a comparison of theorem provers. We used this
example in [KMW04b] to illustrate our MWTT-based system to customise ren- dering of MWTT documents (see Section 6.3.2). The annotation of this example causes no particular difficulty. The original version, the TSa annotation version and the TSa annotation version with printed interpretations are as follows.
Theorem 1.
[Pythagoras' Theorem
2 pis irrational.
Proof.
If 2p
is ration al, then th e equ ation a 2
= 2b 2
is solubl e in integers a , b
with (a;b)=1. H encea 2
is even , andth ereforea iseven. If a=2c, th en 4c 2 = 2b 2 , 2c 2 =b 2
, andb isalso even , contraryt o th e hypoth esis th at (a;b)=1. [HW80]
Theorem 1.
[Pythagoras' Theorem
2 pis irrational.
Proof.
I f 2p
is ration al , then the equation a 2
= 2b 2
is sol ubl e in int eger s a , b
wi th (a;b)=1. Hence a 2
iseven ,and th erefore a iseven . I f a=2 c , then 4c 2 = 2 b 2 , 2c 2 =b 2
, and b isalso even , contrary to th e hypothesis that(a;b)=1 .
<> <T h>
Theorem 1.
<Th >[Pythagoras' Theorem
<i rra tion al> <s qrt > <2> 2 pis irrational.
<>Proof.
< > If<ra tio nal >< sqr t> <2> 2 p
i s rati onal , th en
< >< sol ubl e>
th e equation <= >< sq> <a > a 2 = < *> <2> 2 < sq> <b > b 2 is sol ubl e < > in
< a> <in teg er>
integers <a >
a , <b >< b>
b
<in teg er> wi th <h> <= >< gcd > ( < a> a; <b> b)= <1 > 1 . <h> <> Hence < eve n> <sq >< a> a 2 is even , <> an d therefore < eve n> <a> a is even . <> If
< >< c> <c> <in teg er> < => <a>
a = <*> <2 > 2 <c> c , < > then <= >< *> <4> 4 < sq> <c > c 2 = <* > <2> 2 < sq> <b > b 2 , < >< => <*> <2 > 2 <s q> <c> c 2 = <s q> <b> b 2 , <> and <e ven> < b> b is also even ,
<> <c ont rad ict ion >
contrary to th e < h> hypothesisth at <=> <g cd> ( <a > a; <b> b)= < 1> 1.
Let us use this example to illustrate another facet of TSa-CGa encodings with the definition of a context for the whole example. We sometime name this context a preface. A preface contains all the identifiers used but not declared nor defined in a document. in this practical example we need to declare “integer”, “1”, “2” and