C a r t p r o d ( C a r t e s i a n P r o d u c t , iI) One o f t h e most c h a r a c t e r i s t i c d i f f e r e n c e s between t h e o l d e r v a r i a n t s o f AUTOMATH, s u c h as AUT-QE, and AUT-II c o n c e r n s t h e n o t a t i o n o f f u ~ z t i o n l i k e e x p r e s s i o n s . The p u r p o s e was t o remove a n a m b i g u i t y i n i n t e r p r e t a t i o n which a r i s e s i n AUT-QE: Suppose we have i n t r o d u c e d t h e t y p e o f n a t u r a l numbers: ..-- 'prim' Now we can i n t e r p r e t t h e e x p r e s s i o n Cx:nalna i n two ways: 1. - " f u n c t i o n c a t e g o r y i n t e r p r e t a t i o n 1 ' : [x:nalna i s t h e t y p e of f u n c t i o n s f r o m na t o na. The i d e n t i t y f u n c t i o n rx:nalx p . e . h a s a s i ~ tsy p e 1x:nalna. I f we i n t e r p r e t rx:nalna i n t h i s way, a s a t y p e ( o f f u n c t i o n s ) we would l i k e t o s e e a s i t s category: ' t y p e ', s o : 't y p e ' 2 . " f u n c t i o n i n t e r p r e t a t i o n " : [x:nalna i s t h e ( c o n s t a n t ) f u n c t i o n which a t t a c h e s t o e a c h o b j e c t i n na t h e t y p e nu. So [x:nalna i s a t y p e - v a l u e d f u n i t i o n o n na. I n t h i s i n t e r p r e t a t i o n t h e c a t e g o r y o f [x:nalna s h o u l d b e [x:na] ' t y p e ' ( t h e c a t e g o r y o f t y p e - v a l u e d f u n c t i o n s on na). I n AUT-OE t h i s p r o b l e m o f i n t e r p r e t a t i o n i s s o l v e d by i n t r o d u c t i o n of so-called "type-reduction" ([x:nal ' t y p e ' r e d u c e s t o ' t y p e ') . I n AUT-X t h e a m b i g u i t y i s removed i n a n o t h e r way: f u n c t i o n l i k e e x p r e s s i o n s $ which must b e i n t e r p r e t e d a s c a t e g o r i e s of f u n c t i o n s ( i n t e r p r e t a t i o n 1 . ) II ( f ) , o r i n machine i n p u t l a n g u a g e a s c a r t p r o d f f ) . Hence are written as t h e name AUT-11. So i n AUT-TI we h a v e : 'type ' lI f [x:nal ' t y p e ') I n some c a s e s we h a v e a s p e c i f i c i n t e r p r e t a t i o n of I I - e x p r e s s i o n s : A. Category of p r e d i c a t e s L e t a : ' t y p e '. Then, a c c o r d i n g t o o u r p r e v i o u s s t a t e m e n t s , IIf[x:a]' p r a p ') must b e i n t e r p r e t e d a s " t h e c a t e g o r y of p r o p (= p r o p o s i t i o n ) - v a l u e d on a", i.e. " t h e c a t e g o r y of ( u n a r y ) p r e d i c a t e s on a". To emphasize t h i s i n - t e r p r e t a t i o n , "REAL ANALYSIS" c o n t a i n s t h e f o l l o w i n g a b b r e v i a t i o n : @[a: ' t y p e 'I p r e d := II ([x:a1 ' p r o p '1 functions B. Universal Quantification Suppose we have a predicate p on some type a: c- @ [ a :' t y p e ' 1Cp:pred i a ) 1 Then II(p) has the following interpretation: "the category of functions which provide for all z:a a proof that <x>p (i.e. that p holds ,at x)". This is "the category of proofs that p holds for all x:oll'. So n i p ) can be interpreted as the proposition V ( p ) ( a l u a y s ( p ) , a l l f p ) ) . Again in "REAL ANALYSIS" this interpretation is reflected by appropriate redefinitions of II: (SO a l w a y s and a 2 2 have the same meaning. Which of the two is used de- pends upon the form of the predicate which is quantified. An example: the predicate of "roses being red" can be expressed in two ways: we can have a predicate called r e d , or the proposition i s r e d in the context of an object in the type r o s e s . We express "all roses are red" either as a l u u y s ( r e d ) or a l l iIr : r o s e s 1 i s r e d ( r ) ) . C. (Generalized) Implication Let A and B be propositions: @ [ A :' p r o p ' I C B : ' p r o p ' I Then I I ( [ u : A ] B ) is "the category of functions which provide for each object in (i.e. proof of) A an object in (i.e. proof of) B". This is "the category of proofs that A implies B". or "the proposition A & ? " . Generally it may occur that we can only state B if we know that A is true. For instance, in the statement "if he is an elephant, his trunk is shorter than five meter", i.n a precize formalization, the fact that "he is an elephant" must be presupposed when we state something about "his trunk". This general situation is called "generalized implication", an example of "generalized logic" (see also "generalized conjunction" in the description of p a i r c a t ) . Examples of the use of generalized logic can be found in "REAL ANALYSIS" (see chapter I , section 6: "generalized if-then-else"). In the simple case of a proposition B which can be stated independently of the truth of A , the implication interpretation of IT can be shown by the following redefinition: @[A: ' p r o p 'ICE: ' p r o p ' I A-tB := lI(Cu:AIB) 'prop ' E x a m ~ l e sand r e m a r k s 1. A c t u a l l y , t h e r e d e f i n i t i o n of II which we i n t r o d u c e d a b o v e (A-tB) i s c o n t a i n e d i n "REAL ANALYSIS" i n a more g e n e r a l way, s u c h t h a t i t c a n a l s o be used f o r " o r d i n a r y " f u n c t i o n c a t e g o r i e s : @CzZ:' s y n t 'IC22: ' s y n t 'I 21+22 = r r ( C x : 2 l l z 2 ) SO we c a n w r i t e : :-(-a))+a, ( x > O ) - t ( ( - x ) 5 0 ) a s w e l l a s pred := a j ' p r o p ', r e l n := a-+(a-t1prop') e t c . 2 . Example: ' @ n a := ' p r i m ' : 'type x 3 := ' p r i m ' : 'prop ' z @ r f := ' p r i m ' @ r f pred := [y : n a l iy-1 : pred (na) r f p r o p := a l w a y s ( r f p r e d ) : 'prop ' r f p f := [ x : n a l r f ( x l : r f prop m i s example u s e s some a b b r e v i a t i o n s o f Il which we i n t r o d u c e d e a r l i e r ( p r e d , always) . r f p r e d i s t h e p r e d i c a t e of "being equal t o i t s e l f " ( r e f l e x i v i t y ) , r f p r o p i s t h e p r o p o s i t i o n " a l l o b j e c t s i n na a r e e q u a l t o i t s e l f f 1 and r f p f i s a p r o o f of t h i s proposition. P a i r c a t ( c a t e g o r y of p a i r s , C). A common m a t h e m a t i c a l a c t i v i t y is t h e f o r m a t i o n of p a i r s o f o b j e c t s . We show how t h i s c o n c e p t c o u l d b e i n t r o d u c e d i n AUT-QE: @[a: ' t y p e 'ICB: ' t y p e ' I c- p a i r c a t := ' p r i m ' : 'type' o r d e r e d p a i r := ' p r i m ' : paircat := ' p r i m ' . a p r o j 2 := ' p r i m ' . B y @ p r oj 1 r u Z e := ' p r i m ' : p r o jl ( o r d e r e d p a i r f'x,y)l = x p r o j 2 r u l e := ' p r i m ' : p r o j 2 (o r d e r e d p a i r ( x ,2 ) j z @ p a i r r u Z e := ' p r i m ' : proj l =y o r d e r e d p a i r ( p r oj l ( z j ,pro j 2 (2)1 =z The e q u a l i t y symbol i n t h e l a s t t h r e e axioms r e p r e s e n t s some e q u a l i t y not i o n which s h o u l d b e i n t r o d u c e d e a r l i e r i n t h e book ("book e q u a l i t y " ) . How- e v e r , we c a n o n l y p r o v e t h e s e e q u a l i t i e s ; t h e o b j e c t s a r e n o t d e f i n i t i o n a l l y e q u a l ( i . e . e q u a l f o r t h e m a c h i n e ) . I f we want t o h a v e t h e s e r u l e s on t h e l e v e l of d e f i n i t i o n a l e q u a l i t y , t h e above p i e c e o f t e x t h a s t o b e i n c l u d e d i n t h e l a n g u a g e d e f i n i t i o n which i s f e d t o t h e machine. 1.e.: the l a s t three r u l e s must b e i n c o r p o r a t e d i n t h e v e r i f i c a t i o n program a s r e d u c t i o n procedures. T h i s i s a c t u a l l y done i n t h e c a s e of AUT-IT. So we h a v e t h e ( " p r e d e f i n e d " ) paircat, o r d e r e d p a i r , p r o j l and p r o j 2 . F u r t h e r m o r e t h e axioms ( p r o j l r u l e , p r o j 2 r u l e a n d p a i r r u l e ) a r e i n c o r p o r a t e d a s t h e r e d u c t i o n s language c o n s t a n t s 1' T~ and cr r e s p e c t i v e l y . The p a i r i n g c o n s t r u c t o f AUT-IT i s , i n f a c t , more g e n e r a l . t h a n t h e one i n t r o d u c e d a b o v e , namely: t h e c a t e g o r y o f t h e s e c o n d member o f t h e p a i r may depend on t h e f i r s t member. T h i s t y p e r e l a t i o n c a n b e g i v e n by a t y p e - v a l u e d f u n c t i o n o. So i f a : ' t y p e i.e. ' and a : w ' t y p e ', t h e n we h a v e p a i r c a t ( c r ) : ' t y p e ', t h e c a t e g o r y of ( g e n e r a l i z e d ) p a i r s . An o b j e c t i n t h i s t y p e ( h a v i n g t h i s c a t e g o r y ) i s o r d e r e d p a i r ( 0 , a , b ) i f a : a and b:<a>o. The p a i r i n g c o n s t r u c t i s a l s o more g e n e r a l i n a n o t h e r way: o t h e r k i n d s o f p a i r s may b e formed. B e s i d e s " p a i r s o f o b j e c t s " , d e s c r i b e d a b o v e , we may have : a ) p a i r s c o n s i s t i n g o f two p r o o f s . The i n t e r p r e t a t i o n OF t h e p a i r cons i s t i n g o f a p r o o f o f A and a p r o o f o f B i s : "a p r o o f o f A and B ( t h e conj u n c t i o n of A and R ) " . H ~ r pt h p p r n p n q i t i n n R may a l s n d e p e n d on t h e proof of A ( r a t h e r : t h e f a c t t h a t t h e r e i s a proof of A ) , i.e. i t can b e t h e c a s e t h a t we c a n o n l y e x p r e s s 3 i f we know t h a t A i s t r u e (example: "a > 0 a n d l o g ( a ) > 1". s o i n AUT-Ti H e r e we may o n l y s p e a k o f l o g ( a ) b e c a u s e we know t h a t a > 0 , t h i s p r o p o s i t i o n r e a d s a s f o l l o w s : paircat(lu:a>O](Zog(a,u)>lj)). This i s c a l l e d "generalized conjunction". b ) p a i r s c o n s i s t i n g o f a n o b j e c t and a p r o o f . I n g e n e r a l t h e c a t e g o r y o f t h e s e c o n d member ( t h e p r o o f ) a g a i n depends on t h e f i r s t one: i t p r o v e s a p r o p e r t y o f t h e f i r s t member ( t h e o b j e c t ) , i . e . i t proves t h a t t h i s o b j e c t s a t i s f i e s a p r e d i c a t e p. We c a n i n t e r p r e t t h i s p a i r i n two ways: 1. As a p r o o f , namely t h a t t h e r e e x i s t s a n o b j e c t s a t i s f y i n g p (in a s t r o n g s e n s e of a c t u a l l y e x h i b i t i n g such an o b j e c t : " s t r o n g e x i s t e n c e " ) . T h i s i n t e r p r e t a t i o n , however i s i n c o n s i s t e n t w i t h t h e " i r r e l e v a n c e o f p r o o f s " c o n c e p t ( s e e [Zu] , page 1 3 ) . 2 . As a n o b j e c t i n t h e " s u b t y p e " o f o b j e c t s s a t i s f y i n g p. T h i s i n t e r p r e t a t i o n i s c o n s i s t e n t . So i f a:'typer and p some p r e d i c a t e on a , i . e . : p:a+'prop ', t h e n paircatjp) : 'type'. O b j e c t s i n t h i s " s u b t y p e d e t e r m i n e d by p" a r e o b t a i n e d a s f o l l o w s : i f x:a and u:<x>p t h e n orderedpair(p,x, u ) :paircatip). Remarks 1 . One would e x p e c t ( f o r r e a s o n s o f s y m e t r y p e r h a p s ) a f o u r t h k i n d of p a i r c o n s t r u c t i o n , namely p a i r s o f p r o o f s and o b j e c t s . Analogous t o t h e a r g u m e n t a t i o n g i v e n i n [Zu] f o r t h e c a s e o f p a i r s of o b j e c t s and p r o o f s , t h i s p a i r c a n n o t b e i n t e r p r e t e d a s a p r o o f . Then we w e r e a l l o w e d t o w r i t e t h e f o l lowing: (O=0)+ type ' a1 := [u:O=Olna : pl := paircat(a1) .- 'prop' pf1 := orderedpairf ol,pf, 01 : p1 pf2 := orderedpair ( 0 1 , pf, 1 ) : p1 According t o " i r r e l e v a n c e of proofs": D (using r i g h t projection):0=1. D pf1 = pf2 ( t h e y b o t h p r o v e pl). So So p l c a n n o t b e i n t e r p r e t e d a s a p r o p o s i t i o n . I f p a i r s o f p r o o f s and o b j e c t s s h o u l d b e p a r t o f AUT-II t h e y s h o u l d b e o b j e c t s . However, i n c l u s i o n o f t h i s k i n d o f p a i r s d o e s n o t seem u s e f u l , and t h e r e f o r e AUT-fl d o e s n o t c o n t a i n t h i s p o s s i b i l i t y . 2. On t h e u s e o f p a i r c a t , orderedpair, p r o j l , p r o j 2 . Summarizing we have t h e following paircat constructions: a: ' t y p e ', a : a+ ' t y p e ' + - p a i r c a t : ' t y p e ' a : ' t y p e ', p :a+ 'prop ' F p a i r c a t : ' t y p e ' A : 'prop ', p:A+ 'prop ' I- p a i r c a t : 'prop ' S o , a p p a r e n t l y , p a i r c a t depends upon two a r g u m e n t s . However, t h e implementat i o n o f p a i r c a t i s s u c h t h a t i t o n l y r e q u i r e s one argument. U s i n g " s y n t a c t i c a l o p e r a t i o n s " t h e o t h e r argument c a n b e r e c o v e r e d . We may w r i t e p a i r c a t ( p ) and t h i s i s t r a n s l a t e d t o paircat(domain(p),p). I n t h e same way p r o j l and p r o j 2 can b e c o n s t r u e d o p e r a t i n g on a s i n g l e argument: p r o j Z ( z ) i s r e w r i t t e n a s p r c j l ( d o m a i n ( p ) , p , z ) where p ~ l a s t e Z t ( t a i (2 ' i d f ' p a i r c a t , c a t e g o r g ( z ) ) I . F i n a l l y , orderedpair must b e s u p p l i e d w i t h e i t h e r two o r t h r e e a r g u m e n t s . G e n e r a l l y i t n e e d s t h r e e a r g u m e n t s t o p r e s e r v e u n i q u e n e s s of t y p e s . F o r i f we h a v e a: ' t y p e where q ', p:a-+'prop ', x:a, u:q D = <x>p, we c a n n o t r e c o v e r p u n i q u e l y f r o m 4 . E.g. i f u:x=x we have both So i f we would w r i t e o r d e r e d p a i r i x , ~ ) i t would n o t b e c l e a r w h e t h e r we meant orderedpair(Cy :a1 (y=y),x,u) o r orderedpair (1y:uI iy=x) ,z,u) ( n o t e t h a t t h e s e p a i r s have d i f f e r e n t t y p e s ) . However, we c a n w r i t e o r d e r e d p a i r i x , y ) no i n c e r t a i n c a s e s where t h e r e i s a m b i g u i t y ; namely i f t h e c a t e g o r y o f y d o e s n o t depend upon x . The ma- chine i n t e r p r e t e s orderedpair(x,y) o r d e r e d p a i r ~[ z : c a t e g o r y i x ) l c a t e g o r y ( y ),z,y) . 3. We c a n r e d e f i n e p a i r c a t i n some s p e c i a l c a s e s , i n o r d e r t o r e f l e c r i t s interpretation i n those cases. @La:' t y p e ' I C B : ' t y p e ' I : 'type ' ax6 := paircat(Lx:cilB) c- @[a: ' t y p e 'ILp:a+ 'prop ' 1 subtype := p a i r c a t ( p ) : 'type' : 'prop ' @ C.4 :'prop ' I C B :'prop ' 3 AAB := p a i r c a t ( [ u : A I B ) 4. The three reduction rules (T 1' ~2 and a) apply to all p a i r c a t cases. So assuming that the expressions on the left are correct: p r o jl ( o r d e r e d p a i r i labe I, x, y ) ) reduces with n 1 to x, pro j 2 ( o r d e r e d p a i r i labe 2 , x, Y) ) to y and o r d e r e d p a i r i l a b e 2 , p r o j l ( z ),proj1 ( 2 ) ) reduces with 2 a to z . (Note: correctness of the expression on the left is not enough in reduces with T the case of a-reduction: the following condition must also be satisfied: D c a t e g o r y ( z ) = p a i r c a t ( l a b e 2 ) . This is illustrated by the next example: zero1 := orderedpair ( i s s e l f , 0 , pf) : subtype i i s s e l f ) zero2 := o r d e r e d p a i r i i s z e r o , 0 , p f ) : subtype i i s z e r o ) Now, zero3 defined as follows: is definitionally equal to z e r o 2 , not to z e r o l ! ! ) . . Disjoint sum Ln mathematical reasoning we often need the notion of a "disjoint sum" (or "disjoint union"). E.g. if we have two types we want to speak about the *- type of objects in either one of these types. In the older AUTOMATH languages this type can be introduced axiomatically: @ [ a 1 :' t y p e 'lCa2: ' t y p e ' I a1 .+.a2 := ' p r i m ' : 'type' Ex: a1 1 i n j l := ' p r i m ' i n j 2 := ' p r i m ' : a 1 .+.a2 Now suppose we have a third type a3 and functions f 1 :al+ct3, f 2 : a 2 % 3 . Then the "sumfunction" of f 1 and f 2 is the function from a l . + . a 2 to a 3 which maps objects in a I . + . a 2 originating from a 1 into their fl-image and those originating from a 2 into their f2-image. This function can be introduced as follows : a 2 @ [ a 3 :' t y p e 'I C f 1 :a1%31 [ f 2 : a 2 + 3 3 ] swn f n := ' p r i m ' and can be characterized by the following "computation rules": f2@[y:a21 s u m f n p r o p 2 := ' p r i m ' As in the case of the projection rules for pairs (see paircat-description) these injection rules for sumfunctions are expressed in terms of bookequality (= is some equalitynotion introduced earlier in the book). To obtain these rules on the level of machine-equality, AUT-II contains a disjointsum fragment. Thus we have "definitional equality by language reduction" in- stead of "bookequality by axiom''. ~ i s i o i n tSum i n AUT-II AUT-II c o n t a i n s t h e language c o n s t a n t s d i s j o i n t s w n , i n j e c t i o n 1 and in- j e c t i o n 2 . D i s j o i n t s w n a p p l i e s t o v a r i o u s k i n d s of e x p r e s s i o n s , s u c h as t y p e s and f u n c t i o n s . Thus a l . + . a 2 and s u m f n f f l , f 2 ) a s d e f i n e d i n t h e p r e c e d i n g sec- t i o n a r e both a v a i l a b l e as d i s j o i n t s u m ( a 1 , a Z ) t i v e l y . A c t u a l l y t h e AUT-Il and d i s j o i n t s w n l f l , f 2 ) respec- "sum of f u n c t i o n s " c o n c e p t is more g e n e r a l t h a n t h e one d e s c r i b e d above: t h e range of t h e two f u n c t i o n s need n o t b e a c o n s t a n t t y p e ( a 3 a b o v e ) , b u t may be g i v e n by a type v a l u e d f u n c t i o n . So i f we have a context [ a l : ' t y p e ' ] [ a 2 : ' t y p e ' ] [ a l : a l + ' t y p e r11:u2:a2+'type ']If1: T I ( o l I l L f 2 : I I f a 2 ) ] we can form t h e sumfunction d i s j o i n t s u r n f f I , f 2 ) . The c a t e g o r y of t h i s f u n c t i o n i s : " t h e c a t e g o r y of f u n c t i o n s from a I . + . a 2 ( t y p e v a l u e d ) f u n c t i o n s a1 and 02". t o t y p e s g i v e n by t h e sum of t h e To be a b l e t o d e n o t e t h i s c a t e g o r y d i s - j o i n t s u m can a l s o b e a p p l i e d t o t y p e valued f u n c t i o n s . T h e r e f o r e we have i n context [ a I : ' t y p e ' l C a 2 : ' t y p e r l C c r l : a I - + r t y p er 1 C ~ 2 : a 2 + ' t y p e ' l t h e sumfunction d i s j o i n t s m ( a l , o 2 ) which has a s i t s c a t e g o r y d i s j o i n t s w ( a 1 , a2)+'type ', i . e . t h e c a t e g o r y of t y p e v a l u e d f u n c t i o n s on t h e sum t y p e of a1 and a 2 . So: Example. To i l l u s t r a t e t h e u s e and meaning of t h e d i s j o i n t s w n c o n s t a n t i n AUT-TI we w r i t e a p i e c e of t e x t c o n c e r n i n g a s o c i o l o g i c a l e x p e r i m e n t . We have a s i t u a t i o n i n which we have two t y p e s ; men and women: @men := ' p r i m ' : 'type ' women := ? p r i m ' : 'type' ~ n v e s t i g a t i o n st a u g h t us t h a t men always p r e f e r women and v i c e v e r s a . So we have two " p r e f e r e n c e f u n c t i o n s " : men+ ' t y p e menpre := ~ z : m e n l w o m e n : womenpre := [y:womenlmen : women+ ' 't y p e * which t e l l us something a b o u t t h e p r e f e r e n c e of men and women. I n o r d e r t o e x p r e s s t h e s e i n s i g h t s i n a w i d e r p e r s p e c t i v e we d e f i n e a new t y p e mankind a s t h e ( d i s j o i n r ) sum of men and women: mankind := d i s j o i n t s m ( m e n , w o m e d : 'type' C Now we can summarize t h e p r e f e r e n c e of mankind a s t h e sum of t h e p r e f e r e n c e s of men and women. preference := d i s jointswnimenpre, womenpre) : mankind+ ' t y p e ' A f t e r e x t e n s i v e experiments and i n v e s t i g a t i o n s we have managed t o g e t a comp l e t e overview of t h e f a v o u r i t e s of mankind. These r e s u l t s a r e a v a i l a b l e i n t h e form of two t a b l e s ( f u n c t i o n s ) . One f u n c t i o n g i v e s t h e f a v o u r i t e woman of e a c h man. The o t h e r t h e f a v o u r i t e man of each woman. The t o t a l r e s u l t i s now g i v e n by t h e sum of t h e p a r t i a l ' r e s u l t s : This r e s u l t h a s as i t s c a t e g o r y t h e c a t e g o r y of p r e f e r e n c e s . Now, l e t me be a n element of t y p e men. t h e n me can a l s o be c o n s i d e r e d a s a n o b j e c t i n mankind: othemne := i njectionl (men, women, me) :mankind As anyone e l s e otherme i s c u r i o u s t o know t h e f a v o u r i t e man of h i s f a v o u r i t e woman. T h i s f a v o u r i t e woman i s c a l l e d she: she := <otherrne>resuZt : women ( t h e f a c t t h a t she i s of type women i s caused by t h e AUT-II r e d u c t i o n s on t h e d i s j o i n t s u m fragment, i n o l d e r AUTOIIATH v e r s i o n s t h i s would n o t be t h e c a s e ; a l s o n o t i c e t h a t she i s machine-equal t o <me>resuZtl). F i n a l l y t h e i d e n t i t y of t h e f a v o u r i t e man of she can be determined: r i v a l := <she>resuZt2 (end example) : men . The d i s j o i n t s u m c o n s t r u c t i n AUT-II a l s o a p p l i e s t o p r e d i c a t e s and p r o o f s . This means t h a t i f we have two p r e d i c a t e s ( i . e . p r o p v a l u e d f u n c t i o n s ) p l : a l - t r p r o p ' , p2:a2+'propr we a l s o have t h e sum of t h e s e p r e d i c a t e s : d i s j o i n t s u m ( p l , p ~:)d i sjointswn(c11 ,a2)+'propf and analogous t o t h e sum of f u n c t i o n s t h e sum of ( q u a n t i f i e d ) p r o o f s , namely i n context we h a v e d i s jointsum(u1 ,u2) : V ( d i s jointswn(p1 ,p2) ) ( V l p ) i s j u s t Pllp) a s exp l a i n e d i n t h e s e c t i o n o n X) . Summarizing we s e e t h a t i n AUT-II we c a n f o r m t h e d i s j o i n t s u m of t y p e s , t y p e v a l u e d f u n c t i o n s , f u n c t i o n s , p r e d i c a t e s a n d p r o o f s . Maybe t h e r e a d e r e x p e c t s a n o t h e r k i n d o f d i s j o i n t s u m , namely o f p r o p o s i t i o n s . I n d e e d we c o u l d a l l o w d i s j o i n t s w n ( A , B ) , where A and B a r e p r o p o s i t i o n s , a s a p r o p o s i t i o n which c o u l d b e i n t e r p r e t e d a s t h e d i s j u n c t i o n of A and B, i . e . AvB. I f we had a p r o o f u o f A , i n j e c t i o n l ( u ) would p r o v e swn i s n o t i n c l u d e d i n AUT-11. AvB e t c . However, t h i s u s e o f d i s j o i n t - ( I n "REAL ANALYSIS" d i s j u n c t i o n i s d e f i n e d a s : Reduction r u l e s i n t h e d i s j o i n t s u m fragment The r u l e s which w e r e i n t r o d u c e d i n t h e p i e c e o f AUTOMATH t e x t a t t h e beg i n n i n g o f t h i s s e c t i o n a r e i n c o r p o r a t e d i n AUT-X a s I - a n d 1 2 - r e d u c t i o n 1 respectively: < i n j e c t i o n 1f ~ , x !z d i s j o i n t s u m ( f 1, f 2 ) ~ z f l >I 1 < i n j e c t i o n 2( a , y ) > d i s j o i n t s u m ( f I ,f 2 ) > ( a l l e x p r e s s i o n s must b e c o r r e c t ) I <y>f2 2 . Moreover we h a v e a k i n d o f n - r e d u c t i o n f o r s u m f u n c t i o n s ; & - r e d u c t i o n : Remarks 1. ( s e e remark 2 i n t h e s e c t i o n on p a i r c a t ) . For a l l i n t e r p r e t a t i o n s , disjointsurri may b e t a k e n t o h a v e two arguments o n l y . Via " s y n t a c t i c a l o p e r a t i o n s " t h e machine r e c o n s t r u L t s t h e complete a r g u m e n t l i s t . T h e r e f o r e we c a n u s e i n f i x n o t a t i o n . I n "REAL ANALYSIS" t h e f o l lowing a b b r e v i a t i o n i s introduced: z1. +. 22 := d i sj o i n t s w n ( z l , z 2 ) Note t h a t i n j e c t i o n 1 and i n j e c t i o n 2 s t i l l n e e d two a r g u m e n t s t o p r e s e r v e u n i queness of types: i n j e c t i o n 1 (x,6) : a . t. (where x : a ) injection2(y,a):a.t.B (where y:B) 2 . We a l r e a d y gave a n example o f t h e u s e of d i s j o i n t s u m ( " t h e s t o r y of mankind"). Other examples can be found i n "REAL ANALYSIS": - e x t e n s i o n of t h e t y p e of r e a l numbers w i t h t h e "undefined" o b j e c t ( c h a p t e r 10, s e c t i o n 1 ) - a t h e o r y of p a r t i a l f u n c t i o n s ( c h a p t e r 1 , s e c t i o n 10) - a proof o f t h e S c h r o e d e r - B e r n s t e i n theorem ( t e x t on f i n i t e s e t s ) . Appendix A. New in$ut language s y n t a x T h i s r e p o r t u s e s a new s y n t a x f o r t h e AUTOMATH i n p u t l a n g u a g e . The most i m p o r t a n t d i f f e r e n c e s w i t h t h e s y n t a x used i n p r e v i o u s p u b l i c a t i o n s a r e l i s & t e d below. A c o m p l e t e s y n t a x d e s c r i p t i o n can b e f o u n d i n [Z]. subject old syntax new s y n t a x c h i p de'lirniter ( i . e . symbol denoting': "end o f 1ine") c%ntext d e l i m i t e r (i.e. symbol s e p a - r a t i n g context indicating part and d e f i n i t i o n p a r t of a l i n e ) ' type language c o n s t a n t s 'prop ' 'prim' 'synt' E symbol (i.e. symbol deno- := Cx, y l ; t y p e ) ting typing relation) (f block opening Y * x := EB; t y p e , lines (i.e. := [ x : y l : ' t y p e '$) y @ [ x :' t y p e ' 1 8 or lines introducing a (f Y * x ..-- - ; t y p e . moreover i t i s a l l o w e d v a r i a b l e of t o i n t r o d u c e more t h a n a s sump t i o n ) one v a r i a b l e i n one l i n e : y @ [ x :' t y p e ' I C z : x l $ context continuation ( i f a l i n e has t h e c o n t e x t which was v a l i d a t t h e end and and of t h e preceding l i n e , no e x p l i c i t x * y := EB;. .... context indication y * d := .....;..... is required) l o c a l c o n t e x t exten- not possible s i o n s : temporary variables or a s sump t i o n s (namely (the context of the f o r o n e l i n e ) may s e c o n d 1.ine i s be introduced again.dls '3 may o c c u r i n %' and '%') f ti c a t e g o r y p a r t of a may be o m i t t e d , b u t may b e o m i t t e d : we h a v e t w o p a s s i b i - 1i n e lities: x d := e , t h e machine computes t h e c a t e g o r y of e x@d := e;$ x@d := e $ (f) and r e p r i n t s t h e l i n e the f i r s t possibility ( i f asked) a s : corresponds t o t h e o l d c a s e . I n t h e second x * d := e;f, c a s e t h e machine does ,not print f. s e p a r a t i o n symbol i n paras trings empty 1i n e (to establish nice lay-out) not available 2$ comment l i n e not possible Any t e x t n o t c o n t a i n i n g a c h i p d e l i m i t e r , preceeded by one of t h e f o l l o w i n g announcements : T~onunent# ' 'heading 'remark ' ' (These t h r e e c a s e s a r e t r e a t e d d i f f e r e n t l y by t h e AUTOMATH l a y - o u t program) F o r more d e t a i l : s e e [ Z ] alphanumeric b e s i d e s some greek l e t t e r s characters and s p e c i a l symbols (such a s I) a c h a r a c t e r i s added t o make i d e n t i f i e r s more readable: - (the so-called 'underscore') (2s-so-Zseq, eompZ-el-so-open, f i x notation not possible etc) Following mathematical conv e n t i o n s f i x n o t a t i o n may b e used t o i n c r e a s e readab i l i t y . Both p r e f i x , pogtf i x and i n f i x i d e n t i f i e r s a r e allowed (-a, a!,n=b r e s p e c t i v e l y ) . A f i x ident i f i e r may b e a s t r i n g of s p e c i a l " f i x characters" (-=,<v= e t c ) o r a s t r i n g of a r b i t r a r y c h a r a c t e r s be tween q u o t e s ( ' I on the n a t u r o Z s ' 'and', 'plus1 ' etc) . , ~~pendB i .x I n p u t l a n g u a g e a b b r e v i a t i o n f o r a b s t r a c t i o n w i t h q u a n t i f i c a t i o n (abstr) * W r i t i n g a p i e c e o f t e x t i n some AUT-language we o f t e n e n c o u n t e r a s i t u a t i o n i n which we need t h e k - f o l d a b s t r a c t i o n o f some c o n s t a n t . F o r i n s t a n c e , when we i n t r o d u c e a n axiom o f t r a n s i t i v i t y f o r e q u a l i t y , we w r i t e : @ [ a :' t y p e ' l C x : a l [ y : a I [ z : a 1 t r - p r o p := x=z tr,ax := ' p r i m ' : 'prop ' .- t r - p r o p I f we now w a n t t o a b b r e v i a t e t h e u n i v e r s a l c l o s u r e o f t h i s a x i o m , we must w r i t e t h e whole s t o r y a g a i n : ilI\ To p r e v e n t t h i s axfoying a c t i v i t y we i n t r o d u c e t h e f o l l o w i n g a b b r e v i a t i o n for (I): a @ t r , r u l e := a b s t r f 5 * i tr-ax t r - r u l e i s d e f i n e d a s t h e 5-fold a b s t r a c t i o n of t r - a x @- 4* t e x t s a b s t r i 5 * ) ta-zax i s w r i t t e n a s @tr.ax). i.e.: ( i n handwritten Generally, i f p is an i d e n t i f i e r , defined (or primitive) i n context ..... [ x l : a l l , we c a n d e n o t e t h e k - f o l d a b s t r a c t i o n of p (k < n ) , i . e . [ x k : a k l ..... [ x l : a l l p f x k , ..., x l ) , w i t h c o n t e x t [ x n : a n ] ..... . . . . .[ x k + l : ok+l I a s : a b s t r i k * i p ( h a n d w r i t t e n : @ p i . 1xn:anlCxn-1:an-13 T h i s e x p r e s s i o n i s t r e a t e d a s i f i t w e r e some new i d e n t i f i e r ( a c t u a l l y , t h e machine c r e a t e s a n e x t r a l i n e : The c o n t e x t of t h i s new i d e n t i f i e r may b e i n s t a n t i a t e d a g a i n . So we may w r i t e a b s t r i k + ) p ( a n , . .. , a k + I ) . T h i s a b b r e v i a t i o n of a b s t r a c t i o n c a n b e e x t e n d e d i n t h e f o l l o w i n g way. Suppose we want t o g i v e t h e c a t e g o r y e x p r e s s i o n i n l i n e ( 1 ) . t h e f o l l o w i n g ( i n AUT-II) : T h i s would y i e l d C i This e x p r e s s i o n i s b u i l t from tr-prop by a b s t r a c t i o n and q u a n t i f i c a t i o n (5 t i m e s ) . By q u a n t i f i c a t i o n we mean a n o p e r a t i o n on p r e d i c a t e s t o form propos i t i o n s ( e . g . by a l l o r e x i s t s ) o r , more g e n e r a l l y , a n o p e r a t i o n on functions LO form t y p e s ( e . g . by cartprod o r p a i r c a t ) . We can d e n o t e t h i s pro- c e s s of a b s t r a c t i o n followed by q u a n t i f i c a t i o n by t h e f o l l o w i n g e x p r e s s i o n : o r , more e f f i c i e n t l y , abs t r (3*aZl, 2*cartprod) tr-prop (The a b s t r a c t i o n p l u s q u a n t i f i c a t i o n p r o c e s s i s denoted between t h e b r a c k e t s and s h o u l d be r e a d from r i g h t t o l e f t ) . Generally, i f p i s an i d e n t i f i e r defined i n context [xn:an][xn-1:un-I].. ...[ x l : a l ] and q i ( i = I , ...,k 4 with k In) are &"X,,,ors defined e a r l i e r h'&~5 i n t h e book o r p r e d e f i n e d i d c ~ t ~ f ~ (cartprod, c r s paircat e t c . ) , abstr(l*qk, .. .,l * q l ) p then i s an a b b r e v i a t i o n f o r This new " i d e n t i f i e r " h a s a s i t s c o n t e x t [ x n : u n l .....[ x k + l : & + l ] and t h i s c o n t e x t can b e i n s t a n t i a t e d a g a i n : We a l r e a d y i n t r o d u c e d a few e x t r a a b b r e v i a t i o n f a c i l i t i e s above: - n*qi (between t h e b r a c k e t s a f t e r a b s t r ) s t a n d s f o r l * q i , l * q i , . . .,l*qi (n times), - q i (between t h e b r a c k e t s a f t e r a b s t r ) s t a n d s f o r I * q i , - t h e e x t e n s i o n o f t h e a b s t r a b b r e v i a t i o n mechanism t o a b s t r a c t i o n w i t h quant i f i c a t i o n c a n be used i n combination w i t h t h e s i m p l e form i n t r o d u c e d e a r lier. So we may e n c o u n t e r e x p r e s s i o n s l i k e t h e f o l l o w i n g i n AUT(Il) a b s t r ( 2 * , 2*aZZ, cartprod, 2 * p a i r c a t l p f a l , a21, e t c texts: . A s a r e s u l t of t h e mechanism e x p l a i n e d above t h e ( u n i v e r s a l c l o s u r e of t h e ) t r a n s i t i v i t y r u l e f o r e q u a l i t y can now be w r i t t e n a s : u @ t r , r u l e := abs t r ( 5 * 1 t r . d x : a b s t r (3*aZZ, 2*cartprod) tr-prop . One more example: suppose p is a predicate on the reals. We define a proposition stating: p is an interval: (u 15 4 nd K U X ~ ~@CX:RZ~[~:RZ~[Z:RZ~ Cul :zsyl [uZ:yszl i n v l - p r o p := <y>P : 'prop' p @ i n v l := abstr (3*aZ 2, $*cartprod)invZeprop : 'prop' Other examples can be found in "REAL ANALYSIS" (application of "existenceelimination rule", "disjunction-elimination rule", "antisymmetry of subsetsrule", etc) . *) This appendix srrongly resembles an unpublished note by J . Zucker ("~ro- posed abbreviation for abstraction with quantificatioi in AUT-TI" - june 1 9 7 4 ) . b