Definitions for Bounds on quantum nonlocality via partial transposition
DefinitionQAlgorithms_Papers_Independent_Intakethird100_P09The objects the formalized statements of Bounds on quantum nonlocality via partial transposition (arXiv:1407.6999) are stated in. Each was checked against the paper by a blind read-back and a moderator.
BellScenario: PDF p.2: finite nonempty input and output alphabets, without a bound on their sizes.BellCoefficients: PDF p.2: the real coefficient table of one fixed Bell expression.Measurements: PDF p.2: one complete local POVM for every local setting.measuredBox: PDF p.2: Born probabilities using the same two local POVMs.bellValue: PDF p.2: signed Bell value; no absolute value or input-law weight is implicit.bellOperator: PDF p.2, Eq.(1): Bell operator for the fixed measurement family.bellOperatorNormdeterministicBox: PDF p.2: deterministic local strategies. Their convex hull is the local polytope.classicalBound: PDF p.2: C(S) is the maximum signed local value. This finite nonempty set attains its supremum.stateValue: PDF p.2, Eq.(3): supremum over all complete POVMs on this fixed state.quantumBound: PDF p.2: Q(S) optimizes the signed value over all positive finite local dimensions.sepDistance: PDF p.2, Eq.(4): distance to same-dimensional normalized separable states.sepDistanceUntransposed: PDF p.2, following Eq.(4): equivalent distance without transposing the SEP witness.nearSep: PDF p.2, Eq.(5): an actual separable witness at distance at most epsilon is required.HasFiniteLocalModel: PDF pp.4,8: finite local boxes; shared randomness is independent of both inputs. Finite deterministic mixtures describe the entire finite local polytope.classicalKLBits: PDF p.4, Eq.(12): KL divergence in bits. The sum is formed BEFORE taking ofReal; individual summands may be negative. A positive mass over zero has infinite divergence.boxD: PDF pp.4,8: average conditional divergence, with the input law outside each KL divergence.inputOptimization: PDF p.8: uniform modifies every input-law optimization consistently; false means optimized.boxNonlocality: PDF p.4, Eq.(12): supremum over joint input laws, THEN infimum over all local boxes.asFin: Paper-local basis adapter to the accepted dimension-changing FiniteLOCC endpoints. It preserves each owner's basis and both matrix indices.IsOperationalLOCC: PDF pp.3--4,8: operational LOCC includes finite adaptive protocols and their limits. Pointwise topology on finite-dimensional linear maps equals every channel-norm topology; closure here is taken in the ambient function space, whose linear subspace is closed. No separable-operation relaxation or uniform bound on rounds is imposed.BellExperiment: PDF pp.3--4,8: one LOCC preprocessing channel followed by one finite Bell scenario.rBlock: PDF p.4, Eq.(13): finite-block optimized nonlocality, before division by blocklength.tBlock: PDF pp.4,8, Eqs.(14),(A.1): the infimum is INSIDE every supremum, and the same channel and measurement compare rho^n with sigma^n for a ONE-copy separable sigma.asymptoticR: PDF pp.4,8: asymptotic nonlocality uses limsup and positive copy numbers n+1.asymptoticT: PDF pp.4,8: restricted regularized relative entropy, with the source's iid reference.LocalFilter: PDF pp.4,9: a selected product Kraus leaf of a complete locally realizable filter. The two complete instruments are performed locally and both outcomes are flagged. Every product contraction can be rescaled between its factors to fit this form, so arbitrary single-product successful leaves are included, without nonlocal filters.successfulFilterBranch: PDF pp.4,9: subnormalized successful branch, applied AFTER LOCC.hiddenBlock: PDF pp.4,9: success probability OUTSIDE nonlocality of the normalized branch. A zero-probability branch has score zero directly, with no conditional state evaluated.asymptoticRH: PDF p.4, Eq.(18), and p.9: success-weighted hidden nonlocality per input copy.chshScenario: PDF p.3, Eq.(8): correlator CHSH, classical bound 2 and quantum bound 2 sqrt(2).chshCoefficients: PDF p.3, Eq.(8): plus correlations except at (1,1); outcomes use signs (-1)^a.flatX: PDF p.3, Eq.(9): flat-unitary shield operator, with the printed X prefactor retained.flatY: PDF p.3, Eq.(9): Y = sqrt(d) X^Gamma, with Gamma only on Bob's shield.flatProbability: PDF p.3, Eq.(9): mixing probability, with denominator sqrt(d)+1.pptPrivate: PDF p.3, Eq.(9): constructed approximate private bit on the physical AA':BB' cut. The source prints flat modulus 1/d. Changed to 1/sqrt(d) in theorem hypotheses: unitarity, the named QFT example and traceNorm X=1 force this correction.hidingResource: PDF p.7, Eq.(A.8): exact computed family, q=1/3, d=m^2, k=m. Normalizer has BOTH exponents m; no density, proximity or key premise is substituted.paired: PDF pp.3,7: tensor product with both owners' registers grouped together.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_MatrixDistances
import Definitions.Def_QAlgorithms_Defs_BipartiteSeparability
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P24
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P42
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P56
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P47
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P54
import Definitions.Def_QAlgorithms_Papers_Independent_Gap48_P42
/-!
Horodecki--Murta, arXiv:1407.6999v3. Citations are PDF pages.
All new objects are local to this paper. Entropies are in bits, with extended
nonnegative values and infinity on support failure. Gamma always transposes Bob.
The unrestricted signed corollaries and one-sided separable gauge are deferred.
The positive-coefficient corrections below require independent moderation.
-/
noncomputable section
namespace QAlgorithms.Papers.Independent.Intakethird100.P09
open scoped Matrix ComplexConjugate ComplexOrder ENNReal
open Filter
open QAlgorithms.Entanglement (IsSeparableDensity)
open QAlgorithms.Papers.Independent.Dependency50.P24
(transposeSecond partyCut xForm swapPrivate hidingOne hidingTwo)
open QAlgorithms.Papers.Independent.Dependency50.P42 (dimensionedPower)
open QAlgorithms.Papers.Independent.Information100.P21 (Op FiniteLOCC)
open QAlgorithms.Papers.Independent.Information100.P56 (IsLaw)
open QAlgorithms.Papers.Independent.Advance50.P47 (Box)
open QAlgorithms.Papers.Independent.Information100.P54 (relativeEntanglement)
attribute [local instance] Classical.propDecidable
attribute [local instance] Classical.decEq
/-- PDF p.2: finite nonempty input and output alphabets, without a bound on their sizes. -/
structure BellScenario where
nx : ℕ+
ny : ℕ+
na : ℕ+
nb : ℕ+
/-- PDF p.2: the real coefficient table of one fixed Bell expression. -/
abbrev BellCoefficients (S : BellScenario) := Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb)
/-- PDF p.2: one complete local POVM for every local setting. -/
structure Measurements (S : BellScenario) (I J : Type) [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] where
alice : Fin S.nx → Fin S.na → Op I
bob : Fin S.ny → Fin S.nb → Op J
alice_complete : ∀ x, IsPOVM (alice x)
bob_complete : ∀ y, IsPOVM (bob y)
/-- PDF p.2: Born probabilities using the same two local POVMs. -/
def measuredBox {S : BellScenario} {I J : Type} [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] (M : Measurements S I J) (rho : Op (I × J)) : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb) :=
fun x y a b => effectProb (Matrix.kronecker (M.alice x a) (M.bob y b)) rho
/-- PDF p.2: signed Bell value; no absolute value or input-law weight is implicit. -/
def bellValue {S : BellScenario} (s : BellCoefficients S) (P : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb)) : ℝ :=
∑ x, ∑ y, ∑ a, ∑ b, s x y a b * P x y a b
/-- PDF p.2, Eq.(1): Bell operator for the fixed measurement family. -/
def bellOperator {S : BellScenario} {I J : Type} [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] (s : BellCoefficients S) (M : Measurements S I J) :
Op (I × J) :=
∑ x, ∑ y, ∑ a, ∑ b, (s x y a b : ℂ) • Matrix.kronecker (M.alice x a) (M.bob y b)
open scoped Matrix.Norms.L2Operator in
/-- PDF p.2: the spectral/operator norm, explicitly selecting Mathlib's Euclidean operator norm. -/
def bellOperatorNorm {I : Type} [Fintype I] [DecidableEq I] (X : Op I) : ℝ :=
‖X‖
/-- PDF p.2: deterministic local strategies. Their convex hull is the local polytope. -/
def deterministicBox {S : BellScenario} (f : Fin S.nx → Fin S.na)
(g : Fin S.ny → Fin S.nb) : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb) :=
fun x y a b => if f x = a ∧ g y = b then 1 else 0
/-- PDF p.2: C(S) is the maximum signed local value. This finite nonempty set attains its supremum. -/
def classicalBound {S : BellScenario} (s : BellCoefficients S) : ℝ :=
sSup {v | ∃ f : Fin S.nx → Fin S.na, ∃ g : Fin S.ny → Fin S.nb,
v = bellValue s (deterministicBox f g)}
/-- PDF p.2, Eq.(3): supremum over all complete POVMs on this fixed state. -/
def stateValue {S : BellScenario} {I J : Type} [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] (s : BellCoefficients S) (rho : Op (I × J)) : ℝ :=
sSup {v | ∃ M : Measurements S I J, v = bellValue s (measuredBox M rho)}
/-- PDF p.2: Q(S) optimizes the signed value over all positive finite local dimensions. -/
def quantumBound {S : BellScenario} (s : BellCoefficients S) : ℝ :=
sSup {v | ∃ a b : ℕ+, ∃ rho : Op (Fin a × Fin b), IsDensityMatrix rho ∧
∃ M : Measurements S (Fin a) (Fin b), v = bellValue s (measuredBox M rho)}
/-- PDF p.2, Eq.(4): distance to same-dimensional normalized separable states. -/
def sepDistance {I J : Type} [Fintype I] [Fintype J] [Nonempty I] [Nonempty J]
[DecidableEq I] [DecidableEq J] (rho : Op (I × J)) : ℝ :=
sInf {r | ∃ sigma : Op (I × J), IsSeparableDensity sigma ∧
r = traceNorm (transposeSecond rho - transposeSecond sigma)}
/-- PDF p.2, following Eq.(4): equivalent distance without transposing the SEP witness. -/
def sepDistanceUntransposed {I J : Type} [Fintype I] [Fintype J] [Nonempty I] [Nonempty J]
[DecidableEq I] [DecidableEq J] (rho : Op (I × J)) : ℝ :=
sInf {r | ∃ sigma : Op (I × J), IsSeparableDensity sigma ∧
r = traceNorm (transposeSecond rho - sigma)}
/-- PDF p.2, Eq.(5): an actual separable witness at distance at most epsilon is required. -/
def nearSep {I J : Type} [Fintype I] [Fintype J] [Nonempty I] [Nonempty J]
[DecidableEq I] [DecidableEq J] (epsilon : ℝ) : Set (Op (I × J)) :=
{rho | IsDensityMatrix rho ∧ ∃ sigma : Op (I × J), IsSeparableDensity sigma ∧
traceNorm (transposeSecond rho - transposeSecond sigma) ≤ epsilon}
/-- PDF pp.4,8: finite local boxes; shared randomness is independent of both inputs.
Finite deterministic mixtures describe the entire finite local polytope. -/
def HasFiniteLocalModel {S : BellScenario} (P : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb)) : Prop :=
∃ k : ℕ, ∃ w : Fin k → ℝ, IsLaw w ∧
∃ f : Fin k → Fin S.nx → Fin S.na, ∃ g : Fin k → Fin S.ny → Fin S.nb,
∀ x y a b, P x y a b = ∑ i, w i * deterministicBox (f i) (g i) x y a b
/-- PDF p.4, Eq.(12): KL divergence in bits. The sum is formed BEFORE taking ofReal;
individual summands may be negative. A positive mass over zero has infinite divergence. -/
def classicalKLBits {I : Type} [Fintype I] (p q : I → ℝ) : ℝ≥0∞ :=
if ∃ i, 0 < p i ∧ q i = 0 then ⊤ else
ENNReal.ofReal (∑ i, if p i = 0 then 0 else p i * (Real.log (p i / q i) / Real.log 2))
/-- PDF pp.4,8: average conditional divergence, with the input law outside each KL divergence. -/
def boxD {S : BellScenario} (p : Fin S.nx × Fin S.ny → ℝ) (P Q : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb)) : ℝ≥0∞ :=
∑ z, ENNReal.ofReal (p z) * classicalKLBits
(fun ab : Fin S.na × Fin S.nb => P z.1 z.2 ab.1 ab.2)
(fun ab : Fin S.na × Fin S.nb => Q z.1 z.2 ab.1 ab.2)
/-- PDF p.8: uniform modifies every input-law optimization consistently; false means optimized. -/
def inputOptimization (uniform : Bool) (S : BellScenario)
(f : (Fin S.nx × Fin S.ny → ℝ) → ℝ≥0∞) : ℝ≥0∞ :=
if uniform then f (fun _ => ((S.nx : ℝ) * (S.ny : ℝ))⁻¹)
else sSup {v | ∃ p, IsLaw p ∧ v = f p}
/-- PDF p.4, Eq.(12): supremum over joint input laws, THEN infimum over all local boxes. -/
def boxNonlocality {S : BellScenario} (uniform : Bool) (P : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb)) : ℝ≥0∞ :=
inputOptimization uniform S (fun p => sInf {v | ∃ Q : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb), HasFiniteLocalModel Q ∧ v = boxD p P Q})
/-- Paper-local basis adapter to the accepted dimension-changing FiniteLOCC endpoints.
It preserves each owner's basis and both matrix indices. -/
def asFin {I J : Type} [Fintype I] [Fintype J] (rho : Op (I × J)) :
Op (Fin (Fintype.card I) × Fin (Fintype.card J)) :=
fun a b => rho ((Fintype.equivFin I).symm a.1, (Fintype.equivFin J).symm a.2)
((Fintype.equivFin I).symm b.1, (Fintype.equivFin J).symm b.2)
/-- PDF pp.3--4,8: operational LOCC includes finite adaptive protocols and their limits.
Pointwise topology on finite-dimensional linear maps equals every channel-norm topology;
closure here is taken in the ambient function space, whose linear subspace is closed.
No separable-operation relaxation or uniform bound on rounds is imposed. -/
def IsOperationalLOCC {a b c d : ℕ}
(L : Superop (Fin a × Fin b) (Fin c × Fin d)) : Prop :=
L ∈ closure {K | FiniteLOCC K}
/-- PDF pp.3--4,8: one LOCC preprocessing channel followed by one finite Bell scenario. -/
structure BellExperiment (a b : ℕ) where
outA : ℕ+
outB : ℕ+
scenario : BellScenario
channel : Superop (Fin a × Fin b) (Fin outA × Fin outB)
local_channel : IsOperationalLOCC channel
measurement : Measurements scenario (Fin outA) (Fin outB)
/-- PDF p.4, Eq.(13): finite-block optimized nonlocality, before division by blocklength. -/
def rBlock {a b : ℕ} (uniform : Bool) (rho : Op (Fin a × Fin b)) : ℝ≥0∞ :=
sSup {v | ∃ E : BellExperiment a b,
v = boxNonlocality uniform (measuredBox E.measurement (E.channel rho))}
/-- PDF pp.4,8, Eqs.(14),(A.1): the infimum is INSIDE every supremum, and the same
channel and measurement compare rho^n with sigma^n for a ONE-copy separable sigma. -/
def tBlock {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)]
(uniform : Bool) (rho : Op (Fin a × Fin b)) (n : ℕ) : ℝ≥0∞ :=
sSup {v | ∃ E : BellExperiment (a ^ n) (b ^ n),
v = inputOptimization uniform E.scenario (fun p =>
sInf {w | ∃ sigma : Op (Fin a × Fin b), IsSeparableDensity sigma ∧
w = boxD p
(measuredBox E.measurement (E.channel (dimensionedPower rho n)))
(measuredBox E.measurement (E.channel (dimensionedPower sigma n)))})}
/-- PDF pp.4,8: asymptotic nonlocality uses limsup and positive copy numbers n+1. -/
def asymptoticR {a b : ℕ} (uniform : Bool) (rho : Op (Fin a × Fin b)) : ℝ≥0∞ :=
Filter.limsup (fun n : ℕ => rBlock uniform (dimensionedPower rho (n+1)) /
(n+1 : ℝ≥0∞)) Filter.atTop
/-- PDF pp.4,8: restricted regularized relative entropy, with the source's iid reference. -/
def asymptoticT {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)]
(uniform : Bool) (rho : Op (Fin a × Fin b)) : ℝ≥0∞ :=
Filter.limsup (fun n : ℕ => tBlock uniform rho (n+1) / (n+1 : ℝ≥0∞)) Filter.atTop
/-- PDF pp.4,9: a selected product Kraus leaf of a complete locally realizable filter.
The two complete instruments are performed locally and both outcomes are flagged.
Every product contraction can be rescaled between its factors to fit this form,
so arbitrary single-product successful leaves are included, without nonlocal filters. -/
structure LocalFilter (a b : ℕ) where
countA : ℕ+
countB : ℕ+
alice : Fin countA → Op (Fin a)
bob : Fin countB → Op (Fin b)
completeA : IsKrausFamily alice
completeB : IsKrausFamily bob
selectedA : Fin countA
selectedB : Fin countB
/-- PDF pp.4,9: subnormalized successful branch, applied AFTER LOCC. -/
def successfulFilterBranch {a b : ℕ} (F : LocalFilter a b) (rho : Op (Fin a × Fin b)) :
Op (Fin a × Fin b) :=
let K := Matrix.kronecker (F.alice F.selectedA) (F.bob F.selectedB)
K * rho * Kᴴ
/-- PDF pp.4,9: success probability OUTSIDE nonlocality of the normalized branch.
A zero-probability branch has score zero directly, with no conditional state evaluated. -/
def hiddenBlock {a b : ℕ} (uniform : Bool) (rho : Op (Fin a × Fin b)) : ℝ≥0∞ :=
sSup {v | ∃ E : BellExperiment a b, ∃ F : LocalFilter E.outA E.outB,
let branch := successfulFilterBranch F (E.channel rho)
let p := branch.trace.re
v = if p = 0 then 0 else ENNReal.ofReal p *
boxNonlocality uniform (measuredBox E.measurement ((p : ℂ)⁻¹ • branch))}
/-- PDF p.4, Eq.(18), and p.9: success-weighted hidden nonlocality per input copy. -/
def asymptoticRH {a b : ℕ} (uniform : Bool) (rho : Op (Fin a × Fin b)) : ℝ≥0∞ :=
Filter.limsup (fun n : ℕ => hiddenBlock uniform (dimensionedPower rho (n+1)) /
(n+1 : ℝ≥0∞)) Filter.atTop
/-- PDF p.3, Eq.(8): correlator CHSH, classical bound 2 and quantum bound 2 sqrt(2). -/
def chshScenario : BellScenario := ⟨2, 2, 2, 2⟩
/-- PDF p.3, Eq.(8): plus correlations except at (1,1); outcomes use signs (-1)^a. -/
def chshCoefficients : BellCoefficients chshScenario :=
fun x y a b => (if x = 1 ∧ y = 1 then -1 else 1) *
(if a = b then 1 else -1)
/-- PDF p.3, Eq.(9): flat-unitary shield operator, with the printed X prefactor retained. -/
def flatX (d : ℕ+) (U : Matrix.unitaryGroup (Fin d) ℂ) : Op (Fin d × Fin d) :=
fun a b => if b = (a.2, a.1) then
(((d : ℝ) * Real.sqrt d)⁻¹ : ℂ) * (U : Op (Fin d)) a.1 a.2 else 0
/-- PDF p.3, Eq.(9): Y = sqrt(d) X^Gamma, with Gamma only on Bob's shield. -/
def flatY (d : ℕ+) (U : Matrix.unitaryGroup (Fin d) ℂ) : Op (Fin d × Fin d) :=
(Real.sqrt d : ℂ) • transposeSecond (flatX d U)
/-- PDF p.3, Eq.(9): mixing probability, with denominator sqrt(d)+1. -/
def flatProbability (d : ℕ+) : ℝ := (Real.sqrt d + 1)⁻¹
/-- PDF p.3, Eq.(9): constructed approximate private bit on the physical AA':BB' cut.
The source prints flat modulus 1/d. Changed to 1/sqrt(d) in theorem hypotheses:
unitarity, the named QFT example and traceNorm X=1 force this correction. -/
def pptPrivate (d : ℕ+) (U : Matrix.unitaryGroup (Fin d) ℂ) :
Op ((Fin 2 × Fin d) × (Fin 2 × Fin d)) :=
let X := flatX d U
let Y := flatY d U
let p := flatProbability d
let noise : Op ((Fin 2 × Fin 2) × (Fin d × Fin d)) :=
fun a b => (p/2 : ℂ) *
(if a.1 = (0,1) ∧ b.1 = (0,1) then (cfc Real.sqrt (Y * Yᴴ)) a.2 b.2
else if a.1 = (1,0) ∧ b.1 = (1,0) then (cfc Real.sqrt (Yᴴ * Y)) a.2 b.2 else 0)
partyCut ((1-p : ℂ) • xForm X + noise)
/-- PDF p.7, Eq.(A.8): exact computed family, q=1/3, d=m^2, k=m.
Normalizer has BOTH exponents m; no density, proximity or key premise is substituted. -/
def hidingResource (m : ℕ) :
Op ((Fin 2 × (Fin m → Fin m → Fin (m^2))) ×
(Fin 2 × (Fin m → Fin m → Fin (m^2)))) :=
let tau1 := hidingOne (m^2) m
let tau2 := hidingTwo (m^2) m
let diag := (1/6 : ℂ) • (tau1 + tau2)
let off := (1/6 : ℂ) • (tau1 - tau2)
let odd := (1/6 : ℂ) • tau2
let tensor := fun X : Op ((Fin m → Fin (m^2)) × (Fin m → Fin (m^2))) =>
fun a b : (Fin m → Fin m → Fin (m^2)) × (Fin m → Fin m → Fin (m^2)) =>
∏ t, X (a.1 t, a.2 t) (b.1 t, b.2 t)
partyCut (fun a b => ((2*(1/3 : ℂ)^m + 2*(1/6 : ℂ)^m)⁻¹) *
(if (a.1 = (0,0) ∧ b.1 = (0,0)) ∨ (a.1 = (1,1) ∧ b.1 = (1,1)) then
tensor diag a.2 b.2
else if (a.1 = (0,0) ∧ b.1 = (1,1)) ∨ (a.1 = (1,1) ∧ b.1 = (0,0)) then
tensor off a.2 b.2
else if (a.1 = (0,1) ∧ b.1 = (0,1)) ∨ (a.1 = (1,0) ∧ b.1 = (1,0)) then
tensor odd a.2 b.2 else 0))
/-- PDF pp.3,7: tensor product with both owners' registers grouped together. -/
def paired {I J K L : Type} (rho : Op (I × J)) (sigma : Op (K × L)) :
Op ((I × K) × (J × L)) :=
fun a b => rho (a.1.1,a.2.1) (b.1.1,b.2.1) * sigma (a.1.2,a.2.2) (b.1.2,b.2.2)
-- Sanity checks pin the concrete definitions; no target theorem is proved here.
example {I J : Type} (X : Op (I × J)) : transposeSecond (transposeSecond X) = X := rfl
example {S : BellScenario} (P : Box (Fin S.nx) (Fin S.ny) (Fin S.na) (Fin S.nb)) : bellValue (fun _ _ _ _ => 0) P = 0 := by
simp [bellValue]
example : chshCoefficients 1 1 0 0 = -1 := by
norm_num [chshCoefficients, chshScenario] <;> rfl
example : chshCoefficients 0 1 0 0 = 1 := by
norm_num [chshCoefficients, chshScenario] <;> rfl
example {I : Type} [Fintype I] (p : I → ℝ) : classicalKLBits p p = 0 := by
have h : ¬ ∃ i, 0 < p i ∧ p i = 0 := by
rintro ⟨i, hi, he⟩
exact (ne_of_gt hi) he
simp only [classicalKLBits, if_neg h]
have hsum : (∑ i, if p i = 0 then 0 else p i * (Real.log (p i / p i) / Real.log 2)) = 0 := by
apply Finset.sum_eq_zero
intro i hi
by_cases hz : p i = 0
· simp [hz]
· simp [hz]
rw [hsum]
exact ENNReal.ofReal_zero
example {a b : ℕ} : IsOperationalLOCC (fun X : Op (Fin a × Fin b) => X) :=
subset_closure (FiniteLOCC.identity a b)
example {I J : Type} [Fintype I] [Fintype J] (rho : Op (I × J)) (a b) :
dimensionedPower (asFin rho) 0 a b = 1 := by
simp [dimensionedPower, QAlgorithms.Papers.Independent.Information100.P80.groupedPower]
example {I J K L : Type} (rho : Op (I × J)) (sigma : Op (K × L)) (a b) :
paired rho sigma a b = rho (a.1.1,a.2.1) (b.1.1,b.2.1) *
sigma (a.1.2,a.2.2) (b.1.2,b.2.2) := rfl
example : flatProbability 1 = 1/2 := by
norm_num [flatProbability]
example (d : ℕ+) (U : Matrix.unitaryGroup (Fin d) ℂ) (i j : Fin d) :
flatX d U (i,j) (j,i) =
(((d : ℝ) * Real.sqrt d)⁻¹ : ℂ) * (U : Op (Fin d)) i j := by
simp [flatX]
example (S : BellScenario) (f : (Fin S.nx × Fin S.ny → ℝ) → ℝ≥0∞) :
inputOptimization true S f = f (fun _ => ((S.nx : ℝ) * (S.ny : ℝ))⁻¹) := rfl
end QAlgorithms.Papers.Independent.Intakethird100.P09
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intakethird100.P09.BellCoefficients
For any Bell scenario , Bell coefficients are an arbitrary real-valued array , indexed by , , , and . No sign, normalization, or other constraint is imposed on this array.
QAlgorithms.Papers.Independent.Intakethird100.P09.BellExperiment
For natural numbers , possibly zero, this structure consists of positive output dimensions , a scenario with positive natural numbers of Alice and Bob inputs and outcomes, a function from complex matrices on to matrices on , and local measurement matrices on and on . For each input , all must be positive semidefinite and satisfy ; the analogous conditions hold for every and its . The function must lie in the pointwise topological closure of maps recursively constructed from bipartite identities and finite local Kraus instruments: each Alice or Bob instrument has local Kraus matrices whose adjoint products sum to the local identity, each outcome is followed by a recursively constructed continuation, and the branch outputs are summed. The structure contains no input state and imposes no additional relation among its output dimensions, scenario counts, and measurements.
QAlgorithms.Papers.Independent.Intakethird100.P09.BellScenario
A Bell scenario consists of four strictly positive integers . These give the numbers of Alice’s inputs, Bob’s inputs, Alice’s outputs, and Bob’s outputs, respectively; none may be zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.HasFiniteLocalModel
Let specify positive natural numbers , giving Alice’s and Bob’s input and output index sets, and let be any real-valued array on these sets. This predicate means that there exist a natural number , real weights for with , and deterministic response functions and , such that, for every input and output quadruple,
Zero weights are permitted; cannot satisfy the requirement that the weights sum to . No separate correlation or no-signaling hypothesis is required of .
QAlgorithms.Papers.Independent.Intakethird100.P09.IsOperationalLOCC
For any natural numbers , including zero, and any function from complex matrices on to complex matrices on , this predicate means that belongs to the topological closure of the following recursively generated set of maps: identity maps on bipartite systems are included; an Alice step chooses finitely many rectangular matrices with , applies , follows each outcome by another recursively generated map , and sums the resulting outputs; a Bob step has the same form using with . Local dimensions may change, and each continuation may depend on its outcome. The closure uses the topology on functions given by pointwise convergence of output matrices. No separate linearity or channel condition is included in this predicate beyond membership in that closure.
QAlgorithms.Papers.Independent.Intakethird100.P09.LocalFilter
For any natural numbers , a local filter consists of positive integers , families of complex square matrices for and for , satisfying
together with selected indices and . The local dimensions may be zero. The selected matrices may be zero; no positive probability or nonzero action is required of the selected branch.
QAlgorithms.Papers.Independent.Intakethird100.P09.Measurements
For any Bell scenario and finite types , each equipped with decidable equality, a measurement specification consists of complex matrices indexed by and indexed by . For every , all are positive semidefinite and ; for every , all are positive semidefinite and . The types are allowed to be empty; on an empty index type, the identity and all matrices are the unique empty matrix, so the corresponding requirements are satisfied.
QAlgorithms.Papers.Independent.Intakethird100.P09.asFin
For any finite types , possibly empty, and any complex matrix indexed by , choose the bijections and supplied by their finite-type structures. This defines a matrix indexed by through
Thus the definition reindexes both rows and columns using those bijections. It requires no nonemptiness, decidable-equality, positivity, or normalization hypotheses.
QAlgorithms.Papers.Independent.Intakethird100.P09.asymptoticR
For natural numbers , a Boolean flag , and any complex matrix on , this defines the extended nonnegative real number
Here is the matrix with entries , relabelled onto local index sets of sizes using the specified finite-set bijections. For a matrix , is the supremum over experiments consisting of a map in the closure of finite LOCC maps, positive finite output dimensions, a Bell scenario with positive finite input and outcome counts, and local POVMs , of the following quantity for :
Each POVM consists of positive semidefinite matrices summing to the identity. A finite local box is a finite convex combination of deterministic boxes . The divergence is , interpreted in , where if some has , and otherwise
The uniform input law assigns to each pair. Finite LOCC maps are generated by identity maps and finite, outcome-dependent local Kraus operations, summing over branches, with each local Kraus family satisfying . The limiting sequence uses only , so its denominator never vanishes. Neither positivity nor trace one is required of , and or may be zero; all expressions retain their literal total-function meanings, including division by zero and . Suprema and the limit superior take values in , with an empty supremum equal to zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.asymptoticRH
For natural numbers , a Boolean flag , and any complex matrix on local index sets of sizes , this defines
where has entries , relabelled onto local index sets of sizes by the specified bijections. For any matrix , is the supremum over a map in the closure of finite LOCC maps, positive finite output dimensions, local output filters with complete nonempty finite Kraus families and selected indices , and Bell measurements with positive finite input and outcome counts. Write
The optimized value is zero for , and otherwise is , where , and each local measurement is a family of positive semidefinite effects summing to the identity. The quantity is for , and otherwise. Finite local boxes are finite convex combinations of deterministic product responses. Here , where if some has , and otherwise ; the uniform input law weights input pairs equally. Finite LOCC maps are generated by identities and finite, outcome-dependent complete local Kraus operations, summing over branches. The limit uses only . No density-matrix hypothesis is imposed on , and zero local dimensions are allowed; negative branch traces are converted to zero in , where , and empty suprema are zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.asymptoticT
For natural numbers whose index sets and are nonempty, hence , a Boolean flag , and any complex matrix on their product, this defines
For each , is the supremum over Bell experiments on local dimensions . Such an experiment comprises a map in the closure of finite LOCC maps, positive finite output dimensions, positive finite numbers of inputs and outcomes, and local POVMs . Set
where has tensor-product entries , relabelled by the specified bijections onto index sets of sizes . The experiment contributes
Here is a single matrix on the original system, and uses with the same experiment. “Separable density matrix” means a finite sum , where , , and are positive semidefinite of trace one. Each POVM consists of positive semidefinite matrices summing to the identity. Finite LOCC maps are generated by identities and finite, outcome-dependent local Kraus operations with complete Kraus families, summing over branches. The divergence is , where if some has , and otherwise ; the uniform input law gives every input pair equal weight. The limit uses . No density-matrix assumption is imposed on ; the real division and logarithms are total, and all optimization and limiting operations shown here are in .
QAlgorithms.Papers.Independent.Intakethird100.P09.bellOperator
For any Bell scenario , finite types with decidable equality, real coefficient array , and measurement specification , this defines the complex matrix
on . For every , the matrices are positive semidefinite and sum over to , and for every , the matrices are positive semidefinite and sum over to ; tensor-product entries are . The coefficients may have either sign. The types may be empty, yielding an empty matrix.
QAlgorithms.Papers.Independent.Intakethird100.P09.bellOperatorNorm
For any finite type equipped with decidable equality and any complex matrix indexed by , this defines a real number equal to the ambient matrix norm . No Hermiticity, positivity, or normalization assumption is imposed on . The index type may be empty, in which case this norm is zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.bellValue
For any Bell scenario and arbitrary real arrays and on its input and output indices, the Bell value is
Neither array is required to be nonnegative or normalized.
QAlgorithms.Papers.Independent.Intakethird100.P09.boxD
For a scenario with positive numbers of inputs and outputs, any real input array , and any real arrays and , this defines
where , embedded into the extended nonnegative reals. For arrays on the output pairs, if some output pair has and ; otherwise it is the nonnegative part of . These expressions use total real division and logarithms, with division by zero and equal to zero and for negative . No probability, normalization, or no-signaling assumptions are imposed on . Extended multiplication uses , so input pairs with nonpositive contribute zero even when their divergence is infinite.
QAlgorithms.Papers.Independent.Intakethird100.P09.boxNonlocality
For a scenario with positive input and output counts and any real array , this defines, when the Boolean flag is true, the infimum over finite local models of the input-weighted divergence at the uniform input law; when the flag is false, it defines
All extrema and sums here take values in . A finite local model has the form , for a natural number , nonnegative real weights summing to , and deterministic local response functions with the scenario’s input and output sets. For output arrays , if some coordinate has ; otherwise it is the nonnegative part of . Division and logarithms are total, with division by zero and equal to zero and negative logarithm arguments interpreted through their absolute values; extended multiplication satisfies . In the uniform case . The infimizing local model may depend on the chosen input law, and itself is not assumed to be a correlation.
QAlgorithms.Papers.Independent.Intakethird100.P09.chshCoefficients
For inputs and outcomes , this defines the real coefficient
Thus equal outcomes receive coefficient and unequal outcomes coefficient , with both signs reversed for the input pair .
QAlgorithms.Papers.Independent.Intakethird100.P09.chshScenario
This defines a Bell scenario with two inputs for Alice, two inputs for Bob, two outcomes for Alice, and two outcomes for Bob. Each input and outcome index therefore ranges over .
QAlgorithms.Papers.Independent.Intakethird100.P09.classicalBound
For any Bell scenario and arbitrary real coefficient array , the classical bound is the real supremum of the values
over all functions and . This is a finite nonempty collection because all four scenario sizes are strictly positive.
QAlgorithms.Papers.Independent.Intakethird100.P09.classicalKLBits
For any finite type , possibly empty, and arbitrary real-valued functions , this defines an extended nonnegative real number by
The finite value in the second branch is embedded into the extended nonnegative reals. Neither function is assumed nonnegative or normalized. Division and logarithms are total: division by zero gives zero, , and the real logarithm at a negative argument is the logarithm of its absolute value. The exceptional infinite branch tests strictly positive , not merely nonzero . If is empty, the value is zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.deterministicBox
For any Bell scenario and functions and , this defines the real array to equal when both and , and otherwise.
QAlgorithms.Papers.Independent.Intakethird100.P09.flatProbability
For every positive integer , including , this defines the real number
QAlgorithms.Papers.Independent.Intakethird100.P09.flatX
For every positive integer and every complex unitary matrix , this defines a complex matrix indexed by pairs from , with
The case is included. The assumption on is unitarity; no equal-magnitude condition on its entries is imposed.
QAlgorithms.Papers.Independent.Intakethird100.P09.flatY
For every positive integer and every complex unitary matrix , this defines , where
Equivalently,
All four indices range over , including when ; only unitarity is assumed of .
QAlgorithms.Papers.Independent.Intakethird100.P09.hiddenBlock
For natural numbers , a Boolean flag , and any complex matrix on the product of local index sets of sizes , this defines an extended nonnegative supremum over Bell experiments and selected local-filter branches. An experiment consists of a map in the closure of finite LOCC maps, positive finite output dimensions, positive finite numbers of inputs and outcomes, and local POVMs . A filter on the output consists of nonempty finite families , satisfying , , and selected indices . Put
The value included in the supremum is zero when , and otherwise is
Here is when , and otherwise. A finite local box is a finite convex combination of . The divergence is , with if some has , and otherwise
The uniform input law assigns equal weight to every input pair. POVM effects are positive semidefinite and sum to the identity; finite LOCC maps are generated by identities and finite, outcome-dependent complete local Kraus operations, summing over branches. No positivity or normalization hypothesis is imposed on , and may be zero. In particular, need not be positive; for , its extended nonnegative conversion is zero, and multiplication uses the convention . An empty supremum is zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.hidingResource
For every natural number , this defines a complex matrix on two parties, each indexed by , where . To specify its entries, put , let be the identity on , let have entries when and , and otherwise, and define and . On pairs of length- strings over , define and by and . Put , , , and . Writing , , and , the entry of with row and column is if or , is if or , is if or , and is otherwise. This definition includes , with empty products equal to , and ; scalar inverses at zero are defined to be zero, including those in the formulas for . The declaration itself imposes no positivity or trace condition on .
QAlgorithms.Papers.Independent.Intakethird100.P09.inputOptimization
For a Boolean flag called “uniform,” a scenario with positive input and output counts , and any function from real arrays on the input pairs to , this defines
The supremum is taken in the extended nonnegative reals and may be infinite. The function is unrestricted, and the optimized input laws may correlate Alice’s and Bob’s inputs and may assign zero weight to some input pairs.
QAlgorithms.Papers.Independent.Intakethird100.P09.measuredBox
For any Bell scenario , finite types with decidable equality, measurement specification , and arbitrary complex matrix indexed by , this defines the real array
Here, for every , the matrices are positive semidefinite and sum over to , and for every , the matrices are positive semidefinite and sum over to ; the tensor product has entries . No density-matrix hypothesis is imposed on , so the definition alone imposes no probability constraints on . Either or may be empty, in which case every entry of is zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.nearSep
For finite, nonempty types with decidable equality and any real number , this defines the set of complex matrices on that are positive semidefinite with trace and for which there exists a separable density matrix satisfying
Here , and , using continuous functional calculus. The required separability of means that, for some natural number , it has a decomposition , where the real weights are nonnegative and sum to , and every is positive semidefinite with trace on its respective subsystem. The definition allows every real ; for , the set is empty.
QAlgorithms.Papers.Independent.Intakethird100.P09.paired
For arbitrary types , and arbitrary complex matrices indexed by and indexed by , this defines a matrix on by
The types need not be finite or nonempty, and neither matrix is assumed positive, Hermitian, or normalized.
QAlgorithms.Papers.Independent.Intakethird100.P09.pptPrivate
For every positive integer and every complex unitary matrix , this defines a complex matrix on as follows. Define matrices on the two -dimensional shield indices by
On key indices ordered as , form the shield-valued block matrix
where the square roots are obtained by applying the real square-root function through continuous functional calculus. The returned matrix regroups key and shield indices by party:
The definition includes and assumes only unitarity of , without any additional restriction on its entry magnitudes.
QAlgorithms.Papers.Independent.Intakethird100.P09.quantumBound
For any Bell scenario and arbitrary real coefficient array , the quantum bound is the real supremum, over all strictly positive integers , all positive semidefinite complex matrices of trace on , and all measurement families , of
Every measurement matrix is positive semidefinite, with for every and for every ; tensor-product entries are . The local dimensions have no upper bound.
QAlgorithms.Papers.Independent.Intakethird100.P09.rBlock
For natural numbers , a Boolean flag, and any complex matrix on , this defines the extended nonnegative supremum over experiments described as follows: choose positive output dimensions , positive finite input and outcome counts, a map in the pointwise closure of finite adaptive local Kraus protocols, and positive semidefinite local measurement matrices summing to their respective identities for every input. Such finite protocols are generated recursively from identities by complete local Kraus instruments, outcome-dependent continuations, and summation over branches. Form the real array
The value assigned to this experiment is at when the flag is true, and the supremum of that infimum over all nonnegative input laws summing to when the flag is false. Here ranges over finite deterministic local mixtures with nonnegative weights summing to . The output divergence is infinite if some coordinate has , and otherwise is . All arithmetic follows the total real conventions for division and logarithms, and . No density-matrix assumption is imposed on , and or may be zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.sepDistance
For any finite nonempty types , each equipped with decidable equality, and arbitrary complex matrix on , this defines the real infimum of , where and . The infimum ranges over matrices admitting a finite decomposition , where , every , , and every and is a positive semidefinite complex matrix of trace on and , respectively. The sum-of-weights condition excludes , but individual weights may vanish. The square root is the positive matrix square root, and denotes conjugate transpose. No density-matrix condition is imposed on .
QAlgorithms.Papers.Independent.Intakethird100.P09.sepDistanceUntransposed
For finite, nonempty types with decidable equality and any complex matrix indexed by , this defines
where and , with the square root defined by continuous functional calculus. Here a separable density matrix is any matrix expressible as , for some natural number , real weights summing to , and positive semidefinite matrices on , respectively, each of trace . Thus cannot satisfy the weight condition, although individual weights may vanish. Only is partially transposed in the distance expression; no positivity or normalization assumption is imposed on .
QAlgorithms.Papers.Independent.Intakethird100.P09.stateValue
For any Bell scenario , finite types with decidable equality, arbitrary real coefficient array , and arbitrary complex matrix on , the state value is the real supremum of
over all families of positive semidefinite matrices satisfying for every and for every . Tensor-product entries are . No positivity or trace-one condition is required of . Either local index type may be empty, in which case all values in this supremum are zero.
QAlgorithms.Papers.Independent.Intakethird100.P09.successfulFilterBranch
For any natural numbers , any complex matrix on the product of the local index sets of sizes , and a local filter consisting of nonempty finite matrix families with , , and selected indices , this defines
No division by the trace is performed. Neither positivity nor trace one is required of , the resulting matrix may be zero, and zero local dimensions are included.
QAlgorithms.Papers.Independent.Intakethird100.P09.tBlock
For natural numbers with nonempty index sets and , hence , any Boolean flag, any complex matrix on , and any natural number , this defines the extended nonnegative supremum over experiments on input dimensions of the following value:
An experiment chooses positive output dimensions, positive finite input and outcome counts, a map in the pointwise closure of finite adaptive local Kraus protocols, and local positive semidefinite measurements summing to their identities for each input; the finite protocols are recursively generated from identities by complete local Kraus instruments, outcome-dependent continuations, and summation of branches. Its arrays are , where has entries , reindexed by the chosen bijections from length- index sequences to indices of sizes . A separable density matrix is a finite sum with nonnegative real weights summing to and positive semidefinite trace-one factors. The divergence is infinite if some coordinate has ; otherwise it is the nonnegative part of , using total real division and logarithms and . The infimum chooses a single-copy and compares its -fold power using the same experiment; it may depend on the input law. No density assumption is imposed on . The case is included, with both matrix powers equal to the one-dimensional matrix because their entry products are empty.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.