classical
exact {
operation :=funE=>if k ∈EthenLinearMap.id else0
positive :=by
intro E hE x hx
by_cases h : k ∈E
· simpa only [h, ite_eq_left, LinearMap.id_apply] using hx
· simp only [h]; exact le_rfl
total_unit :=by simp
}
law :=Measure.dirac k
probability := inferInstance
posterior _ :=S
posterior_positive _ := hS
posterior_trace _ := hn
integrable _ _ _ := integrable_const _
update E hE x i j :=byby_cases h : k ∈E
· simp [deterministicInstrument,h,Measure.real, Measure.dirac_apply', hE]
· simp [deterministicInstrument,h,Measure.real, Measure.dirac_apply', hE]
lemmadeterministic_event [MeasurableSingletonClassK] [Fintype ι] [DecidableEq ι] (k l : K) (S : ReferenceFunctionalA ι) :
S ((deterministicInstrument (A:=A) k).operation {l} 1) =
if k = l thenS1else0:=by
proof · 1
line
by_cases h : k = l <;> simp [deterministicInstrument,h]
defscalarIncoming (G : Ω →Matrix ι ι ℂ)
(hG : ∀ x, ZeroKey.Density (G x)) (hm : Measurable[L] G)
(hc : ∀ n E, MeasurableSet[F n] E→
(∫ x inE, G x ∂μ) = ∫ x inE, U n x ∂μ) :
IncomingObservableProcess (L:=L) (A:=ℂ) μ FUwhere
body · 6
lines
state x := scalarReference (G x)
positive x := scalarReference_positive (hG x).1
positive_unit := zero_le_one
normalized x :=by simpa using (hG x).2
local_measurable :=by simpa using hm
causality :=by simpa using hc
lemmaclassicalReadout_value [NonemptyK] (f : Ω →K) (hf : Measurable[L] f) (k : K) (x : Ω) :
(e.classicalReadout f hf).value k x = if f x = k then e.state x 1else0:=
lemmaintegral_entry (n : ℕ) (S : Set Ω) (hS : MeasurableSet[F n] S) (i j : ι) :
(∫ ω inS, H.density n ω i j ∂μ) = H.finiteValue n S i j :=by
proof · 6
lines
rw [setIntegral_trim (F.le n) (H.measurable_entry n i j).stronglyMeasurable hS]
let : MeasurableSpace Ω :=F n
apply (H.finiteMeasure n).integral_density_entry _ _ S hS i j
intro T hT hμ
apply (H.finiteMeasure n).value_zero_of_traceMeasure_zero T hT
rwa [H.traceLaw n]
lemmadensity_entry_martingale_re (i j : ι) :
Martingale (fun n ω => (H.density n ω i j).re) F μ :=by
proof · 15
lines
refine ⟨fun n => ((H.measurable_entry n i j).re).stronglyMeasurable, ?_⟩
intro n k hnk
symm
apply ae_eq_condExp_of_forall_setIntegral_eq (F.le n) ((H.integrable_entry k i j).re)
· intro S _ _
exact (H.integrable_entry n i j).re.integrableOn
· intro S hS _
change (∫ ω inS, RCLike.re (H.density n ω i j) ∂μ) =
∫ ω inS, RCLike.re (H.density k ω i j) ∂μ
rw [integral_re (H.integrable_entry n i j).integrableOn,
integral_re (H.integrable_entry k i j).integrableOn,
H.integral_entry n S hS i j,
H.integral_entry k S ((F.mono hnk) S hS) i j]
exact congrArg (funZ : Matrix ι ι ℂ=> (Z i j).re) (H.consistency n k hnk S hS)
· exact ((H.measurable_entry n i j).re).stronglyMeasurable.aestronglyMeasurable
lemmadensity_entry_martingale_im (i j : ι) :
Martingale (fun n ω => (H.density n ω i j).im) F μ :=by
proof · 15
lines
refine ⟨fun n => ((H.measurable_entry n i j).im).stronglyMeasurable, ?_⟩
intro n k hnk
symm
apply ae_eq_condExp_of_forall_setIntegral_eq (F.le n) ((H.integrable_entry k i j).im)
· intro S _ _
exact (H.integrable_entry n i j).im.integrableOn
· intro S hS _
change (∫ ω inS, RCLike.im (H.density n ω i j) ∂μ) =
∫ ω inS, RCLike.im (H.density k ω i j) ∂μ
rw [integral_im (H.integrable_entry n i j).integrableOn,
integral_im (H.integrable_entry k i j).integrableOn,
H.integral_entry n S hS i j,
H.integral_entry k S ((F.mono hnk) S hS) i j]
exact congrArg (funZ : Matrix ι ι ℂ=> (Z i j).im) (H.consistency n k hnk S hS)
· exact ((H.measurable_entry n i j).im).stronglyMeasurable.aestronglyMeasurable
theoremfull_reference_measure : ∃V : PositiveMatrixMeasure Ω ι,
∀ n S, MeasurableSet[F n] S→V.value S = H.finiteValue n S:=by
proof · 7
lines
obtain ⟨V,hV⟩ := positive_matrix_martingale_extension (H.density)
H.density_entry_martingale_re H.density_entry_martingale_im H.density_pos
(fun n => (H.density_trace n).mono (fun _ h => le_of_eq h))
refine ⟨V,fun n S hS => ?_⟩
rw [hV n S hS]
ext i j
exact H.integral_entry n S hS i j
lemmarestrictEvent_value [DecidableEq ι] (W : PositiveMatrixMeasure Ω ι) (A : Set Ω)
(hA : MeasurableSetA) (S : Set Ω) (hS : MeasurableSetS) :
(W.restrictEvent A hA).value S = W.value (S∩A) :=by
proof · 2
lines
ext i j
exact VectorMeasure.restrict_apply _ hA hS
lemmaeq_of_value [DecidableEq ι] (WV : PositiveMatrixMeasure Ω ι)
(h : ∀S, MeasurableSetS→W.value S = V.value S) : W = V:=by
proof · 9
lines
havehe : W.entry = V.entry :=by
funext i j
apply VectorMeasure.ext
intro S hS
exact congrArg (funX : Matrix ι ι ℂ=>X i j) (h S hS)
cases W
cases V
cases he
rfl
lemmabitReadout_value (W : PositiveMatrixMeasure Ω ι) (record : Ω →T) (hr : Measurable record)
(a b : Ω →Bool) (ha : Measurable a) (hb : Measurable b) (i j : Bool)
(S : SetT) (hS : MeasurableSetS) :
(W.bitReadout record hr a b ha hb i j).value S =
W.value ((record ⁻¹' S) ∩ ((a ⁻¹' {i}) ∩ (b ⁻¹' {j}))) :=by
lemmabitReadout_filter {κ : Type v12122_0} [Fintype κ] [DecidableEq κ]
(W : PositiveMatrixMeasure Ω ι) (record : Ω →T) (hr : Measurable record)
(a b : Ω →Bool) (ha : Measurable a) (hb : Measurable b) (i j : Bool)
(K : Matrix κ ι ℂ) (S : SetT) (hS : MeasurableSetS) :
((W.filter K).bitReadout record hr a b ha hb i j).value S =
((W.bitReadout record hr a b ha hb i j).filter K).value S:=by
theoremfull_reference_born (hm : mΩ = ⨆ n, F n) :
∃W : PositiveMatrixMeasure Ω ι,
(∀ n S, MeasurableSet[F n] S→W.value S = H.finiteValue n S) ∧∀ (E : Matrix ι ι ℂ), E.PosSemidef→∀ (ν : Measure Ω) [IsFiniteMeasure ν],
(∀ n S, MeasurableSet[F n] S→
(trace (E * H.finiteValue n S)).re = ν.real S) →W.testMeasure E = ν :=by
proof · 9
lines
obtain ⟨W,hW⟩ :=H.full_reference_measure
refine ⟨W,hW,?_⟩
intro E hE ν hν htests
apply scalar_measure_ext_on_filtration _ _ F hm
intro n S hS
apply (ENNReal.toReal_eq_toReal_iff' (measure_ne_top _ _) (measure_ne_top _ _)).mp
change (W.testMeasure E).real S = ν.real S
rw [W.testMeasure_real E hE S (F.le n S hS),hW n S hS]
exact htests n S hS
lemmavalue_sum_readout [DecidableEq ι] [Fintype α] [MeasurableSpace α] [MeasurableSingletonClass α]
(W : PositiveMatrixMeasure Ω ι) (a : Ω → α) (ha : Measurable a)
(S : Set Ω) (hS : MeasurableSetS) :
∑ i, W.value (S∩ a ⁻¹' {i}) = W.value S:=by
proof · 18
lines
classical
havehd : Set.PairwiseDisjoint (↑(Finset.univ : Finset α)) (fun i =>S∩ a ⁻¹' {i}) :=by
intro i _ j _ hij
apply Set.disjoint_left.mpr
intro x hi hj
exact hij (hi.2.symm.trans hj.2)
havehm : ∀ i ∈ (Finset.univ : Finset α), MeasurableSet (S∩ a ⁻¹' {i}) :=fun i _ => hS.inter (ha (measurableSet_singleton i))
havehu : (⋃ i ∈ (Finset.univ : Finset α), S∩ a ⁻¹' {i}) = S:=by
ext x
simp only [Finset.mem_univ,Set.iUnion_true,Set.mem_iUnion,Set.mem_inter_iff,
Set.mem_preimage,Set.mem_singleton_iff]
exact ⟨fun ⟨_,hx,_⟩ => hx, fun hx => ⟨a x,hx,rfl⟩⟩
ext i j
simp only [Matrix.sum_apply]
have h := (W.entry i j).of_biUnion_finset hd hm
rw [hu] at h
simpa only [Finset.mem_univ,ite_true,value] using h.symm
lemmabitReadout_total (W : PositiveMatrixMeasure Ω ι) (record : Ω →T) (hr : Measurable record)
(a b : Ω →Bool) (ha : Measurable a) (hb : Measurable b)
(S : SetT) (hS : MeasurableSetS) :
∑ i, ∑ j, (W.bitReadout record hr a b ha hb i j).value S = W.value (record ⁻¹' S) :=by
proof · 6
lines
simp_rw [bitReadout_value _ _ _ _ _ _ _ _ _ _ hS, ←Set.inter_assoc]
have hi (i : Bool) : (∑ j, W.value ((record ⁻¹' S∩ a ⁻¹' {i}) ∩ b ⁻¹' {j})) =
W.value (record ⁻¹' S∩ a ⁻¹' {i}) :=W.value_sum_readout b hb _ ((hr hS).inter (ha (measurableSet_singleton i)))
simp_rw [hi]
exact W.value_sum_readout a ha _ (hr hS)
G : (ℕ→O) →Matrix ι ι ℂH : (ℕ→O) →Matrix η η ℂmeasurableG : Measurable[d.sampler.localField true] GmeasurableH : Measurable[d.sampler.localField false] HdensityG : ∀ x, Density (G x)
densityH : ∀ x, Density (H x)
consistentG : ∀ n S, MeasurableSet[historyFiltration n] S→
(∫ x inS, G x ∂d.probeLaw) = ∫ x inS,
AdaptiveQuantum.globalLocalReferenceA d.sampler d.kernelA p.executionA n (historyPrefix n x) ∂d.probeLaw
consistentH : ∀ n S, MeasurableSet[historyFiltration n] S→
(∫ x inS, H x ∂d.probeLaw) = ∫ x inS,
AdaptiveQuantum.globalLocalReferenceB d.sampler d.kernelB p.executionB n (historyPrefix n x) ∂d.probeLaw
reference : PositiveMatrixMeasure (ℕ→O) (ι × η)
reference_value : ∀S, MeasurableSetS→ reference.value S = ∫ x inS, G x ⊗ₖ H x ∂d.probeLaw
reference_prefix : ∀ n S, MeasurableSet[historyFiltration n] S→
reference.value S = ∫ x inS,
AdaptiveQuantum.jointReference d.sampler d.kernelA d.kernelB p.executionA p.executionB
n (historyPrefix n x) ∂d.probeLaw
lemmacompleteReference_value (i j : K) (x : ℕ→O) :
p.toFinite.completeReference i j x =
if p.outputA x = i ∧ p.outputB x = j then p.completion.G x ⊗ₖ p.completion.H x else0:=by
proof · 4
lines
simp only [FiniteProtocol.completeReference, toFinite,
IncomingObservableProcess.classicalReadout_value, scalarIncoming]
by_cases ha : p.outputA x = i <;> by_cases hb : p.outputB x = j <;>
simp [ha,hb,scalarReference_one]
lemmavalue_eq_of_ae_set (W : PositiveMatrixMeasure Ω ι)
(SU : Set Ω) (hS : MeasurableSetS) (hU : MeasurableSetU)
(h : S =ᵐ[W.traceMeasure] U) : W.value S = W.value U:=by
proof · 4
lines
ext i j
rw [←W.integral_density_entry W.traceMeasure W.value_zero_of_traceMeasure_zero S hS i j,
←W.integral_density_entry W.traceMeasure W.value_zero_of_traceMeasure_zero U hU i j]
exact setIntegral_congr_set h
theorembitReadout_eq_off_private_null (W : PositiveMatrixMeasure Ω ι)
(record : Ω →T) (hr : Measurable record)
(a b a' b' : Ω →Bool) (ha : Measurable a) (hb : Measurable b)
(ha' : Measurable a') (hb' : Measurable b')
(N : Set Ω) (hN : W.traceMeasure N = 0)
(hbits : ∀ x, x ∉N→ a x = a' x ∧ b x = b' x)
(i j : Bool) :
W.bitReadout record hr a b ha hb i j = W.bitReadout record hr a' b' ha' hb' i j :=by
proof · 16
lines
apply eq_of_value
intro S hS
rw [bitReadout_value _ _ _ _ _ _ _ _ _ _ hS,
bitReadout_value _ _ _ _ _ _ _ _ _ _ hS]
apply value_eq_of_ae_set _ _ _
((hr hS).inter ((ha (measurableSet_singleton i)).inter (hb (measurableSet_singleton j))))
((hr hS).inter ((ha' (measurableSet_singleton i)).inter (hb' (measurableSet_singleton j))))
havehn : ∀ᵐ x ∂W.traceMeasure, x ∉N:=by
rw [ae_iff]
simpa only [not_not,Set.ofPred_mem_eq] using hN
filter_upwards [hn] with x hx
rcases hbits x hx with ⟨he,hf⟩
apply propext
change (record x ∈S∧ (a x = i ∧ b x = j)) ↔
(record x ∈S∧ (a' x = i ∧ b' x = j))
rw [he,hf]
theoremprepared_default_outputs {κ : Type v12423_0} [Fintype κ] [DecidableEq κ]
(V : PositiveMatrixMeasure Ω κ) (W : PositiveMatrixMeasure Ω ι)
(K : Matrix κ ι ℂ) (F : Filtrationℕ mΩ) (hm : mΩ = ⨆ n, F n)
(hfinite : ∀ n S, MeasurableSet[F n] S→V.value S = K * W.value S * Kᴴ)
(record : Ω →T) (hr : Measurable record)
(a b a' b' : Ω →Bool) (ha : Measurable a) (hb : Measurable b)
(ha' : Measurable a') (hb' : Measurable b')
(N : Set Ω) (hN : V.traceMeasure N = 0)
(hbits : ∀ x, x ∉N→ a x = a' x ∧ b x = b' x)
(i j : Bool) :
V.bitReadout record hr a b ha hb i j =
(W.bitReadout record hr a' b' ha' hb' i j).filter K:=by
proof · 7
lines
rw [V.bitReadout_eq_off_private_null record hr a b a' b' ha hb ha' hb' N hN hbits i j]
havehe : V = W.filter K:=by
exact W.filter_eq_of_filtration VKF hm hfinite
rw [he]
apply eq_of_value
intro S hS
exact W.bitReadout_filter record hr a' b' ha' hb' i j KS hS
theoremInstrumentRun.tensor_event [OneC] (E : SetO) (hE : MeasurableSetE)
(a : B) (b : C) :
(∫ o inE, r.posterior o a ⊗ₖ T b ∂r.law) = S (J.operation E a) ⊗ₖ T b :=by
proof · 8
lines
havehi : Integrable (fun o => r.posterior o a ⊗ₖ T b) r.law :=by
apply ZeroKey.integrable_matrix_of_entries
intro i j
exact (r.integrable a i.1 j.1).mul_const _
ext i j
rw [ZeroKey.integral_matrix_entry hi.integrableOn]
simp only [Matrix.kroneckerMap_apply]
rw [integral_mul_const,r.update E hE]
theoremInstrumentRun.filtered_tensor_event (K : Matrix κ (ι × η) ℂ)
(E : SetO) (hE : MeasurableSetE) (a : B) (b : C) :
(∫ o inE, K * (r.posterior o a ⊗ₖ T b) * Kᴴ ∂r.law) =
K * (S (J.operation E a) ⊗ₖ T b) * Kᴴ :=by
proof · 5
lines
havehi : Integrable (fun o => r.posterior o a ⊗ₖ T b) r.law :=by
apply ZeroKey.integrable_matrix_of_entries
intro i j
exact (r.integrable a i.1 j.1).mul_const _
rw [ZeroKey.integral_filter _ hi.integrableOn,InstrumentRun.tensor_event JS r TE hE]
theoremBitProtocol.filtered_output_event (K : Matrix κ (ι × η) ℂ)
(i j : Bool) (E : Set (ℕ→M)) (hE : MeasurableSetE) :
((p.probeOutput i j).filter K).value E =
∫ x in d.sampler.publicRecord ⁻¹' E,
((filterFunctional K (tensorReferenceFunctional (p.incomingA.state x) (p.incomingB.state x))).comp
(TensorProduct.map ((p.readoutA.instrument x).operation {i})
((p.readoutB.instrument x).operation {j}))) (1 ⊗ₜ[ℂ] 1) ∂d.probeLaw :=by
proof · 3
lines
rw [PositiveMatrixMeasure.filter_value,p.probeOutput_event i j E hE]
simp_rw [tensor_filter_event]
exact (integral_filter _ (p.completeReference_integrable i j).integrableOn).symm
theoremprepared_actual_output {κ : Type v12613_0} [Fintype κ] [DecidableEq κ]
(K : Matrix κ (ι × η) ℂ) (V : PositiveMatrixMeasure (ℕ→O) κ)
(hfinite : ∀ n S, MeasurableSet[historyFiltration n] S→V.value S = K * (∫ x inS,
AdaptiveQuantum.jointReference d.sampler d.kernelA d.kernelB p.executionA p.executionB
n (historyPrefix n x) ∂d.probeLaw) * Kᴴ)
(a b : (ℕ→O) →Bool) (ha : Measurable a) (hb : Measurable b)
(N : Set (ℕ→O)) (hN : V.traceMeasure N = 0)
(hbits : ∀ x, x ∉N→ a x = p.outputA x ∧ b x = p.outputB x)
(i j : Bool) :
V.bitReadout d.sampler.publicRecord d.sampler.measurable_publicRecord a b ha hb i j =
(p.toBit.probeOutput i j).filter K:=by
proof · 10
lines
havehe : V = p.completion.reference.filter K:=by
apply p.completion.reference.filter_eq_of_filtration VK historyFiltration
· exact historyFiltration_generates
· intro n S hS
rw [p.completion.reference_prefix n S hS]
exact hfinite n S hS
rw [V.bitReadout_eq_off_private_null _ _ a b p.outputA p.outputB ha hb
(p.measurableA.mono (d.sampler.localField_le true) le_rfl)
(p.measurableB.mono (d.sampler.localField_le false) le_rfl) N hN hbits i j,he,
p.toBit_purifiedOutput K i j]
operation E:= (μ.real E : ℂ) • LinearMap.id
positive E hE a ha := positive_scaling (μ.real E) ENNReal.toReal_nonneg a ha
total_unit :=by simp [Measure.real]
law := μ
probability := inferInstance
posterior _ :=S
posterior_positive _ := hS
posterior_trace _ := hn
integrable _ _ _ := integrable_const _
update E hE a i j :=by
simp only [independentCoinInstrument,LinearMap.smul_apply,LinearMap.id_apply,
map_smul,Matrix.smul_apply,integral_const,
smul_eq_mul,Complex.real_smul]
simp only [Measure.real, Measure.restrict_apply_univ]
lemmaindependentCoinRun_reference [DecidableEq ι] (S : ReferenceFunctionalA ι) (hS : PositiveFunctionalS)
(hn : trace (S1) = 1) (o : O) (a : A) :
(independentCoinRun μ positive_scaling S hS hn).posterior o a = S a := rfl