letB:=CFC.sqrt ShavehB : Bᴴ = B:= (CFC.sqrt_nonneg S).posSemidef.isHermitian.eq
havehBB : B * B = S:=CFC.sqrt_mul_sqrt_self S hS.nonneg
have h := re_trace_nonneg (hT.mul_mul_conjTranspose_same B)
rwa [hB, Matrix.trace_mul_cycle, hBB] at h
lemmasqrtRows_gram [Fintype ι] [DecidableEq ι] {R : Matrix κ κ ℂ} (hR : R.PosSemidef) (f g : ι → κ) :
(CFC.sqrt R).submatrix f id * ((CFC.sqrt R).submatrix g id)ᴴ = R.submatrix f g :=by
proof · 3
lines
rw [Matrix.conjTranspose_submatrix, (CFC.sqrt_nonneg R).posSemidef.isHermitian.eq,
←Matrix.submatrix_mul _ _ f id g Function.bijective_id,
CFC.sqrt_mul_sqrt_self R hR.nonneg]
defamplifyTensor {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
{κ : Type v344_0} (U : Matrix (κ × (Fin a ×Fin c)) (κ × (Fin a ×Fin c)) ℂ) :
Matrix (κ × (Fin b ×Fin d)) (κ × (Fin b ×Fin d)) ℂ:=
body · 1
line
fun i j => tensorMap LM (fun x y =>U (i.1,x) (j.1,y)) i.2 j.2
lemmatensorMap_amplify_positive {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b}
{M : Mat c →ₗ[ℂ] Mat d} (hL : CompletelyPositiveL) (hM : CompletelyPositiveM)
{κ : Type v349_0} [Fintype κ]
{U : Matrix (κ × (Fin a ×Fin c)) (κ × (Fin a ×Fin c)) ℂ} (hU : U.PosSemidef) :
(amplifyTensor LMU).PosSemidef:=by
proof · 8
lines
have h₁ := cp_amplifyIndex hM _
(hU.submatrix (funi : (κ ×Fin a) ×Fin c => (i.1.1, (i.1.2, i.2))))
have h₂ := cp_amplifyIndex hL _
(h₁.submatrix (funi : (κ ×Fin d) ×Fin a => ((i.1.1, i.2), i.1.2)))
have h₃ := h₂.submatrix (funi : κ × (Fin b ×Fin d) => ((i.1, i.2.2), i.2.1))
convert h₃ using1
ext i j
exact tensorMap_apply LM _ _ _ _ _
lemmatensorMap_global_transpose {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b)
(M : Mat c →ₗ[ℂ] Mat d) (U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ) :
tensorMap (L.comp (transposeLinear a)) (M.comp (transposeLinear c)) U =
tensorMap LMUᵀ :=by
proof · 7
lines
ext i j
calc
_ = (L.comp (transposeLinear a))
(fun x y => (M.comp (transposeLinear c)) (fun z w =>U (x,z) (y,w)) i.2 j.2)
i.1 j.1:= tensorMap_apply _ _ _ _ _ _ _
_ = L (fun x y =>M (fun z w =>Uᵀ (x,z) (y,w)) i.2 j.2) i.1 j.1:= rfl
_ = _ := (tensorMap_apply _ _ _ _ _ _ _).symm
lemmatensorMap_outer_block {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b}
{M : Mat c →ₗ[ℂ] Mat d} (hL : CompletelyPositiveL) (hM : CompletelyPositiveM)
(u s : Fin a ×Fin c →ℂ) :
(fromBlocks (tensorMap LM (outer u u)) (tensorMap LM (outer u s))
(tensorMap LM (outer s u)) (tensorMap LM (outer s s))).PosSemidef:=by
proof · 6
lines
letv : Bool× (Fin a ×Fin c) →ℂ:=fun i =>if i.1then s i.2else u i.2have h := tensorMap_amplify_positive hL hM (outer_posSemidef v)
have h' := h.submatrix (Sum.elim (fun i => (false,i)) (fun i => (true,i)))
convert h' using1
ext i j
cases i <;> cases j <;> simp [amplifyTensor, Matrix.submatrix, v, outer, Matrix.fromBlocks] <;> rfl
lemmatensorMap_outer_block_adjoint {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b}
{M : Mat c →ₗ[ℂ] Mat d} (hL : CompletelyPositiveL) (hM : CompletelyPositiveM)
(u s : Fin a ×Fin c →ℂ) :
(fromBlocks (tensorMap LM (outer u u)) (tensorMap LM (outer u s))
(tensorMap LM (outer u s))ᴴ (tensorMap LM (outer s s))).PosSemidef:=by
proof · 3
lines
have h := tensorMap_outer_block hL hM u s
have he := (Matrix.isHermitian_fromBlocks_iff.mp h.isHermitian).2.1
rwa [he]
lemmadirect_block_bound {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b}
{M : Mat c →ₗ[ℂ] Mat d} (hL : CompletelyPositiveL) (hM : CompletelyPositiveM)
(u s : Fin a ×Fin c →ℂ) (D₀D₁ : Matrix (Fin b ×Fin d) (Fin b ×Fin d) ℂ)
(hD₀ : D₀.PosSemidef) (hD₁ : D₁.PosSemidef) :
traceNorm (CFC.sqrt D₀ * tensorMap LM (outer u s) * CFC.sqrt D₁) ≤Real.sqrt ((trace (D₀ * tensorMap LM (outer u u))).re *
(trace (D₁ * tensorMap LM (outer s s))).re) :=by
lemmareversed_block_bound {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b}
{M : Mat c →ₗ[ℂ] Mat d} (hL : PPTTypeL) (hM : PPTTypeM)
(u s : Fin a ×Fin c →ℂ) (D₀D₁ : Matrix (Fin b ×Fin d) (Fin b ×Fin d) ℂ)
(hD₀ : D₀.PosSemidef) (hD₁ : D₁.PosSemidef) :
traceNorm (CFC.sqrt D₀ * tensorMap LM (outer u s) * CFC.sqrt D₁) ≤Real.sqrt ((trace (D₀ * tensorMap LM (outer s s))).re *
(trace (D₁ * tensorMap LM (outer u u))).re) :=by
proof · 2
lines
have h := direct_block_bound hL.2 hM.2 (star s) (star u) D₀D₁ hD₀ hD₁
simpa only [tensorMap_global_transpose, outer_transpose_conj] using h
letB:=CFC.sqrt ShavehB : Bᴴ = B:= (CFC.sqrt_nonneg S).posSemidef.isHermitian.eq
havehBB : B * B = S:=CFC.sqrt_mul_sqrt_self S hS.nonneg
have h := (hT.mul_mul_conjTranspose_same B).trace_nonneg
rwa [hB, Matrix.trace_mul_cycle, hBB] at h
lemmatensorMap_add {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
(UV : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ) :
tensorMap LM (U+V) = tensorMap LMU + tensorMap LMV:=by
proof · 2
lines
ext i j
simp [tensorMap, add_mul, Finset.sum_add_distrib]
lemmatensorMap_smul {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
(z : ℂ) (U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ) :
tensorMap LM (z • U) = z • tensorMap LMU:=by
proof · 2
lines
ext i j
simp [tensorMap, smul_eq_mul, mul_assoc, Finset.mul_sum]
lemmatensorMap_expansion {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b)
(M : Mat c →ₗ[ℂ] Mat d) (U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ) :
tensorMap LMU = ∑ i, ∑ j, U i j •
(L (matrixUnit i.1 j.1) ⊗ₖ M (matrixUnit i.2 j.2)) :=by
proof · 13
lines
ext s t
simp only [Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul, Matrix.kroneckerMap_apply,
Fintype.sum_prod_type, tensorMap]
apply Finset.sum_congr rfl
intro i _
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro j _
apply Finset.sum_congr rfl
intro k _
apply Finset.sum_congr rfl
intro l _
ring
lemmatensorMap_effect_pairing {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b)
(M : Mat c →ₗ[ℂ] Mat d) (X : Mat b) (Y : Mat d)
(U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ) :
trace ((X ⊗ₖ Y) * tensorMap LMU) = trace ((effectDual LX ⊗ₖ effectDual MY) * U) :=by
proof · 10
lines
rw [tensorMap_expansion]
simp only [Matrix.mul_sum, Matrix.mul_smul, Matrix.trace_sum, Matrix.trace_smul,
←Matrix.mul_kronecker_mul, Matrix.trace_kronecker, smul_eq_mul]
simp only [trace, Matrix.diag, Matrix.mul_apply, Matrix.kroneckerMap_apply, effectDual]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro i _
apply Finset.sum_congr rfl
intro j _
ring
lemmatensor_weight_nonneg {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b}
{M : Mat c →ₗ[ℂ] Mat d} (hL : CompletelyPositiveL) (hM : CompletelyPositiveM)
(u : Fin a ×Fin c →ℂ) {X : Mat b} {Y : Mat d}
(hX : X.PosSemidef) (hY : Y.PosSemidef) :
0≤ weight (tensorMap LM (outer u u)) XY:=by
havehle : A≤E:=by rw [← hsum]; exact le_add_of_nonneg_right hB.nonneg
have hsupp := hE.mul_right_and_mul_left_of_nonneg_of_le hA.nonneg hle
havehe : B = E - A:=by rw [← hsum]; abel
change A * B = B * A
rw [he, mul_sub, sub_mul, hsupp.1, hsupp.2]
(S * A * S).PosSemidef∧ (S * B * S).PosSemidef∧Commute (S * A * S) (S * B * S) :=by
dsimp
letS:= cfc whiteningFunction (A+B)
letE:= cfc supportFunction (A+B)
have hw := whitening_of_psd (A+B) (hA.add hB)
dsimp at hw
havehS : Sᴴ = S:= hw.1.eq
havehSA : (S * A * S).PosSemidef:=by
simpa only [hS] using hA.mul_mul_conjTranspose_same ShavehSB : (S * B * S).PosSemidef:=by
simpa only [hS] using hB.mul_mul_conjTranspose_same Shavehsum : S * A * S + S * B * S = E:=by
rw [← add_mul, ← mul_add]
exact hw.2.2.2.2.1
exact ⟨hSA, hSB, commute_of_sum_projection _ _ E hSA hSB hw.2.2.2.2.2 hsum⟩
lemmatensor_qform_eq_weight {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b)
(M : Mat c →ₗ[ℂ] Mat d) (X : Mat b) (Y : Mat d) (u : Fin a ×Fin c →ℂ) :
weight (tensorMap LM (outer u u)) XY = qform (effectDual LX ⊗ₖ effectDual MY) u :=by
lemmainput_split_weights {a c : ℕ} (A₀A₁ : Mat a) (B₀B₁ : Mat c)
(hA₀ : A₀.PosSemidef) (hA₁ : A₁.PosSemidef)
(hB₀ : B₀.PosSemidef) (hB₁ : B₁.PosSemidef) (χ : Fin a ×Fin c →ℂ) :
∃ v w, χ = v+w ∧
(∀A∈ ({A₀,A₁} : Finset (Mat a)), ∀B∈ ({B₀,B₁} : Finset (Mat c)),
qform (A ⊗ₖ B) χ = qform (A ⊗ₖ B) v + qform (A ⊗ₖ B) w) ∧
qform (A₁ ⊗ₖ B₁) v ≤ qform (A₀ ⊗ₖ B₁) v ∧
qform (A₀ ⊗ₖ B₀) w ≤ qform (A₁ ⊗ₖ B₀) w :=by
proof · 44
lines
classical
obtain ⟨V,W,hVW,hcross₀,hcross₁,hplus,hminus⟩ := generalized_effect_split A₀A₁ hA₀ hA₁
letVV:=V ⊗ₖ (1 : Mat c)
letWW:=W ⊗ₖ (1 : Mat c)
havehVVWW : VV+WW=1:=by
dsimp [VV, WW]
rw [←Matrix.add_kronecker, hVW, Matrix.one_kronecker_one]
refine ⟨VV *ᵥ χ, WW *ᵥ χ, ?_, ?_, ?_, ?_⟩
· rw [←Matrix.add_mulVec, hVVWW, Matrix.one_mulVec]
· intro A hA B hB
havehc : Vᴴ*A*W=0:=by
simp only [Finset.mem_insert, Finset.mem_singleton] at hA
rcases hA with rfl | rfl <;> assumption
havehAp : A.PosSemidef:=by
simp only [Finset.mem_insert, Finset.mem_singleton] at hA
rcases hA with rfl | rfl <;> assumption
havehBp : B.PosSemidef:=by
simp only [Finset.mem_insert, Finset.mem_singleton] at hB
rcases hB with rfl | rfl <;> assumption
apply filter_qform_split hVVWW (hAp.kronecker hBp).isHermitian
dsimp [VV, WW]
rw [tensor_filter_congruence, hc, Matrix.zero_kronecker]
· have h := qform_nonneg (hplus.kronecker hB₁) χ
rw [qform_congruence, qform_congruence]
dsimp [VV]
rw [tensor_filter_congruence, tensor_filter_congruence]
havehe : (Vᴴ * (A₀-A₁) * V) ⊗ₖ B₁ =
(Vᴴ*A₀*V) ⊗ₖ B₁ - (Vᴴ*A₁*V) ⊗ₖ B₁:=by
rw [mul_sub, sub_mul]
ext i j
simp only [Matrix.kroneckerMap_apply, Matrix.sub_apply, sub_mul]
rw [he, qform_sub] at h
linarith
· have h := qform_nonneg (hminus.kronecker hB₀) χ
rw [qform_congruence, qform_congruence]
dsimp [WW]
rw [tensor_filter_congruence, tensor_filter_congruence]
havehe : (Wᴴ * (A₁-A₀) * W) ⊗ₖ B₀ =
(Wᴴ*A₁*W) ⊗ₖ B₀ - (Wᴴ*A₀*W) ⊗ₖ B₀:=by
rw [mul_sub, sub_mul]
ext i j
simp only [Matrix.kroneckerMap_apply, Matrix.sub_apply, sub_mul]
rw [he, qform_sub] at h
linarith
theoremfour_effect_inequality {a b : ℕ}
(R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ) (hR : InClassR)
(X₀X₁ : Mat a) (Y₀Y₁ : Mat b)
(hX₀ : X₀.PosSemidef) (hX₁ : X₁.PosSemidef)
(hY₀ : Y₀.PosSemidef) (hY₁ : Y₁.PosSemidef) :
traceNorm (CFC.sqrt (X₀ ⊗ₖ Y₀) * R * CFC.sqrt (X₁ ⊗ₖ Y₁)) ≤Real.sqrt (weight RX₀Y₀ * weight RX₀Y₁) +
Real.sqrt (weight RX₁Y₀ * weight RX₁Y₁) +
2 * Real.sqrt (weight RX₀Y₁ * weight RX₁Y₀) :=by
proof · 74
lines
classical
obtain ⟨_,c,d,L,M,χ,hL,hM,rfl⟩ := hR
letA₀:= effectDual LX₀letA₁:= effectDual LX₁letB₀:= effectDual MY₀letB₁:= effectDual MY₁
obtain ⟨v,w,hχ,hsplit,hv,hw⟩ := input_split_weights A₀A₁B₀B₁
(effectDual_positive hL.1 hX₀) (effectDual_positive hL.1 hX₁)
(effectDual_positive hM.1 hY₀) (effectDual_positive hM.1 hY₁) χ
let p :=funXY u => weight (tensorMap LM (outer u u)) XYletZ:=fun u s =>CFC.sqrt (X₀ ⊗ₖ Y₀) * tensorMap LM (outer u s) *
CFC.sqrt (X₁ ⊗ₖ Y₁)
have hpos (X : Mat a) (Y : Mat b) (hX : X.PosSemidef) (hY : Y.PosSemidef)
(u : Fin c ×Fin d →ℂ) : 0≤ p XY u := tensor_weight_nonneg hL.1 hM.1 u hX hY
have hsplit' (X : Mat a) (hX : X∈ ({X₀,X₁} : Finset (Mat a)))
(Y : Mat b) (hY : Y∈ ({Y₀,Y₁} : Finset (Mat b))) :
p XY χ = p XY v + p XY w :=by
dsimp [p]
simp only [tensor_qform_eq_weight]
apply hsplit
· simp only [Finset.mem_insert, Finset.mem_singleton] at hX ⊢
rcases hX with rfl | rfl <;> tauto
· simp only [Finset.mem_insert, Finset.mem_singleton] at hY ⊢
rcases hY with rfl | rfl <;> tauto
have hmono (X : Mat a) (hX : X∈ ({X₀,X₁} : Finset (Mat a)))
(Y : Mat b) (hY : Y∈ ({Y₀,Y₁} : Finset (Mat b))) :
p XY v ≤ p XY χ ∧ p XY w ≤ p XY χ :=byhavehXp : X.PosSemidef:=by
simp only [Finset.mem_insert, Finset.mem_singleton] at hX
rcases hX with rfl | rfl <;> assumption
havehYp : Y.PosSemidef:=by
simp only [Finset.mem_insert, Finset.mem_singleton] at hY
rcases hY with rfl | rfl <;> assumption
have he := hsplit' X hX Y hY
have hvp := hpos XY hXp hYp v
have hwp := hpos XY hXp hYp w
constructor <;> linarith
have h00 := hmono X₀ (by simp) Y₀ (by simp)
have h01 := hmono X₀ (by simp) Y₁ (by simp)
have h10 := hmono X₁ (by simp) Y₀ (by simp)
have h11 := hmono X₁ (by simp) Y₁ (by simp)
havehv' : p X₁Y₁ v ≤ p X₀Y₁ v :=by simpa [p, tensor_qform_eq_weight, A₀,A₁,B₀,B₁] using hv
havehw' : p X₀Y₀ w ≤ p X₁Y₀ w :=by simpa [p, tensor_qform_eq_weight, A₀,A₁,B₀,B₁] using hw
have hdir (u s : Fin c ×Fin d →ℂ) :
traceNorm (Z u s) ≤Real.sqrt (p X₀Y₀ u * p X₁Y₁ s) :=
direct_block_bound hL.1 hM.1 u s _ _ (hX₀.kronecker hY₀) (hX₁.kronecker hY₁)
have hrev (u s : Fin c ×Fin d →ℂ) :
traceNorm (Z u s) ≤Real.sqrt (p X₀Y₀ s * p X₁Y₁ u) :=
reversed_block_bound hL hM u s _ _ (hX₀.kronecker hY₀) (hX₁.kronecker hY₁)
havehvv : traceNorm (Z v v) ≤Real.sqrt (p X₀Y₀ χ * p X₀Y₁ χ) :=
(hdir v v).trans (sqrt_mul_mono (hpos _ _ hX₁ hY₁ v) (hpos _ _ hX₀ hY₀ χ)
h00.1 (hv'.trans h01.1))
havehww : traceNorm (Z w w) ≤Real.sqrt (p X₁Y₀ χ * p X₁Y₁ χ) :=
(hdir w w).trans (sqrt_mul_mono (hpos _ _ hX₁ hY₁ w) (hpos _ _ hX₁ hY₀ χ)
(hw'.trans h10.2) h11.2)
havehcross : Real.sqrt (p X₀Y₀ w * p X₁Y₁ v) ≤Real.sqrt (p X₀Y₁ χ * p X₁Y₀ χ) :=by
rw [mul_comm (p X₀Y₁ χ)]
exact sqrt_mul_mono (hpos _ _ hX₁ hY₁ v) (hpos _ _ hX₁ hY₀ χ)
(hw'.trans h10.2) (hv'.trans h01.1)
have hvw := (hrev v w).trans hcross
have hwv := (hdir w v).trans hcross
havehZ : Z χ χ = Z v v + Z w w + Z v w + Z w v :=by
dsimp [Z]
rw [hχ, outer_add_four]
simp only [tensorMap_add, mul_add, add_mul]
change traceNorm (Z χ χ) ≤ _
rw [hZ]
have ht₁ := traceNorm_add_le (Z v v) (Z w w)
have ht₂ := traceNorm_add_le (Z v v + Z w w) (Z v w)
have ht₃ := traceNorm_add_le (Z v v + Z w w + Z v w) (Z w v)
change traceNorm _ ≤Real.sqrt (p X₀Y₀ χ * p X₀Y₁ χ) +
Real.sqrt (p X₁Y₀ χ * p X₁Y₁ χ) + 2 * Real.sqrt (p X₀Y₁ χ * p X₁Y₀ χ)
linarith
lemmacp_sum {a b : ℕ} {ν : Type v1039_0} [Fintype ν] (L : ν →Mat a →ₗ[ℂ] Mat b)
(hL : ∀ s, CompletelyPositive (L s)) : CompletelyPositive (∑ s, L s) :=by
proof · 9
lines
intro r U hU
havehe : amplify (∑ s, L s) r U = ∑ s, amplify (L s) r U:=by
ext i j
change (∑ s, L s) (fun x y =>U (i.1,x) (j.1,y)) i.2 j.2 = _
erw [LinearMap.sum_apply]
simp only [Matrix.sum_apply, amplify]
rw [he]
exact Matrix.posSemidef_sum _ (fun s _ => hL s r U hU)
lemmacp_comp {a b c : ℕ} {L : Mat b →ₗ[ℂ] Mat c} {M : Mat a →ₗ[ℂ] Mat b}
(hL : CompletelyPositiveL) (hM : CompletelyPositiveM) : CompletelyPositive (L.comp M) :=by
proof · 2
lines
intro r U hU
exact hL r (amplify M r U) (hM r U hU)
lemmacp_tensorLinear {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b} {M : Mat c →ₗ[ℂ] Mat d}
(hL : CompletelyPositiveL) (hM : CompletelyPositiveM) : CompletelyPositive (tensorLinear LM) :=by
proof · 5
lines
intro r U hU
have h := (tensorMap_amplify_positive hL hM
(hU.submatrix (funi : Fin r × (Fin a ×Fin c) => (i.1, finProdFinEquiv i.2)))).submatrix
(funi : Fin r ×Fin (b*d) => (i.1, finProdFinEquiv.symm i.2))
exact h
lemmatensorLinear_transpose {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d) :
(tensorLinear LM).comp (transposeLinear (a*c)) =
tensorLinear (L.comp (transposeLinear a)) (M.comp (transposeLinear c)) :=by
proof · 4
lines
ext U i j
exact congr_fun (congr_fun (tensorMap_global_transpose LM
(U.submatrix finProdFinEquiv finProdFinEquiv)).symm
(finProdFinEquiv.symm i)) (finProdFinEquiv.symm j)