theoremexists_local_instrument_sampler {O : Type v4286_0} {M : Type v4286_1} [MeasurableSpaceO]
[StandardBorelSpaceO] [NonemptyO] [MeasurableSpaceM]
(alice : ℕ→Bool)
(κA κB : (n : ℕ) →Kernel ((Fin n → (O ⊕ Unit)) × (Fin n →M)) O)
[∀ n, IsMarkovKernel (κA n)] [∀ n, IsMarkovKernel (κB n)]
(sendA sendB : (n : ℕ) → ((Fin n → (O ⊕ Unit)) × (Fin n →M)) ×O→M)
(ha : ∀ n, Measurable (sendA n)) (hb : ∀ n, Measurable (sendB n)) :
∃p : LocalOutcomeSamplerOM,
p.alice = alice ∧ p.sendA = sendA ∧ p.sendB = sendB ∧
(∀ n s, volume.map (fun u => p.sampleA n (s,u)) = κA n s) ∧
(∀ n s, volume.map (fun u => p.sampleB n (s,u)) = κB n s) :=by
proof · 7
lines
have hA (n : ℕ) := sample_instrument_kernel (κA n)
have hB (n : ℕ) := sample_instrument_kernel (κB n)
choose fA hfA hlawA hrestA using hA
choose fB hfB hlawB hrestB using hB
exact ⟨⟨alice,fun n pair => fA n pair.1 pair.2,
fun n pair => fB n pair.1 pair.2,sendA,sendB,hfA,hfB,ha,hb⟩,
rfl,rfl,rfl,hlawA,hlawB⟩
definstrumentKernel
(κA κB : (n : ℕ) →Kernel ((Fin n → (O ⊕ Unit)) × (Fin n →M)) O)
(n : ℕ) : Kernel (Fin n →O) O:=
body · 5
lines
if p.alice n then
(κA n).comap (fun x => (p.extractPrivate true n x,p.publicFrom n x))
((p.measurable_extractPrivate true n).prodMk (p.measurable_publicFrom n)) else
(κB n).comap (fun x => (p.extractPrivate false n x,p.publicFrom n x))
((p.measurable_extractPrivate false n).prodMk (p.measurable_publicFrom n))
lemmacausal_step_law
(κA κB : (n : ℕ) →Kernel ((Fin n → (O ⊕ Unit)) × (Fin n →M)) O)
(ha : ∀ n s, volume.map (fun u => p.sampleA n (s,u)) = κA n s)
(hb : ∀ n s, volume.map (fun u => p.sampleB n (s,u)) = κB n s) :
∀ n s, volume.map (fun u => p.causal.step n (s,u)) = p.instrumentKernel κA κB n s :=by
proof · 6
lines
intro n s
change volume.map (fun u =>if p.alice n then
p.sampleA n ((p.extractPrivate true n s,p.publicFrom n s),u) else
p.sampleB n ((p.extractPrivate false n s,p.publicFrom n s),u)) = _
unfold instrumentKernel
split <;> simp_all only [Kernel.comap_apply]
theorempositive_matrix_martingale_extension (W : ℕ→ Ω →Matrix ι ι ℂ)
(hr : ∀ i j, Martingale (fun n ω => (W n ω i j).re) F μ)
(hi : ∀ i j, Martingale (fun n ω => (W n ω i j).im) F μ)
(hp : ∀ n, ∀ᵐ ω ∂μ, (W n ω).PosSemidef)
(ht : ∀ n, ∀ᵐ ω ∂μ, (trace (W n ω)).re ≤1) :
∃V : PositiveMatrixMeasure Ω ι, ∀ n S, MeasurableSet[F n] S→V.value S = fun i j =>∫ ω inS, W n ω i j ∂μ :=by
proof · 63
lines
have hbound (n : ℕ) (i j : ι) : ∀ᵐ ω ∂μ, ‖W n ω i j‖ ≤1:=by
filter_upwards [hp n,ht n] with ω hω htω
exact (psd_entry_norm_le_trace hω i j).trans htω
have hbr (i j : ι) (n : ℕ) : ∀ᵐ ω ∂μ, ‖(W n ω i j).re‖ ≤1:=
(hbound n i j).mono (fun ω hω => (show ‖(W n ω i j).re‖ ≤ ‖W n ω i j‖ fromby simpa only [Real.norm_eq_abs] usingComplex.abs_re_le_norm (W n ω i j)).trans hω)
have hbi (i j : ι) (n : ℕ) : ∀ᵐ ω ∂μ, ‖(W n ω i j).im‖ ≤1:=
(hbound n i j).mono (fun ω hω => (show ‖(W n ω i j).im‖ ≤ ‖W n ω i j‖ fromby simpa only [Real.norm_eq_abs] usingComplex.abs_im_le_norm (W n ω i j)).trans hω)
choose gr hgr htr hcr using (fun i j => bounded_martingale_limit (hr i j) (hbr i j))
choose gi hgi hti hci using (fun i j => bounded_martingale_limit (hi i j) (hbi i j))
letG : Ω →Matrix ι ι ℂ:=fun ω i j => (gr i j ω : ℂ) + (gi i j ω : ℂ)*Complex.Ihave hG (i j : ι) : Integrable (fun ω =>G ω i j) μ :=
((hgr i j).ofReal).add (((hgi i j).ofReal).mul_const Complex.I)
havehlim : ∀ᵐ ω ∂μ, Tendsto (fun n =>W n ω) atTop (𝓝 (G ω)) :=byhave htr' := ae_all_iff.mpr (fun i => ae_all_iff.mpr (htr i))
have hti' := ae_all_iff.mpr (fun i => ae_all_iff.mpr (hti i))
filter_upwards [htr',hti'] with ω hωr hωi
havehc : Tendsto (fun n i j =>W n ω i j) atTop (𝓝 (fun i j =>G ω i j)) :=by
apply tendsto_pi_nhds.mpr; intro i
apply tendsto_pi_nhds.mpr; intro j
have hh := (Complex.continuous_ofReal.continuousAt.tendsto.comp (hωr i j)).add
((Complex.continuous_ofReal.continuousAt.tendsto.comp (hωi i j)).mul_const Complex.I)
simpa only [Function.comp_apply, Pi.add_apply, Complex.re_add_im] using hh
havehcM : Continuous (Matrix.of : (ι → ι →ℂ) →Matrix ι ι ℂ) :=
continuous_matrix (fun i j => continuous_apply_apply i j)
exact hcM.continuousAt.tendsto.comp hc
havehGp : ∀ᵐ ω ∂μ, (G ω).PosSemidef:=by
filter_upwards [hlim,ae_all_iff.mpr hp] with ω hω hh
exact (isClosed_Ici.mem_of_tendsto hω (Eventually.of_forall (fun n => (hh n).nonneg))).posSemidef
refine ⟨positiveMatrixMeasureOfDensity hG hGp, ?_⟩
intro n S hS
rw [positiveMatrixMeasureOfDensity_value hG hGp S (F.le n S hS)]
have hc (i j : ι) : Integrable (fun ω =>W n ω i j) μ :=byhave hh := ((hr i j).integrable n).ofReal.add (((hi i j).integrable n).ofReal.mul_const Complex.I)
havehefun : (fun ω =>W n ω i j) =
((fun ω => ((W n ω i j).re : ℂ)) + (fun ω => ((W n ω i j).im : ℂ)*Complex.I)) :=
funext (fun ω => (Complex.re_add_im (W n ω i j)).symm)
rw [hefun]
exact hh
have he (i j : ι) : (∫ ω inS, G ω i j ∂μ) = ∫ ω inS, W n ω i j ∂μ :=by
apply Complex.ext
· change RCLike.re (∫ ω inS, G ω i j ∂μ) = RCLike.re (∫ ω inS, W n ω i j ∂μ)
rw [← integral_re (hG i j).integrableOn, ← integral_re (hc i j).integrableOn]
haveheG : (fun ω =>RCLike.re (G ω i j)) = gr i j :=by
funext ω
change ((gr i j ω : ℂ) + (gi i j ω : ℂ)*Complex.I).re = _
simp
rw [heG]
calc
_ = ∫ ω inS, μ[gr i j | F n] ω ∂μ :=
(setIntegral_condExp (F.le n) (hgr i j) hS).symm
_ = _ := integral_congr_ae (ae_restrict_of_ae (hcr i j n).symm)
· change RCLike.im (∫ ω inS, G ω i j ∂μ) = RCLike.im (∫ ω inS, W n ω i j ∂μ)
rw [← integral_im (hG i j).integrableOn, ← integral_im (hc i j).integrableOn]
haveheG : (fun ω =>RCLike.im (G ω i j)) = gi i j :=by
funext ω
change ((gr i j ω : ℂ) + (gi i j ω : ℂ)*Complex.I).im = _
simp
rw [heG]
calc
_ = ∫ ω inS, μ[gi i j | F n] ω ∂μ :=
(setIntegral_condExp (F.le n) (hgi i j) hS).symm
_ = _ := integral_congr_ae (ae_restrict_of_ae (hci i j n).symm)
exact Matrix.ext (fun i j => (integral_matrix_entry (integrable_matrix_of_entries hG).integrableOn i j).trans (he i j))
lemmalocalAction_refFilter (L : Mat a →ₗ[ℂ] Mat b) (K : Matrix κ η ℂ)
(U : Matrix (Fin a × η) (Fin a × η) ℂ) :
localAction L (referenceFilter KU) = referenceFilter K (localAction LU) :=by
proof · 25
lines
ext ⟨i,x⟩ ⟨j,y⟩
rw [referenceFilter_apply]
change L (fun u v => referenceFilter KU (u,x) (v,y)) i j = _
havehe : (fun u v => referenceFilter KU (u,x) (v,y) : Mat a) =
∑ s, ∑ t, (K x s * star (K y t)) • (fun u v =>U (u,s) (v,t) : Mat a) :=by
apply Matrix.ext; intro u v
rw [referenceFilter_apply]
simp only [Finset.sum_apply,Pi.smul_apply,smul_eq_mul]
apply Finset.sum_congr rfl; intro s _
apply Finset.sum_congr rfl; intro t _
ring
havehm : L (∑ s, ∑ t, (K x s * star (K y t)) • (fun u v =>U (u,s) (v,t) : Mat a)) =
∑ s, ∑ t, (K x s * star (K y t)) • L (fun u v =>U (u,s) (v,t)) :=by
exact map_sum L _ _ |>.trans (Finset.sum_congr rfl (fun s _ =>
(map_sum L _ _).trans (Finset.sum_congr rfl (fun t _ =>L.map_smul _ _))))
have hh := congrArg (funF : Mat b =>F i j) ((congrArg L he).trans hm)
refine hh.trans ?_
simp only [Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul]
apply Finset.sum_congr rfl; intro s _
apply Finset.sum_congr rfl; intro t _
unfold localAction
ring
defsum {β : Type v4900_0} [Fintype β] (W : β →PositiveMatrixMeasure Ω ι) :
PositiveMatrixMeasure Ω ι where
body · 6
lines
entry i j :=∑ k, (W k).entry i j
positive S hS :=byhavehe : (fun i j => (∑ k, (W k).entry i j) S) = ∑ k, (W k).value S:=by
ext i j; simp [value,Matrix.sum_apply]
rw [he]
exact Matrix.posSemidef_sum _ (fun k _ => (W k).positive S hS)
lemmasum_value [DecidableEq ι] {β : Type v4909_0} [Fintype β] (W : β →PositiveMatrixMeasure Ω ι) (S : Set Ω) :
(sum W).value S = ∑ k, (W k).value S:=by
lemmavalue_zero_of_sum_trace_zero {β : Type v4913_0} [Fintype β]
(W : β →PositiveMatrixMeasure Ω ι) (S : Set Ω) (hS : MeasurableSetS)
(h : (sum W).traceMeasure S=0) (k : β) : (W k).value S=0:=by
proof · 10
lines
have he := value_zero_of_traceMeasure_zero (sum W) S hS h
rw [sum_value] at he
haveht : ∑ l, (Matrix.trace ((W l).value S)).re=0:=byhave hh := congrArg (funM : Matrix ι ι ℂ=> (trace M).re) he
simpa [Matrix.trace_sum,Complex.re_sum] using hh
have hp (l : β) : 0≤ (Matrix.trace ((W l).value S)).re :=
(RCLike.nonneg_iff.mp ((W l).positive S hS).trace_nonneg).1have hz := (Finset.sum_eq_zero_iff_of_nonneg (fun l _ => hp l)).mp ht k (Finset.mem_univ k)
apply ((W k).positive S hS).trace_eq_zero_iff.mp
exact Complex.ext hz (RCLike.nonneg_iff.mp ((W k).positive S hS).trace_nonneg).2
change (∫ t inS, ∑ i, ∑ j, T i j * W.density μ t j i ∂μ) =
∑ i, ∑ j, T i j * W.value S j i
rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _
(fun j _ => ((W.integrable_entry μ j i).const_mul (T i j)).integrableOn))]
apply Finset.sum_congr rfl; intro i _
rw [integral_finsetSum _ (fun j _ =>
((W.integrable_entry μ j i).const_mul (T i j)).integrableOn)]
apply Finset.sum_congr rfl; intro j _
rw [integral_const_mul,W.integral_density_entry μ hAC S hS j i]
lemmalocalAction_product [Fintype η] [DecidableEq η] (L : Mat a →ₗ[ℂ] Mat b)
(A : Mat a) (B : Matrix η η ℂ) :
localAction L (A ⊗ₖ B) = LA ⊗ₖ B:=by
proof · 6
lines
ext ⟨i,x⟩ ⟨j,y⟩
change L (fun u v =>A u v * B x y) i j = LA i j * B x y
havehe : (fun u v =>A u v * Bx y : Mat a) = B x y • A:=by
ext u v; simp [smul_eq_mul,mul_comm]
rw [he,map_smul]
simp [smul_eq_mul,mul_comm]
lemmakeepReference_localAction [Fintype η] [DecidableEq η] (L : Mat a →ₗ[ℂ] Mat b)
(hL : ∀A, trace (LA) = trace A)
(U : Matrix (Fin a × η) (Fin a × η) ℂ) :
keepReference (localAction LU) = keepReference U:=by
lemmatrace_localAction (L : Mat a →ₗ[ℂ] Mat b)
(hL : ∀A, trace (LA) = trace A)
(U : Matrix (Fin a × η) (Fin a × η) ℂ) :
trace (localAction LU) = trace U:=by
proof · 1
line
rw [← trace_keepReference,keepReference_localAction L hL,trace_keepReference]
structureQuantumInstrument (O : Type v5068_0) [MeasurableSpaceO] (a b : ℕ) where
body · 6
lines
operation : SetO→Mat a →ₗ[ℂ] Mat b
coefficient : Fin b →Fin b →Fin a →Fin a →ComplexMeasureOoperation_coefficient : ∀S i j x y,
operation S (matrixUnit x y) i j = coefficient i j x y ScompletelyPositive : ∀S, MeasurableSetS→CompletelyPositive (operation S)
totalTrace : ∀U, trace (operation Set.univ U) = trace U
defretainReference (W : PositiveMatrixMeasureO (ι × η)) : PositiveMatrixMeasureO η where
body · 9
lines
entry x y :=∑ i, W.entry (i,x) (i,y)
positive S hS :=byhavehp : (keepReference (W.value S)).PosSemidef:= keepReference_pos (W.positive S hS)
havehe : (funx y : η => (∑ i, W.entry (i,x) (i,y)) S) =
keepReference (W.value S) :=by
ext x y
simp only [_root_.sum_apply,keepReference,value]
rw [he]
exact hp
lemmaoperation_apply (S : SetO) (U : Mat a) (i j : Fin b) :
J.operation SU i j = ∑ x, ∑ y, U x y * J.coefficient i j x y S:=by
proof · 6
lines
have hh := congrArg (funX : Mat b =>X i j)
(congrArg (J.operation S) (matrix_sum_units U))
rw [map_sum] at hh
simp only [map_sum,map_smul,Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,
J.operation_coefficient] at hh
exact hh
defwithReference {η : Type v5151_0} [Fintype η] [DecidableEq η]
(U : Matrix (Fin a × η) (Fin a × η) ℂ) (hU : U.PosSemidef) :
PositiveMatrixMeasureO (Fin b × η) where
body · 10
lines
entry p q :=∑ x, ∑ y, U (x,p.2) (y,q.2) • J.coefficient p.1 q.1 x y
positive S hS :=byhavehe : (funp q : Fin b × η =>
(∑ x, ∑ y, U (x,p.2) (y,q.2) • J.coefficient p.1 q.1 x y) S) =
localAction (J.operation S) U:=by
ext ⟨i,r⟩ ⟨j,s⟩
simp only [_root_.sum_apply,_root_.smul_apply,smul_eq_mul]
exact (J.operation_apply S _ i j).symm
rw [he]
exact localAction_positive _ (J.completelyPositive S hS) hU
lemmawithReference_value {η : Type v5165_0} [Fintype η] [DecidableEq η]
(U : Matrix (Fin a × η) (Fin a × η) ℂ) (hU : U.PosSemidef) (S : SetO) :
(J.withReference U hU).value S = localAction (J.operation S) U:=by
proof · 4
lines
ext ⟨i,r⟩ ⟨j,s⟩
change (∑ x, ∑ y, U (x,r) (y,s) • J.coefficient i j x y) S = _
simp only [_root_.sum_apply,_root_.smul_apply,smul_eq_mul]
exact (J.operation_apply S _ i j).symm
theoremreference_posterior_mean {η : Type v5235_0} [Fintype η] [DecidableEq η]
(U : Matrix (Fin a × η) (Fin a × η) ℂ) (hU : DensityU) :
letW:=J.withReference U hU.1
proof · 20
lines
(∀ᵐ o ∂W.traceMeasure, Density (W.density W.traceMeasure o)) ∧∀ x y, (∫ o, keepReference (W.density W.traceMeasure o) x y ∂W.traceMeasure) =
keepReference U x y :=by
dsimp only
refine ⟨(J.withReference U hU.1).normalized_density,?_⟩
intro x y
letW:=J.withReference U hU.1havehe : (∫ o, keepReference (W.density W.traceMeasure o) x y ∂W.traceMeasure) =
keepReference (W.value Set.univ) x y :=by
change (∫ o, ∑ i, W.density W.traceMeasure o (i,x) (i,y) ∂W.traceMeasure) = _
rw [integral_finsetSum _ (fun i _ =>W.integrable_entry W.traceMeasure (i,x) (i,y))]
change (∑ i, ∫ o, W.density W.traceMeasure o (i,x) (i,y) ∂W.traceMeasure) = _
change (∑ i, ∫ o, W.density W.traceMeasure o (i,x) (i,y) ∂W.traceMeasure) =
∑ i, W.value Set.univ (i,x) (i,y)
apply Finset.sum_congr rfl
intro i _
simpa only [Measure.restrict_univ] usingW.integral_density_entry W.traceMeasure
W.value_zero_of_traceMeasure_zero Set.univ MeasurableSet.univ (i,x) (i,y)
rw [he]
exact congrArg (funA : Matrix η η ℂ=>A x y) (J.total_reference_unchanged U hU.1)
theoreminstrument_history_reference_extension :
∃V : PositiveMatrixMeasure (ℕ→O) ι, ∀ n S,
MeasurableSet[historyFiltration n] S→V.value S = fun i j =>∫ x inS, U n (historyPrefix n x) i j ∂P:=by
proof · 5
lines
apply positive_matrix_martingale_extension (fun n x =>U n (historyPrefix n x))
· exact reference_history_martingale_re PK hP U hU hm hmean
· exact reference_history_martingale_im PK hP U hU hm hmean
· intro n; exact Filter.Eventually.of_forall (fun x => (hU n _).1)
· intro n; exact Filter.Eventually.of_forall (fun x =>by simp only [(hU n _).2,Complex.one_re,le_refl])