Professional Documents
Culture Documents
MOQCUA
MOQCUA
MOQCUA
Alejandro Díaz-Caro
UNIVERSIDAD NACIONAL DE QUILMES
& CONICET / UNIVERSIDAD de BUENOS AIRES
Buenos Aires, Argentina
Γ⊢A Γ⊢B ∧ Γ ⊢ A ∧ B Γ, A ⊢ C Γ ⊢ A ∧ B Γ, B ⊢ C
i ∧e1 ∧e2
Γ⊢A∧B Γ⊢C Γ⊢C
π1 π2
Γ⊢A Γ⊢B ∧ π3
i
Γ⊢A∧B Γ, A ⊢ C
∧e1 −→ (π1 /A)π3
Γ⊢C
Example 2
Γ⊢A Γ ⊢ A tonk B Γ, B ⊢ C
tonki tonke
Γ ⊢ A tonk B Γ⊢C
π1
Γ⊢A π2
tonki
Γ ⊢ A tonk B Γ, B ⊢ C
tonke
Γ⊢C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 1 / 6: The sup connective Slide 2 / 21
Not harmony
Insufficiency [Prior 1960]
Γ⊢A Γ ⊢ A tonk B Γ, B ⊢ C
tonki tonke
Γ ⊢ A tonk B Γ⊢C
π1
Γ⊢A π2
tonki
Γ ⊢ A tonk B Γ, B ⊢ C
tonke
Γ⊢C
Excessiveness
Γ ⊢ A Γ ⊢ B ⌣i Γ ⊢ A ⌣ B Γ, A ⊢ C Γ, B ⊢ C
⌣e
Γ⊢A⌣B Γ⊢C
π1 π2
Γ ⊢ A Γ ⊢ B ⌣i π3 π4 (π1 /A)π3
Γ⊢A⌣B Γ, A ⊢ C Γ, B ⊢ C
⌣e (π2 /A)π4
Γ⊢C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 1 / 6: The sup connective Slide 2 / 21
⊙ connective
In PL [A.DC. & Gilles Dowek, ICTAC 2021, TCS 2023]
Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ ⊢ A ⊙ B Γ, A ⊢ C Γ ⊢ A ⊙ B Γ, B ⊢ C Γ⊢A⊙B Γ, A ⊢ C Γ, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢C Γ⊢C Γ⊢C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 1 / 6: The sup connective Slide 3 / 21
⊙ connective
In PL [A.DC. & Gilles Dowek, ICTAC 2021, TCS 2023]
Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ⊢A⊙B Γ⊢A⊙B Γ⊢A⊙B Γ, A ⊢ C Γ, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢A Γ⊢B Γ⊢C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 1 / 6: The sup connective Slide 3 / 21
⊙ connective
In PL [A.DC. & Gilles Dowek, ICTAC 2021, TCS 2023]
Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ⊢A⊙B Γ⊢A⊙B Γ⊢A⊙B Γ, A ⊢ C Γ, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢A Γ⊢B Γ⊢C
In ILL, an additive connective [A.DC. & Gilles Dowek, FSCD 2022, arXiv:2201.11221]
Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ⊢A⊙B Γ⊢A⊙B Γ⊢A⊙B ∆, A ⊢ C ∆, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢A Γ⊢A Γ, ∆ ⊢ C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 1 / 6: The sup connective Slide 3 / 21
⊙ connective
As an additive conjunction
The rule
Γ⊢A⊙B ∆, A ⊢ C ∆, B ⊢ C
⊙e
Γ, ∆ ⊢ C
or
Γ ⊢ A&B
&e2
Γ⊢B ⊕i2
Γ⊢A⊕B ∆, A ⊢ C ∆, B ⊢ C
⊕e
Γ, ∆ ⊢ C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 2 / 6: The L⊙-calculus Slide 5 / 21
The L⊙-calculus
Intuitionistic linear logic connectives
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 2 / 6: The L⊙-calculus Slide 5 / 21
The L⊙-calculus
Some deduction rules
Γ ⊢ t : A ⊕ B ∆, x : A ⊢ r : C ∆, y : B ⊢ s : C
⊕e
Γ, ∆ ⊢ match(t, x.r , y .s) : C
Γ⊢t :A⊙B ∆, x : A ⊢ r : C ∆, y : B ⊢ s : C
⊙
⊙e
Γ, ∆ ⊢ match (t, x.r , y .s) : C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 2 / 6: The L⊙-calculus Slide 6 / 21
The L⊙-calculus
Some reduction rules
We can consider
equivalent to
Γ ⊢ A Γ ⊢ A sum Γ ⊢ A prod
Γ⊢A Γ⊢A
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 3 / 6: The LS -calculus and the linearity Slide 8 / 21
The LS -calculus and the linearity
Addition and multiplication by scalar
Γ ⊢ A Γ ⊢ A sum Γ ⊢ A prod
Γ⊢A Γ⊢A
Now some proofs cannot be reduced, e.g.
π1 π2
Γ⊢A Γ⊢B
&
Γ ⊢ A & B prodi
Γ ⊢ A&B
&e
Γ⊢A
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 3 / 6: The LS -calculus and the linearity Slide 8 / 21
The LS -calculus and the linearity
Addition and multiplication by scalar
Γ ⊢ A Γ ⊢ A sum Γ ⊢ A prod
Γ⊢A Γ⊢A
Now some proofs cannot be reduced, e.g.
π1 π2
Γ⊢A Γ⊢B
&
Γ ⊢ A & B prodi
Γ ⊢ A&B
&e
Γ⊢A
ax Γ ⊢ t : A Γ ⊢ u : A sum Γ ⊢ t : A prod
Γ ⊢ s.⋆ : 1 Γ⊢t +u :A Γ⊢s •t :A
Now some proofs cannot be reduced, e.g.
Γ⊢t:A Γ⊢u:B
&i
Γ ⊢ ⟨t, u⟩ : A & B
prod
Γ ⊢ s • ⟨t, u⟩ : A & B
&e
Γ ⊢ fst(s • ⟨t, u⟩) : A
Theorem (Linearity)
| & ·{z
Let A be any proposition, and B = 1 · · & 1} ⊢ t : A ⊸ B, and u, v ∈ A, then
n≥1
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 3 / 6: The LS -calculus and the linearity Slide 10 / 21
The LS -calculus and the linearity
Syntactic linearity
Theorem (Linearity)
| & ·{z
Let A be any proposition, and B = 1 · · & 1} ⊢ t : A ⊸ B, and u, v ∈ A, then
n≥1
t(1. ⋆ + 2.⋆) −→∗ λy .y 3.⋆ (t1.⋆) + (t2.⋆) −→∗ λy .(y 1.⋆) + (y 2.⋆)
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 3 / 6: The LS -calculus and the linearity Slide 10 / 21
The LS -calculus and the linearity
Syntactic linearity
Theorem (Linearity)
| & ·{z
Let A be any proposition, and B = 1 · · & 1} ⊢ t : A ⊸ B, and u, v ∈ A, then
n≥1
t(1. ⋆ + 2.⋆) −→∗ λy .y 3.⋆ (t1.⋆) + (t2.⋆) −→∗ λy .(y 1.⋆) + (y 2.⋆)
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 3 / 6: The LS -calculus and the linearity Slide 10 / 21
Quantum computing
Encoding quantum computing in the L⊙C -calculus
Qubits and norm
Definition (Qubits: Qn )
Q0 = 1 Qn+1 = Qn ⊙ Qn
Definition (Norm)
Let t closed irreductible proof of Qn .
▶ If n = 0, t = a.⋆ ∥t∥2 = |a|2
▶ If n = n′ + 1, t = [t1 , t2 ] ∥t∥2 = ∥t1 ∥2 + ∥t2 ∥2
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 11 / 21
Encoding quantum computing in the L⊙C -calculus
Qubits and norm
Definition (Qubits: Qn )
Q0 = 1 Qn+1 = Qn ⊙ Qn
Definition (Norm)
Let t closed irreductible proof of Qn .
▶ If n = 0, t = a.⋆ ∥t∥2 = |a|2
▶ If n = n′ + 1, t = [t1 , t2 ] ∥t∥2 = ∥t1 ∥2 + ∥t2 ∥2
u
Convention u closed irreductible proof of Qn =⇒ alternative expression of the n-qubit ∥u∥ .
Example: √12 |0⟩ + √12 |1⟩ can be expressed by [ √12 .⋆, √12 .⋆] or by [1.⋆, 1.⋆].
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 11 / 21
Encoding quantum computing in the L⊙C -calculus
Qubits and norm
Definition (Qubits: Qn )
Q0 = 1 Qn+1 = Qn ⊙ Qn
Definition (Norm)
Let t closed irreductible proof of Qn .
▶ If n = 0, t = a.⋆ ∥t∥2 = |a|2
▶ If n = n′ + 1, t = [t1 , t2 ] ∥t∥2 = ∥t1 ∥2 + ∥t2 ∥2
u
Convention u closed irreductible proof of Qn =⇒ alternative expression of the n-qubit ∥u∥ .
Example: √12 |0⟩ + √12 |1⟩ can be expressed by [ √12 .⋆, √12 .⋆] or by [1.⋆, 1.⋆].
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 11 / 21
Measurement in the L⊙C -calculus
Definition (Measurement of n qubits)
measn = λx.match⊙ (x, y .[y , 0Qn−1 ], z.[0Qn−1 , z]) ⊢ measn : Qn ⊸ Qn
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 12 / 21
Measurement in the L⊙C -calculus
Definition (Measurement of n qubits)
measn = λx.match⊙ (x, y .[y , 0Qn−1 ], z.[0Qn−1 , z]) ⊢ measn : Qn ⊸ Qn
Definition (Bits: B)
B=1⊕1 0 = inl(1.⋆) 1 = inr(1.⋆)
Convention Proofs of bits are taken modulo normalization.
a • 0 with a ̸= 0 represents the Boolean 0 a • 1 with a ̸= 0 represents the Boolean 1
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 12 / 21
Measurement in the L⊙C -calculus
Definition (Measurement of n qubits)
measn = λx.match⊙ (x, y .[y , 0Qn−1 ], z.[0Qn−1 , z]) ⊢ measn : Qn ⊸ Qn
Definition (Bits: B)
B=1⊕1 0 = inl(1.⋆) 1 = inr(1.⋆)
Convention Proofs of bits are taken modulo normalization.
a • 0 with a ̸= 0 represents the Boolean 0 a • 1 with a ̸= 0 represents the Boolean 1
Example
meas′1 [a.⋆, b.⋆]
2
|b|2
Reduces to a.0 with probability |a|2|a|
+|b|2 Reduces to b.1 with probability |a|2 +|b|2
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 12 / 21
Example: Deutsch’s algorithm
Preliminaires
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 13 / 21
Example: Deutsch’s algorithm
Preliminaires
Definition (⊢ U : (B ⊸ B) ⊸ Q2 ⊸ Q2 )
⊙ ⊙
U = λf .λq. M0 π1 (π1 q) + M1 π2⊙ (π1⊙ q) + M2 π1⊙ (π2⊙ q) +
⊙ ⊙
M3 π2 (π2 q)
Example
⊢f :B⊸B
▶ If f constant function, Deutsch f −→∗(1) a • 0, for some scalar a,
▶ If f if not constant, Deutsch f −→∗(1) a • 1 for some scalar a.
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 4 / 6: Quantum computing Slide 14 / 21
Categorical model
A categorical model of the LS -calculus
[ADC & O. Malherbe, arXiv:2205.02142, 2022]
Definition (Semiring)
▶ (S, +) commutative monoid with identity 0 In particular {∗} is a
▶ (S, ·) commutative monoid with identity 1 semiring, with 0 = 1 = ∗
▶ · distributes w.r.t. +
▶ For any s ∈ S, 0 · s = 0
Definition (S-semimodule)
(A, +) commutative monoid with additive identity 0 and • : S × A → A satisfying:
(s · s ′ ) • a = s • (s ′ • a) 1•a=a
′ ′
s • (a + a ) = (s • a) + (s • a ) s •0=0•a=0
(s + s ′ ) • a = (s • a) + (s ′ • a)
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 5 / 6: Categorical model Slide 15 / 21
A categorical model of the LS -calculus
[ADC & O. Malherbe, arXiv:2205.02142, 2022]
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 5 / 6: Categorical model Slide 16 / 21
Interpreting the non-determinism
Interpreting the non-determinism
[A.DC. & Octavio Malherbe, arXiv:2309.04624, 2023]
Moggi’s approach:
1. PA = {X | X ⊆ A}
2. Calculate the two outputs (a1 , a2 ).
3. Map them into {a1 , a2 }
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 17 / 21
Interpreting the non-determinism
[A.DC. & Octavio Malherbe, arXiv:2309.04624, 2023]
Moggi’s approach:
1. PA = {X | X ⊆ A}
2. Calculate the two outputs (a1 , a2 ).
3. Map them into {a1 , a2 }
Problem: the map ξ(a1 , a2 ) = {a1 , a2 } is not linear
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 17 / 21
Interpreting the non-determinism
[A.DC. & Octavio Malherbe, arXiv:2309.04624, 2023]
Moggi’s approach:
1. PA = {X | X ⊆ A}
2. Calculate the two outputs (a1 , a2 ).
3. Map them into {a1 , a2 }
Problem: the map ξ(a1 , a2 ) = {a1 , a2 } is not linear
Possible alternative:
1. LA = {ℓ | ℓ is a list of elements of A}
2. Calculate the two outputs (a1 , a2 ).
3. Map them into [a1 , a2 ]
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 17 / 21
Interpreting the non-determinism
[A.DC. & Octavio Malherbe, arXiv:2309.04624, 2023]
Moggi’s approach:
1. PA = {X | X ⊆ A}
2. Calculate the two outputs (a1 , a2 ).
3. Map them into {a1 , a2 }
Problem: the map ξ(a1 , a2 ) = {a1 , a2 } is not linear
Possible alternative:
1. LA = {ℓ | ℓ is a list of elements of A}
2. Calculate the two outputs (a1 , a2 ).
3. Map them into [a1 , a2 ]
Problem: Pointwise sum does not represent the mixture of non-deterministic choices!
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 17 / 21
Interpreting the non-determinism
Our (first) approach: using the codiagonal
First attempt
A
id ∆ id
A π1 A×A π2 A
A i1 A+A i2 A
id ∇ id
ξ
Instead of A × A −→ PA defined by ξ(a1 , a2 ) = {a1 , a2 }
∇
use A × A −→ A defined by ∇(a1 , a2 ) = a1 +A a2
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 18 / 21
Interpreting the non-determinism
Our (first) approach: using the codiagonal
First attempt
Problem:
∆ = ⟨id, id⟩ ∇ = [id, id] ▶ t → t1 and t → t2
A
id ∆ id
A π1 A×A π2 A
A i1 A+A i2 A
id ∇ id
ξ
Instead of A × A −→ PA defined by ξ(a1 , a2 ) = {a1 , a2 }
∇
use A × A −→ A defined by ∇(a1 , a2 ) = a1 +A a2
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 18 / 21
Interpreting the non-determinism
Our (first) approach: using the codiagonal
First attempt
Problem:
∆ = ⟨id, id⟩ ∇ = [id, id] ▶ t → t1 and t → t2
A ▶ (t, v ) → (t1 , v ) and (t, v ) → (t2 , v )
id ∆ id
A π1 A×A π2 A
A i1 A+A i2 A
id ∇ id
ξ
Instead of A × A −→ PA defined by ξ(a1 , a2 ) = {a1 , a2 }
∇
use A × A −→ A defined by ∇(a1 , a2 ) = a1 +A a2
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 18 / 21
Interpreting the non-determinism
Our (first) approach: using the codiagonal
First attempt
Problem:
∆ = ⟨id, id⟩ ∇ = [id, id] ▶ t → t1 and t → t2
A ▶ (t, v ) → (t1 , v ) and (t, v ) → (t2 , v )
▶ ∇((t1 , v ), (t2 , v ))
id ∆ id
= (t1 , v ) +A×B (t2 , v )
A π1 A×A π2 A = (t1 +A t2 , v +B v)
A i1 A+A i2 A
id ∇ id
ξ
Instead of A × A −→ PA defined by ξ(a1 , a2 ) = {a1 , a2 }
∇
use A × A −→ A defined by ∇(a1 , a2 ) = a1 +A a2
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 18 / 21
Interpreting the non-determinism
Our (first) approach: using the codiagonal
First attempt
Problem:
∆ = ⟨id, id⟩ ∇ = [id, id] ▶ t → t1 and t → t2
A ▶ (t, v ) → (t1 , v ) and (t, v ) → (t2 , v )
▶ ∇((t1 , v ), (t2 , v ))
id ∆ id
= (t1 , v ) +A×B (t2 , v )
A π1 A×A π2 A = (t1 +A t2 , v +B v )
▶ But if first reduce t and then place it
A i1 A+A i2 A
in the context (_, v ):
id ∇ id
(∇(t1 , t2 ), v ) = (t1 +A t2 , v )
A
ξ
Instead of A × A −→ PA defined by ξ(a1 , a2 ) = {a1 , a2 }
∇
use A × A −→ A defined by ∇(a1 , a2 ) = a1 +A a2
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 18 / 21
Interpreting the non-determinism
Our approach: using a weighted codiagonal
A
p̂ ∆pq q̂
A π1 A×A π2 A
A i1 A+A i2 A
p̂ ∇pq q̂
A
ξ
Instead of A × A −→ PA defined by ξ(a1 , a2 ) = {a1 , a2 }
∇pq
use A × A −→ A defined by ∇pq (a1 , a2 ) = p •A a1 +A q •A a2
with p +S q = 1
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 19 / 21
Interpreting the non-determinism
Our approach: using a weighted codiagonal
A Same example:
p̂ ∆pq q̂
▶ t → t1 and t → t2
▶ (t, v ) → (t1 , v ) and (t, v ) → (t2 , v )
A π1 A×A π2 A
▶ ∇pq ((t1 , v ), (t2 , v ))
A i1 A+A i2 A = p •A×B (t1 , v ) +A×B q •A×B (t2 , v )
p̂ ∇pq q̂
= (p •A t1 +A q •A t2 , v )
A
ξ
Instead of A × A −→ PA defined by ξ(a1 , a2 ) = {a1 , a2 }
∇pq
use A × A −→ A defined by ∇pq (a1 , a2 ) = p •A a1 +A q •A a2
with p +S q = 1
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 19 / 21
Interpreting the non-determinism
Interpretation of ⊙ using ∇pq
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 20 / 21
Interpreting the non-determinism
Interpretation of ⊙ using ∇pq
Similarity with ⊕e
JA ⊕ BK = JAK + JBK Γ ⊢ t : A ⊕ B x : A, ∆ ⊢ u : C y : B, ∆ ⊢ v : C
⊕e
Γ, ∆ ⊢ match(t, x.u, y .v ) : C
t⊗id d [u,v ]
JΓK ⊗ J∆K −→ (JAK + JBK) ⊗ J∆K −→ (JAK ⊗ J∆K) + (JBK ⊗ J∆K) −→ JC K
[u,v ] u×v ∇
A + B −→ C equivalent to A × B −→ C × C −→ C
u×v ∇ u×v ∇pq
So changed A × B −→ C × C −→ C by A × B −→ C × C −→ C
Alejandro Díaz-Caro Sup: A logical connective for non-determinism Section 6 / 6: Interpreting the non-determinism Slide 20 / 21
Summarizing
Linearity result from sum and scalar multiplication in the linear lambda-calculus
Categorical model for the extended linear lambda-calculus (semimodules over a semiring).