SlideShare a Scribd company logo
A type system for the vectorial aspects of the
      linear-algebraic lambda-calculus

 Pablo Arrighi1,2             Alejandro Díaz-Caro1              Benoît Valiron3,4

                      1
                          Université de Grenoble, LIG, France
            2
                École Normale Supérieure de Lyon, LIP, France
                  3
                      Université de Paris-Nord, LIPN, France
                          4
                              University of Pennsylvania, USA


       7th DCM • July 3, 2011 • Zurich, Switzerland
M, N ::= x | λx.M | (M)N | M + N | α.M | 0

                               Beta reduction:
                           (λx.M)N → M[x := N]

                          “Algebraic” reductions:
                       α.M + β.M → (α + β).M,
                     (M)(N1 + N2 ) → (M)N1 + (M)N2 ,
                                    ...
                                    ...
                                    ...
               (oriented version of the axioms of vectorial spaces)

Two origins:
     Differential λ-calculus: capturing linearity à la Linear Logic
  → Removing the differential operator : Algebraic λ-calculus (λalg )   [Vaux’09]

     Quantum computing: superposition of programs
  → Linearity as in algebra: Linear-algebraic λ-calculus (λlin )
[Arrighi,Dowek’08]
                                                                                   2 / 15
M, N ::= x | λx.M | (M)N | M + N | α.M | 0

                          Beta reduction:
                      (λx.M)N → M[x := N]

                      “Algebraic” reductions:
                   α.M + β.M → (α + β).M,
                 (M)(N1 + N2 ) → (M)N1 + (M)N2 ,
                                ...
                                ...
                                ...
          (oriented version of the axioms of vectorial spaces)

                      λalg                λlin
        Origin   Linear Logic     Quantum computing
     Strategy    Call-by-name        Call-by-value
Algebraic part    Equalities        Rewrite system



                                                                 2 / 15
An infinite dimensional vectorial space of values

   B = {Mi : Mi is a variable or abstraction }

             Set of values ::= Span(B)




 (Now we should call λlin ’s strategy: “call-by-base”)




                                                         3 / 15
Why would it be interesting?
    Several theories using the concept of linear-combination of terms
                    quantum, probabilistic, non-deterministic models, . . .
    “Why would vector spaces be an interesting theory?”
                 Many applications and moreover, interesting by itself!


Aim of the current work:
    A type system capturing the “vectorial” structure of terms
          . . . to check for probability distributions
          . . . or “quantumness” of the term
          . . . or whatever application needing the structure of the vector
                in normal form
          . . . a Curry-Howard approach to defining
                Fuzzy/Quantum/Probabilistic logics from
                Fuzzy/Quantum/Probabilistic programming languages.



                                                                              4 / 15
The Scalar Type System [Arrighi,Díaz-Caro’09]
    A polymorphic type system tracking scalars:
     Γ M:T                     Barycentric restrictions
    Γ    α.M : α.T              Characterises the “amount” of terms


The Additive Type System [Díaz-Caro,Petit’10]
    A polymorphic type system with sums:

Γ       M:T    Γ     N:R            Sums ∼ Assoc., comm. pairs
    Γ    M +N :T +R                 distributive w.r.t. application



                       Can we combine them?




                                                                      5 / 15
The Vectorial Type System

Types:
                   T , R, S := U | T + R | α.T
                  U, V , W := X | U → T | ∀X .U
                   (U, V , W reflect the basis terms)

Equivalences:

                            1.T   ≡ T
                       α.(β.T ) ≡ (α × β).T
                    α.T + α.R     ≡ α.(T + R)
                    α.T + β.T     ≡ (α + β).T
                         T +R     ≡ R +T
                  T + (R + S) ≡ (T + R) + S

                  (reflect the vectorial spaces axioms)



                                                         6 / 15
The factorisation rule problem


                       Γ M:T       Γ M:T
                      ===========
                       ===========
                      Γ α.M + β.M : α.T + β.T

    However, α.M + β.M → (α + β).M
    In general α.T + β.T = (α + β).T = (α + β).T
(and since we are working in System F, there is no principal types neither)




                                                                              7 / 15
Several possible solutions:

Remove factorisation rule (Done. SR and SN both work)
    + in scalars not used anymore. Scalars ⇒ Monoid
    It works!... but it is no so expressive (“vectorial” structure lost)




                                                                           8 / 15
Several possible solutions:

Remove factorisation rule (Done. SR and SN both work)
    + in scalars not used anymore. Scalars ⇒ Monoid
    It works!... but it is no so expressive (“vectorial” structure lost)

Add several typing rules to allow typing (α + β).M with α.T + β.T
    As soon as we add one, we have to add many to make it work
    Too complex and inelegant (subject reduction by axiom)




                                                                           8 / 15
Several possible solutions:

Remove factorisation rule (Done. SR and SN both work)
    + in scalars not used anymore. Scalars ⇒ Monoid
    It works!... but it is no so expressive (“vectorial” structure lost)

Add several typing rules to allow typing (α + β).M with α.T + β.T
    As soon as we add one, we have to add many to make it work
    Too complex and inelegant (subject reduction by axiom)

Church style
    Seems to be the natural solution
    Big complexity with polymorphism and distributivity




                                                                           8 / 15
Several possible solutions:

Remove factorisation rule (Done. SR and SN both work)
    + in scalars not used anymore. Scalars ⇒ Monoid
    It works!... but it is no so expressive (“vectorial” structure lost)

Add several typing rules to allow typing (α + β).M with α.T + β.T
    As soon as we add one, we have to add many to make it work
    Too complex and inelegant (subject reduction by axiom)

Church style
    Seems to be the natural solution
    Big complexity with polymorphism and distributivity

Weak subject reduction (this work)
    What is the best we can get in Curry style?




                                                                           8 / 15
Typing rules
                                             Γ       M:T                           Γ     M:T
                                 ax                               0I                                αI
          Γ, x : U        x :U               Γ       0 : 0.T                   Γ       α.M : α.T
           n                                                      m
 Γ   M:         αi .∀X .(U → Ti )                Γ    N:              βi .Vj           ∀Vj ,∃Wj /U[Wj /X ]=Vj
          i=1                                                 j=1
                                         n       m
                                                                                                                →E
                      Γ     (M)N :                    αi × βi .Ti [Wj /X ]
                                       i=1 j=1

                Γ, x : U    M:T                           Γ       M:T              Γ      N:R
                                        →I                                                         +I
           Γ      λx.M : U → T                                Γ       M +N :T +R

                 Γ    M:U             X ∈FV (Γ)
                                        /                             Γ    M : ∀X .U
                                                     ∀I                                       ∀E
                      Γ     M : ∀X .U                             Γ       M : U[V /X ]




                                                                                                                     9 / 15
(α + β).T   α.T + β.T      if ∃M / Γ M : T and Γ   M:T
                (and its contextual closure)




                                                         10 / 15
(α + β).T    α.T + β.T      if ∃M / Γ M : T and Γ   M:T
                        (and its contextual closure)


Theorem (A weak subject reduction)
If Γ    M : T and M →R N, then
       if R is not a factorisation rule: Γ    N:T
       if R is a factorisation rule: ∃S      T /Γ   N:S




                                                                 10 / 15
(α + β).T    α.T + β.T      if ∃M / Γ M : T and Γ   M:T
                        (and its contextual closure)


Theorem (A weak subject reduction)
If Γ    M : T and M →R N, then
       if R is not a factorisation rule: Γ    N:T
       if R is a factorisation rule: ∃S      T /Γ   N:S

How weak?
Let M → N,
Subject reduction
    Γ M:T ⇒Γ              N:T
Subtyping
    Γ M:T ⇒Γ              N : S, but S ≤ T , so Γ    N:T
Our theorem
    Γ M:T ⇒Γ              N : S, and S       T


                                                                 10 / 15
Confluence and Strong normalisation
In the original untyped setting: “confluence by restrictions”:

                  YB = (λx.(B + (x)x))λx.(B + (x)x)


                  YB → B + YB → B + B + YB → . . .




                                                                11 / 15
Confluence and Strong normalisation
In the original untyped setting: “confluence by restrictions”:

                  YB = (λx.(B + (x)x))λx.(B + (x)x)


                  YB → B + YB → B + B + YB → . . .


YB + (−1).YB −→ (1 − 1).YB −→∗ 0
       ↓                       Solution in the untyped setting:
B + YB + (−1).YB                  α.M + β.M → (α + β).M
       ↓∗                         only if M is closed-normal
       B




                                                                  11 / 15
Confluence and Strong normalisation
In the original untyped setting: “confluence by restrictions”:

                  YB = (λx.(B + (x)x))λx.(B + (x)x)


                  YB → B + YB → B + B + YB → . . .


YB + (−1).YB −→ (1 − 1).YB −→∗ 0
       ↓                       Solution in the untyped setting:
B + YB + (−1).YB                  α.M + β.M → (α + β).M
       ↓∗                         only if M is closed-normal
       B

    In the typed setting: Strong normalisation solves the problem



                                                                    11 / 15
Theorem (Strong normalisation)
Γ   M : T ⇒ M strongly normalising.

Proof.
Reducibility candidates method.
Main difficulty: Show that

    {Mi }i strongly normalizing ⇒         αi .Mi strongly normalizing
                                      i

Done by using a measurement on terms decreasing on algebraic
rewrites.




                                                                        12 / 15
Theorem (Confluence)
                             M →∗ N1                N1 →∗ L
     ∀M / Γ    M:T              ∗    ⇒ ∃L such that
                             M → N2                 N2 →∗ L

Proof.
                       M → N1                N1 →∗ L
1) local confluence:           ⇒ ∃L such that
                       M → N2                N2 →∗ L
    Algebraic fragment: Coq proof
    Beta-reduction: Straightforward extension
    Commutation: Induction

2) Local confluence + Strong normalisation ⇒ Confluence   [TeReSe’03]




                                                                      13 / 15
Expressing matrices and vectors
                    true = λx.λy .x
Two base vectors:
                    false = λx.λy .y




                                       14 / 15
Expressing matrices and vectors
                  true = λx.λy .x
Two base vectors:
                  false = λx.λy .y
             T = ∀XY .X → Y → X
Their types:
             F = ∀XY .X → Y → Y

                      α.true + β.false : α.T + β.F




                                                     14 / 15
Expressing matrices and vectors
                  true = λx.λy .x
Two base vectors:
                  false = λx.λy .y
             T = ∀XY .X → Y → X
Their types:
             F = ∀XY .X → Y → Y

                       α.true + β.false : α.T + β.F

                    (U)true = a.true + b.false
Linear map U s.t.
                    (U)false = c.true + d .false




                                                      14 / 15
Expressing matrices and vectors
                  true = λx.λy .x
Two base vectors:
                  false = λx.λy .y
             T = ∀XY .X → Y → X
Their types:
             F = ∀XY .X → Y → Y

                       α.true + β.false : α.T + β.F

                    (U)true = a.true + b.false
Linear map U s.t.
                    (U)false = c.true + d .false
        U := λx.{((x)[a.true + b.false])[c.true + d .false]}
                                                   with    [M] := λz.M
                                                           {M} := (M)_
                                                          {[M]}→ M

       U : ∀X .((I → (a.T + b.F)) → (I → (c.T + d .F)) → X ) → X



                                                                         14 / 15
Contributions

    Scalar ∪ Additive (“AC, distributive pairs”)
         ⇒ linear-combination of types
    The typing gives the information of
        “how much the scalars sums” in the normal form
    Weak SR
       ⇒ Church style captures better the vectorial structure
    Strong normalisation
        ⇒ Confluence without restrictions
    Representation of matrices and vectors




                                                                15 / 15

More Related Content

What's hot

Common derivatives integrals_reduced
Common derivatives integrals_reducedCommon derivatives integrals_reduced
Common derivatives integrals_reduced
Kyro Fitkry
 
Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010
Christian Robert
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
The Statistical and Applied Mathematical Sciences Institute
 
Calculus cheat sheet_integrals
Calculus cheat sheet_integralsCalculus cheat sheet_integrals
Calculus cheat sheet_integrals
UrbanX4
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)
Matthew Leingang
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
The Statistical and Applied Mathematical Sciences Institute
 
Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!
A Jorge Garcia
 
Calculus Cheat Sheet All
Calculus Cheat Sheet AllCalculus Cheat Sheet All
Calculus Cheat Sheet All
Moe Han
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
homeworkping3
 
THE CALCULUS INTEGRAL (Beta Version 2009)
THE CALCULUS INTEGRAL (Beta Version 2009)THE CALCULUS INTEGRAL (Beta Version 2009)
THE CALCULUS INTEGRAL (Beta Version 2009)
briansthomson
 
Markov Chain Monte Carlo Methods
Markov Chain Monte Carlo MethodsMarkov Chain Monte Carlo Methods
Markov Chain Monte Carlo Methods
Francesco Casalegno
 
Prml
PrmlPrml
Prml
syou6162
 
Lesson 4: Calcuating Limits (slides)
Lesson 4: Calcuating Limits (slides)Lesson 4: Calcuating Limits (slides)
Lesson 4: Calcuating Limits (slides)
Matthew Leingang
 
My data are incomplete and noisy: Information-reduction statistical methods f...
My data are incomplete and noisy: Information-reduction statistical methods f...My data are incomplete and noisy: Information-reduction statistical methods f...
My data are incomplete and noisy: Information-reduction statistical methods f...
Umberto Picchini
 
Introduction to advanced Monte Carlo methods
Introduction to advanced Monte Carlo methodsIntroduction to advanced Monte Carlo methods
Introduction to advanced Monte Carlo methods
Christian Robert
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
Matthew Leingang
 
Day 01
Day 01Day 01
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
The Statistical and Applied Mathematical Sciences Institute
 
A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...
A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...
A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...
Umberto Picchini
 
A comparison of three learning methods to predict N20 fluxes and N leaching
A comparison of three learning methods to predict N20 fluxes and N leachingA comparison of three learning methods to predict N20 fluxes and N leaching
A comparison of three learning methods to predict N20 fluxes and N leaching
tuxette
 

What's hot (20)

Common derivatives integrals_reduced
Common derivatives integrals_reducedCommon derivatives integrals_reduced
Common derivatives integrals_reduced
 
Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
Calculus cheat sheet_integrals
Calculus cheat sheet_integralsCalculus cheat sheet_integrals
Calculus cheat sheet_integrals
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!
 
Calculus Cheat Sheet All
Calculus Cheat Sheet AllCalculus Cheat Sheet All
Calculus Cheat Sheet All
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
 
THE CALCULUS INTEGRAL (Beta Version 2009)
THE CALCULUS INTEGRAL (Beta Version 2009)THE CALCULUS INTEGRAL (Beta Version 2009)
THE CALCULUS INTEGRAL (Beta Version 2009)
 
Markov Chain Monte Carlo Methods
Markov Chain Monte Carlo MethodsMarkov Chain Monte Carlo Methods
Markov Chain Monte Carlo Methods
 
Prml
PrmlPrml
Prml
 
Lesson 4: Calcuating Limits (slides)
Lesson 4: Calcuating Limits (slides)Lesson 4: Calcuating Limits (slides)
Lesson 4: Calcuating Limits (slides)
 
My data are incomplete and noisy: Information-reduction statistical methods f...
My data are incomplete and noisy: Information-reduction statistical methods f...My data are incomplete and noisy: Information-reduction statistical methods f...
My data are incomplete and noisy: Information-reduction statistical methods f...
 
Introduction to advanced Monte Carlo methods
Introduction to advanced Monte Carlo methodsIntroduction to advanced Monte Carlo methods
Introduction to advanced Monte Carlo methods
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
 
Day 01
Day 01Day 01
Day 01
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...
A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...
A likelihood-free version of the stochastic approximation EM algorithm (SAEM)...
 
A comparison of three learning methods to predict N20 fluxes and N leaching
A comparison of three learning methods to predict N20 fluxes and N leachingA comparison of three learning methods to predict N20 fluxes and N leaching
A comparison of three learning methods to predict N20 fluxes and N leaching
 

Viewers also liked

Nous Materials
Nous MaterialsNous Materials
Nous Materials
Isis95
 
Week 13 part2
Week 13 part2Week 13 part2
Week 13 part2
educw200
 
Tractaments de l'aigua2
Tractaments de l'aigua2Tractaments de l'aigua2
Tractaments de l'aigua2
AsianaLiXue
 
European tours
European tours European tours
European tours
ratlas1
 
Ired Mansions In The Park Timisoara
Ired Mansions In The Park TimisoaraIred Mansions In The Park Timisoara
Ired Mansions In The Park Timisoara
olivieri_pieralessandro
 

Viewers also liked (7)

Nous Materials
Nous MaterialsNous Materials
Nous Materials
 
Week 13 part2
Week 13 part2Week 13 part2
Week 13 part2
 
Tractaments de l'aigua2
Tractaments de l'aigua2Tractaments de l'aigua2
Tractaments de l'aigua2
 
Pasqua al trasimeno 2012
Pasqua al trasimeno 2012Pasqua al trasimeno 2012
Pasqua al trasimeno 2012
 
European tours
European tours European tours
European tours
 
Ired Mansions In The Park Timisoara
Ired Mansions In The Park TimisoaraIred Mansions In The Park Timisoara
Ired Mansions In The Park Timisoara
 
Paginas filosofia
Paginas filosofiaPaginas filosofia
Paginas filosofia
 

Similar to A type system for the vectorial aspects of the linear-algebraic lambda-calculus

Mtc ssample05
Mtc ssample05Mtc ssample05
Mtc ssample05
bikram ...
 
Mtc ssample05
Mtc ssample05Mtc ssample05
Mtc ssample05
bikram ...
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
anhlodge
 
cswiercz-general-presentation
cswiercz-general-presentationcswiercz-general-presentation
cswiercz-general-presentation
Chris Swierczewski
 
Matlabtut1
Matlabtut1Matlabtut1
Matlabtut1
Vinnu Vinay
 
Online Maths Assignment Help
Online Maths Assignment HelpOnline Maths Assignment Help
Online Maths Assignment Help
Maths Assignment Help
 
Functions lesson
Functions lesson Functions lesson
Functions lesson
YesseniaVillalobos2
 
Online Maths Assignment Help
Online Maths Assignment HelpOnline Maths Assignment Help
Online Maths Assignment Help
Math Homework Solver
 
Linear regression
Linear regressionLinear regression
Linear regression
Zoya Bylinskii
 
Slides QuAND 2011
Slides QuAND 2011Slides QuAND 2011
Slides QuAND 2011
Alejandro Díaz-Caro
 
MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...
The Statistical and Applied Mathematical Sciences Institute
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
Cesar Mendoza
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
Cesar Mendoza
 
Presentation.pdf
Presentation.pdfPresentation.pdf
Presentation.pdf
Chiheb Ben Hammouda
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptx
PremanandS3
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5
Bryan O'Sullivan
 
Signals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptxSignals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptx
Matlab Assignment Experts
 
Networking Assignment Help
Networking Assignment HelpNetworking Assignment Help
Networking Assignment Help
Computer Network Assignment Help
 
5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!
A Jorge Garcia
 
Desm s mathematics
Desm s mathematicsDesm s mathematics
Desm s mathematics
Ajaypal Yadav
 

Similar to A type system for the vectorial aspects of the linear-algebraic lambda-calculus (20)

Mtc ssample05
Mtc ssample05Mtc ssample05
Mtc ssample05
 
Mtc ssample05
Mtc ssample05Mtc ssample05
Mtc ssample05
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 
cswiercz-general-presentation
cswiercz-general-presentationcswiercz-general-presentation
cswiercz-general-presentation
 
Matlabtut1
Matlabtut1Matlabtut1
Matlabtut1
 
Online Maths Assignment Help
Online Maths Assignment HelpOnline Maths Assignment Help
Online Maths Assignment Help
 
Functions lesson
Functions lesson Functions lesson
Functions lesson
 
Online Maths Assignment Help
Online Maths Assignment HelpOnline Maths Assignment Help
Online Maths Assignment Help
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Slides QuAND 2011
Slides QuAND 2011Slides QuAND 2011
Slides QuAND 2011
 
MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Multidimensional Monot...
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
 
Presentation.pdf
Presentation.pdfPresentation.pdf
Presentation.pdf
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptx
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5
 
Signals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptxSignals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptx
 
Networking Assignment Help
Networking Assignment HelpNetworking Assignment Help
Networking Assignment Help
 
5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!
 
Desm s mathematics
Desm s mathematicsDesm s mathematics
Desm s mathematics
 

More from Alejandro Díaz-Caro

Typing quantum superpositions and measurement
Typing quantum superpositions and measurementTyping quantum superpositions and measurement
Typing quantum superpositions and measurement
Alejandro Díaz-Caro
 
A lambda calculus for density matrices with classical and probabilistic controls
A lambda calculus for density matrices with classical and probabilistic controlsA lambda calculus for density matrices with classical and probabilistic controls
A lambda calculus for density matrices with classical and probabilistic controls
Alejandro Díaz-Caro
 
Towards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum controlTowards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum control
Alejandro Díaz-Caro
 
Affine computation and affine automaton
Affine computation and affine automatonAffine computation and affine automaton
Affine computation and affine automaton
Alejandro Díaz-Caro
 
Simply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphismsSimply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphisms
Alejandro Díaz-Caro
 
The probability of non-confluent systems
The probability of non-confluent systemsThe probability of non-confluent systems
The probability of non-confluent systems
Alejandro Díaz-Caro
 
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Alejandro Díaz-Caro
 
Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...
Alejandro Díaz-Caro
 
Non determinism through type isomophism
Non determinism through type isomophismNon determinism through type isomophism
Non determinism through type isomophism
Alejandro Díaz-Caro
 
Call-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type disciplineCall-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type discipline
Alejandro Díaz-Caro
 
Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"
Alejandro Díaz-Caro
 
A System F accounting for scalars
A System F accounting for scalarsA System F accounting for scalars
A System F accounting for scalars
Alejandro Díaz-Caro
 

More from Alejandro Díaz-Caro (12)

Typing quantum superpositions and measurement
Typing quantum superpositions and measurementTyping quantum superpositions and measurement
Typing quantum superpositions and measurement
 
A lambda calculus for density matrices with classical and probabilistic controls
A lambda calculus for density matrices with classical and probabilistic controlsA lambda calculus for density matrices with classical and probabilistic controls
A lambda calculus for density matrices with classical and probabilistic controls
 
Towards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum controlTowards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum control
 
Affine computation and affine automaton
Affine computation and affine automatonAffine computation and affine automaton
Affine computation and affine automaton
 
Simply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphismsSimply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphisms
 
The probability of non-confluent systems
The probability of non-confluent systemsThe probability of non-confluent systems
The probability of non-confluent systems
 
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
 
Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...
 
Non determinism through type isomophism
Non determinism through type isomophismNon determinism through type isomophism
Non determinism through type isomophism
 
Call-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type disciplineCall-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type discipline
 
Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"
 
A System F accounting for scalars
A System F accounting for scalarsA System F accounting for scalars
A System F accounting for scalars
 

Recently uploaded

Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 

Recently uploaded (20)

Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 

A type system for the vectorial aspects of the linear-algebraic lambda-calculus

  • 1. A type system for the vectorial aspects of the linear-algebraic lambda-calculus Pablo Arrighi1,2 Alejandro Díaz-Caro1 Benoît Valiron3,4 1 Université de Grenoble, LIG, France 2 École Normale Supérieure de Lyon, LIP, France 3 Université de Paris-Nord, LIPN, France 4 University of Pennsylvania, USA 7th DCM • July 3, 2011 • Zurich, Switzerland
  • 2. M, N ::= x | λx.M | (M)N | M + N | α.M | 0 Beta reduction: (λx.M)N → M[x := N] “Algebraic” reductions: α.M + β.M → (α + β).M, (M)(N1 + N2 ) → (M)N1 + (M)N2 , ... ... ... (oriented version of the axioms of vectorial spaces) Two origins: Differential λ-calculus: capturing linearity à la Linear Logic → Removing the differential operator : Algebraic λ-calculus (λalg ) [Vaux’09] Quantum computing: superposition of programs → Linearity as in algebra: Linear-algebraic λ-calculus (λlin ) [Arrighi,Dowek’08] 2 / 15
  • 3. M, N ::= x | λx.M | (M)N | M + N | α.M | 0 Beta reduction: (λx.M)N → M[x := N] “Algebraic” reductions: α.M + β.M → (α + β).M, (M)(N1 + N2 ) → (M)N1 + (M)N2 , ... ... ... (oriented version of the axioms of vectorial spaces) λalg λlin Origin Linear Logic Quantum computing Strategy Call-by-name Call-by-value Algebraic part Equalities Rewrite system 2 / 15
  • 4. An infinite dimensional vectorial space of values B = {Mi : Mi is a variable or abstraction } Set of values ::= Span(B) (Now we should call λlin ’s strategy: “call-by-base”) 3 / 15
  • 5. Why would it be interesting? Several theories using the concept of linear-combination of terms quantum, probabilistic, non-deterministic models, . . . “Why would vector spaces be an interesting theory?” Many applications and moreover, interesting by itself! Aim of the current work: A type system capturing the “vectorial” structure of terms . . . to check for probability distributions . . . or “quantumness” of the term . . . or whatever application needing the structure of the vector in normal form . . . a Curry-Howard approach to defining Fuzzy/Quantum/Probabilistic logics from Fuzzy/Quantum/Probabilistic programming languages. 4 / 15
  • 6. The Scalar Type System [Arrighi,Díaz-Caro’09] A polymorphic type system tracking scalars: Γ M:T Barycentric restrictions Γ α.M : α.T Characterises the “amount” of terms The Additive Type System [Díaz-Caro,Petit’10] A polymorphic type system with sums: Γ M:T Γ N:R Sums ∼ Assoc., comm. pairs Γ M +N :T +R distributive w.r.t. application Can we combine them? 5 / 15
  • 7. The Vectorial Type System Types: T , R, S := U | T + R | α.T U, V , W := X | U → T | ∀X .U (U, V , W reflect the basis terms) Equivalences: 1.T ≡ T α.(β.T ) ≡ (α × β).T α.T + α.R ≡ α.(T + R) α.T + β.T ≡ (α + β).T T +R ≡ R +T T + (R + S) ≡ (T + R) + S (reflect the vectorial spaces axioms) 6 / 15
  • 8. The factorisation rule problem Γ M:T Γ M:T =========== =========== Γ α.M + β.M : α.T + β.T However, α.M + β.M → (α + β).M In general α.T + β.T = (α + β).T = (α + β).T (and since we are working in System F, there is no principal types neither) 7 / 15
  • 9. Several possible solutions: Remove factorisation rule (Done. SR and SN both work) + in scalars not used anymore. Scalars ⇒ Monoid It works!... but it is no so expressive (“vectorial” structure lost) 8 / 15
  • 10. Several possible solutions: Remove factorisation rule (Done. SR and SN both work) + in scalars not used anymore. Scalars ⇒ Monoid It works!... but it is no so expressive (“vectorial” structure lost) Add several typing rules to allow typing (α + β).M with α.T + β.T As soon as we add one, we have to add many to make it work Too complex and inelegant (subject reduction by axiom) 8 / 15
  • 11. Several possible solutions: Remove factorisation rule (Done. SR and SN both work) + in scalars not used anymore. Scalars ⇒ Monoid It works!... but it is no so expressive (“vectorial” structure lost) Add several typing rules to allow typing (α + β).M with α.T + β.T As soon as we add one, we have to add many to make it work Too complex and inelegant (subject reduction by axiom) Church style Seems to be the natural solution Big complexity with polymorphism and distributivity 8 / 15
  • 12. Several possible solutions: Remove factorisation rule (Done. SR and SN both work) + in scalars not used anymore. Scalars ⇒ Monoid It works!... but it is no so expressive (“vectorial” structure lost) Add several typing rules to allow typing (α + β).M with α.T + β.T As soon as we add one, we have to add many to make it work Too complex and inelegant (subject reduction by axiom) Church style Seems to be the natural solution Big complexity with polymorphism and distributivity Weak subject reduction (this work) What is the best we can get in Curry style? 8 / 15
  • 13. Typing rules Γ M:T Γ M:T ax 0I αI Γ, x : U x :U Γ 0 : 0.T Γ α.M : α.T n m Γ M: αi .∀X .(U → Ti ) Γ N: βi .Vj ∀Vj ,∃Wj /U[Wj /X ]=Vj i=1 j=1 n m →E Γ (M)N : αi × βi .Ti [Wj /X ] i=1 j=1 Γ, x : U M:T Γ M:T Γ N:R →I +I Γ λx.M : U → T Γ M +N :T +R Γ M:U X ∈FV (Γ) / Γ M : ∀X .U ∀I ∀E Γ M : ∀X .U Γ M : U[V /X ] 9 / 15
  • 14. (α + β).T α.T + β.T if ∃M / Γ M : T and Γ M:T (and its contextual closure) 10 / 15
  • 15. (α + β).T α.T + β.T if ∃M / Γ M : T and Γ M:T (and its contextual closure) Theorem (A weak subject reduction) If Γ M : T and M →R N, then if R is not a factorisation rule: Γ N:T if R is a factorisation rule: ∃S T /Γ N:S 10 / 15
  • 16. (α + β).T α.T + β.T if ∃M / Γ M : T and Γ M:T (and its contextual closure) Theorem (A weak subject reduction) If Γ M : T and M →R N, then if R is not a factorisation rule: Γ N:T if R is a factorisation rule: ∃S T /Γ N:S How weak? Let M → N, Subject reduction Γ M:T ⇒Γ N:T Subtyping Γ M:T ⇒Γ N : S, but S ≤ T , so Γ N:T Our theorem Γ M:T ⇒Γ N : S, and S T 10 / 15
  • 17. Confluence and Strong normalisation In the original untyped setting: “confluence by restrictions”: YB = (λx.(B + (x)x))λx.(B + (x)x) YB → B + YB → B + B + YB → . . . 11 / 15
  • 18. Confluence and Strong normalisation In the original untyped setting: “confluence by restrictions”: YB = (λx.(B + (x)x))λx.(B + (x)x) YB → B + YB → B + B + YB → . . . YB + (−1).YB −→ (1 − 1).YB −→∗ 0 ↓ Solution in the untyped setting: B + YB + (−1).YB α.M + β.M → (α + β).M ↓∗ only if M is closed-normal B 11 / 15
  • 19. Confluence and Strong normalisation In the original untyped setting: “confluence by restrictions”: YB = (λx.(B + (x)x))λx.(B + (x)x) YB → B + YB → B + B + YB → . . . YB + (−1).YB −→ (1 − 1).YB −→∗ 0 ↓ Solution in the untyped setting: B + YB + (−1).YB α.M + β.M → (α + β).M ↓∗ only if M is closed-normal B In the typed setting: Strong normalisation solves the problem 11 / 15
  • 20. Theorem (Strong normalisation) Γ M : T ⇒ M strongly normalising. Proof. Reducibility candidates method. Main difficulty: Show that {Mi }i strongly normalizing ⇒ αi .Mi strongly normalizing i Done by using a measurement on terms decreasing on algebraic rewrites. 12 / 15
  • 21. Theorem (Confluence) M →∗ N1 N1 →∗ L ∀M / Γ M:T ∗ ⇒ ∃L such that M → N2 N2 →∗ L Proof. M → N1 N1 →∗ L 1) local confluence: ⇒ ∃L such that M → N2 N2 →∗ L Algebraic fragment: Coq proof Beta-reduction: Straightforward extension Commutation: Induction 2) Local confluence + Strong normalisation ⇒ Confluence [TeReSe’03] 13 / 15
  • 22. Expressing matrices and vectors true = λx.λy .x Two base vectors: false = λx.λy .y 14 / 15
  • 23. Expressing matrices and vectors true = λx.λy .x Two base vectors: false = λx.λy .y T = ∀XY .X → Y → X Their types: F = ∀XY .X → Y → Y α.true + β.false : α.T + β.F 14 / 15
  • 24. Expressing matrices and vectors true = λx.λy .x Two base vectors: false = λx.λy .y T = ∀XY .X → Y → X Their types: F = ∀XY .X → Y → Y α.true + β.false : α.T + β.F (U)true = a.true + b.false Linear map U s.t. (U)false = c.true + d .false 14 / 15
  • 25. Expressing matrices and vectors true = λx.λy .x Two base vectors: false = λx.λy .y T = ∀XY .X → Y → X Their types: F = ∀XY .X → Y → Y α.true + β.false : α.T + β.F (U)true = a.true + b.false Linear map U s.t. (U)false = c.true + d .false U := λx.{((x)[a.true + b.false])[c.true + d .false]} with [M] := λz.M {M} := (M)_ {[M]}→ M U : ∀X .((I → (a.T + b.F)) → (I → (c.T + d .F)) → X ) → X 14 / 15
  • 26. Contributions Scalar ∪ Additive (“AC, distributive pairs”) ⇒ linear-combination of types The typing gives the information of “how much the scalars sums” in the normal form Weak SR ⇒ Church style captures better the vectorial structure Strong normalisation ⇒ Confluence without restrictions Representation of matrices and vectors 15 / 15