A computational definition of the notion of vectorial space

We usually define an algebraic structure by a set, some operations defined on this set and some propositions that the algebraic structure must validate. In some cases, we can replace these propositions by an algorithm on terms constructed upon these …

Authors: ** - Pablo Arrighi (Université de Marne-la-Vallée, 프랑스) – *arrighi@univ-mlv.fr* - Gilles Dowek (École Polytechnique & INRIA, 프랑스) – *Gilles.Dowek@polytechnique.fr* **

A computational definition of the noti o n of v ectorial spa ce P ablo Arrighi ∗ Gilles Dow e k † Abstract W e usually define an algebraic structure by a set, some op erations defined on th is set and some prop ositions that the algebraic structure must v alidate. In some cases, we can replace these propositions by an algorithm on terms constructed up on these op erations that t h e alge braic structure m ust v alidate. W e sho w in this note that th is is the case for the notions of vectorial space and b ilinear op eration. An algorithm defined b y a confluent and terminating rewrite sys tem R on terms of a languag e L is sa id to b e valid in a structure M on the languag e L if for each rule l − → r and assig nment φ , w e hav e J l K φ = J r K φ . Thus, algorithms and theories play the sa me r ole with resp ect to the notion of model: like a theor y , an algorithm may or may not be v alid in a mo del. This notion of v alidity of an algo rithm, like the notion of v a lidit y o f a theory , can be used in tw o ways: to study the algorithms or to define algebraic structures as models of some algorithm. When a cla s s o f algebr aic structures — such as the class of g roups or that o f rings — can b e defined as the class of mo dels o f some equationa l theory T and this equatio nal theor y can be transformed into a rewrite system R , w e ha ve the following equiv alence • A is a member of the class (i.e. is a group, a ring, ...), • A is a mo del o f the theory T , • A is a mo del o f the algorithm R . In this case, w e say that the class of algebraic structure s has a c omputational definition . The goal of this no te is to show tha t the cla ss of vectorial spaces has such a computational definition, i.e. that the axioms of vectorial spaces can be or iented as a r e write system. Moreover, the alg orithm o btained this way is a well-known algorithm in linear alg ebra: it is an a lg orithm trans forming any term expres s ing a v ector in to a linear com bination of the unknowns. This algorithm is a lso central to the op erational seman tic of our functional programming language ∗ Institut Gaspard Monge, 5 Bd Descartes, Champs-sur-M arne, 77574 Marne-l a-V all´ ee Cedex 2, F rance, arrighi@univ-m lv.fr. † ´ Ecole p olytec hnique and INRIA, LIX, ´ Ecole p olytec hnique, 91128 Palaiseau Cedex, F rance, Gilles.Dowek@pol ytechnique.fr. for quantum computing Linea l [1], b ecaus e in such languages a pr ogram and its input v a lue for m a term ex pressing a vector whose v a lue, the o utput, is a linear combination of the base vectors. More gener a lly , several algorithms used in linear algebr a, s uch as matr ix multiplication algor ithms, tra nsform a ter m expressing a vector with v ario us constructs int o a linea r c o mbin atio n of ba s e vectors. This algorithm is v a lid in all v ectorial spaces and we s how that it moreov er completely defines the notion of vectorial spa ce. The main difficulty to or ie n t the theory of vectorial space s is that this theory has a sort for vectors and a sort fo r scala rs and that the s calars must form a field. The theory of fields is already difficult to orient, b ecause divis io n is a partial op eration. Ho wev er, there are many fields, for insta nce the field Q o f rational nu mbers, whose a ddition and m ultiplication can b e pres ent ed by a terminating and gr ound confluent rewrite system. Th us, w e sha ll not c o nsider a n ar bitr ary vectorial space o ver an arbitrar y field. Instead, we consider a giv en field K defined by a terminating and ground confluent rewrite system S and fo c us on K -vectorial spaces. Our rewr ite system for vectors will thus be parametr iz ed by a r ewrite system for sca lars and we will hav e to pr ovide pr o ofs o f c o nfluence and termination using minimal requirements on the scalar rewr ite system. This leads to a new metho d to prov e the confluence of a rewrite system built as the union of tw o systems. Moreov er, this computationa l de finitio n of the notion o f vectorial spa ce can be extended to define o ther algebra ic notions such a s bilinear ope rations. 1 Rewrite systems Definition 1. 1 (Rewriting) L et L b e a first-or der language and R b e a r ewrite system on L . We say that a t erm t R - rewrites in one step to a term u if and only if ther e is an o c cu rr enc e α in t he term t , a r ewrite rule l − → r in R , and a substitution σ such that t | α = σ l and u = t [ σ r ] α . Definition 1. 2 (Asso ciative-Comm utativ e Rewriti ng) L et L b e a fi rst- or der language c ontaining binary fun ct ion symb ols f 1 , ..., f n and R b e a r ewrite system on L . We sa y that a term t R / AC ( f 1 , ..., f n )-rewrites in one step t o a term u if and only if ther e is a term t ′ , an o c curr enc e α in the term t ′ , a r ewrite rule l − → r in R , and a su bstitution σ such that t ′ = AC t , t ′ | α = σ l and u = AC t ′ [ σ r ] α . R emark: This notion must b e distinguished fro m that of R,AC-r ewriting [3] where a term t rewrites to a term u only when it has a subterm A C-equiv alent to an insta nce of the left hand side of a rewrite rule . F or instance with the rule x + x − → 2 .x the term t + ( u + t ) R/ AC -r e w r ites to 2 .t + u but is R , AC -normal. 2 2 Mo d els Definition 2. 1 (Algebra) Le t L b e a first- or der language. A n L -algebra is a family forme d by a set M and for e ach symb ol f of L of arity n , a function ˆ f fr om M n to M . The denotation J t K φ of a t erm t for an assignment φ mapp ing variables to elements of M is de fine d as usual. Definition 2. 2 (Mo del of a rewrite system) L et L b e a first- or der language and R an algorithm define d by a r ewrite system on t erms of the language L . An L -algebra M is a mo del of the algorithm R , or the algorithm R is v alid in the mo del M , ( M | = R ) if for al l re write rules l − → r of the r ewrite system and valuations φ , J l K φ = J r K φ . Definition 2. 3 (Mo del of an AC-rewrite system) L et L b e a first-or der language c ontaining binary function symb ols f 1 , ..., f n , and R an algorithm de- fine d by an AC ( f 1 , ..., f n ) -r ewrite system o n t erms of t he language L . An L - algebra M is a mo del of the algorithm R ( M | = R ) if • for al l r ewrite rules l − → r of R and valuations φ , J l K φ = J r K φ , • for al l valuations φ and indic es i J f i ( x, f i ( y , z )) K φ = J f i ( f i ( x, y ) , z ) K φ J f i ( x, y ) K φ = J f i ( y , x ) K φ Example: Consider the language L formed b y tw o binar y symbols + and × and the algo rithm R defined by the rules ( x + y ) × z − → ( x × z ) + ( y × z ) x × ( y + z ) − → ( x × y ) + ( x × z ) transforming for insta nc e , the ter m ( a + a ) × a to the term a × a + a × a . The structure h{ 0 , 1 } , min , max i is a mo del of this algo rithm. R emark: This de finitio n of the v a lidit y of a n alg orithm in a mo del extends some definitions of the semantics of a pro g ramming lang uage where a seman tic is defined by a set M , a function [ ] mapping v alues of the language to elements o f M and n -ary programs to functions from M n to M , such that the progra m P taking the v alues v 1 , ..., v n as input produces the v alue w as o utput if and only if [ w ] = [ P ]([ v 1 ] , ..., [ v n ]). Indeed, let us cons ider a prog ramming languag e where the set of v alues is defined b y a fir st-order language, whose symbo ls are called c onstructors . Con- sider a n extensio n of this lang uage with a function symbo l p and p os s ibly other function symbols. A program P in this lang uage is given by a terminating and confluent rew r ite system on the extended lang ua ge, s uc h that for a ny n -uple of v alues v 1 , ..., v n the progra m P taking the v alues v 1 , ..., v n as input pr o duces the 3 v alue w as output if and only if the normal for m o f the term p ( v 1 , ..., v n ) is w . Then, a mo del o f this rewr ite system is for med b y a set M , fo r each constructo r c of arity m , a function ˆ c from M m to M , a function ˆ p from M n to M , and po ssibly other functions, such that for all rules l − → r of the rewrite system and v alua tions φ , J l K φ = J r K φ . The denotations of the constructor s define the function [ ] ab ov e mapping v alues to elemen ts of M and the function ˆ p is the function [ P ]. F or an y n -uple of v a lues v 1 , ..., v n , if the nor mal for m of the term p ( v 1 , ..., v n ) is the v alue w then J w K = ˆ p ( J v 1 K , ..., J v n K ) and thus [ w ] = [ P ]([ v 1 ] , ..., [ v n ]). 3 Computing linear com binations of the unkno wns 3.1 An algorithm Let L be a 2- sorted language with a sort K for s c a lars and a sort E for vectors containing tw o binar y symbols + and × o f rank h K , K , K i , t wo constants 0 and 1 of sor t K , a binary symbol, also written +, of r ank h E , E , E i , a binary symbol . of ra nk h K, E , E i and a constant 0 of sort E . T o tra nsform a term o f so rt E into a linear combination o f the unknows, we wan t to develop s ums of vectors λ. ( u + v ) − → λ. u + λ. v but factor sums o f scala rs a nd nested products λ. u + µ. u − → ( λ + µ ) . u λ. ( µ. u ) − → ( λ × µ ) . u we als o need the trivial rules u + 0 − → u 0 . u − → 0 1 . u − → u and, finally , three mor e rules for co nfluence λ. 0 − → 0 λ. u + u − → ( λ + 1) . u u + u − → (1 + 1) . u As we wan t to b e a ble to apply the factor ization rule to a term of the form (3 . x + 4 . y ) + 2 . x , reductio ns in the ab ov e r e write system m ust b e defined mo dulo the ass o ciativity and commutativit y of +. This leads to the following definitio n. 4 Definition 3. 1 (The rewri te system R ) The re write system R is the AC(+)- r ewrite system u + 0 − → u 0 . u − → 0 1 . u − → u λ. 0 − → 0 λ. ( µ. u ) − → ( λ.µ ) . u λ. u + µ. u − → ( λ + µ ) . u λ. u + u − → ( λ + 1) . u u + u − → (1 + 1) . u λ. ( u + v ) − → λ. u + λ. v Definition 3. 2 (Scalar rewrite system) A sca lar rewrite sy stem is a r ewrite system on a language c ont aining at le ast the symb ols + , × , 0 and 1 such t hat: • S is terminating and gr ound c onfluent, • for al l close d terms λ , µ and ν , the p air of terms – 0 + λ and λ , – 0 × λ and 0 , – 1 × λ and λ , – λ × ( µ + ν ) and ( λ × µ ) + ( λ × ν ) , – ( λ + µ ) + ν and λ + ( µ + ν ) , – λ + µ and µ + λ , – ( λ × µ ) × ν and λ × ( µ × ν ) , – λ × µ and µ × λ have the same normal forms, • 0 and 1 ar e normal terms. W e no w wan t to prove that the for an y scalar rewr ite system S , the system R ∪ S is ter minating and confluent. 5 3.2 T ermination Prop ositio n 3.1 The system R terminates. Pr o of: Co ns ider the following in terpreta tion (compatible with A C) | u + v | = 2 + | u | + | v | | λ. u | = 1 + 2 | u | | 0 | = 0 Each time a term t r ewrites to a term t ′ we have | t | > | t ′ | . Hence, the system terminates. ✷ Prop ositio n 3.2 F or any sc alar re write system S , t he system R ∪ S terminates. Pr o of: By definition of the function | | , if a term t S -reduces to a term t ′ then | t | = | t ′ | . Consider a ( R ∪ S )-re ductio n sequence. A t each R -reduction step, the measure of the term stric tly decrease s and at each S -r eduction step it re ma ins the same. Thu s ther e are only a finite n umber of R -reductio n steps in the sequence and, as S termina tes, the sequence is finite. ✷ 3.3 Confluence Definition 3. 3 (The rewri te system S 0 ) The system S 0 is forme d by the rules 0 + λ − → λ 0 × λ − → 0 1 × λ − → λ λ × ( µ + ν ) − → ( λ × µ ) + ( λ × ν ) wher e + and × ar e AC symb ols. Prop ositio n 3.3 The r ewrite system S 0 terminates. Pr o of: Co ns ider the following in terpreta tion (compatible with A C) || λ + µ || = || λ || + || µ || + 1 || λ × µ || = || λ |||| µ || || 0 || = || 1 || = 2 Notice that all ter ms ar e worth at leas t 2 and th us that each time a term t rewrites to a term t ′ we ha ve || t || > || t ′ || . Hence, the system terminates. ✷ 6 Prop ositio n 3.4 The system R ∪ S 0 terminates. Pr o of: B y definition o f the function | | , if a term t S 0 -reduces to a ter m t ′ then | t | = | t ′ | . Consider a ( R ∪ S 0 )-reduction sequence. A t each R -reduction step, the measure o f the ter m strictly decreases and at each S 0 -reduction step, it r emains the same. Thus there are only a finite n umber of R -reduction steps in the sequenc e and, a s S 0 terminates, by Pro po sition 3.3, the sequence is finite. ✷ Prop ositio n 3.5 The r ewrite system R ∪ S 0 is c onfluent. Pr o of: As the system terminates b y Prop osition 3 .4, it is sufficient to prov e the all cr itica l pair c lose. This can be mec hanica lly c heck ed, for instance using the system CIME 1 . ✷ Definition 3. 4 (Subsumption) A t erminating and c onfluent r elation S sub- sumes a r elation S 0 if whe never t S 0 u , t and u have the same S -normal form. Definition 3. 5 (Commut ation) The r elation R commutes with the r elation R ′ , if whenever t R u 1 and t R ′ u 2 , t her e exists a term w su ch that u 1 R ′ w and u 2 R w . Prop ositio n 3.6 L et S b e a sc alar r ewrite system, then R c ommutes with the r eflex ive-tr ansit ive closur e S ∗ of S . Pr o of: W e c heck this for eac h rule of R , using the fac t that in the left member of a rule, eac h subterms of sort scalar is either a v ar ia bles or 0 or 1, whic h are normal forms. ✷ Prop ositio n 3.7 (Key Lem ma) L et R , S and S 0 b e t hr e e r elations define d on a set such that S is terminating and c onfluent, R ∪ S terminates, R ∪ S 0 is c onflu ent, S subsumes S 0 ans the r elation R c ommutes with S ∗ . Then, the r elation R ∪ S is c onfluent. Pr o of: W e write t ↓ for the S -normal form of t . W e define the relatio n S ↓ by t S ↓ u if u is the S -normal form of t and the relatio n R ; S ↓ by t ( R ; S ↓ ) u if there exists a term v s uch that t R v S ↓ u . First notice that, if t R u then t ↓ ( R ; S ↓ ) u ↓ using the commutation of R and S ∗ and the unicit y o f S -no rmal forms. Thus if t ( R ∪ S ) ∗ u then t ↓ ( R ; S ↓ ) ∗ u ↓ simulating ea ch R -reduction step by a ( R ; S ↓ )-reduction step on no rmal forms. In a similar wa y , if t ( R ∪ S 0 ) ∗ u then t ↓ ( R ; S ↓ ) ∗ u ↓ , simulating each R - reduction step by a ( R ; S ↓ )-reduction step on norma l forms and using the subsumption of S 0 by S for S 0 -steps. 1 http://c ime.lri.fr/ 7 W e then chec k that R ; S ↓ is lo cally c o nfluent . If t ( R ; S ↓ ) v 1 and t ( R ; S ↓ ) v 2 then there e x ist terms u 1 and u 2 such that t R u 1 S ↓ v 1 and t R u 2 S ↓ v 2 . Thus, by confluence, of R ∪ S 0 , there exists a term w such that u 1 ( R ∪ S 0 ) ∗ w and u 2 ( R ∪ S 0 ) ∗ w . Thus u 1 ↓ ( R ; S ↓ ) ∗ w ↓ and u 2 ↓ ( R ; S ↓ ) ∗ w ↓ i.e. v 1 ( R ; S ↓ ) ∗ w ↓ and v 2 ( R ; S ↓ ) ∗ w ↓ . As the r elation R ; S ↓ is lo cally confluent and terminating, it is confluent. Finally , if w e hav e t ( R ∪ S ) ∗ u 1 and t ( R ∪ S ) ∗ u 2 then w e hav e t ↓ ( R ; S ↓ ) ∗ u 1 ↓ and t ↓ ( R ; S ↓ ) ∗ u 2 ↓ . Thus, there exists a term w such that u 1 ↓ ( R ; S ↓ ) ∗ w and and u 2 ↓ ( R ; S ↓ ) ∗ w . Th us u 1 ( R ∪ S ) ∗ w a nd u 2 ( R ∪ S ) ∗ w . ✷ Prop ositio n 3.8 L et S b e a sc alar r ewrite system. The r ewrite syst em R ∪ S is c onfluent on terms c ontaining variables of sort E but no variables of sort K . Pr o of: W e use the Key Lemma on the set o f semi-op en terms, i.e. ter ms with v ar iables o f sort E but no v ariables of sort K . As S is ground confluent and terminating, it is co nfluen t and ter minating o n semi-op en terms, by Pro po sition 3.2, the system R ∪ S terminates, by P rop osition 3 .5, the system R ∪ S 0 is confluent, the system S subsumes S 0 bec ause S is a s calar r e write system, and by Pr op osition 3.6, the s ystem R commutes with S ∗ . ✷ R emark: Confluence on semi-o pen terms implies ground confluence in a n y ex- tension of the language with constants for v ectors, typically base vectors. 3.4 Normal for ms Prop ositio n 3.9 L et t b e a normal term whose variables ar e among x 1 , ..., x n . The t erm t is 0 or a term of the form λ 1 . x i 1 + ... + λ k . x i k + x i k +1 + ... + x i k + l wher e the indic es i 1 , ..., i k + l ar e distinct and λ 1 , ..., λ k ar e neither 0 nor 1 . Pr o of: The term t is a sum u 1 + ... + u n of nor mal terms that ar e not sums (we take n = 1 if t is no t a sum). A nor ma l term that is not a sum is either 0 , a v ariable, or a ter m of the form λ. v . In this case, λ is neither 0 nor 1 and v is neither 0 , nor a s um o f tw o vectors no r a pro duct of a scalar by a v ector , thus it is a v ariable. As the term t is normal, if n > 1 then none of the u i is 0 . Hence, the ter m t is either 0 or a term of the form λ 1 . x i 1 + ... + λ k . x i k + x i k +1 + ... + x i k + l where λ 1 , ..., λ k are neither 0 nor 1. As the term t is nor mal, the indices i 1 , ..., i k + l are distinct. ✷ 8 4 V ectorial spaces Given a field K = h K , + , × , 0 , 1 i the class of K -vectorial spa c e s can b e defined as follows. Definition 4. 1 (V ectorial s pace) The structur e h E , + , ., 0 i is a K -ve ctorial sp ac e if and only if the structur e h K , + , × , 0 , 1 , E , + , ., 0 i is a mo del of the 2- sorte d the ory. ∀ u ∀ v ∀ w (( u + v ) + w = u + ( v + w )) ∀ u ∀ v ( u + v = v + u ) ∀ u ( u + 0 = u ) ∀ u ∃ u ′ ( u + u ′ = 0 ) ∀ u (1 . u = u ) ∀ λ ∀ µ ∀ u ( λ. ( µ. u ) = ( λ.µ ) . u ) ∀ λ ∀ µ ∀ u (( λ + µ ) . u = λ. u + µ. u ) ∀ λ ∀ u ∀ v ( λ. ( u + v ) = λ. u + λ. v ) W e no w prov e that, the cla s s o f K -vectorial space s can b e defined a s the class of mo dels o f the rew r ite system R . Prop ositio n 4.1 L et K = h K , + , × , 0 , 1 i b e a field. The structu re h E , + , ., 0 i is a K -ve ctorial sp ac e if and only if the stru ctur e h K, + , × , 0 , 1 , E , + , ., 0 i is a mo del of the r ewrite system R . Pr o of: W e first check tha t a ll the rules of R are v alid in all vectorial s paces, i.e . that the pr op ositions ( u + v ) + w = u + ( v + w ) u + v = v + u u + 0 = u 0 . u = 0 1 . u = u λ. 0 = 0 λ. ( µ. u ) = ( λ.µ ) . u λ. u + µ. u = ( λ + µ ) . u λ. u + u = ( λ + 1) . u u + u = (1 + 1) . u λ. ( u + v ) = λ. u + λ. v 9 are theorems of the theory of vectorial spaces. Seven of them are axioms of the theo ry of vectorial spaces , the prop os itions λ. u + u = ( λ + 1 ) . u and u + u = (1 + 1) . u a re consequence of 1 . u = u and λ. u + µ. u = ( λ + µ ) . u . Let us prove tha t 0 . u = 0 . Let u ′ be such that u + u ′ = 0 . Then 0 . u = 0 . u + 0 = 0 . u + u + u ′ = 0 . u + 1 . u + u ′ = 1 . u + u ′ = u + u ′ = 0 . Finally λ. 0 = 0 is a consequence of 0 . u = 0 and λ. ( µ. u ) = ( λ.µ ) . u . Conv ersely , we pr ov e that all axioms of v ector ial spaces are v alid in a ll mo dels of R . The v alidity of eac h of them is a consequence of the v alidity of a rewrite rule, except ∀ u ∃ u ′ ( u + u ′ = 0 ) that is a consequence of u + ( − 1) . u = 0 itself being a consequence of λ. u + µ. u = ( λ + µ ) . u and 0 . u = 0 . ✷ Prop ositio n 4.2 (Univ ersality) L et t and u b e two t erms wh ose variables ar e among x 1 , ..., x n . The fol lowing pr op ositions ar e e quivalent: 1. the normal forms of t and u ar e identic al mo dulo A C, 2. the e quation t = u is valid in al l K - ve ctorial sp ac es, 3. and the denotation of t and u in K n for t he assignment φ = e 1 / x 1 , ..., e n / x n , wher e e 1 , ..., e n is the c anonic al b ase of K n , ar e identic al. Pr o of: Pro po sition (i) implies pro p o sition (ii) and pr o p o sition (ii) implies prop o- sition (iii). Let us prov e that prop osition (iii) implies prop osition (i). Let t b e a normal term whose v aria ble s a r e among x 1 , ..., x n . The de c om- p osition of t along x 1 , ..., x n is the se q uence α 1 , ..., α n such that if ther e is a subterm of the form λ. x i in t , then α i = λ , if there is a subterm o f the form x i in t , then α i = 1 , and α i = 0 other wise. Assume J t K φ = J u K φ . Let e 1 , ..., e n be the ca no nical ba se of K n and φ = e 1 / x 1 , ..., e n / x n . Call α 1 , ..., α n the coo rdinates of J t K φ in e 1 , ..., e n . Then the decomp ositions o f the norma l forms o f t and u a re b oth α 1 , ..., α n and thus they are identical modulo A C. ✷ 5 Bilinearit y 5.1 An algorithm Definition 5. 1 (The rewri te system R ′ ) Consider a language with four sorts: K for sc alars and E , F , and G for the ve ctors of t hr e e ve ctor sp ac es, t he symb ols + , × , 0 , 1 for sc alars, thr e e c opies of t he symb ols + , . and 0 for e ach sort E , F , and G and a symb ol ⊗ of r ank h E , F, G i . The system R ′ is the r ewrite system forme d by thr e e c opies of the ru les of the system R and the rules ( u + v ) ⊗ w − → ( u ⊗ w ) + ( v ⊗ w ) ( λ. u ) ⊗ v − → λ. ( u ⊗ v ) 10 u ⊗ ( v + w ) − → ( u ⊗ v ) + ( u ⊗ w ) u ⊗ ( λ. v ) − → λ. ( u ⊗ v ) 0 ⊗ u − → 0 u ⊗ 0 − → 0 Prop ositio n 5.1 The r ewrite system R ′ terminates. Pr o of: W e extend the in terpre ta tion of Definition 3.1 with | u ⊗ v | = (3 | u | + 2)(3 | v | + 2) ✷ Prop ositio n 5.2 F or any s c alar r ewrite system S , the system R ′ ∪ S termi- nates. Pr o of: As in Prop ositio n 3.2. ✷ Prop ositio n 5.3 The system R ′ ∪ S 0 terminates. Pr o of: As in Prop ositio n 3.4. ✷ Prop ositio n 5.4 The r ewrite system R ′ ∪ S 0 is c onfluent. Pr o of: As in the pro of o f Prop osition 3.5, we prov e lo cal confluence by chec king that all cr itica l pair close . ✷ Prop ositio n 5.5 L et S b e a sc alar rew rite system, then R ′ c ommu t es with S ∗ . Pr o of: As in the pro of of P rop osition 3.6. ✷ Prop ositio n 5.6 L et S b e a sc alar r ewrite system. The r ewrite system R ′ ∪ S is c onfluent on terms c ont aining variabl es of sort E , F , and G but no variable s of sort K . Pr o of: Using the Key Lemma. ✷ 11 Prop ositio n 5.7 L et t b e a normal term whose variables of sort E ar e among x 1 , ..., x n , whose variables of sort F ar e among y 1 , ..., y p , and that has no vari- ables of sort G and K . If t has sort E or F , t hen it has t he same form as in Pr op osition 3.9. If it has sort G , t hen it has the form λ 1 . ( x i 1 ⊗ y j 1 ) + ... + λ k . ( x i k ⊗ y j k ) + ( x i k +1 ⊗ y j k +1 ) + ... + ( x i k + l ⊗ y j k + l ) wher e the p airs of indic es h i 1 , j 1 i , ..., h i k + l , j k + l i ar e distinct and λ 1 , ..., λ k ar e neither 0 nor 1 . Pr o of: The term t is a sum u 1 + ... + u n of nor mal terms that ar e not sums (we take n = 1 if t is no t a sum). A no rmal term that is not a sum is either 0 , a term o f the form v ⊗ w , or o f the form λ. v . In this case, λ is neither 0 nor 1 a nd v is neither 0 , nor a sum of t wo vectors nor a pro duct of a sca lar b y a vector, thus it is of the form v ⊗ w . In a term o f the form v ⊗ w , ne ither v nor w is a sum, a pr o duct o f a scalar by a vector or 0 . Th us b oth v and w are v ar iables. As the term t is normal, if n > 1 then none of the u i is 0 . Hence, the ter m t is either 0 or a term of the form λ 1 . ( x i 1 ⊗ y j 1 ) + ... + λ k . ( x i k ⊗ y j k ) + ( x i k +1 ⊗ y j k +1 ) + ... + ( x i k + l ⊗ y j k + l ) where λ 1 , ..., λ k are neither 0 no r 1. As the term t is normal, the pairs of indices ar e distinct. ✷ 5.2 Bilinearit y Definition 5. 2 (Bilinear op eration) L et E , F , and G b e thr e e ve ctorial sp ac es on the same field. A n op er ation ⊗ fr om E × F t o G is said to b e bilinear if ( u + v ) ⊗ w = ( u ⊗ w ) + ( v ⊗ w ) ( λ. u ) ⊗ v = λ. ( u ⊗ v ) u ⊗ ( v + w ) = ( u ⊗ v ) + ( u ⊗ w ) u ⊗ ( λ. v ) = λ. ( u ⊗ v ) Prop ositio n 5.8 L et K = h K , + , × , 0 , 1 i b e a field. The structu r es h E , + , ., 0 i , h F, + , ., 0 i , h G, + , ., 0 i ar e K -ve ctorial sp ac es and ⊗ is a biline ar op er ation fr om E × F to G if and only if h K , + , × , 0 , 1 , E , + , ., 0 , F, + , ., 0 , G, + , ., 0 , ⊗i is a mo del of the system R ′ . Pr o of: The v alidity of the r ule s of the three copies of the system R , ex pr ess that h E , + , ., 0 i , h F, + , ., 0 i , h G, + , ., 0 i ar e K -vectorial spac e s. The v alidity of the six other rules is the v a lidit y of the axioms of Definition 5.2 plus the t wo extra prop ositions 0 ⊗ u = 0 and u ⊗ 0 = 0 that are conseq uences of these axioms. ✷ 12 Definition 5. 3 (T ensorial pro duct) L et E and F b e t wo ve ctorial sp ac es, the p air forme d by the ve ctorial sp ac e G and the biline ar op er ation fr om E × F to G is a tensorial pro duct of E and F if for al l b ases ( e i ) i ∈ I of E and ( e ′ j ) j ∈ J of F the family ( e i ⊗ e ′ j ) h i,j i is a b ase of G . Example: Let ⊗ b e the unique bilinea r o pe r ation such that e i ⊗ e ′ j = e ′′ p ( i − 1)+ j where e 1 , ..., e n is the ca nonical base of K n , e ′ 1 , ..., e ′ p that of o f K p , and e ′′ 1 , ..., e ′′ np that of K np . Then K np together with ⊗ is the tensor ial pro duct of K n and K p . Prop ositio n 5.9 (Univ ersality) L et t and u b e two terms whose variables of sort E ar e among x 1 , ..., x n , whose variables of sort F ar e among y 1 , ..., y p , and that have n o variables of sort G and K . The f ol lowing pr op ositions ar e e quivalent: 1. the normal forms of t and u ar e identic al mo dulo A C, 2. the e quation t = u is valid in al l st r u ctur es forme d by thr e e ve ctorial sp ac es and a bili ne ar op er ation, 3. the e quation t = u is valid in al l st ructur es forme d by two ve ctorial sp ac es and their tensorial pr o duct, 4. and the denotation of t and u in K np for the assignment φ = e 1 / x 1 , ..., e n / x n , e ′ 1 / y 1 , ..., e ′ p / y p wher e e 1 , ..., e n is the c anonic al b ase of K n , e ′ 1 , ..., e ′ p that o f K p and ⊗ is the unique biline ar op er ation s uch that e i ⊗ e ′ j = e ′′ p ( i − 1)+ j wher e e ′′ 1 , ..., e ′′ np is the c anonic al b ase of K np . Pr o of: Prop o s ition (i) implies prop os ition (ii), prop osition (ii) implies prop o- sition (iii) and prop osition (iii) implies pr op osition (iv). Let us prov e that prop osition (iv) implies propo sition (i). Let t b e a normal ter m of s o rt G with v aria bles of so r t E among x 1 , ..., x n , v ar iables of sort F a mong y 1 , ..., y p , and no v a r iables of sort G and K . The de c omp osition of t along x 1 , ..., x n , y 1 , ..., y p , is the sequence α 1 , ..., α np such that if there is a subterm of the form λ. ( x i ⊗ y j ) in t , then α p ( i − 1)+ j = λ , if there is a subterm of the form x i ⊗ y j in t , then α p ( i − 1)+ j = 1, a nd α p ( i − 1)+ j = 0 otherwise. Assume J t K φ = J u K φ . Call α 1 , ..., α np the co or dinates o f J t K φ in e ′′ 1 , ..., e ′′ np . Then the decomp ositions of the normal forms of t and u are both α 1 , ..., α np and thus they are identical mo dulo A C. ✷ 13 Conclusion W e us ually define an algebraic structure by three comp onents: a set, some op erations defined on this set and so me prop o s itions that m ust be v a lid in the structure. F o r instance a K -vectorial space is defined b y a set E , the ope rations 0 , + and . and the equations o f Definition 4.1. W e can, in a more computation-or ient ed w ay , define an algebraic structure by a set, op eratio ns on this set a nd an algorithm on ter ms constructed up on these op er ations tha t must b e v alid in the structure. F or instance a K -vectorial space is defined b y a set E , the op erations 0 , + and . and the algorithm R . This algor ithm is a w ell-k nown a lgorithm in linear algebra: it is the algor ithm that transfor ms any linear expr ession int o a linear combination of the unknowns. This alg orithm is, at a first lo ok, only one among the ma n y algorithms used in linear a lgebra, but it completely defines the notio n of vectorial spa ce: a vectorial space is any structure where this algorithm is v a lid, it is any structure whe r e linear expressions can be transformed this w ay into linear com binations of the unknowns. Ac kno wledgemen ts The autho rs w ant to thank ´ Evelyne Contejean, Claude Kir chner and Claude March ´ e for c o mment s on a previous draft o f this paper. References [1] P . Arrighi and G. Dow ek, Op eratio nal semantics for formal tensorial cal- culus, 2nd International Workshop on Quantu m Pr o gr amming L anguages , Helsinki, 20 04. [2] N. Dershowitz a nd J.-P . Joua nna ud, R ewrite systems , Handb o ok of theo- retical co mputer science (vol. B): formal mo dels a nd semantics, MIT Pres s, 1991. [3] G.E . Peterson a nd M.E. Stick el, Complete sets of r e ductions for some e qu a- tional the ories , Journal of the ACM, 28, 2, p.233 -264, 1981. 14

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment