This paper introduces two quantum lambda calculi using density matrices, enabling formal reasoning about quantum data and mixed states with classical and probabilistic controls.
Contribution
It presents two novel quantum lambda calculi, $
ho$ and $
ho^ullet$, for modeling quantum data and mixed states within a formal lambda calculus framework.
Findings
01
Provides formal semantics for density matrix-based quantum programs
02
Defines two calculi capturing classical control and mixed quantum states
03
Lays groundwork for reasoning about quantum algorithms in lambda calculus
Abstract
In this paper we present two flavors of a quantum extension to the lambda calculus. The first one, λρ, follows the approach of classical control/quantum data, where the quantum data is represented by density matrices. We provide an interpretation for programs as density matrices and functions upon them. The second one, λρ∘, take advantage of the density matrices presentation in order to follow the mixed trace of programs in a kind of generalised density matrix. Such a control can be seen as a weaker form of the quantum control and data approach.
Tables8
Table 1. Table 1: Grammar of terms of λ ρ subscript 𝜆 𝜌 \lambda_{\rho} .
(Standard lambda calculus)
(Quantum postulates)
(Classical control)
Table 2. Table 2: Rewrite system for λ ρ subscript 𝜆 𝜌 \lambda_{\rho} .
Table 3. Table 3: Type system for λ ρ subscript 𝜆 𝜌 \lambda_{\rho} .
Table 4. Table 4: Interpretation of types
Table 5. Table 5: Interpretation of terms
Table 6. Table 6: Grammar of terms of λ ρ ∘ superscript subscript 𝜆 𝜌 \lambda_{\rho}^{\circ} .
(Standard lambda calculus)
(Quantum postulates)
(Probabilistic control)
Table 7. Table 7: Rewrite system of λ ρ ∘ superscript subscript 𝜆 𝜌 \lambda_{\rho}^{\circ} .
Table 8. Table 8: Type system for λ ρ ∘ superscript subscript 𝜆 𝜌 \lambda_{\rho}^{\circ} .
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Full text
11institutetext: Universidad Nacional de Quilmes & CONICET
Roque Sáenz Peña 352, B1876BXD Bernal, Buenos Aires, Argentina
Alejandro Díaz-Caro
Supported by
projects STIC-AmSud 16STIC05 FoQCoSS, PICT 2015-1208 and the Laboratoire
International Associé “INFINIS”.
Abstract
In this paper we present two flavors of a quantum extension to the lambda
calculus. The first one, λρ, follows the approach of classical
control/quantum data, where the quantum data is represented by density
matrices. We provide an interpretation for programs as density matrices and
functions upon them. The second one, λρ∘, takes advantage of the
density matrices presentation in order to follow the mixed trace of programs
in a kind of generalised density matrix. Such a control can be seen as a
weaker form of the quantum control and data approach.
Keywords:
lambda
calculus, quantum computing, density matrices, classical control
1 Introduction
In the last decade several quantum extensions to lambda calculus have been
investigated,
e.g. [22, 21, 18, 30, 6, 5, 10].
In all of those approaches, the language chosen to represent the quantum state
are vectors in a Hilbert space. However, an alternative formulation of quantum
mechanics can be made using density matrices. Density matrices provide a way to
describe a quantum system in which the state is not fully known. More precisely,
density matrices describe quantum systems in a mixed state, that is, a
statistical set of several quantum states. All the postulates of quantum
mechanics can be described in such a formalism, and hence, also quantum
computing can be done using density matrices.
The first postulate states that a quantum system can be fully described by a
density matrix ρ, which is a positive operator with trace (tr) one. If a
system is in state ρi with probability pi, then the density matrix of
the system is ∑ipiρi. The second postulate states that the evolution
of a quantum system ρ is described with a unitary operator U by UρU†, where U† is the adjoint operator of U. The third
postulate states that the measurement is described by a set of measurement
operators {πi}i with ∑iπi†πi=I, so that the
output of the measurement is i, with probability
tr(πi†πiρ), leaving the sate of the system as
tr(πi†πiρ)πiρπi†. The fourth
postulate states that from two systems ρ and ρ′, the composed one can
be described by the tensor product of those ρ⊗ρ′.
Naturally, if we want to use the output of a measurement as a condition in the
classical control, we need to know that output. However, density matrices can
still be used as a way to compare processes before running them. For example the
process of tossing a coin, and according to its result, applying Z or not to a
balanced superposition, and the process of tossing a coin and not looking at its
result, may look quite different in most quantum programming languages. Yet both
processes output the same density matrix, and so they are indistinguishable.
In [19], Selinger introduced a language of quantum flow charts,
and an interpretation of his language into a CPO of density matrices. After this
paper, the language of density matrices has been widely used in quantum
programming, e.g.
[9, 14, 13, 24, 27].
Indeed, the book “Foundations of Quantum Programming” [26] is entirely
written in the language of density matrices. Yet, as far as we know, no lambda
calculus for density matrix have been proposed.
Apart from the distinction of languages by how they treat the quantum states
(vectors in a Hilbert space or density matrices), we also can distinguish the
languages on how the control is considered: either quantumly or classically. The
idea of quantum data / classical control stated by Selinger in
[19] induced a quantum lambda calculus in this paradigm
[21]. Later, this calculus was the base to construct the
programming language Quipper
[15], an embedded, scalable,
functional programming language for quantum computing. The concept of quantum
data / classical control declares that quantum computers will run in a
specialized device attached to a classical computer, and it is the classical
computer which will instruct the quantum computer what operations to perform
over which qubits, and then read the classical result after a measurement. It is
a direct consequence from the observation that quantum circuits are classical
(i.e. one cannot superpose circuits or measure them). Several studies have been
done under this paradigm, e.g. [2, 15, 18, 21, 30].
Dually to the quantum data / classical control paradigm, there is what we can
call the quantum data and control paradigm. The idea is to provide a
computational definition of the notions of vector space and bilinear functions.
In the realm of quantum walks, quantum control is not uncommon (e.g.
[3, 1]).
Also, several high-level languages on quantum control have been proposed in the
past (e.g.
[2, 28, 29, 8]),
however, up to now, no complete lambda-calculus with quantum control have been
proposed. We benefit, though, from the long line of works in this direction
[6, 5, 4, 7, 12].
In this paper, we propose a quantum extension to the lambda calculus,
λρ, in the quantum data / classical control paradigm, where the quantum
data is given by density matrices, as first suggested by Selinger’s
interpretation of quantum flow charts [19]. Then, we propose a modification of such a
calculus, called λρ∘, in which we generalise the density matrices to
the classical control: That is, after a measurement, we take all the possible
outcomes in a kind of generalised density matrix of arbitrary terms. The control
does not become quantum, since it is not possible to superpose programs in the
quantum sense. However, we consider the density matrix of the mixed state of
programs arising from a measurement. Therefore, this can be considered as a kind
of probabilistic control, or even another way, perhaps weaker, of quantum
control.
Outline of the Paper.
In Section 2 we introduce the typed calculus λρ, which
manipulates density matrices, and we give two interpretations of the calculus.
One where the terms are interpreted into a generalisation of mixed states, and
another where the terms are interpreted into density matrices. Then we prove
some properties of those interpretations. In Section 3 we
introduce a modification of λρ, called λρ∘, where the output
of a measurement produce a sum with all the possible outputs. We then extend the
interpretation of λρ to accommodate λρ∘, and prove its basic
properties. In Section 4 we prove the Subject Reduction
(Theorem 4.1) and Progress (Theorem 4.2) properties for
both calculi. In Section 5 we give two interesting examples, in
both calculi. Finally, in Section 6, we conclude and discuss
some future work.
2 Classical-control calculus with probabilistic
rewriting
2.1 Definitions
The grammar of terms, given in Table 1, have been divided in
three categories.
Standard lambda calculus terms: Variables from a set Vars,
abstractions and applications.
2. 2.
The four postulates of quantum mechanics, with the measurement postulate
restricted to measurements in the computational basis111A
generalisation to any arbitrary measurement can be considered in a future,
however, for the sake of simplicity in the classical control, we consider
only measurements in the computational basis, which is a common practice in
quantum lambda
calculi [18, 20, 21, 30, 16, 10].:
ρn to represent the density matrix of a quantum system. Unt to
describe its evolution. πnt to measure it. t⊗t to describe the
density matrix of a composite system (that is, a non entangled system composed
of two subsystems).
3. 3.
Two constructions for the classical control: a pair (bm,ρn), where
bm is the output of a measurement in the computational basis and ρn
is the resulting density matrix, and the conditional letcase
construction reading the output of the measurement.
The rewrite system, given in Table 2, is described by the relation
⟶p, which is a probabilistic relation where p is the probability of
occurrence. If Um is applied to ρn, with m≤n, we write
Um for Um⊗In−m. Similarly, we write πm when we
apply this measurement operator to ρn for {π0⊗In−m,…,π2m−1⊗In−m}. If the unitary Um needs to be
applied, for example, to the last m qubits of ρn instead of the first
m, we will need to use the unitary transformation In−m⊗Um
instead. And if it is applied to the qubits k to k+m, then, we can use
Ik−1⊗Um.
This rewrite system assumes that after a measurement, the result is known.
However, since we are working with density matrices we could also provide an
alternative rewrite system where after a measurement, the system turns into a
mixed state. We left this possibility for Section 3.
The type system, including the grammar of types and the derivation rules, is
given in Table 3. The type system is affine, so variables can be used
at most once, forbiding from cloning a density matrix.
Example 1
The teleportation algorithm, while it is better described by pure states, can
be expressed in the following way:
Let β00=21(∣00⟩⟨00∣+∣00⟩⟨11∣+∣11⟩⟨00∣+∣11⟩⟨11∣).
Then, the following term expresses the teleportation algorithm.
[TABLE]
where Z3=I⊗I⊗Z1 and X3=I⊗I⊗X1.
The type derivation is as follows.
[TABLE]
2.2 Interpretation
We give two interpretations for terms. One, noted by \llparenthesis⋅\rrparenthesis, is the
interpretation of terms into density matrices and functions upon them, and the
other, noted by [[⋅]], is a more fine-grained interpretation,
interpreting terms into a generalisation of mixed states. In particular, we want
[[πnρn]]={(tr(πi†πiρn),tr(πi†πiρn)πiρnπi†)}i,
while \llparenthesisπnρ\rrparenthesis=∑iπiρnπi†. However, since the
letcase construction needs also to distinguish each possible result
of a measurement, we will carry those results in the interpretation
[[⋅]], making it a set of triplets instead of a set of tuples.
Let Nε=N0∪{ε}, so terms are
interpreted into sets of triplets (p,b,e) with p∈R+≤1,
representing the probability, b∈Nε, representing the
output of a measurement if it occurred, and e∈[[A]] for some type A and
an interpretation [[⋅]] on types yet to define. In addition, we
consider that the sets {…,(p,b,e),(q,b,e),…} and
{…,(p+q,b,e),…} are equal. Finally, we define the weight function as
w({(pi,bi,ei)}i)=∑ipi. We are interested in sets S such that
w(S)=1.
The interpretation of types is given in Table 4. Dn is the set
of density matrices of n-qubits, that is Dn={ρ∣ρ∈M2n×2n+ such that tr(ρ)=1}, where M2n×2n+ is the set of positive matrices of size 2n×2n.
P(b,A) is the following property: [A=(m,n)⟹b=ε].
We also establish the convention that
P({(pi,bi,ei)}i,A)=⋀iP(bi,A). Finally, we write
trd(S)={e∣(p,b,e)∈S}.
Let E=⋃A∈Types[[A]]. We denote by θ to a
valuation Vars→Nε×E. Then, we define the
interpretation of terms with respect to a given valuation θ in
Table 5.
Definition 1
θ⊨Γ if and only if, for all x:A∈Γ, θ(x)=(b,e)
with e∈[[A]], and P(b,A).
Lemma 1 states that a term with type (m,n) will be the result of a measurement, and hence, its
interpretation will carry the results bi=ε.
Lemma 1
Let Γ⊢t:(m,n), θ⊨Γ, and [[t]]θ
be well-defined. Then, [[t]]θ={(pi,bi,ei)}i with bi=ε
and ei∈Dn.
Proof
By induction on the type derivation (cf. Appendix 0.A.1).∎
Lemma 2 states that the interpretation of a typed term is
well-defined.
Lemma 2
If Γ⊢t:A and θ⊨Γ, then w([[t]]θ)=1, and
trd([[t]]θ)⊆[[A]].
Since the interpretation [[⋅]] of a term is morally a mixed state, the
interpretation \llparenthesis⋅\rrparenthesis, which should be the density matrix of such a
state, is naturally defined using the interpretation [[⋅]].
Definition 2
Let e∈[[A]] for some A, θ a valuation, and t be a term such
that [[t]]θ={(pi,bi,ei)}i.
We state the convention that (b,e)↦∑ipiei=∑ipi((b,e)↦ei).
We define [e] and \llparenthesist\rrparenthesisθ by mutual recursion as follows:
[TABLE]
Lemma 3 (Substitution)
Let [[r]]θ={(pi,bi,ei)}i, then
[TABLE]
Proof
By induction on t. However, we enforce the hypothesis by also showing that
if [[t]]θ,x=(bi,ei)={(qij,bij′,ρij)}j, then
[[t[r/x]]]θ={(piqij,bij′,ρij)}ij. We use five
auxiliary results (cf. Appendix 0.A.3).∎
Theorem 2.1 shows how the interpretation \llparenthesis⋅\rrparenthesis of a term
relates to all its reducts.
Theorem 2.1
If Γ⊢t:A, θ⊨Γ and t⟶piri, with
∑ipi=1, then \llparenthesist\rrparenthesisθ=∑ipi\llparenthesisri\rrparenthesisθ.
Proof
By induction on the relation ⟶p (cf. Appendix 0.A.4).∎
3 Probabilistic-control calculus with no-probabilistic
rewriting
3.1 Definitions
In the previous sections we have presented an extension to lambda calculus to
handle density matrices. The calculus could have been done using just vectors,
because the output of a measurement is not given by the density matrix of the
produced mixed state, instead each possible output is given with its
probability. In this section, we give an alternative presentation, named
λρ∘, where we can make the most of the density matrices setting.
In Table 6 we give a modified grammar of terms for
λρ∘ in order to allow for linear combination of terms. We follow the
grammar of the algebraic
lambda-calculi [6, 7, 23].
The new rewrite system is given by the non-probabilistic relation ⇝,
described in Table 7. The measurement does not reduce, unless it
is the parameter of a letcase∘. Therefore, if only a measurement
is needed, we can encode it as:
[TABLE]
where ρ′=∑iπiρnπi†. The rationale is that
in this version of the calculus, we can never look at the result of a
measurement. It will always produce the density matrix of a mixed-state. As a
consequence, the letcase∘ constructor rewrites to a sum of
terms.
The type system for λρ∘, including the grammar of types and the
derivation rules, is given in Table 8. The only difference with
the type system of λρ (cf. Table 3), is that rule
axam is no longer needed, since (bm,ρn) is not in
the grammar of λρ∘, and there is a new rule (+) typing the
generalised mixed states. We use the symbol ⊩ for λρ∘ to
distinguish it from ⊢ used in λρ.
Example 2
The teleportation algorithm expressed in λρ in
Example 1, is analogous for λρ∘, only changing
the term letcase by letcase∘. Also, the type
derivation is analogous. The difference is in the reduction. Let ρ be the
density matrix of a given quantum state (mixed or pure). Let
[TABLE]
The trace of the teleportation of ρ in λρ is the following:
[TABLE]
From (1), there are four possible reductions. For i=0,1,2,3, let
pi=tr(πi†πiρ23) and
ρ3i3=piπiρ23πi†. Then,
On the other hand, the trace of the same term, in λρ∘, would be
analogous until (1), just using ⇝ instead of ⟶1. Then:
[TABLE]
3.2 Interpretation
The interpretation of λρ given in Section 2.2 considers
already all the traces. Hence, the interpretation of λρ∘ can be
obtained from a small modification of it. We only need to drop the
interpretation of the term that no longer exists, (bm,ρn), and add an
interpretation for the new term ∑ipiti as follows:
[TABLE]
The interpretation of letcase∘ is the same as the interpretation
of letcase.
Then, we can prove a theorem (Theorem 3.1) for λρ∘
analogous to Theorem 2.1.
We need the following auxiliary Lemmas.
Lemma 4
If Γ⊩t:A and θ⊨Γ, then \llparenthesis∑ipiti\rrparenthesisθ=∑ipi\llparenthesisti\rrparenthesisθ
Proof
Let [[ti]]θ={(qij,bij,eij)}j. Then, we have
\llparenthesis∑ipiti\rrparenthesisθ=∑ijpiqijeij=∑ipi∑jqijeij=∑ipi\llparenthesisti\rrparenthesisθ.
∎
Lemma 5
Let [[r]]θ={(pi,bi,ei)}i, then
\llparenthesist[r/x]\rrparenthesisθ=∑ipi\llparenthesist\rrparenthesisθ,x=(bi,ei).
Proof
The proof of the analogous Lemma 3 in λρ
follows by induction on t. Since the definition of [[⋅]] is the
same for λρ than for λρ∘, we only need to check the only
term of λρ∘ which is not a term of λρ: ∑jqjtj. Using
Lemma 4, and the induction hypothesis, we have
\llparenthesis(∑jqjtj)[r/x]\rrparenthesisθ=\llparenthesis∑jqj(tj[r/x])\rrparenthesisθ=∑jqj\llparenthesistj[r/x]\rrparenthesisθ=∑jqj∑ipi\llparenthesistj\rrparenthesisθ,x=(bi,ei)=∑ipi\llparenthesis∑jqjtj\rrparenthesisθ,x=(bi,ei). ∎
Theorem 3.1
If Γ⊩t:A, θ⊨Γ and t⇝r, then \llparenthesist\rrparenthesisθ=\llparenthesisr\rrparenthesisθ.
Proof
By induction on the relation ⇝. Rules (λx.t)r⇝t[r/x],
Umρn⇝ρ′ and ρ⊗ρ′⇝ρ′′ are also valid rules
for relation ⟶1, and hence the proof of these cases are the same than
in Theorem 2.1.
∎
4 Subject Reduction and Progress
In this section we state and prove the subject reduction and progress properties
on both, λρ and λρ∘ (Theorems 4.1
and 4.2 respectively).
Lemma 6 (Weakening)
•
If Γ⊢t:A and x∈/FV(t), then Γ,x:B⊢t:A.
•
If Γ⊩t:A and x∈/FV(t), then Γ,x:B⊩t:A.
Proof
By a straightforward induction on the derivation of Γ⊢t:A and on
Γ⊩t:A.∎
Lemma 7 (Strengthening)
•
If Γ,x:A⊢t:B and x∈/FV(t), then Γ⊢t:B.
•
If Γ,x:A⊩t:B and x∈/FV(t), then Γ⊩t:B.
Proof
By a straightforward induction on the derivation of Γ,x:A⊢t:B and
Γ,x:A⊩t:B.∎
By induction on the relations ⟶p and ⇝ (cf.
Appendix 0.C.2). ∎
Definition 3 (Values)
•
A value in λρ is a term v defined by the following grammar:
[TABLE]
•
A value in λρ∘ (or value∘) is a term v defined by the
following grammar:
[TABLE]
Lemma 9
If v is a value, then there is no t such that v⟶pt for any
p.
2. 2.
If v is a value∘, then there is no t such that v⇝t.
Proof
By induction on v in both cases (cf. Appendix 0.C.3).∎
Theorem 4.2 (Progress)
If ⊢t:A, then either t is a value or there exist n,
p1,…,pn, and r1,…,rn such that t⟶piri.
2. 2.
If ⊩t:A and A=(m,n), then either t is a value∘* or there
exists r such that t⇝r.*
Proof
We relax the hypotheses and prove the theorem for open terms as well. That is:
If Γ⊢t:A, then either t is a value, there exist n,
p1,…,pn, and r1,…,rn such that t⟶piri, or t
contains a free variable, and t does not rewrite.
2. 2.
If Γ⊩t:A, then either t is a value∘, there exists r
such that t⇝r, or t contains a free variable, and t does not
rewrite.
In both cases, we proceed by induction on the type derivation
(cf. Appendix 0.C.4).∎
5 Examples
Example 3
Consider the following experiment: Measure some ρ and then toss a coin to
decide whether to return the result of the measurement, or to give the result
of tossing a new coin.
The experiment in λρ.
This experiment can be implemented in λρ as follows:
[TABLE]
Trace:
We give one possible probabilistic trace. Notice that, by using different
strategies, we would get different derivation trees. We will not prove
confluence in this setting (cf. [11] for a full
discussion on the notion of confluence of probabilistic rewrite systems), but
we conjecture that such a property is meet.
We use the following notations:
[TABLE]
Using this notation, the probabilistic trace is given by the tree in
Table 9. Therefore, with probability 85 we get ∣0⟩⟨0∣, and with probability 83 we get ∣1⟩⟨1∣. Thus, the
density matrix of this mixed state is 85∣0⟩⟨0∣+83∣1⟩⟨1∣.
Typing:
[TABLE]
[TABLE]
[TABLE]
Interpretation:
[TABLE]
Then,
[TABLE]
Hence,
[TABLE]
The experiment in λρ∘.
In λρ∘, the example
becomes:
[TABLE]
Trace:
In this case the trace is not a tree, because the relation
⇝ is not probabilistic. We use the same ρ as before: 43∣0⟩⟨0∣+43∣1⟩⟨0∣+43∣0⟩⟨1∣+41∣1⟩⟨1∣.
[TABLE]
Typing and Interpretation:
Since t does not contain sums, its
typing is analogous to the term in λρ, as well as the interpretation.
Example 4
In [17, p 371] there is an example of the freedom in the
operator-sum representation by showing two quantum operators, which are
actually the same. One is the process of tossing a coin and, according to its
results, applying I or Z to a given qubit The second is the process
performing a projective measurement with unknown outcome to the same qubit.
These operations can be encoded in λρ by:
[TABLE]
with π1={∣0⟩⟨0∣,∣1⟩⟨1∣}.
Let us apply those operators to the qubit ρ=43∣0⟩⟨0∣+43∣0⟩⟨1∣+43∣1⟩⟨0∣+41∣1⟩⟨1∣. We can check that the terms O1ρ and O2ρ have different
interpretations [[⋅]]. Let ρ−=ZρZ†, then
[TABLE]
However, they have the same interpretation \llparenthesis⋅\rrparenthesis.
[TABLE]
The trace of O1ρ is given in Table 10, and the
trace of O2ρ in Table 11.
The first term produces ρ, with probability 21, and ρ−,
with probability 21, while the second term produces either ∣0⟩⟨0∣ with probability 43 or ∣1⟩⟨1∣, with probability 41.
However, if we encode the same terms in λρ∘, we can get both programs
to produce the same density matrix:
[TABLE]
The traces of O1∘ρ and O2∘ρ are as follow:
[TABLE]
6 Conclusions
In this paper we have presented the calculus λρ, which is a quantum
data / classical control extension to the lambda calculus where the data is
manipulated by density matrices. The main importance of this calculus is its
interpretation into density matrices, which can equate programs producing the
same density matrices. Then, we have given a second calculus, λρ∘,
where the density matrices are generalised to accommodate arbitrary terms, and
so, programs producing the same density matrices, rewrite to such a matrix,
thus, coming closer to its interpretation. The control of λρ∘ is not
classical nor quantum, however it can be seen as a weaker version of the quantum
control approach. It is indeed not classical control because a generalised
density matrix of terms is allowed (∑ipiti). It is not quantum control
because superposition of programs are not allowed (indeed, the previous sum is
not a quantum superposition since all the pi are positive and so no
interference can occur). However, it is quantum in the sense that programs in a
kind of generalised mixed-states are considered. We preferred to call it probabilistic control.
As depicted in Example 4, the calculus λρ∘ allows to
represent the same operator in different ways. Understanding when two operators
are equivalent is important from a physical point of view: it gives insights on
when two different physical processes produce the same dynamics. To the best of
our knowledge, it is the first lambda calculus for density matrices.
Future work and open questions
As pointed out by Bǎdescu and Panangaden [8], one
of the biggest issues with quantum control is that it does not accommodate well
with traditional features from functional programming languages like recursion.
Ying [25] went around this problem by introducing a recursion based on
second quantisation. Density matrices are DCPOs with respect to the Löwner
order. Is the form of weakened quantum control suggested in this paper monotone?
Can it be extended with recursion? Could this lead to a concrete quantum
programming language, like
Quipper [15]?
All these open questions are promising new lines of research that we are willing
to follow. In particular, we have four ongoing works trying to answer some of
these questions:
•
The most well studied quantum lambda calculus is, without doubt,
Selinger-Valiron’s λq [21]. Hence, we are
working on the mutual simulations between λρ and λq, and
between λρ∘ and a generalisation of λq into mixed states.
•
We are also working on a first prototype of an implementation of
λρ∘.
•
We are studying extensions to both λρ and λρ∘ with
recursion and with polymorphism.
•
Finally, we are studying a more sophisticated denotational semantics for
both calculi than the one given in this paper. We hope such a semantics to be
adequate and fully abstract.
Acknowledgements
We want to thank the anonymous reviewer for some
important references and suggestions on future lines of work.
Let Γ,x:(m,n)⊢x:(m,n) as a
consequence of rule ax. Since θ⊨Γ,x:(m,n), we have θ(x)=(b,e) with e∈Dn and
b=ε. Hence, [[x]]θ={(1,b,e)}.
•
Let Γ,Δ⊢tr:(m,n) as a consequence of
Γ⊢t:A⊸(m,n), Δ⊢r:A and rule
⊸e. Since θ⊨Γ,Δ, we have
θ⊨Γ. Since [[tr]]θ is well-defined, we have [[r]]θ={(pi,bi,ei)}i, [[t]]θ={(qj,bj′,fj)}i, and
fj(bi,ei)={(hijk,bijk′′,gijk)}k, and hence
[[tr]]θ={(piqjhijk,bijk′′,gijk)}ijk. By the induction
hypothesis, fi∈[[A⊸(m,n)]], so, by
definition, bijk′′=ε and gijk∈Dn.
•
Let Γ⊢πmt:(m,n) as a consequence of Γ⊢t:n
and rule m. Then we have that [[πmt]]θ is equal to
{pjtr(πi†πiρj),i,tr(πi†πiρj)πiρjπi†∣[[t]]θ={(pj,ε,ρj)}j}, with i=ε. Notice that
tr(πi†πiρj)πiρjπi†∈Dn.
•
Let Γ⊢(bm,ρn):(m,n) as a consequence of rule
axam. Then, [[(bm,ρn)]]θ={(1,bm,ρn)}.
Notice that ρn∈Dn.
•
Let Γ⊢letcasex=rin{t0,…,t2m′−1}:(m,n) as a consequence of x:n′⊢tk:(m,n),
for k=0,…,2m′−1, Γ⊢r:(m′,n′) and rule lc.
Since [[letcasex=rin{t0,…,t2m′−1}]]θ is well-defined, [[r]]θ={(pi,bi,ρin)}i,
[[ti]]θ,x=(ε,ρin)={(qij,bij′,eij)}j and
[[letcasex=rin{t0,…,t2m′−1}]]θ={(piqij,bij′,eij)}ij. By the induction hypothesis,
bij′=ε and eij∈Dn.
∎
Let t=x. Then x:A∈Γ. [[x]]θ={(1,b,e)}, with
θ(x)=(b,e). Since θ⊨Γ we have e∈[[A]].
•
Let t=λx.r. Then A=B⊸C, Γ,x:B⊢r:C and
[[λx.r]]θ={(1,ε,(b,e)↦[[r]]θ,x=(b,e))}. Let
e∈[[B]] and b∈Nε such that P(b,B). Then, since
θ⊨Γ, we have θ,x=(b,e)⊨Γ,x:B. Hence, by the
induction hypothesis, trd([[r]]θ,x=(b,e))⊆[[C]].
Therefore, (b,e)↦[[r]]θ,x=(b,e)∈[[B⊸C]].
•
Let t=rs. Then Γ=Γ1,Γ2, with Γ1⊢r:B⊸A and Γ2⊢s:B. Since θ⊨Γ, we have
θ⊨Γ1 and θ⊨Γ2, so by the induction
hypothesis, [[s]]θ={(pi,bi,ei)}i, ∑ipi=1 and ei∈[[B]].
Similarly, [[r]]θ={(qj,bj′,fj)}j, ∑jqj=1 and
fj∈[[B⊸A]]. Let
fj(bi,ei)={(hijk,bijk′′,gijk)}k. Then,
[[rs]]θ={(piqjhijk,bijk′′,gijk)}ijk. By
Lemma 1, we have P(b,B), so by definition of
[[B⊸A]], we have {gijk}=trd(fj(bi,ei))⊆[[A]] and w(fj(bi,ei))=1. Notice that
∑ijkpiqjhijk=∑ipi∑jqj∑khijk=1.
•
Let t=ρn. Then A=n and [[ρn]]θ={(1,ε,ρn)}.
Notice that ρn∈Dn=[[A]].
•
Let t=Umr. Then A=n and Γ⊢r:n. By the induction
hypothesis, [[r]]θ={(pi,bi,ρin)}i, with ∑ipi=1 and
ρin∈Dn. Then, UmρnUm†∈Dn=[[A]], and
[[Umr]]θ={(pi,ε,UmρnUm†)}.
•
Let t=πmr. Then A=(m,n) and Γ⊢r:n. By the induction
hypothesis, [[r]]θ={(pi,bi,ρin)}i, with ∑ipi=1 and
ρin∈Dn. Let πm={πj}j, and
qij=tr(πj†πjρin). So,∑jqij=1.
Let
ρijn=qijπjρinπj†∈Dn=[[(m,n)]].
Then, we have [[πmr]]θ={(piqij,j,ρijn)}ij. Notice that
∑ijpiqij=∑ipi∑jqij=1.
•
Let t=r⊗s. Then A=n+m and Γ=Γ1,Γ2, with
Γ1⊢r:n and Γ2⊢s:m. Since θ⊨Γ, we
have θ⊨Γ1 and θ⊨Γ2. Then, by the induction
hypothesis, [[r]]θ={(pi,bi,ρin)}i, with ∑ipi=1 and
ρin∈Dn. Similarly, [[s]]θ={(qj,bj′,ρjm)}j, with ∑jqj=1 and ρjm∈Dm. Hence, [[r⊗s]]θ={(piqj,ε,ρin⊗ρjm)}ij. Notice that
ρin⊗ρjm∈Dn+m, and
∑ijpiqj=∑ipi∑jqj=1.
•
Let t=(bm,ρn). Then A=(m,n) and
[[(bm,ρn)]]θ={(1,bm,ρn)}, with ρn∈Dn=[[A]].
•
Let t=letcasex=rin{s0,…,s2m−1}. Then, x:n⊢sk:A, for
k=0,…,2m−1, and Γ⊢r:(m,n). Hence, by the induction
hypothesis, [[r]]θ={(pi,bi,ρin)}i with ρin∈Dn and
∑ipi=1. By Lemma 1, bi=ε, so
θ,x=(ε,ρin)⊨x:n and hence, by the induction
hypothesis,
[[sbi]]θ,x=(ε,ρin)={(qij,bij′,eij)}j,
with ∑jqij=1 and eij∈[[A]]. Hence, [[letcasex=rin{s0,…,s2m−1}]]θ={(piqij,bij′,eij)}ij. Notice that
i ∑ijpiqij=∑ipi∑jqij=1. ∎
We need the next four lemmas and the corollary as auxiliary results.
Lemma 10
If Γ⊢t:A⊸B and θ⊨Γ, then we have \llparenthesist\rrparenthesisθ=∑ipi((b,e)↦\llparenthesisri\rrparenthesisθ,x=(b,e)). ∎
Lemma 11
If \llparenthesist\rrparenthesisθ=∑ipi((b,e)↦\llparenthesisri\rrparenthesisθ′,x=(b,e)) and [[s]]θ={(qj,bj,ej)}j, then we have
\llparenthesists\rrparenthesisθ=∑ijpiqj\llparenthesisri\rrparenthesisθ′,x=(bj,ej) ∎
Corollary 1
If \llparenthesist\rrparenthesisθ=∑ipi((b,e)↦\llparenthesisri\rrparenthesisθ′,x=(b,e)) and \llparenthesiss\rrparenthesisθ=∑jqjej, then
\llparenthesists\rrparenthesisθ=∑ijpiqj\llparenthesisri\rrparenthesisθ′,x=(ε,ej) ∎
Lemma 12
If Γ⊢t:n and θ⊨Γ, then
\llparenthesisUmt\rrparenthesisθ=Um\llparenthesist\rrparenthesisθUm† and
\llparenthesisπmt\rrparenthesisθ=∑iπi\llparenthesist\rrparenthesisθπi†. ∎
Lemma 13
If Γ⊢t:n, Δ⊢r:m and θ⊨Γ,Δ,
then \llparenthesist⊗r\rrparenthesisθ=\llparenthesist\rrparenthesisθ⊗\llparenthesisr\rrparenthesisθ. ∎
We proceed by induction on t, however, we enforce the hypothesis by also
showing that if [[t]]θ,x=(bi,ei)={(qij,bij′,ρij)}j,
then [[t[r/x]]]θ={(piqij,bij′,ρij)}ij.
•
Let t=x. \llparenthesisx[r/x]\rrparenthesisθ=\llparenthesisr\rrparenthesisθ=∑ipi[ei]=∑ipi\llparenthesisx\rrparenthesisθ,x=(bi,ei).
Notice that [[x]]θ,x=(bi,ei)={(1,bi,ei)} and [[r]]θ={(pi,bi,ei)}i.
•
Let t=y. Let θ(y)=(b′,f). Then, \llparenthesisy[r/x]\rrparenthesisθ=\llparenthesisy\rrparenthesisθ=f=\llparenthesisy\rrparenthesisθ,x=(bi,ei)=∑ipi\llparenthesisy\rrparenthesisθ,x=(bi,ei).
Notice that [[y]]θ,x=(bi,ei)={(1,b′,f)}={(pi,b′,f′)}i=[[y[r/x]]]θ.
•
Let t=λy.s. Then, using the induction hypothesis, we have
\llparenthesis(λy.s)[r/x]\rrparenthesisθ=\llparenthesisλy.s[r/x]\rrparenthesisθ=(b,e)↦\llparenthesiss[r/x]\rrparenthesisθ,y=(b,e)=(b,e)↦∑ipi\llparenthesiss\rrparenthesisθ,y=(b,e),x=(bi,ei)=∑ipi((b,e)↦\llparenthesiss\rrparenthesisθ,y=(b,e),x=(bi,ei))=∑ipi\llparenthesisλy.s\rrparenthesisθ,x=(bi,ei). Notice that λy.s
cannot have type n or (m,n).
•
Let t=s1s2
–
Let x∈FV(s1). By Lemma 10, we have
\llparenthesiss1\rrparenthesisθ,x=(bi,ei)=∑jqij((b,e)↦\llparenthesissij′\rrparenthesisθ,x=(bi,ei),y=(b,e)).
Then, by the induction hypothesis, \llparenthesiss1[r/x]\rrparenthesisθ=∑ipi\llparenthesiss1\rrparenthesisθ,x=(bi,ei)=∑ijpiqij((b,e)↦\llparenthesissij′\rrparenthesisθ,x=(bi,ei),y=(b,e)). Let [[s2]]θ={(hk,bk′,fk)}k. Hence, by Lemma 11, we have that
\llparenthesiss1[r/x]s2\rrparenthesisθ=∑ijkpiqijhk\llparenthesissij′\rrparenthesisθ,x=(bi,ei),y=(bk′,fk).
Since x∈/FV(s2), we also have that
[[s2]]θ,x=(bi,ei)=[[s2]]θ, so, also by
Lemma 11, we have
\llparenthesiss1s2\rrparenthesisθ,x=(bi,ei)=∑jkqijhk\llparenthesissij′\rrparenthesisθ,x=(bi,ei),y=(bk′,fk).
Therefore, we have
\llparenthesis(s1s2)[r/x]\rrparenthesisθ=∑ipi\llparenthesiss1s2\rrparenthesisθ,x=(bi,ei). Since
sij′ is smaller than s1, the induction hypothesis applies, and so,
if [[sij′]]θ,x=(bi,ei),y=(bk′,fk))={(qij,bij′,ρij)}j, then
[[sij′[r/x]]]θ,y=(bk′,fk)={(piqij,bij′,ρij)}ij.
–
Let x∈FV(ss). By Lemma 10, we have
\llparenthesiss1\rrparenthesisθ,x=(bi,ei)=∑jqj(b,e)↦\llparenthesissij′\rrparenthesisθ,x=(bi,ei),y=(b,e).
By Corollary 1, we have that
\llparenthesiss1s2\rrparenthesisθ,x=(bi,ei)=∑jqj\llparenthesissij′\rrparenthesisθ,x=(bi,ei),y=(ε,\llparenthesiss2\rrparenthesisθ,x=(bi,ei)). By the
induction hypothesis, we have
\llparenthesiss2[r/x]\rrparenthesisθ=∑ipi\llparenthesiss2\rrparenthesisθ,x=(bi,ei). Since x∈/FV(s2[r/x]), we have
\llparenthesiss2[r/x]\rrparenthesisθ=\llparenthesiss2[r/x]\rrparenthesisθ,x=(bi,ei). Therefore, by
Corollary 1, we have
\llparenthesiss1s2[r/x]\rrparenthesisθ,x=(bi,ei)=∑ijpiqj\llparenthesissij′\rrparenthesisθ,x=(bi,ei),y=(ε,\llparenthesiss2\rrparenthesisθ,x=(bi,ei))
=∑ipi\llparenthesiss1s2\rrparenthesisθ,x=(bi,ei). Since sij′ is smaller
than s1, the induction hypothesis applies, and therefore, if
[[sij′]]θ,x=(bi,ei),y=(ε,\llparenthesiss2\rrparenthesisθ,x=(bi,ei))={(qij,bij′,ρij)}j,
then
[[sij′[r/x]]]θ,y=(ε,\llparenthesiss2\rrparenthesisθ,x=(bi,ei))={(piqij,bij′,ρij)}ij.
•
Let t=ρn.
\llparenthesisρn[r/x]\rrparenthesisθ=\llparenthesisρn\rrparenthesisθ=ρn=\llparenthesisρn\rrparenthesisθ,x=(bi,ei)=∑ipi\llparenthesisρn\rrparenthesisθ,x=(bi,ei).
In addition,
[[ρn]]θ,x=(bi,ei)={(1,ε,ρn)}={(pi,ε,ρn)}i=[[ρn[r/x]]]θ.
•
Let t=Ums. By the induction hypothesis,
\llparenthesiss[r/x]\rrparenthesisθ=∑ipi\llparenthesiss\rrparenthesisθ,x=(bi,ei). By
Lemma 12, \llparenthesisUms[r/x]\rrparenthesisθ=Um\llparenthesiss[r/x]\rrparenthesisθUm†=Um∑ipi\llparenthesiss\rrparenthesisθ,x=(bi,ei)Um†=∑ipiUm\llparenthesiss\rrparenthesisθ,x=(bi,ei)Um†=∑ipi\llparenthesisUms\rrparenthesisθ,x=(bi,ei). Let
[[s]]θ,x=(bi,ei)={(qij,bij,ρij)}j, then
[[Ums]]θ,x=(bi,ei)={(qij,ε,UmρijUm)}j.
In addition, by the induction hypothesis, we have
[[s[r/x]]]θ={(piqij,bij,ρij)}ij, therefore
[[(Ums)[r/x]]]θ=[[Ums[r/x]]]θ={(piqij,ε,UmρijUm)}ij.
•
Let t=πms. By the induction hypothesis,
\llparenthesiss[r/x]\rrparenthesisθ=∑ipi\llparenthesiss\rrparenthesisθ,x=(bi,ei). By
Lemma 12, \llparenthesisπms[r/x]\rrparenthesisθ=∑jπj\llparenthesiss[r/x]\rrparenthesisθπj†=∑jπj∑jpi\llparenthesiss\rrparenthesisθ,x=(bi,ei)πj†=∑ipi∑jπj\llparenthesiss\rrparenthesisθ,x=(bi,ei)πj†=∑ipi\llparenthesisπms\rrparenthesisθ,x=(bi,ei). Let
[[s]]θ,x=(bi,ei)={(qij,bij,ρij)}j, then
[[πms]]θ,x=(bi,ei)={(qijtr(πk†πkρij),k,tr(πk†πkρij)πkρijπk)}jk.
By the induction hypothesis,
[[s[r/x]]]θ={(piqij,bij,ρij)}ij, therefore, we have
[[(πms)[r/x]]]θ=[[πms[r/x]]]θ={(piqijtr(πk†πkρij),k,tr(πk†πkρij)πkρijπk)}ijk.
•
Let t=s1⊗s2, with x∈FV(s1). By the induction hypothesis,
\llparenthesiss1[r/x]\rrparenthesisθ=∑ipi\llparenthesiss1\rrparenthesisθ,x=(bi,ei), and notice that,
since x∈/FV(s2), we have \llparenthesiss2\rrparenthesisθ=\llparenthesiss2\rrparenthesisθ,x=(bi,ei).
Therefore, by Lemma 13, \llparenthesiss1[r/x]⊗s2\rrparenthesisθ=\llparenthesiss1[r/x]\rrparenthesisθ⊗\llparenthesiss2\rrparenthesisθ=(∑ipi\llparenthesiss1\rrparenthesisθ,x=(bi,ei))⊗\llparenthesiss2\rrparenthesisθ,x=(bi,ei)=∑ipi\llparenthesiss1\rrparenthesisθ,x=(bi,ei)⊗\llparenthesiss2\rrparenthesisθ,x=(bi,ei)=∑ipi\llparenthesiss1⊗s2\rrparenthesisθ,x=(bi,ei), where the last step
is due to Lemma 13 as well. Note that if
[[s1]]θ,x=(bi,ei)={(qij,bij,ρij)}j, and
[[s2]]θ,x=(bi,ei)={(hk,bk′,ρk′)}k, we have
[[s1⊗si]]θ,x=(bi,ei)={(qijhk,ε,ρij⊗ρk′)}kj. By the induction
hypothesis [[s1[r/x]]]θ={(piqij,bij,ρij)}ij, and so
[[(s1⊗s2)[r/x]]]θ=[[s1[r/x]⊗s2]]θ={(piqijhk,ε,ρij⊗ρk′)}ijk.
•
Let t=(bm,ρn).
\llparenthesis(bm,ρn)[r/x]\rrparenthesisθ=\llparenthesis(bm,ρn)\rrparenthesisθ=ρn=\llparenthesis(bm,ρn)\rrparenthesisθ,x=(bi,ei)=∑ipi\llparenthesis(bm,ρn)\rrparenthesisθ,x=(bi,ei). Moreover,
[[(bm,ρn)]]θ,x=(bi,ei)={(1,bm,ρn)}={(pi,bm,ρn)}i=[[(bm,ρn[r/x])]]θ=[[(bm,ρn)[r/x]]]θ.
•
Let t=letcasey=sin{t0,…,t2m−1}. Let [[s]]θ,x=(bi,ei)={(qij,bij′,ρij)}j. Then, by the induction hypothesis,
[[s[r/x]]]θ={piqij,bij′,ρij}ij. Let, forall i and
j, [[tbij′]]θ,x=(bi,ei),y=(ε,ρij)={(hijk,bijk′′,fijk)}k. Hence, we have that [[letcasey=sin{t0,…,t2m−1}]]θ,x=(bi,ei)={(qijhijk,bijk′′,fijk}jk and also [[letcasey=s[r/x]in{t0,…,t2m−1}]]θ={(piqijhijk,bijk′′,fijk)}ijk. Therefore, we have
\llparenthesisletcasey=s[r/x]in{t0,…,t2m−1}\rrparenthesisθ=∑ipi\llparenthesisletcasey=sin{t0,…,t2m−1}\rrparenthesisθ,x=(bi,ei) ∎
(λx.t)r⟶1t[r/x]. We have [[λx.t]]θ={1,ε,(b,e)↦[[t]]θ,x=(b,e))}. By
Lemma 2, we have [[r]]θ={(pi,bi,ei)}i with ∑ipi=1, and [[t]]θ,x=(bi,ei)={(qij,bij′,gij)}j.
Therefore, we have that [[(λx.t)r]]θ={(piqij,bij′,gij)}ij, and \llparenthesis(λx.t)r\rrparenthesisθ=∑ijpiqijgij which, by Lemma 3,
is equal to \llparenthesist[r/x]\rrparenthesisθ.
•
letcasex=(bm,ρn)in{t0,…,t2m−1}⟶1tbm[ρn/x].
Then, we have that [[letcasex=(bm,ρn)in{t0,…,t2m−1}]]θ=[[tbm]]θ,x=(ε,ρn). Therefore, we have that
\llparenthesisletcasex=(bm,ρn)in{t0,…,t2m−1}\rrparenthesisθ=\llparenthesistbm\rrparenthesisθ,x=(ε,ρn). Since
[[ρn]]θ={(1,ε,ρn)}, we have, by
Lemma 3,
\llparenthesistbm\rrparenthesisθ,x=(ε,ρn)=\llparenthesistbm[ρn/x]\rrparenthesisθ.
•
Umρn⟶1ρ′n, with ρ′n=UmρnUm†.
Then [[Umρn]]θ={(1,ε,UmρnUm†)}=[[ρ′n]]θ, so \llparenthesisUmρn\rrparenthesisθ=ρ′n=\llparenthesisρ′n\rrparenthesisθ.
•
πnρn⟶pi(im,ρin), with
pi=tr(πi†πiρn) and
ρin=piπiρnπi†. We have
[[πmρn]]θ={(pi,i,ρin)}i. Hence,
\llparenthesisπmρn\rrparenthesisθ=∑ipiρin=∑ipi\llparenthesisρin\rrparenthesisθ.
•
ρ1⊗ρ2⟶1ρ, with ρ=ρ1⊗ρ2. We have
[[ρ1⊗ρ2]]θ={(1,ε,ρ)}, so
\llparenthesisρ1⊗ρ2\rrparenthesisθ=ρ=\llparenthesisρ\rrparenthesisθ.
•
Contextual cases: Let s⟶pisi. Then
–
λx.s⟶piλx.si. By the induction hypothesis,
\llparenthesiss\rrparenthesisθ′=∑ipi\llparenthesissi\rrparenthesisθ′, for all
θ′⊨Γ,x:A. Then, \llparenthesisλx.s\rrparenthesisθ=(b,e)↦\llparenthesiss\rrparenthesisθ,x=(b,e)=(b,e)↦∑ipi\llparenthesissi\rrparenthesisθ,x=(b,e)=∑ipi((b,e)↦\llparenthesissi\rrparenthesisθ,x=(b,e))=∑ipi\llparenthesisλx.si\rrparenthesisθ.
–
ts⟶pitsi. By the induction hypothesis, \llparenthesiss\rrparenthesisθ=∑ipi\llparenthesissi\rrparenthesisθ. Then, we have
[[ts]]θ={(piqjhijk,bijk′′,gijk)}ijk, with [[s]]θ={(pi,bi,ei)}i, [[t]]θ={(qj,bj′,fj)}j, and
fj(bi,ei)={(hijk,bijk′′,gijk)}k. Hence,
\llparenthesists\rrparenthesisθ=∑ijkpiqjhijkgijk=∑ipi(∑jkqjhijkgijk)=∑ipi\llparenthesistsi\rrparenthesisθ
–
st⟶pisit. By the induction hypothesis, \llparenthesiss\rrparenthesisθ=∑ipi\llparenthesissi\rrparenthesisθ. Then, we have
[[st]]θ={(qjpihjik,bjik′′,gjik)}jik, with [[t]]θ={(qj,bj′,fj)}j, [[s]]θ={(pi,bi,ei)}i, and
ei(bj,fj)={(hjik,bjik′′,gjik)}k. Hence,
\llparenthesisst\rrparenthesisθ=∑jikqjpihjikgjik=∑ipi(∑jkqjhijkgijk)=∑ipi\llparenthesissit\rrparenthesisθ
–
Ums⟶piUmsi. By the induction hypothesis, \llparenthesiss\rrparenthesisθ=∑ipi\llparenthesissi\rrparenthesisθ. By Lemma 12, we have \llparenthesisUms\rrparenthesisθ=Um∑ipi\llparenthesissi\rrparenthesisθUm†=∑ipiUm\llparenthesissi\rrparenthesisθUm†=∑ipi\llparenthesisUmsi\rrparenthesisθ.
–
πms⟶pir=πmsi. By the induction hypothesis, \llparenthesiss\rrparenthesisθ=∑ipi\llparenthesissi\rrparenthesisθ. By Lemma 12, we have \llparenthesisπms\rrparenthesisθ=πj∑ipi\llparenthesissi\rrparenthesisθπj†=∑ipiπj\llparenthesissi\rrparenthesisθπj†=∑ipi\llparenthesisπmsi\rrparenthesisθ.
–
t⊗s⟶pir=t⊗si. By the induction hypothesis,
\llparenthesiss\rrparenthesisθ=∑ipi\llparenthesissi\rrparenthesisθ. By Lemma 13,
\llparenthesist⊗s\rrparenthesisθ=\llparenthesist\rrparenthesisθ⊗\llparenthesiss\rrparenthesisθ=\llparenthesist\rrparenthesisθ⊗(∑ipi\llparenthesissi\rrparenthesisθ)=∑ipi\llparenthesist\rrparenthesisθ⊗\llparenthesissi\rrparenthesisθ=∑ipi\llparenthesist⊗si\rrparenthesisθ.
–
s⊗t⟶pir=si⊗t. Analogous to previous case.
–
letcasex=sin{t0,…,t2m−1}⟶piletcasex=siin{t0,…,t2m−1}. By the induction hypothesis, we have that
\llparenthesiss\rrparenthesisθ=∑ipi\llparenthesissi\rrparenthesisθ. Let [[s]]θ={(pi,bi,ρi)}i and
[[tbi]]θ,x=(ε,ρi)={(qij,bij′,eij)}j,
then, \llparenthesisletcasex=sin{t0,…,t2m−1}\rrparenthesisθ=∑ijpiqijeij=∑ipi(∑jqijeij)
Notice that ∑jqijeij=\llparenthesisletcasex=siin{t0,…,t2m−1}\rrparenthesisθ. ∎
By induction on the relation ⇝. Rules (λx.t)r⇝t[r/x],
Umρn⇝ρ′ and ρ⊗ρ′⇝ρ′′ are also valid rules for
relation ⟶1, and hence the proof of these cases are the same than in
Theorem 2.1.
Remaining cases:
•
letcase∘x=πmρnin{t0,…,t2m−1}⇝∑ipiti[ρ′/x], with pi=tr(πi†πiρn) and
ρ′=piπiρnπi†. Since the
interpretation of letcase∘ coincides with the interpretation
of letcase, and letcasex=πmρnin{t0,…,t2m−1}⟶piti[ρ′/x], we can conclude by Theorem 2.1, and
Lemma 4 that \llparenthesisletcase∘x=πmρnin{t0,…,t2m−1}\rrparenthesisθ=∑ipi\llparenthesisti[ρ′/x]\rrparenthesisθ=\llparenthesis∑ipiti[ρ′/x]\rrparenthesisθ.
•
∑ipiρi⇝ρ′, with ρ′=∑ipiρi.
\llparenthesis∑ipiρi\rrparenthesisθ=∑ipiρi=\llparenthesisρ′\rrparenthesisθ.
•
∑ipit⇝t. Let [[t]]θ={(qj,bj,ej)}j. Then,
[[∑ipit]]θ={(piqj,bj,ej)}ij and so,
\llparenthesis∑ipit\rrparenthesisθ=∑ijpiqjej=(∑ipi)∑jqjej=∑jqjej=\llparenthesist\rrparenthesisθ.
•
(∑ipiti)r⇝∑ipi(tir). Let
[[ti]]θ={(qij,bij,fij)}j, [[r]]θ={(hk,bk′,ek)}k, and
fij(bk′,ek)={(ℓijkh,bijkh′′,gijkh)}h. Then, we have that
[[tir]]θ is equal to
{(qijhkℓijkh,bijkh′′,gijkh)}jkh, and
\llparenthesis∑ipi(tir)\rrparenthesisθ=∑jkhpiqijhkℓijkhgijkh. On the
other hand, [[∑ipiti]]θ={(piqij,bij,fij)}ij, and so
[[(∑ipiti)r]]θ={(piqijhkℓijkh,bijkh′′,gijkh)}ijkh.
Hence,
\llparenthesis(∑ipiti)r\rrparenthesisθ=∑jkhpiqijhkℓijkhgijkh=\llparenthesis∑ipi(tir)\rrparenthesisθ.
•
Contextual cases: Only two cases need to be checked. All the other cases
are analogous to those of the proof of Theorem 2.1.
–
Let ∑ipiti⇝∑ipiri, where tj⇝rj and ∀i=j, ti=ri. By the induction hypothesis, \llparenthesistj\rrparenthesisθ=\llparenthesisrj\rrparenthesisθ.
Hence, using Lemma 4,
\llparenthesis∑ipiti\rrparenthesisθ=∑ipi\llparenthesisti\rrparenthesisθ=∑ipi\llparenthesisri\rrparenthesisθ=\llparenthesis∑ipiri\rrparenthesisθ.
–
Let letcase∘x=tin{s0,…,sn}⇝letcase∘x=rin{s0,…,sn},
where t⇝r. Let [[t]]θ={(pi,bi,ρi)}i and
[[sbi]]θ,x=(ε,ρi)={(qij,bij′,eij)}j,
then \llparenthesisletcase∘x=tin{s0,…,s2m−1}\rrparenthesisθ=∑ijpiqijeij.
On the other hand, let [[r]]θ={(hk,bk′′,ρk′)}k. By the induction
hypothesis, ∑khkρk′=∑ipiρi. We conclude by inversion
that hi=pi and ρi′=ρi, which prove the case. ∎
By induction on t. The only difference between λρ and λρ∘
are in terms (bm,ρn), which is not present in λρ∘, and
∑ipiti, which is not present in λρ. Hence, we can prove both
calculi at the same time. We use ⊢ generically to refer also to ⊩
where it is also valid.
•
Let t=x. Then B=A. By Lemma 6, Γ,Δ⊢r:A.
Notice that t[r/x]=r.
•
Let t=y. Then, by Lemmas 6 and 7,
Γ,Δ⊢y:B. Notice that t[r/x]=y.
•
Let t=λy.s. Then B=C⊸D and, by inversion,
Γ,x:A,y:C⊢s:D. Then, by the induction hypothesis,
Γ,y:C,Δ⊢s[r/x]:D, so, by rule ⊸i,
Γ,Δ⊢λy.(s[r/x]):C⊸D. Notice that λy.(s[r/x])=(λy.s)[r/x].
•
Let t=t1t2. Then Γ,x:A=Γ1,Γ2, with Γ1⊢t1:C⊸B and Γ2⊢t2:C.
–
If x:A∈Γ1, then, by the induction hypothesis
Γ1∖{x:A},Δ⊢t1[r/x]:C⊸B, so by rule
⊸e, Γ1∖{x:A},Γ2,Δ⊢t1[r/x]t2:B. Notice that Γ1∖{x:A},Γ2=Γ and
t1[r/x]t2=(t1t2)[r/x].
–
If x:A∈Γ2, then, by the induction hypothesis
Γ2∖{x:A},Δ⊢t2[r/x]:C, so by rule
⊸e, Γ1,Γ2∖{x:A},Δ⊢t1(t2[r/x]):B. Notice that Γ1,Γ2∖{x:A}=Γ and
t1(t2[r/x])=(t1t2)[r/x].
•
Let t=ρn. Then B=n. By Lemmas 6 and 7,
Γ,Δ⊢ρn:n. Notice that t[r/x]=ρn.
•
Let t=Ums. Then B=n and Γ,x:A⊢s:n. Then, by the
induction hypothesis, Γ,Δ⊢s[r/x]:n. So, by rule u,
Γ,Δ⊢Um(s[r/x]):n. Notice that Um(s[r/x])=(Ums)[r/x].
•
Let t=πms. Then B=(m,n) and Γ,x:A⊢s:n. Then, by the
induction hypothesis, Γ,Δ⊢s[r/x]:n. So, by rule m,
Γ,Δ⊢πm(s[r/x]):(m,n). Notice that
πm(s[r/x])=(πms)[r/x].
•
Let t=t1⊗t2. Then B=n1+n2, Γ,x:A=Γ1,Γ1
with Γi⊢ti:ni for i=1,2. Let x:A∈Γi for some
i=1,2. Then, by the induction hypothesis,
Γi∖{x:A},Δ⊢ti[r/x], so by rule ⊗, either
Γ,Δ⊢t1[r/x]⊗t2:n1+n2, or Γ,Δ⊢t1⊗t2[r/x]:n1+n2. In the first case, notice that t1[r/x]⊗t2=(t1⊗t2)[r/x], and in the second, t1⊗t2[r/x]=(t1⊗t2)[r/x].
•
Let t=(bm,ρn). Then B=(m,n). By Lemmas 6
and 7, Γ,Δ⊢(bm,ρn):(m,n). Notice that
t[r/x]=(bm,ρn).
•
Let t=∑ipiti. Then Γ,x:A⊩ti:B and so, by the
induction hypothesis, Γ,Δ⊩ti[r/x]:B. Therefore, by rule
+, Γ,Δ⊩∑ipiti[r/x]:B.
•
Let t=letcasey=sin{t0,…,t2m−1}. y:n⊢ti:B, for
i=0,…,2m−1, and, Γ⊢s:(m,n). By the induction hypothesis,
Γ,Δ⊢s[r/x]:(m,n). So, by rule lc,
Γ,Δ⊢letcasey=s[r/x]in{t0,…,t2m−1}:B. Notice
that letcasey=s[r/x]in{t0,…,t2m−1}=(letcasey=sin{t0,…,t2m−1})[r/x].∎
Let t=(λx.t′)s, r=t′[r/s] and p=1. Then
Γ⊢(λx.t′)s:A, so, Γ1⊢λx.t′:B⊸A and Γ2⊢s:B, with Γ=Γ1,Γ2. Hence,
Γ1,x:B⊢t′:A, and so, by Lemma 8,
Γ⊢t′[s/x]:A.
•
Let t=letcasex=(bm,ρn)in{t0,…,t2m−1},
r=tbm[ρn/x] and p=1. Then, by inversion, x:n′⊢ti:A, for
i=0,…,2m−1, and Γ⊢(bm,ρn):(m′,n′). So, by inversion again, m′=m and n′=n. By rule axρ,
Γ⊢ρn:n. Hence, by Lemma 8,
Γ⊢tbm[ρn/x]:A.
•
Let t=Umρn, r=ρ′n and p=1, with
ρ′n=UmρnUm†. Then A=n. By rule
axρ, Γ⊢ρ′n:n.
•
Let t=πmρn, r=(im,ρin), with
ρin=pπiρnπi† and
p=tr(π1†πiρn). Then B=(m,n). By rule
m, Γ⊢(im,ρin):(m,n).
•
Let t=ρ1n⊗ρ2m and r=ρ, with
ρ=ρ1n⊗ρ2m. Then, A=n+m, with ⊢ρ1n:n and
⊢ρ2m:m. Since ρ is a density matrix of (n+m)-qubits,
⊢ρ:n+m.
•
Contextual cases: Let s⟶ps′, then
–
Consider t=λx.s and r=λx.s′. Then A=B⊸C
and Γ,x:B⊢s:C. So, by the induction hypothesis,
Γ,x:B⊢s′:C and by rule ⊸i, Γ⊢λx.s′:B⊸C.
–
Consider t=t′s and r=t′s′. Then Γ=Γ1,Γ2, with
Γ1⊢t′:B⊸A and Γ2⊢s:B. By the
induction hypothesis, Γ2⊢s′:B, so by rule ⊸e,
Γ⊢t′s′:A.
–
Consider t=st′ and r=s′t′. Then Γ=Γ1,Γ2, with
Γ1⊢s:B⊸A and Γ2⊢t′:B. By the
induction hypothesis, Γ1⊢s′:B⊸A, so by rule
⊸e, Γ⊢s′t′:A.
–
Consider t=Ums and r=Ums′. Then A=n and Γ⊢s:n. By
the induction hypothesis Γ⊢s′:n, so by rule u,
Γ⊢Ums′:n.
–
Consider t=πms and r=πms′. Then A=n and Γ⊢s:n. By the induction hypothesis Γ⊢s′:n, so by rule
m, Γ⊢πms′:n.
–
Consider t=t′⊗s and r=t′⊗s′. Then A=n+m and
Γ=Γ1,Γ2, with Γ1⊢t′:n and Γ2⊢s:m. By the induction hypothesis Γ2⊢s′:m, so by rule
⊗, Γ⊢t′⊗s′:n+m.
–
Consider t=s⊗t′ and r=s′⊗t′. Then A=n+m and
Γ=Γ1,Γ2, with Γ1⊢s:n and Γ2⊢t′:m. By the induction hypothesis Γ2⊢s′:m, so by rule
⊗, Γ⊢t′⊗s′:n+m.
–
Consider t=letcasex=sin{t0,…,t2m−1} and r=letcasex=s′in{t0,…,t2m−1}. Then x:n⊢ti:A for i=0,…,2m−1,
and Γ⊢s:(m,n). So, by the induction hypothesis, Γ⊢s′:(m,n) and by rule lc, Γ⊢letcasex=s′in{t0,…,t2m−1}:A.∎
2. 2.
•
Let t=(λx.t′)s and r=t′[s/x]. Analogous to the same rule in
λρ.
•
Let t=letcase∘x=πmρnin{t0,…,t2m−1} and r=∑ipiti[ρin/x], with
ρin=piπiρnπi† and
pi=tr(πi†πiρn). Then
Γ⊩πmρn:(m,n) and x:n⊩ti:A. By
Lemma 8, Γ⊩ti[ρin/x]:A, then, by
rule +, Γ⊩∑ipiti[ρin/x]:A.
•
Let t=Umρn and r=ρ′n, with
UmρnUm†=ρ′n. Analogous to the same rule in
λρ.
•
Let t=ρ1n⊗ρ2m and r=ρ, with
ρ=ρ1n⊗ρ2m. Analogous to the same rule in λρ.
•
Let t=∑ipiρi and r=ρ′, with ρ′=∑ipiρi.
Then, Γ⊩∑ipiρi:n, and by rule axρ,
Γ⊩ρ′:n.
•
Let t=∑ipir. Then, Γ⊩r:A.
•
Let t=(∑ipiti)r and ∑ipi(tir). Then,
Γ=Γ1,Γ2, Γ1⊩ti:B⊸A and
Γ2⊩r:B. Therefore, by rule ⊸e,
Γ1,Γ2⊩tir:A, and by rule +,
Γ1,Γ2⊩∑ipi(tir):A.
•
Contextual cases. All the contextual cases are analogous to the same
rules in λρ, except for the contextual rule of ∑: Consider
t=∑ipiti and r=∑ipiri, with tj⇝rj, and ∀i=j, ti=ri. By inversion, Γ⊩ti:A. By the induction
hypothesis, ∀i, Γ⊩ri:A. Then, by rule +,
Γ⊩∑ipiri. ∎
Let v=x. Then we are done, since variables do not rewrite.
•
Let v=λx.v′. By the induction hypothesis, v′ does not
rewrite, and so v neither does.
•
Let v=w1⊗w2. By the induction hypothesis, nor w1 nor w2
rewrite, and the only rule rewriting a ⊗ in head position needs both
w1 and w2 to be density matrices, which are not according to the
grammar.
•
Let v=ρn. Then we are done, since density matrices are constants
and do not rewrite.
•
Let v=(bm,ρn). Then we are done, since pairs are constants and do
not rewrite.
2. 2.
We proceed by induction on v. The only difference with the previous case
is that the last term is not present, and a new term is introduced. Hence, let
v=∑ipiwi. The only possible rewrite would be if there were some
wi=wj, which is explicitly excluded from the grammar. So, this term does
not rewrite ∎
We relax the hypotheses and prove the theorem for open terms as well. That is:
If Γ⊢t:A, then either t is a value, there exist n,
p1,…,pn, and r1,…,rn such that t⟶piri, or t
contains a free variable, and t does not rewrite.
2. 2.
If Γ⊩t:A, then either t is a value∘, there exists r such
that t⇝r, or t contains a free variable, and t does not rewrite.
The proofs proceeds as follows.
We proceed by induction on the derivation of ⊢t:A.
•
Let Γ,x:A⊢x:A as a consequence of rule ax. Then,
we are done since x is a free variable and does not rewrite.
•
Let Γ⊢λx.t:A⊸B as a consequence of
Γ,x:A⊢t:B and rule ⊸i. Then, by the induction
hypothesis, either
–
t is not a value and there exist n, p1,…,pn and
r1,…,rn such that t⟶piri, which case λx.t⟶piλx.ri;
–
t is a value, in which case λx.t is a value as well; or
–
t contains a free variable, and t does not rewrite, in which case
the same happens to λx.t.
•
Let Γ,Δ⊢tr:B as a consequence of Γ⊢t:A⊸B, Δ⊢r:A and rule ⊸e. Then, by the
induction hypothesis, one of the following cases happens:
–
There exist n, p1,…,pn, and t1,…,tn such that
t⟶piti, in which case tr⟶pitir.
–
There exist n, p1,…,pn and r1,…,rn such that
r⟶piri, in which case tr⟶pitri.
–
t is a value and r does not rewrite. The only values which can be
typed by A⊸B are:
t=x, in which case xr contains a free variable and does not
rewrite.
*
t=λx.v, in which case (λx.v)r⟶1v[r/x].
–
t is not a value, contains a free variable, and does not rewrite,
and r does not rewrite, in which case tr contains a free variable and
does not rewrite.
•
Let Γ⊢ρn:n as a consequence of rule axρ.
Then, we are done since ρn is a value.
•
Let Γ⊢Umt:n as a consequence of Γ⊢t:n and
rule u. Then, by the induction hypothesis, one of the following
cases happens:
–
t is a value. The only values which can be typed by n are:
t=x, in which case Umx contains a free variable and does not
rewrite.
*
t=⨂xi, in which case Um⨂xi contains free
variables and does not rewrite.
*
t=ρn, in which case Umρn⟶1ρ′, with
ρ′=UmρnUm†.
–
There exist n, p1,…,pn and t1,…,tn such that
t⟶piti, in which case Umt⟶piti;
–
t contains a free variable and does not rewrite, in which case the
same is true for Umt.
•
Let Γ⊢πmt:(m,n) as a consequence of Γ⊢t:n
and rule m. Then, by the induction hypothesis, one of the
following cases happens:
–
t is a value. The only values which can be typed by n are:
t=x, in which case πmx contains a free variable and does not
rewrite.
*
t=⨂xi, in which case πm⨂xi contains
free variables and does not rewrite.
*
t=ρn, in which case πmρn⟶pi(i,ρin), with
pi=tr(πi†πiρn) and
ρin=piπiρnπi†.
–
There exist n, p1,…,pn and t1,…,tn such that
t⟶piti, in which case πmt⟶piti;
–
t contains a free variable and does not rewrite, in which case the
same is true for πmt.
•
Let Γ,Δ,⊢t⊗r:n+m as a consequence of
Γ⊢t:n, Δ⊢r:m and rule ⊗. Then, by the
induction hypothesis, one of the following happens:
–
There exist k, p1,…,pn, and t1,…,tk such that
t⟶piti, in which case t⊗r⟶piti⊗r.
–
There exist k, p1,…,pn, and r1,…,rk such that
r⟶piri, in which case t⊗r⟶pit⊗ri.
–
t is a value and r does not rewrite. The only values which can be
typed by n are:
t=x, then t⊗r contains a free variable and does not
rewrite.
*
t=⨂xi, then t⊗r contains free variables and
does not rewrite.
*
t=ρn, then:
·
If r=ρm, t⊗r⟶1ρ′, with
ρ′=ρn⊗ρm.
·
If r contains a free variable and does not rewrite, then the
same is true for t⊗r.
–
t contains a free variable and does not rewrite, and r does not
rewrite, in which case t⊗r contains a free variable and does not
rewrite.
•
Let Γ⊢(bm,ρn):(m,n) as a consequence of rule
axam. Then, we are done since (bm,ρn) is a
value.
•
Let Γ⊢letcasex=rin{t0,…,t2m−1}:A as a consequence of
x:n⊢ti:A for i=0,…,2m−1, Γ⊢r:(m,n), and rule
lc. By the induction hypothesis, the possible cases for r are:
–
r is a value. The possible values which can be typed by (m,n) are:
r=y, in which case letcasex=rin{t0,…,t2m−1} contains a
free variable and does not reduce.
*
r=(bm,ρn), in which case letcasex=rin{t0,…,t2m−1}⟶1tbm[ρn/x].
–
There exist k, p1,…,pk, and r1,…,rk such that
r⟶piri, and letcasex=rin{t0,…,t2m−1}⟶piletcasex=riin{t0,…,t2m−1}.
–
r contains a free variable and does not rewrite, in which case the
same is true for letcasex=rin{t0,…,t2m−1}.
2. 2.
We proceed by induction on the derivation of Γ⊩t:A.
•
Let Γ,x:A⊩x:A as a consequence of rule ax. Then,
we are done since x is a free variable and does not rewrite.
•
Let Γ⊩λx.t:A⊸B as a consequence of
Γ,x:A⊩t:B and rule ⊸i. Then, by the induction
hypothesis, either
–
t is not a value∘ and there exists r such that t⇝r, which
case λx.t⇝λx.r;
–
t is a value∘, in which case λx.t is a value∘ as well;
or
–
t contains a free variable, and t does not rewrite, in which case
the same happens to λx.t.
•
Let Γ,Δ⊩tr:B as a consequence of Γ⊩t:A⊸B, Δ⊩r:A and rule ⊸e. Then, by the
induction hypothesis, one of the following cases happens:
–
There exists t′ such that t⇝t′, in which case tr⇝t′r.
–
There exists r′ such that r⇝r′, in which case tr⇝tr′.
–
t is a value∘ and r does not rewrite. The only values∘ which
can be typed by A⊸B are:
t=x, in which case xr contains a free variable and does not
rewrite.
*
t=λx.v, in which case (λx.v)r⇝v[r/x].
*
t=∑ipiti, where Γ⊩ti:A⊸B. Then,
tr⇝∑ipi(tir).
–
t is not a value∘, contains a free variable, and does not rewrite,
and r does not rewrite, in which case, if t is not a sum, tr
contains a free variable and does not rewrite. If t=∑ipiti is a
sum, tr⇝∑ipi(tir).
•
Let Γ⊩ρn:n as a consequence of rule axρ.
Then, we are done since ρn is a value∘.
•
Let Γ⊩Umt:n as a consequence of Γ⊩t:n and
rule u. Then, by the induction hypothesis, one of the following
cases happens:
–
t is a value∘. Since λx.v cannot be typed by n, the only
values∘ that can be typed by n are either ρn, or they contain
free variables:
Let t=ρn, then Umρn⇝ρ′, with
ρ′=UmρnUm†.
*
Let t contain a free variable. Notice that it can only be either a
free variable by itself, a tensor of values∘ containing free
variables, or a linear combination of different values∘ containing
free variables. In any case, t contains a free variable and does not
rewrite. Hence, Umt contains a free variable and does not rewrite.
–
There exists r such that t⇝r, in which case Umt⇝r;
–
t contains a free variable and does not rewrite, in which case the
same is true for Umt.
•
Let Γ⊩πmt:(m,n) as a consequence of Γ⊩t:n
and rule m. Then, by the induction hypothesis, one of the
following cases happens:
–
t is a value∘. Since λx.v cannot be typed by n, the only
values∘ that can be typed by n are either ρn, or they contain
free variables:
Let t=ρn, then πmρn⇝ρ′, with
ρ′=∑iπiρnπi†.
*
Let t contain a free variable. Notice that it can only be either a
free variable by itself, a tensor of values∘ containing free
variables, or a linear combination of different values∘ containing
free variables. In any case, t contains a free variable and does not
rewrite. Hence, πmt contains a free variable and does not rewrite.
–
There exists r such that t⇝r, in which case πmt⇝r;
–
t contains a free variable and does not rewrite, in which case the
same is true for πmt.
•
Let Γ,Δ,⊩t⊗r:n+m as a consequence of
Γ⊩t:n, Δ⊩r:m and rule ⊗. Then, by the
induction hypothesis, one of the following happens:
–
There exists t′ such that t⇝t′, in which case t⊗r⇝t′⊗r.
–
There exists r′ such that r⇝r′, in which case t⊗r⇝t⊗r′.
–
t is a value∘ and r does not rewrite. The only values∘ that
can be typed by n are either ρn, or they contain free variables.
Let t=ρn, then:
·
If r=ρm, t⊗r⇝ρ′, with
ρ′=ρn⊗ρm.
·
If r contains a free variable and does not rewrite, then the
same is true for t⊗r.
*
Let t contain a free variable. Then t⊗r contains a free
variable and does not rewrite.
–
t contains a free variable and does not rewrite, and r does not
rewrite, in which case t⊗r contains a free variable and does not
rewrite.
•
Let Γ⊩letcase∘x=rin{t0,…,t2m−1}:A as a consequence
of x:n⊩ti:A for i=0,…,2m−1, Γ⊩r:(m,n), and rule
lc. By the induction hypothesis, the possible cases for r are:
–
r is a value∘. The only possible values∘ that can be typed by
(m,n) are variables or linear combination of variables. In any case, we
have that letcase∘x=rin{t0,…,t2m−1} contains at least a free
variable and does not rewrite.
–
There exists r′ such that r⇝r′, in which case, we have to
distinguish two cases:
r=πmρn, and therefore letcase∘x=rin{t0,…,t2m−1}⇝letcase∘x=r′in{t0,…,t2m−1}.
*
r=πmρn, and therefore letcase∘x=rin{t0,…,t2m−1}⇝∑ipiti[ρin/x], where
pi=tr(πi†πiρn) and
ρin=piπiρnπi†.
–
r contains a free variable and does not rewrite, in which case the
same is true for letcase∘x=rin{t0,…,t2m−1}.
•
Let Γ⊩∑ipiti:A as a consequence of Γ⊩ti:A, ∑ipi=1, and rule +. If ∑ipiti is a value∘, then we
are done. If it is not a value, then one of the following cases is true:
–
tj=tk for some j=k, in which case ∑ipiti⇝(∑i=j,kpiti)+(pj+pk)tj.
–
At least one ti is not a value. By the induction hypothesis, if
ti is not a value, either it rewrites, or it contains a free variable
and does not rewrite. If at least one ti rewrites, then ∑ipiti
rewrites. If none of these rewrites and at least one contains a free
variable, then ∑ipiti does not rewrite and contain a free
variable. ∎
Bibliography30
The reference list from the paper itself. Each links out to its DOI / PubMed record.
1[1] Aharonov, D., Ambainis, A., Kempe, J., Vazirani, U.: Quantum walks on graphs. In: Proceedings of the Thirty-third Annual ACM Symposium on Theory of Computing. pp. 50–59. STOC ’01, ACM (2001)
2[2] Altenkirch, T., Grattage, J.J.: A functional quantum programming language. In: Proceedings of LICS-2005. pp. 249–258. IEEE Computer Society (2005)
3[3] Ambainis, A., Bach, E., Nayak, A., Vishwanath, A., Watrous, J.: One-dimensional quantum walks. In: Proceedings of the Thirty-third Annual ACM Symposium on Theory of Computing. pp. 37–49. STOC ’01, ACM (2001)
4[4] Arrighi, P., Díaz-Caro, A.: A System F accounting for scalars. Logical Methods in Computer Science 8(1:11) (2012)
5[5] Arrighi, P., Díaz-Caro, A., Valiron, B.: The vectorial λ 𝜆 \lambda -calculus. Information and Computation 254(1), 105–139 (2017)
6[6] Arrighi, P., Dowek, G.: Lineal: A linear-algebraic lambda-calculus. Logical Methods in Computer Science 13(1:8) (2017)
7[7] Assaf, A., Díaz-Caro, A., Perdrix, S., Tasson, C., Valiron, B.: Call-by-value, call-by-name and the vectorial behaviour of the algebraic λ 𝜆 \lambda -calculus. Logical Methods in Computer Science 10(4:8) (2014)
8[8] Bǎdescu, C., Panangaden, P.: Quantum alternation: Prospects and problems. In: Heunen, C., Selinger, P., Vicary, J. (eds.) Proceedings of QPL-2015. Electronic Proceedings in Theoretical Computer Science, vol. 195, pp. 33–42 (2015)