theoremexists_isometry_comp_of_norm_eq {V : Type v17_0} [inst17_0 : NormedAddCommGroupV]
[inst17_1 : InnerProductSpaceℂV] [inst17_2 : FiniteDimensionalℂV]
(f g : V→ₗ[ℂ] V)
(h : ∀ x, ‖f x‖ = ‖g x‖) :
∃U : V→ₗᵢ[ℂ] V, U.toLinearMap.comp g = f :=by
proof · 14
lines
havehb : ∃C : ℝ, ∀ x, ‖f x‖ ≤C * ‖g x‖ := ⟨1, fun x =>by simp [h x]⟩
letL : LinearMap.range g →ₗᵢ[ℂ] V:=
{ toLinearMap := (f.compLeftInverse g).toLinearMap
norm_map' :=by
rintro ⟨y, x, rfl⟩
simpa only [ContinuousLinearMap.coe_coe,
LinearMap.compLeftInverse_apply_of_bdd f g hb x (g x) rfl,
←Submodule.norm_coe] using h x }
refine ⟨L.extend, ?_⟩
ext x
change L.extend (g x) = f x
rw [showL.extend (g x) = L ⟨g x, LinearMap.mem_range_self g x⟩ fromL.extend_apply ⟨g x, LinearMap.mem_range_self g x⟩]
exact LinearMap.compLeftInverse_apply_of_bdd f g hb x (g x) rfl
deftensorMap {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
(U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ) :
Matrix (Fin b ×Fin d) (Fin b ×Fin d) ℂ:=
body · 2
lines
fun i j =>∑ x, ∑ y, ∑ z, ∑ w,
U (x,z) (y,w) * L (matrixUnit x y) i.1 j.1 * M (matrixUnit z w) i.2 j.2
lemmacp_amplifyIndex {a b : ℕ} {L : Mat a →ₗ[ℂ] Mat b} (hL : CompletelyPositiveL)
{κ : Type v269_0} [Fintype κ] (U : Matrix (κ ×Fin a) (κ ×Fin a) ℂ)
(hU : U.PosSemidef) : (amplifyIndex LU).PosSemidef:=by
proof · 8
lines
let e :=Fintype.equivFin κ
have h := hL (Fintype.card κ)
(U.submatrix (fun i => (e.symm i.1, i.2)) (fun i => (e.symm i.1, i.2)))
(hU.submatrix _)
have h' := h.submatrix (funi : κ ×Fin b => (e i.1, i.2))
convert h' using1
ext i j
simp [amplifyIndex, amplify, Matrix.submatrix]
lemmatensorMap_apply {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
(U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ) (i j : Fin b) (k l : Fin d) :
tensorMap LMU (i,k) (j,l) =
L (fun x y =>M (fun z w =>U (x,z) (y,w)) k l) i j :=by
proof · 21
lines
calc
_ = ∑ x, ∑ y, (∑ z, ∑ w, U (x,z) (y,w) * M (matrixUnit z w) k l) *
L (matrixUnit x y) i j :=by
simp only [tensorMap, Finset.sum_mul]
apply Finset.sum_congr rfl
intro x _
apply Finset.sum_congr rfl
intro y _
apply Finset.sum_congr rfl
intro z _
apply Finset.sum_congr rfl
intro w _
ring
_ = ∑ x, ∑ y, M (fun z w =>U (x,z) (y,w)) k l * L (matrixUnit x y) i j :=by
apply Finset.sum_congr rfl
intro x _
apply Finset.sum_congr rfl
intro y _
exact congrArg (fun t => t * L (matrixUnit x y) i j)
(linearMap_matrix_units_apply M (fun z w =>U (x,z) (y,w)) k l).symm
_ = _ := (linearMap_matrix_units_apply L _ i j).symm
lemmatensorMap_positive {a b c d : ℕ} {L : Mat a →ₗ[ℂ] Mat b}
{M : Mat c →ₗ[ℂ] Mat d} (hL : CompletelyPositiveL) (hM : CompletelyPositiveM)
{U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ} (hU : U.PosSemidef) :
(tensorMap LMU).PosSemidef:=by
proof · 6
lines
have h₁ := cp_amplifyIndex hM U hU
have h₂ := cp_amplifyIndex hL _ (h₁.submatrix Prod.swap)
have h₃ := h₂.submatrix Prod.swap
convert h₃ using1
ext i j
exact tensorMap_apply LMU i.1 j.1 i.2 j.2
lemmacp_of_kraus_representation {a b : ℕ} {ν : Type v1019_0} [Fintype ν]
(L : Mat a →ₗ[ℂ] Mat b) (K : ν →Matrix (Fin b) (Fin a) ℂ)
(hK : ∀U, LU = ∑ s, K s * U * (K s)ᴴ) : CompletelyPositiveL:=by
proof · 16
lines
intro r U hU
havehe : amplify L r U = ∑ s, ((1 : Mat r) ⊗ₖ K s) * U * ((1 : Mat r) ⊗ₖ K s)ᴴ :=by
ext ⟨i,x⟩ ⟨j,y⟩
change L (fun v w =>U (i,v) (j,w)) x y = _
erw [hK]
simp only [Matrix.sum_apply]
apply Finset.sum_congr rfl
intro s _
change (K s * U.submatrix (fun v => (i,v)) (fun w => (j,w)) * (K s)ᴴ) x y = _
simp [Matrix.mul_apply, Matrix.conjTranspose_apply, Matrix.submatrix,
Fintype.sum_prod_type, Matrix.one_apply, apply_ite]
rw [he]
apply Matrix.posSemidef_sum
intro s _
exact hU.mul_mul_conjTranspose_same _
fin_cases t <;> fin_cases j <;> change (tensor₂ _ _).IsHermitian
all_goals
rw [Matrix.IsHermitian]
ext i l
rw [Matrix.conjTranspose_apply, tensor₂_apply, tensor₂_apply]
generalize hi : ofLex i = ii
generalize hl : ofLex l = ll
rcases ii with ⟨i,h⟩
rcases ll with ⟨l,k⟩
fin_cases i <;> fin_cases h <;> fin_cases l <;> fin_cases k <;>
norm_num [pauliX, pauliY, pauliZ, Matrix.one_apply]
lemmacontext_real (t : Fin6) (j : Fin3) (i l : LocalBasis) :
star (contextObservable t j i l) = contextObservable t j i l :=by
proof · 9
lines
fin_cases t <;> fin_cases j <;> change star (tensor₂ _ _ i l) = tensor₂ _ _ i l
all_goals
rw [tensor₂_apply]
generalize hi : ofLex i = ii
generalize hl : ofLex l = ll
rcases ii with ⟨i,h⟩
rcases ll with ⟨l,k⟩
fin_cases i <;> fin_cases h <;> fin_cases l <;> fin_cases k <;>
norm_num [pauliX, pauliY, pauliZ, Matrix.one_apply]
lemmacontext_involution (t : Fin6) (j : Fin3) :
contextObservable t j * contextObservable t j = 1:=by
proof · 11
lines
fin_cases t <;> fin_cases j <;> change tensor₂ _ _ * tensor₂ _ _ = (1 : MatrixLocalBasisLocalBasisℂ)
all_goals
ext i l
rw [Matrix.mul_apply, sum_localBasis, localBasis_one_apply]
simp only [tensor₂_apply, ofLex_toLex]
generalize hi : ofLex i = ii
generalize hl : ofLex l = ll
rcases ii with ⟨i,h⟩
rcases ll with ⟨l,k⟩
fin_cases i <;> fin_cases h <;> fin_cases l <;> fin_cases k <;>
norm_num [pauliX, pauliY, pauliZ, Matrix.one_apply]
lemmacontext_commute (t : Fin6) :
Commute (contextObservable t 0) (contextObservable t 1) :=by
proof · 11
lines
change contextObservable t 0 * contextObservable t 1 = contextObservable t 1 * contextObservable t 0
fin_cases t <;> change tensor₂ _ _ * tensor₂ _ _ = tensor₂ _ _ * tensor₂ _ _
all_goals
ext i l
simp only [Matrix.mul_apply, sum_localBasis, tensor₂_apply, ofLex_toLex]
generalize hi : ofLex i = ii
generalize hl : ofLex l = ll
rcases ii with ⟨i,h⟩
rcases ll with ⟨l,k⟩
fin_cases i <;> fin_cases h <;> fin_cases l <;> fin_cases k <;>
norm_num [pauliX, pauliY, pauliZ, Matrix.one_apply]
lemmacontext_third (t : Fin6) : contextObservable t 2 =
contextParity t • (contextObservable t 0 * contextObservable t 1) :=by
proof · 10
lines
fin_cases t <;> change tensor₂ _ _ = _ • (tensor₂ _ _ * tensor₂ _ _)
all_goals
ext i l
simp only [Matrix.smul_apply, smul_eq_mul, Matrix.mul_apply, sum_localBasis, tensor₂_apply, ofLex_toLex]
generalize hi : ofLex i = ii
generalize hl : ofLex l = ll
rcases ii with ⟨i,h⟩
rcases ll with ⟨l,k⟩
fin_cases i <;> fin_cases h <;> fin_cases l <;> fin_cases k <;>
norm_num [contextParity, pauliX, pauliY, pauliZ, Matrix.one_apply, Fin.ext_iff]
lemmaspectralSign_projection (O : MatrixLocalBasisLocalBasisℂ)
(hO : O.IsHermitian) (hO2 : O*O=1) (a : Sign) :
IsStarProjection (spectralSign O a) :=by
proof · 10
lines
refine ⟨?_, ?_⟩
· change spectralSign O a * spectralSign O a = spectralSign O a
dsimp [spectralSign]
rw [smul_mul_smul_comm, add_mul, one_mul, smul_mul_assoc, sign_eigen_aux O hO2]
rw [smul_smul, signValue_sq, one_smul]
module
· change star (spectralSign O a) = spectralSign O a
dsimp [spectralSign]
simp only [star_smul, star_add, star_one, signValue_conj, hO.star_eq]
norm_num
lemmacontextProjection_factor (t : Fin6) (a : Outcome) : contextProjection t a =
spectralSign (contextObservable t 0) (ofLex a).1 *
spectralSign (contextObservable t 1) (ofLex a).2:=by
proof · 2
lines
simp only [contextProjection, spectralSign, smul_mul_smul_comm]
norm_num
lemmacontext_eigen_second (t : Fin6) (a : Outcome) :
contextObservable t 1 * contextProjection t a =
signValue (ofLex a).2 • contextProjection t a :=by
lemmacontext_eigen (t : Fin6) (a : Outcome) (j : Fin3) :
contextObservable t j * contextProjection t a =
contextEigenvalue t a j • contextProjection t a :=by
proof · 10
lines
fin_cases j
· exact context_eigen_first t a
· exact context_eigen_second t a
· change contextObservable t 2 * contextProjection t a =
(contextParity t * signValue (ofLex a).1 * signValue (ofLex a).2) • _
rw [context_third, smul_mul_assoc, mul_assoc, context_eigen_second,
mul_smul_comm, context_eigen_first]
simp only [smul_smul]
congr 1
ring
lemmacontext_eigen_right (t : Fin6) (a : Outcome) (j : Fin3) :
contextProjection t a * contextObservable t j =
contextEigenvalue t a j • contextProjection t a :=by
proof · 3
lines
have h := congrArg star (context_eigen t a j)
simpa only [star_mul, (contextProjection_projection t a).isSelfAdjoint.star_eq,
(context_hermitian t j).star_eq, star_smul, contextEigenvalue_conj] using h
lemmacontextProjection_orthogonal (t : Fin6) (a b : Outcome) (hab : a≠b) :
contextProjection t a * contextProjection t b = 0:=by
proof · 8
lines
by_contra h
have he (j : Fin3) := eigenvalues_agree _ _ _ _ _
(context_eigen_right t a j) (context_eigen t b j) h
apply hab
apply ofLex.injective
apply Prod.ext
· exact signValue_injective (he 0)
· exact signValue_injective (he 1)
lemmatrivialProjection_sum : ∑ a, trivialProjection a = 1:=by
proof · 6
lines
classical
haveh : ∀ a, trivialProjection a = if a = toLex (1,1) then1else0:=by
intro a
simp [trivialProjection, ← ofLex.injective.eq_iff]
simp only [h]
simp
lemmalocalProjection_real (S : EightSet) (q : Question) (a : Outcome) (i j : LocalBasis) :
star (localProjection S q a i j) = localProjection S q a i j :=by
proof · 5
lines
rcases localProjection_type S q with h | ⟨t,h⟩
· rw [h]
unfold trivialProjection
split <;> simp [Matrix.one_apply]
· rw [h]; exact contextProjection_real t a i j
lemmalocalProjection_orthogonal (S : EightSet) (q : Question) (a b : Outcome) (hab : a≠b) :
localProjection S q a * localProjection S q b = 0:=by
proof · 3
lines
rcases localProjection_type S q with h | ⟨t,h⟩
· rw [h]; exact trivialProjection_orthogonal a b hab
· rw [h]; exact contextProjection_orthogonal t a b hab
ext h l
simp only [Matrix.sum_apply, projection, ofLex_toLex]
have he := congr_fun (congr_fun (tensorPi_sum (funS a => localProjection S q a)) (ofLex h)) (ofLex l)
havehr : tensorPi (funS=>∑ a, localProjection S q a) = 1:=by
simp only [localProjection_sum, tensorPi_one]
rw [hr] at he
calc
_ = ∑a : EightSet→Outcome, ∏S, localProjection S q (a S) (ofLex h S) (ofLex l S) :=
(Equiv.sum_comp (show (EightSet→Outcome) ≃ OutcomeStringfromEquiv.refl _)
(funa : OutcomeString=>∏S, localProjection S q (ofLex a S) (ofLex h S) (ofLex l S))).symm
_ = _ :=by
simpa only [tensorPi, Matrix.sum_apply, Matrix.one_apply,
show (ofLex h = ofLex l) ↔ h=l fromIff.rfl] using he
lemmaprojection_mul_apply (i j : Label) (h l : Basis) :
(projection i * projection j) h l = ∏S,
(localProjection S (ofLex i).1 (ofLex (ofLex i).2S) *
localProjection S (ofLex j).1 (ofLex (ofLex j).2S)) (ofLex h S) (ofLex l S) :=by
proof · 6
lines
lete : Basis ≃ (EightSet→LocalBasis) :=Equiv.refl _
letA:= tensorPi (funS=> localProjection S (ofLex i).1 (ofLex (ofLex i).2S))
letB:= tensorPi (funS=> localProjection S (ofLex j).1 (ofLex (ofLex j).2S))
change (A.submatrix e e * B.submatrix e e) h l = _
rw [Matrix.submatrix_mul_equiv]
exact congr_fun (congr_fun (tensorPi_mul _ _).symm (ofLex h)) (ofLex l)
lemmalocalProjection_commute (S : EightSet) (q r : Question) (a b : Outcome)
(hqr : overlap q r ≠0) : Commute (localProjection S q a) (localProjection S r b) :=by
proof · 11
lines
by_cases he : q=r
· subst r; exact localProjection_self_commute S q a b
by_cases hS : PairwiseOrthogonalS
· by_cases hq : q∈S.1
· havehr : r∉S.1:=fun hr => hqr (hS q hq r hr he)
rw [localProjection_trivial_of_not_mem S r hr]
exact (trivialProjection_commute b _).symm
· rw [localProjection_trivial_of_not_mem S q hq]
exact trivialProjection_commute a _
· rw [localProjection_trivial_of_not_orthogonal S q hS]
exact trivialProjection_commute a _
let : Fintype {A : Finset (Fin k) // A.card=514∧ (0 : Fin k) ∈A} :=
inferInstanceAs (FintypeBase)
have h := card_subsets_containing (0 : Fin k) 514 (by decide)
change Fintype.card Base = Nat.choose (Fintype.card (Fin k)-1) (514-1) at h
rw [Fintype.card_fin] at h
delta b
exact h.trans (congrArg₂ Nat.choose (show k-1=1027from rfl) (show514-1=513from rfl))
lemmasigned_overlap {α : Type v1995_0} [Fintype α] [DecidableEq α] (AB : Finset α) :
(∑ h, (if h ∈Athen (1:ℝ) else -1) * (if h ∈Bthen1else -1)) =
Fintype.card α - 2*(A.card:ℝ) - 2*(B.card:ℝ) + 4*(A∩B).card :=by
proof · 10
lines
have hp (h : α) :
(if h ∈Athen (1:ℝ) else -1) * (if h ∈Bthen1else -1) =
1 - 2*(if h ∈Athen1else0) - 2*(if h ∈Bthen1else0) +
4*(if h ∈A∩Bthen1else0) :=byby_cases ha : h ∈A <;> by_cases hb : h ∈B <;> simp [ha,hb] <;> norm_num
simp only [hp, Finset.sum_add_distrib, Finset.sum_sub_distrib, ←Finset.mul_sum]
simp
congr 1
ext x
simp
lemmabinomial_term_le (n j x y : ℕ) (hj : j ≤ n) :
x^j*y^(n-j)*Nat.choose n j ≤ (x+y)^n :=by
proof · 3
lines
rw [add_pow]
exact single_le_sum (f :=fun m => x^m*y^(n-m)*Nat.choose n m)
(fun _ _ =>Nat.zero_le _) (show j ∈ range (n+1) from mem_range.mpr (by omega))
lemmaprojection_transpose (i : Label) : (projection i)ᵀ = projection i :=by
proof · 4
lines
ext h l
have hh := congrArg (funA : MatrixBasisBasisℂ=>A h l)
(show (projection i)ᴴ=projection i from (projection_projection i).isSelfAdjoint)
exact (projection_real i l h).symm.trans hh
lemmaprojectionKraus_coeff [Fintype β] (u : β → γ →ℝ) (P : β →Matrix α α ℂ)
(hP : ∀ i, (P i).IsHermitian) (i j : β) (a b : α) :
(∑ s, projectionKraus u P s i a * star (projectionKraus u P s j b)) =
(∑ h, (u i h : ℂ) * (u j h : ℂ)) * (P j * P i) b a :=by
proof · 10
lines
simp only [projectionKraus, Fintype.sum_prod_type, star_mul, Complex.star_def,
Complex.conj_ofReal]
have hp (l : α) : star (P j l b) = P j b l := congrArg (funA : Matrix α α ℂ=>A b l) (hP j).eq
simp only [←Complex.star_def, hp, Matrix.mul_apply, Finset.sum_mul, Finset.mul_sum]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro h _
apply Finset.sum_congr rfl
intro l _
ring
lemmaprojectionKraus_formula (u : β → γ →ℝ) (P : β →Matrix α α ℂ)
(hP : ∀ i, (P i).IsHermitian) (U : Matrix α α ℂ) (i j : β) :
(∑ s, projectionKraus u P s * U * (projectionKraus u P s)ᴴ) i j =
trace (((∑ h, (u i h : ℂ) * (u j h : ℂ)) • (P j * P i)) * U) :=by
proof · 17
lines
simp only [Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply]
simp only [Finset.sum_mul]
calc
_ = ∑ b, ∑ a, (∑ s, projectionKraus u P s i a * star (projectionKraus u P s j b)) * U a b :=by
simp only [Finset.sum_mul]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro b _
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro a _
apply Finset.sum_congr rfl
intro s _
ring
_ = _ :=by
simp only [projectionKraus_coeff u P hP, trace, Matrix.diag_apply,
Matrix.mul_apply, Matrix.smul_apply, smul_eq_mul]
structureObservableInstrument (O : Type v3140_0) [MeasurableSpaceO]
(A : Type v3140_1) (B : Type v3140_2) [AddCommGroupA] [ModuleℂA] [OneA] [LEA]
[AddCommGroupB] [ModuleℂB] [OneB] [LEB] where
body · 3
lines
operation : SetO→B→ₗ[ℂ] Apositive : ∀E, MeasurableSetE→∀ x, 0≤ x →0≤ operation E x
total_unit : operation Set.univ 1 = 1
law : MeasureOprobability : IsProbabilityMeasure law
posterior : O→ReferenceFunctionalB ι
posterior_positive : ∀ o, PositiveFunctional (posterior o)
posterior_trace : ∀ o, trace (posterior o 1) = 1integrable : ∀ x i j, Integrable (fun o => posterior o x i j) law
update : ∀E, MeasurableSetE→∀ x i j,
(∫ o inE, posterior o x i j ∂law) = S (J.operation E x) i j
havehjoin : CondIndepC (A ⊔ C) B hC μ :=
(condIndep_join_public_right hC hB hA h.symm).symm
have href := condIndep_local_refinement hC (sup_le hA hC) hB
le_sup_right hCN hNA hjoin
exact condIndep_of_condIndep_of_le_left href le_sup_left
rw [condIndep_iff _ _ _ _ hA hB]
intro s t hs ht
have hmul := (h.indepSet_of_measurableSet hs ht).measure_inter_eq_mul
simp only [condExp_bot, integral_indicator (hA s hs), integral_indicator (hB t ht),
integral_indicator ((hA s hs).inter (hB t ht)), integral_const,
smul_eq_mul, mul_one]
exact Filter.Eventually.of_forall fun _ =>by
simpa only [Measure.real, Measure.restrict_apply_univ, Pi.mul_apply, ENNReal.toReal_mul] using congrArg ENNReal.toReal hmul
defprivatePrefix (a : Bool) : (n : ℕ) →UniformTape× (Fin n →M) → (Fin n → (O ⊕ Unit))
body · 7
lines
| 0, _ =>Fin.elim0
| n+1, pair =>let old := privatePrefix a n (pair.1,fun i => pair.2 i.castSucc)
let pubPast :=funi : Fin n => pair.2 i.castSucc
Fin.snoc old (if p.alice n = a thenSum.inl
(if a then p.sampleA n ((old,pubPast),pair.1 n)
else p.sampleB n ((old,pubPast),pair.1 n)) elseSum.inr ())
| 0, _ =>Fin.elim0
| n+1, x =>let old :=funi : Fin n => x i.castSucc
let pubPast := publicFrom n old
Fin.snoc pubPast (if p.alice n then
p.sendA n ((p.extractPrivate true n old,pubPast),x (Fin.last n)) else
p.sendB n ((p.extractPrivate false n old,pubPast),x (Fin.last n)))
lemmaintegral_density_entry (W : PositiveMatrixMeasure Ω ι) (μ : Measure Ω) [SigmaFinite μ]
(hAC : ∀S, MeasurableSetS→ μ S = 0→W.value S = 0)
(S : Set Ω) (hS : MeasurableSetS) (i j : ι) :
(∫ t inS, W.density μ t i j ∂μ) = W.value S i j :=by
proof · 15
lines
have h := (ComplexMeasure.absolutelyContinuous_ennreal_iff _ _).mp
(W.entry_absolutelyContinuous μ hAC i j)
apply Complex.ext
· have hh := congrArg (funs : SignedMeasure Ω => s S)
(SignedMeasure.withDensityᵥ_rnDeriv_eq (W.entry i j).re μ h.1)
rw [withDensityᵥ_apply (SignedMeasure.integrable_rnDeriv _ _) hS] at hh
change RCLike.re (∫ t inS, W.density μ t i j ∂μ) = _
rw [← integral_re ((W.integrable_entry μ i j).integrableOn)]
exact hh
· have hh := congrArg (funs : SignedMeasure Ω => s S)
(SignedMeasure.withDensityᵥ_rnDeriv_eq (W.entry i j).im μ h.2)
rw [withDensityᵥ_apply (SignedMeasure.integrable_rnDeriv _ _) hS] at hh
change RCLike.im (∫ t inS, W.density μ t i j ∂μ) = _
rw [← integral_im ((W.integrable_entry μ i j).integrableOn)]
exact hh
lemmaae_complex_nonneg_of_integral_nonneg {μ : Measure Ω} {f : Ω →ℂ}
(hf : Integrable f μ)
(h : ∀S, MeasurableSetS→ μ S < ⊤ →0≤∫ t inS, f t ∂μ) :
∀ᵐ t ∂μ, 0≤ f t :=by
proof · 13
lines
havehre : ∀ᵐ t ∂μ, 0≤ (f t).re :=by
apply ae_nonneg_of_forall_setIntegral_nonneg hf.re
intro S hs hm
rw [integral_re hf.integrableOn]
exact (RCLike.nonneg_iff.mp (h S hs hm)).1havehim : (fun t => (f t).im) =ᵐ[μ] fun _ => (0:ℝ) :=by
apply Integrable.ae_eq_of_forall_setIntegral_eq _ _ hf.im (integrable_zero _ _ _)
intro S hs hm
rw [integral_im hf.integrableOn]
simp only [Pi.zero_apply,integral_zero]
exact (RCLike.nonneg_iff.mp (h S hs hm)).2
filter_upwards [hre,him] with t ht hi
exact RCLike.nonneg_iff.mpr ⟨ht,hi⟩
lemmaintegral_quadraticValue [DecidableEq ι] {μ : Measure Ω} {F : Ω →Matrix ι ι ℂ}
(hF : ∀ i j, Integrable (fun t =>F t i j) μ) (v : ι →ℂ) :
(∫ t, quadraticValue v (F t) ∂μ) = quadraticValue v (fun i j =>∫ t, F t i j ∂μ) :=by
lemmadensity_posSemidef_ae (W : PositiveMatrixMeasure Ω ι) (μ : Measure Ω) [SigmaFinite μ]
(hAC : ∀S, MeasurableSetS→ μ S = 0→W.value S = 0) :
∀ᵐ t ∂μ, (W.density μ t).PosSemidef:=by
proof · 33
lines
havehherm : ∀ᵐ t ∂μ, (W.density μ t).IsHermitian:=byhave hij (i j : ι) : (fun t => star (W.density μ t j i)) =ᵐ[μ]
(fun t =>W.density μ t i j) :=by
apply Integrable.ae_eq_of_forall_setIntegral_eq _ _
((Complex.conjCLE.integrable_comp_iff).mpr (W.integrable_entry μ j i)) (W.integrable_entry μ i j)
intro S hs hm
simp only [Complex.conjCLE_apply,integral_conj,W.integral_density_entry μ hAC S hs]
exact congrArg (funM : Matrix ι ι ℂ=>M i j) (W.positive S hs).isHermitian.eq
havehh : ∀ᵐ t ∂μ, ∀ i j, star (W.density μ t j i)=W.density μ t i j :=
ae_all_iff.mpr (fun i => ae_all_iff.mpr (hij i))
filter_upwards [hh] with t ht
exact Matrix.IsHermitian.ext ht
have hq (v : ι →ℂ) : ∀ᵐ t ∂μ, 0≤ quadraticValue v (W.density μ t) :=by
apply ae_complex_nonneg_of_integral_nonneg
(integrable_quadraticValue (W.integrable_entry μ) v)
intro S hs hm
rw [integral_quadraticValue (fun i j => (W.integrable_entry μ i j).integrableOn)]
simp only [W.integral_density_entry μ hAC S hs]
change 0≤ quadraticValue v (W.value S)
rw [quadraticValue_eq]
exact (W.positive S hs).dotProduct_mulVec_nonneg v
obtain ⟨s,hs,hd⟩ :=TopologicalSpace.exists_countable_dense (ι →ℂ)
let : Countable s := hs.to_subtype
havehqs : ∀ᵐ t ∂μ, ∀v : s, 0≤ quadraticValue v (W.density μ t) :=
ae_all_iff.mpr (fun v => hq v)
filter_upwards [hherm,hqs] with t ht hqt
apply Matrix.posSemidef_iff_dotProduct_mulVec.mpr
refine ⟨ht,fun v => ?_⟩
rw [← quadraticValue_eq]
refine hd.denseRange_val.induction_on (p :=fun v =>0≤ quadraticValue v (W.density μ t)) v ?_ hqt
· apply isClosed_le continuous_const
unfold quadraticValue
fun_prop
lemmareferenceFilter_apply [Fintype κ] [DecidableEq κ] [DecidableEq η] (K : Matrix κ η ℂ) (U : Matrix (ι × η) (ι × η) ℂ)
(i j : ι) (x y : κ) :
referenceFilter KU (i,x) (j,y) = ∑ s, ∑ t, K x s * U (i,s) (j,t) * star (K y t) :=by
proof · 4
lines
simp only [referenceFilter,Matrix.conjTranspose_kronecker,Matrix.conjTranspose_one]
simp [Matrix.mul_apply,Fintype.sum_prod_type,Matrix.one_apply,
Matrix.conjTranspose_apply,Finset.sum_mul]
rw [Finset.sum_comm]
ext x y
simp only [keepReference,outer,vectorize,Matrix.transpose_apply,Matrix.mul_apply,
Matrix.conjTranspose_apply]
apply Finset.sum_congr rfl; intro i _; ring
lemmaintegral_trace_density (W : PositiveMatrixMeasure Ω ι) (μ : Measure Ω) [SigmaFinite μ]
(hAC : ∀S, MeasurableSetS→ μ S=0→W.value S=0)
(S : Set Ω) (hS : MeasurableSetS) :
(∫ t inS, trace (W.density μ t) ∂μ) = trace (W.value S) :=by
proof · 4
lines
unfold trace diag
rw [integral_finsetSum _ (fun i _ => (W.integrable_entry μ i i).integrableOn)]
apply Finset.sum_congr rfl; intro i _
exact W.integral_density_entry μ hAC S hS i i
deffilter {κ : Type v4989_0} [Fintype κ] (W : PositiveMatrixMeasure Ω ι) (K : Matrix κ ι ℂ) :
PositiveMatrixMeasure Ω κ where
body · 14
lines
entry x y :=∑ i, ∑ j, (K x i * star (K y j)) • W.entry i j
positive S hS :=byhavehe : (fun x y => (∑ i, ∑ j, (K x i * star (K y j)) • W.entry i j) S) =
K * W.value S * Kᴴ :=by
ext x y
simp only [_root_.sum_apply,_root_.smul_apply,Matrix.mul_apply,
Matrix.conjTranspose_apply,smul_eq_mul,Finset.sum_mul]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl; intro i _
apply Finset.sum_congr rfl; intro j _
dsimp [value]
ring
rw [he]
exact (W.positive S hS).mul_mul_conjTranspose_same K
lemmafilter_value [DecidableEq ι] {κ : Type v5006_0} [Fintype κ] (W : PositiveMatrixMeasure Ω ι)
(K : Matrix κ ι ℂ) (S : Set Ω) : (W.filter K).value S = K * W.value S * Kᴴ :=by
proof · 7
lines
ext x y
simp only [filter,value,_root_.sum_apply,_root_.smul_apply,Matrix.mul_apply,
Matrix.conjTranspose_apply,smul_eq_mul,Finset.sum_mul]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl; intro i _
apply Finset.sum_congr rfl; intro j _
ring
defhistoryFiltration : Filtrationℕ (inferInstance : MeasurableSpace (ℕ→O)) where
body · 11
lines
seq n :=MeasurableSpace.comap (historyPrefix n) inferInstance
mono' :=by
intro n k hnk
apply MeasurableSpace.comap_le_iff_le_map.mpr
intro S hS
change MeasurableSet[MeasurableSpace.comap (historyPrefix k) inferInstance]
(historyPrefix n ⁻¹' S)
refine ⟨(funs : Fin k →O=>funi : Fin n => s (Fin.castLE hnk i)) ⁻¹' S,
(showMeasurable (funs : Fin k →O=>funi : Fin n => s (Fin.castLE hnk i)) by fun_prop) hS,?_⟩
rfl
le' n := (showMeasurable (historyPrefix (O:=O) n) by unfold historyPrefix; fun_prop).comap_le
lemmareference_history_step_integral (n : ℕ) (S : Set (ℕ→O))
(hS : MeasurableSet[historyFiltration n] S) (i j : ι) :
(∫ x inS, U (n+1) (historyPrefix (n+1) x) i j ∂P) =
∫ x inS, U n (historyPrefix n x) i j ∂P:=by
proof · 50
lines
classical
obtain ⟨A,hA,rfl⟩ := hS
letr : (Fin (n+1) →O) → (Fin n →O) :=fun s i => s i.castSucc
havehr : Measurable r :=by fun_prop
letsnoc : (Fin n →O) ×O→ (Fin (n+1) →O) :=fun s =>Fin.snoc s.1 s.2havehs : Measurable snoc :=by
apply Measurable.of_eval
intro i
refine Fin.lastCases ?_ (fun j => ?_) i
· simpa [snoc] using measurable_snd
· simpa only [snoc, Fin.snoc_castSucc, Function.comp_def] using ((measurable_pi_apply j).comp measurable_fst)
letf : (Fin (n+1) →O) →ℂ:= (r ⁻¹' A).indicator (fun s =>U (n+1) s i j)
letg : (Fin n →O) →ℂ:=A.indicator (fun s =>U n s i j)
letL : Matrix ι ι ℂ→L[ℂ] ℂ:= (Matrix.entryLinearMap ℂℂ i j).toContinuousLinearMap
havehf : Measurable f := (L.continuous.measurable.comp (hm (n+1))).indicator (hr hA)
havehg : Measurable g := (L.continuous.measurable.comp (hm n)).indicator hA
havehfi : Integrable (fun s => f (snoc s)) ((P.map (historyPrefix n)) ⊗ₘ K n) :=by
apply Integrable.of_bound (hf.comp hs).aestronglyMeasurable 1
apply Filter.Eventually.of_forall
intro s
exact (norm_indicator_le_norm_self (s := r ⁻¹' A) (fun t =>U (n+1) t i j) (snoc s)).trans (density_entry_bound (U (n+1)) (hU (n+1)) i j _)
have he (s : Fin n →O) : (∫ o, f (snoc (s,o)) ∂K n s) = g s :=byhave hh (o : O) : f (snoc (s,o)) =
if s ∈AthenU (n+1) (Fin.snoc s o) i j else0:=by
simp only [f,Set.indicator,Set.mem_preimage,r,snoc]
haveht : (funi : Fin n =>Fin.snoc (α :=fun_ : Fin (n+1) =>O) s o i.castSucc) = s :=by
ext i; simp
rw [ht]
simp_rw [hh]
by_cases h : s ∈A
· simp only [h,ite_true,g,Set.indicator_of_mem]
exact hmean n s i j
· simp [h,g]
calc
_ = ∫ x, f (historyPrefix (n+1) x) ∂P:=by
rw [← integral_indicator ((measurable_historyPrefix n) hA)]
congr 1
_ = ∫ s, f s ∂P.map (historyPrefix (n+1)) :=
(integral_map (measurable_historyPrefix _).aemeasurable hf.aestronglyMeasurable).symm
_ = ∫ s, f s ∂(((P.map (historyPrefix n)) ⊗ₘ K n).map snoc) :=by rw [hP n]
_ = ∫ s, f (snoc s) ∂((P.map (historyPrefix n)) ⊗ₘ K n) :=
integral_map hs.aemeasurable hf.aestronglyMeasurable
_ = ∫ s, ∫ o, f (snoc (s,o)) ∂K n s ∂P.map (historyPrefix n) :=MeasureTheory.Measure.integral_compProd hfi
_ = ∫ s, g s ∂P.map (historyPrefix n) :=by simp_rw [he]
_ = ∫ x, g (historyPrefix n x) ∂P:=
integral_map (measurable_historyPrefix n).aemeasurable hg.aestronglyMeasurable
_ = _ :=by
rw [← integral_indicator ((measurable_historyPrefix n) hA)]
rfl
lemmareference_history_integral (n k : ℕ) (hnk : n ≤ k) (S : Set (ℕ→O))
(hS : MeasurableSet[historyFiltration n] S) (i j : ι) :
(∫ x inS, U k (historyPrefix k x) i j ∂P) =
∫ x inS, U n (historyPrefix n x) i j ∂P:=by
proof · 6
lines
induction k, hnk usingNat.le_induction with
| base => rfl
| succ k hnk ih =>
rw [reference_history_step_integral PK hP U hU hm hmean k S
(((historyFiltration (O:=O)).mono hnk) S hS) i j]
exact ih
lemmareference_history_measurable [DecidableEq ι] (n : ℕ) (i j : ι) (hm : ∀ n, Measurable (U n)) :
Measurable[historyFiltration n] (fun x =>U n (historyPrefix n x) i j) :=by
lemmareference_history_integrable (n : ℕ) (i j : ι) (hU : ∀ n s, Density (U n s))
(hm : ∀ n, Measurable (U n)) :
Integrable (fun x =>U n (historyPrefix n x) i j) P:=by
proof · 2
lines
exact integrable_density_entry (fun x =>U n (historyPrefix n x))
(fun x => hU n _) ((hm n).comp (measurable_historyPrefix n)) P i j
lemmareference_history_martingale_re (i j : ι) :
Martingale (fun n x => (U n (historyPrefix n x) i j).re) historyFiltration P:=by
proof · 13
lines
refine ⟨fun n => ((reference_history_measurable U n i j hm).re).stronglyMeasurable, ?_⟩
intro n k hnk
symm
apply ae_eq_condExp_of_forall_setIntegral_eq (historyFiltration.le n)
((reference_history_integrable PU k i j hU hm).re)
· intro S _ _
exact (reference_history_integrable PU n i j hU hm).re.integrableOn
· intro S hS _
change (∫ x inS, RCLike.re (U n (historyPrefix n x) i j) ∂P) = _
rw [integral_re (reference_history_integrable PU n i j hU hm).integrableOn,
integral_re (reference_history_integrable PU k i j hU hm).integrableOn,
reference_history_integral PK hP U hU hm hmean n k hnk S hS i j]
· exact ((reference_history_measurable U n i j hm).re).stronglyMeasurable.aestronglyMeasurable
lemmareference_history_martingale_im (i j : ι) :
Martingale (fun n x => (U n (historyPrefix n x) i j).im) historyFiltration P:=by
proof · 13
lines
refine ⟨fun n => ((reference_history_measurable U n i j hm).im).stronglyMeasurable, ?_⟩
intro n k hnk
symm
apply ae_eq_condExp_of_forall_setIntegral_eq (historyFiltration.le n)
((reference_history_integrable PU k i j hU hm).im)
· intro S _ _
exact (reference_history_integrable PU n i j hU hm).im.integrableOn
· intro S hS _
change (∫ x inS, RCLike.im (U n (historyPrefix n x) i j) ∂P) = _
rw [integral_im (reference_history_integrable PU n i j hU hm).integrableOn,
integral_im (reference_history_integrable PU k i j hU hm).integrableOn,
reference_history_integral PK hP U hU hm hmean n k hnk S hS i j]
· exact ((reference_history_measurable U n i j hm).im).stronglyMeasurable.aestronglyMeasurable
theoremlocal_reference_limit
(W : ℕ→ Ω →Matrix ι ι ℂ)
(hW : ∀ n x, Density (W n x))
(hlocal : ∀ n, Measurable[L] (W n))
(hL : L≤ mΩ)
(hr : ∀ i j, Martingale (fun n x => (W n x i j).re) F μ)
(hi : ∀ i j, Martingale (fun n x => (W n x i j).im) F μ) :
∃G : Ω →Matrix ι ι ℂ,
Measurable[L] G∧ (∀ x, Density (G x)) ∧
(∀ i j, Integrable (fun x =>G x i j) μ) ∧
(∀ᵐ x ∂μ, Tendsto (fun n =>W n x) atTop (𝓝 (G x))) ∧
(∀ n S, MeasurableSet[F n] S→
(∫ x inS, G x ∂μ) = ∫ x inS, W n x ∂μ) :=by
proof · 90
lines
classical
have hbound (n : ℕ) (i j : ι) (x : Ω) : ‖W n x i j‖ ≤1:=by
simpa only [(hW n x).2, Complex.one_re] using
psd_entry_norm_le_trace (hW n x).1 i j
have hbr (i j : ι) (n : ℕ) : ∀ᵐ x ∂μ, ‖(W n x i j).re‖ ≤1:=Filter.Eventually.of_forall (fun x =>
(show ‖(W n x i j).re‖ ≤ ‖W n x i j‖ fromby
simpa only [Real.norm_eq_abs] usingComplex.abs_re_le_norm (W n x i j)).trans
(hbound n i j x))
have hbi (i j : ι) (n : ℕ) : ∀ᵐ x ∂μ, ‖(W n x i j).im‖ ≤1:=Filter.Eventually.of_forall (fun x =>
(show ‖(W n x i j).im‖ ≤ ‖W n x i j‖ fromby
simpa only [Real.norm_eq_abs] usingComplex.abs_im_le_norm (W n x i j)).trans
(hbound n i j x))
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))
letH : Ω →Matrix ι ι ℂ:=fun x i j => (gr i j x : ℂ) + (gi i j x : ℂ)*Complex.Ihave hH (i j : ι) : Integrable (fun x =>H x i j) μ :=
((hgr i j).ofReal).add (((hgi i j).ofReal).mul_const Complex.I)
havehlimH : ∀ᵐ x ∂μ, Tendsto (fun n =>W n x) atTop (𝓝 (H x)) :=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 x hx hy
havehc : Tendsto (fun n i j =>W n x i j) atTop (𝓝 (fun i j =>H x 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 (hx i j)).add
((Complex.continuous_ofReal.continuousAt.tendsto.comp (hy 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
letraw : Ω →Matrix ι ι ℂ:=fun x => limUnder atTop (fun n =>W n x)
havehraw : Measurable[L] raw :=
(@StronglyMeasurable.limUnder ℕ Ω (Matrix ι ι ℂ) L _ _ atTop _ _ _ _
(fun n => (hlocal n).stronglyMeasurable)).measurable
havehgood : MeasurableSet[L] {x | 0≤ raw x ∧ trace (raw x) = 1} :=by
exact (measurableSet_le measurable_const hraw).inter
(measurableSet_eq_fun ((Matrix.traceLinearMap ι ℂℂ).toContinuousLinearMap.continuous.measurable.comp hraw) measurable_const)
letG : Ω →Matrix ι ι ℂ:=fun x =>if0≤ raw x ∧ trace (raw x) = 1then raw x elseW0 x
havehGm : Measurable[L] G:= hraw.ite hgood (hlocal 0)
have hGp (x : Ω) : Density (G x) :=by
dsimp [G]
split
· rename_i h
exact ⟨h.1.posSemidef, h.2⟩
· exact hW 0 x
havehGH : G =ᵐ[μ] H:=by
filter_upwards [hlimH] with x hx
havehrx : raw x = H x := hx.limUnder_eq
havehp : 0≤H x :=
isClosed_Ici.mem_of_tendsto hx (Eventually.of_forall (fun n => (hW n x).1.nonneg))
haveht : trace (H x) = 1:=byhave htend := (Matrix.traceLinearMap ι ℂℂ).toContinuousLinearMap.continuous.continuousAt.tendsto.comp hx
havehe : (fun n => trace (W n x)) = fun _ => (1 : ℂ) := funext (fun n => (hW n x).2)
change Tendsto (fun n => trace (W n x)) atTop (𝓝 (trace (H x))) at htend
rw [he] at htend
exact tendsto_nhds_unique htend tendsto_const_nhds
simp only [G, hrx, hp, ht, and_self, ↓reduceIte]
have hGi (i j : ι) : Integrable (fun x =>G x i j) μ :=
(hH i j).congr (hGH.mono (fun x hx => congrArg (funM=>M i j) hx.symm))
refine ⟨G,hGm,hGp,hGi,?_,?_⟩
· filter_upwards [hlimH,hGH] with x hx he
simpa only [he] using hx
· intro n S hS
have hc (i j : ι) : Integrable (fun x =>W n x i j) μ :=Integrable.of_bound (((Matrix.entryLinearMap ℂℂ i j).toContinuousLinearMap).measurable.comp
((hlocal n).mono hL le_rfl)).aestronglyMeasurable 1
(Eventually.of_forall (hbound n i j))
ext i j
rw [integral_matrix_entry (integrable_matrix_of_entries hGi).integrableOn,
integral_matrix_entry (integrable_matrix_of_entries hc).integrableOn]
calc
_ = ∫ x inS, H x i j ∂μ := integral_congr_ae
(ae_restrict_of_ae (hGH.mono (fun x hx => congrArg (funM=>M i j) hx)))
_ = ∫ x inS, W n x i j ∂μ :=by
apply Complex.ext
· change RCLike.re (∫ x inS, H x i j ∂μ) = RCLike.re (∫ x inS, W n x i j ∂μ)
rw [← integral_re (hH i j).integrableOn, ← integral_re (hc i j).integrableOn]
haveheH : (fun x =>RCLike.re (H x i j)) = gr i j :=by
funext x; simp [H]
rw [heH, ← setIntegral_condExp (F.le n) (hgr i j) hS]
exact integral_congr_ae (ae_restrict_of_ae (hcr i j n).symm)
· change RCLike.im (∫ x inS, H x i j ∂μ) = RCLike.im (∫ x inS, W n x i j ∂μ)
rw [← integral_im (hH i j).integrableOn, ← integral_im (hc i j).integrableOn]
haveheH : (fun x =>RCLike.im (H x i j)) = gi i j :=by
funext x; simp [H]
rw [heH, ← setIntegral_condExp (F.le n) (hgi i j) hS]
exact integral_congr_ae (ae_restrict_of_ae (hci i j n).symm)
state : (n : ℕ) →LocalHistoryOM n →ReferenceFunctional (A n) ι
positive_state : ∀ n h, PositiveFunctional (state n h)
positive_unit : ∀ n, (0 : A n) ≤1normalized : ∀ n h, trace (state n h 1) = 1measurable_reference : ∀ n, Measurable (fun h => state n h 1)
instrument : (n : ℕ) → (h : LocalHistoryOM n) →ObservableInstrumentO (A n) (A (n+1))
run : ∀ n h, InstrumentRun (instrument n h) (state n h)
run_law : ∀ n h, (run n h).law = κ n h
active_update : ∀ n h,
(fun o => state (n+1) (localActive h o (send n (h,o)))) =ᵐ[κ n h] (run n h).posterior
receive : (n : ℕ) →LocalHistoryOM n →M→ (A (n+1) →ₗ[ℂ] A n)
receive_positive : ∀ n h m x, 0≤ x →0≤ receive n h m x
receive_unit : ∀ n h m, receive n h m 1 = 1passive_update : ∀ n h m,
state (n+1) (localPassive h m) = (state n h).comp (receive n h m)
lemmaactive_mean (n : ℕ) (h : LocalHistoryOM n) (i j : ι) :
(∫ o, e.reference (n+1) (localActive h o (send n (h,o))) i j ∂κ n h) =
e.reference n h i j :=by
proof · 8
lines
calc
_ = ∫ o, (e.run n h).posterior o 1 i j ∂κ n h :=by
apply integral_congr_ae
filter_upwards [e.active_update n h] with o ho
exact congrArg (funS : ReferenceFunctional (A (n+1)) ι =>S1 i j) ho
_ = _ :=by
rw [← e.run_law]
exact InstrumentRun.reference_mean (e.instrument n h) (e.state n h) (e.run n h) i j
theoremcondIndep_adaptive_public_message {Ω : Type v5828_0} {M : Type v5828_1}
{mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] [MeasurableSpaceM]
{P : Measure Ω} [IsFiniteMeasureP]
{CAB : MeasurableSpace Ω}
(hC : C≤ mΩ) (hA : A≤ mΩ) (hB : B≤ mΩ)
(h : CondIndepCAB hC P)
(q : Ω →Bool) (a b : Ω →M) (d : M)
(hq : @Measurable Ω BoolC _ q)
(ha : @Measurable Ω M (A ⊔ C) _ a)
(hb : @Measurable Ω M (B ⊔ C) _ b) :
let message :=fun x =>if q x then a x else b x
proof · 51
lines
letN:=C ⊔ MeasurableSpace.comap message inferInstance
CondIndepNAB (sup_le hC ((ha.mono (sup_le hA hC) le_rfl).ite
((measurableSet_singleton true).preimage (hq.mono hC le_rfl))
(hb.mono (sup_le hB hC) le_rfl)).comap_le) P:=bylet left :=fun x =>if q x then a x else d
let right :=fun x =>if q x then d else b x
letNA:=C ⊔ MeasurableSpace.comap left inferInstance
letNB:=NA ⊔ MeasurableSpace.comap right inferInstance
let g :=fun x =>if q x then a x else b x
letN:=C ⊔ MeasurableSpace.comap g inferInstance
havehqset : MeasurableSet[C] {x | q x = true} := hq (measurableSet_singleton true)
havehleft : @Measurable Ω M (A ⊔ C) _ left :=
ha.ite ((showC≤A ⊔ Cfrom le_sup_right) _ hqset) measurable_const
havehCA : C≤NA:= le_sup_left
havehNAA : NA≤A ⊔ C:= sup_le le_sup_right hleft.comap_le
havehNAM : NA≤ mΩ := hNAA.trans (sup_le hA hC)
haveh₁ : CondIndepNAAB hNAM P:= condIndep_local_message hC hA hB hCA hNAA h
havehright : @Measurable Ω M (B ⊔ NA) _ right :=
measurable_const.ite ((hCA.trans le_sup_right) _ hqset)
(hb.mono (sup_le_sup_left hCA B) le_rfl)
havehNBB : NB≤B ⊔ NA:= sup_le le_sup_right hright.comap_le
havehNBM : NB≤ mΩ := hNBB.trans (sup_le hB hNAM)
haveh₂ : CondIndepNBAB hNBM P:=
(condIndep_local_message hNAM hB hA le_sup_left hNBB h₁.symm).symm
havehCN : C≤N:= le_sup_left
havehgN : @Measurable Ω MN _ g :=Measurable.of_comap_le le_sup_right
havehlN : @Measurable Ω MN _ left :=byhavehh : @Measurable Ω MN _ (fun x =>if q x then g x else d) :=
hgN.ite (hCN _ hqset) measurable_const
convert hh using1
ext x
cases hqx : q x <;> simp [left,g,hqx]
havehrN : @Measurable Ω MN _ right :=byhavehh : @Measurable Ω MN _ (fun x =>if q x then d else g x) :=
measurable_const.ite (hCN _ hqset) hgN
convert hh using1
ext x
cases hqx : q x <;> simp [right,g,hqx]
havehNBN : NB≤N:= sup_le (sup_le hCN hlN.comap_le) hrN.comap_le
havehCNB : C≤NB:= le_sup_left.trans le_sup_left
havehlNB : @Measurable Ω MNB _ left :=Measurable.of_comap_le (le_sup_right.trans le_sup_left)
havehrNB : @Measurable Ω MNB _ right :=Measurable.of_comap_le le_sup_right
havehgNB : @Measurable Ω MNB _ g :=byhavehh : @Measurable Ω MNB _ (fun x =>if q x then left x else right x) :=
hlNB.ite (hCNB _ hqset) hrNB
convert hh using1
ext x
cases hqx : q x <;> simp [left,right,g,hqx]
havehe : NB = N:= le_antisymm hNBN (sup_le hCNB hgNB.comap_le)
simpa only [he] using h₂
theoremadaptive_tapes_given_full_transcript {Ω : Type v5898_0} {M : Type v5898_1}
{mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] [MeasurableSpaceM]
{P : Measure Ω} [IsFiniteMeasureP]
(F : Filtrationℕ mΩ) (AB : MeasurableSpace Ω)
(hA : A≤ mΩ) (hB : B≤ mΩ)
(hinitial : CondIndep (F0) AB (F.le 0) P)
(q : ℕ→ Ω →Bool) (a b : ℕ→ Ω →M) (d : M)
(hq : ∀ n, @Measurable Ω Bool (F n) _ (q n))
(ha : ∀ n, @Measurable Ω M (A ⊔ F n) _ (a n))
(hb : ∀ n, @Measurable Ω M (B ⊔ F n) _ (b n))
(hF : ∀ n, F (n+1) = F n ⊔ MeasurableSpace.comap
(fun x =>if q n x then a n x else b n x) inferInstance) :
CondIndep (⨆ n, F n) (A ⊔ ⨆ n, F n) (B ⊔ ⨆ n, F n)
(iSup_le F.le) P:=by
proof · 12
lines
havehfinite : ∀ n, CondIndep (F n) AB (F.le n) P:=by
intro n
induction n with
| zero => exact hinitial
| succ n ih =>have h := condIndep_adaptive_public_message (F.le n) hA hB ih
(q n) (a n) (b n) d (hq n) (ha n) (hb n)
simpa only [hF n] using h
have h := condIndep_full_transcript FAB hA hB hfinite
have hC := iSup_le F.le
have h1 := (condIndep_join_public_right hC hB hA h.symm).symm
exact condIndep_join_public_right hC (sup_le hA hC) hB h1
| 0, _ =>Fin.elim0
| n+1, ω =>Fin.snoc (publicPrefix n ω)
(if p.alice n (publicPrefix n ω) then p.sendA n (ω.1,publicPrefix n ω) else p.sendB n (ω.2,publicPrefix n ω))
lemmameasurable_prefix : ∀ n, Measurable (p.publicPrefix n) :=by
proof · 12
lines
intro n
induction n with
| zero => exact Measurable.of_eval (fun i =>Fin.elim0 i)
| succ n ih =>
apply Measurable.of_eval
intro i
refine Fin.lastCases ?_ (fun j => ?_) i
· simp only [publicPrefix, Fin.snoc_last]
exact ((p.measA n).comp (measurable_fst.prodMk ih)).ite
((measurableSet_singleton true).preimage ((p.measAlice n).comp ih))
((p.measB n).comp (measurable_snd.prodMk ih))
· simpa only [publicPrefix, Fin.snoc_castSucc] using ih.eval (a := j)
lemmaprefix_eq_record (n : ℕ) (ω : U×V) (i : Fin n) :
p.publicPrefix n ω i = p.record ω i :=by
proof · 6
lines
induction n with
| zero => exact Fin.elim0 i
| succ n ih =>
refine Fin.lastCases ?_ (fun j => ?_) i
· simp only [publicPrefix, Fin.snoc_last, record, message, Fin.val_last]
· simpa only [publicPrefix, Fin.snoc_castSucc, Fin.val_castSucc] using ih j
lemmameasurable_finiteHistory : ∀ n, Measurable (f.finiteHistory n) :=by
proof · 11
lines
intro n
induction n with
| zero => exact Measurable.of_eval (fun i =>Fin.elim0 i)
| succ n ih =>havehr : Measurable (funu : Fin (n+1) →N=>funi : Fin n => u i.castSucc) :=by fun_prop
apply Measurable.of_eval
intro i
refine Fin.lastCases ?_ (fun j => ?_) i
· simpa only [finiteHistory, Fin.snoc_last,Function.comp_def] using
(f.measurable_step n).comp ((ih.comp hr).prodMk (measurable_pi_apply (Fin.last n)))
· simpa only [finiteHistory, Fin.snoc_castSucc,Function.comp_def] using (ih.comp hr).eval (a := j)
lemmaprefix_eq_record (n : ℕ) (u : (ℕ→N)) (i : Fin n) :
f.history n u i = f.record u i :=by
proof · 7
lines
induction n with
| zero => exact Fin.elim0 i
| succ n ih =>
rw [f.prefix_succ]
refine Fin.lastCases ?_ (fun j => ?_) i
· simp only [Fin.snoc_last,record, Fin.val_last]
· simpa only [Fin.snoc_castSucc, Fin.val_castSucc] using ih j
theoremfinite_law_unique (κ : (n : ℕ) →Kernel (Fin n →O) O)
[∀ n, IsMarkovKernel (κ n)]
(hlaw : ∀ n s, ν.map (fun u => f.step n (s,u)) = κ n s)
(P : Measure (ℕ→O)) [IsProbabilityMeasureP]
(hP : ∀ n, P.map (fun x =>funi : Fin (n+1) => x i) =
((P.map (fun x =>funi : Fin n => x i)) ⊗ₘ κ n).map
(funp : (Fin n →O) ×O=>Fin.snoc (α :=fun_ : Fin (n+1) =>O) p.1 p.2)) :
∀ n, P.map (fun x =>funi : Fin n => x i) = (noiseTapeLaw ν).map (f.history n) :=by
proof · 11
lines
intro n
induction n with
| zero =>haveht : (funx : ℕ→O=>funi : Fin0=> x i) = fun _ =>Fin.elim0 :=by
funext x i
exact Fin.elim0 i
rw [ht]
change P.map (fun_ : ℕ→O=>Fin.elim0) =
(noiseTapeLaw ν).map (fun_ : (ℕ→N) =>Fin.elim0)
simp
| succ n ih => rw [hP n, ih, f.prefix_law_succ κ hlaw]
defprivatePrefix (a : Bool) : (n : ℕ) →UniformTape× (Fin n →M) → (Fin n → (O ⊕ Unit))
body · 7
lines
| 0, _ =>Fin.elim0
| n+1, pair =>let old := privatePrefix a n (pair.1,fun i => pair.2 i.castSucc)
let pubPast :=funi : Fin n => pair.2 i.castSucc
Fin.snoc old (if p.alice n pubPast = a thenSum.inl
(if a then p.sampleA n ((old,pubPast),pair.1 n)
else p.sampleB n ((old,pubPast),pair.1 n)) elseSum.inr ())
defreplay : (n : ℕ) → (Fin n →O) →
((Fin n → (O ⊕ Unit)) × (Fin n → (O ⊕ Unit))) × (Fin n →M) :=
body · 7
lines
Nat.rec (fun _ => ((Fin.elim0,Fin.elim0),Fin.elim0)) (fun n previous x =>let r := previous (fun i => x i.castSucc)
let o := x (Fin.last n)
let q := p.alice n r.2
((Fin.snoc r.1.1 (if q thenSum.inl o elseSum.inr ()),
Fin.snoc r.1.2 (if q thenSum.inr () elseSum.inl o)),
Fin.snoc r.2 (if q then p.sendA n ((r.1.1,r.2),o) else p.sendB n ((r.1.2,r.2),o))))
lemmameasurable_snoc {Z : Type v6393_0} {X : Type v6393_1} [MeasurableSpaceZ] [MeasurableSpaceX]
{n : ℕ} (f : Z→ (Fin n →X)) (g : Z→X)
(hf : Measurable f) (hg : Measurable g) :
Measurable (fun x =>Fin.snoc (α :=fun_ : Fin (n+1) =>X) (f x) (g x)) :=by
proof · 5
lines
apply Measurable.of_eval
intro i
refine Fin.lastCases ?_ (fun j => ?_) i
· simpa only [Fin.snoc_last] using hg
· simpa only [Fin.snoc_castSucc] using hf.eval (a := j)
lemmaextractPrivate_snoc (a : Bool) (n : ℕ) (x : Fin n →O) (z : O) :
p.extractPrivate a (n+1) (Fin.snoc (α :=fun _ =>O) x z) =
Fin.snoc (p.extractPrivate a n x) (if p.alice n (p.publicFrom n x) = a thenSum.inl z elseSum.inr ()) :=by
proof · 2
lines
cases a <;> cases hq : p.alice n (p.publicFrom n x) <;>
simp only [extractPrivate,replay,Fin.snoc_castSucc,Fin.snoc_last,publicFrom] at hq ⊢ <;> simp [hq]
lemmapublicFrom_snoc (n : ℕ) (x : Fin n →O) (z : O) :
p.publicFrom (n+1) (Fin.snoc (α :=fun _ =>O) x z) =
Fin.snoc (p.publicFrom n x) (if p.alice n (p.publicFrom n x) then
p.sendA n ((p.extractPrivate true n x,p.publicFrom n x),z) else
p.sendB n ((p.extractPrivate false n x,p.publicFrom n x),z)) :=by
proof · 1
line
simp only [publicFrom,replay,extractPrivate,Fin.snoc_castSucc,Fin.snoc_last,Bool.false_eq_true,↓reduceIte]
lemmaprivatePrefix_snoc (a : Bool) (n : ℕ) (u : UniformTape) (h : Fin n →M) (z : M) :
p.privatePrefix a (n+1) (u,Fin.snoc (α :=fun _ =>M) h z) =
Fin.snoc (p.privatePrefix a n (u,h)) (if p.alice n h = a thenSum.inl
(if a then p.sampleA n ((p.privatePrefix a n (u,h),h),u n)
else p.sampleB n ((p.privatePrefix a n (u,h),h),u n)) elseSum.inr ()) :=by
proof · 1
line
simp only [privatePrefix,Fin.snoc_castSucc]
The sampled outcome history, without a bundled measurability certificate.
if p.alice n (p.publicFrom n pair.1) then
p.sampleA n ((p.extractPrivate true n pair.1, p.publicFrom n pair.1), pair.2.1)
else p.sampleB n ((p.extractPrivate false n pair.1, p.publicFrom n pair.1), pair.2.2)
defcausalHistory : (n : ℕ) → (Fin n →I×I) → (Fin n →O)
body · 3
lines
| 0, _ =>Fin.elim0
| n+1, u =>Fin.snoc (causalHistory n (fun i => u i.castSucc))
(p.causalStep n (causalHistory n (fun i => u i.castSucc), u (Fin.last n)))
have h (n : ℕ) : p.causalHistory n = p.causal.finiteHistory n :=by
induction n with
| zero => rfl
| succ n ih =>
funext u
simp only [causalHistory, NoiseSampler.finiteHistory, ih]
rfl
funext u n
change p.causalStep n (p.causalHistory n (fun i => u i), u n) =
p.causal.step n (p.causal.finiteHistory n (fun i => u i), u n)
rw [h n]
rfl
theoremreplay_matches (n : ℕ) (uv : UniformTape×UniformTape) :
p.publicFrom n (p.causal.history n (pairedTape uv)) = p.tapeProgram.publicPrefix n uv ∧
(∀ a, p.extractPrivate a n (p.causal.history n (pairedTape uv)) =
p.privatePrefix a n ((if a then uv.1else uv.2),p.tapeProgram.publicPrefix n uv)) :=by
proof · 28
lines
induction n with
| zero => exact ⟨rfl,fun a =>by cases a <;> rfl⟩
| succ n ih =>havehs : p.causal.step n (p.causal.history n (pairedTape uv),pairedTape uv n) =
if p.alice n (p.tapeProgram.publicPrefix n uv) then
p.sampleA n ((p.privatePrefix true n (uv.1,p.tapeProgram.publicPrefix n uv),
p.tapeProgram.publicPrefix n uv),uv.1 n) else
p.sampleB n ((p.privatePrefix false n (uv.2,p.tapeProgram.publicPrefix n uv),
p.tapeProgram.publicPrefix n uv),uv.2 n) :=by
change (if p.alice n (p.publicFrom n (p.causal.history n (pairedTape uv))) then
p.sampleA n ((p.extractPrivate true n (p.causal.history n (pairedTape uv)),
p.publicFrom n (p.causal.history n (pairedTape uv))),uv.1 n)
else p.sampleB n ((p.extractPrivate false n (p.causal.history n (pairedTape uv)),
p.publicFrom n (p.causal.history n (pairedTape uv))),uv.2 n)) = _
rw [ih.1,ih.2true,ih.2false]
simp only [Bool.false_eq_true,↓reduceIte]
rw [p.causal.prefix_succ,p.publicFrom_snoc,hs,ih.1,ih.2true,ih.2false]
simp only [Bool.false_eq_true,↓reduceIte]
constructor
· rw [p.tapeProgram.prefix_succ]
congr 1
unfold AdaptiveTapeProgram.message tapeProgram
split <;> simp_all only []
· intro a
rw [p.extractPrivate_snoc,ih.2 a,ih.1,p.tapeProgram.prefix_succ,p.privatePrefix_snoc]
congr 1
cases a <;> cases hrole : p.alice n (p.tapeProgram.publicPrefix n uv) <;>
simp only [Bool.false_eq_true,Bool.true_eq_false,↓reduceIte]
lemmainstrumentKernel_apply
(κA κB : (n : ℕ) →Kernel ((Fin n → (O ⊕ Unit)) × (Fin n →M)) O)
(n : ℕ) (s : Fin n →O) :
p.instrumentKernel κA κB n s = if p.alice n (p.publicFrom n s) then
κA n (p.extractPrivate true n s,p.publicFrom n s) else
κB n (p.extractPrivate false n s,p.publicFrom n s) :=by
proof · 3
lines
classical
simp only [instrumentKernel,Kernel.piecewise_apply,Set.mem_preimage,Set.mem_singleton_iff,
Function.comp_def,Kernel.comap_apply]
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.prod volume).map (fun u => p.causal.step n (s,u)) =
p.instrumentKernel κA κB n s :=by
proof · 18
lines
intro n s
rw [p.instrumentKernel_apply κA κB n s]
change (volume.prod volume).map (fun u =>if p.alice n (p.publicFrom n s) then
p.sampleA n ((p.extractPrivate true n s,p.publicFrom n s),u.1) else
p.sampleB n ((p.extractPrivate false n s,p.publicFrom n s),u.2)) = _
split
· havehm : Measurable (funu : I=> p.sampleA n ((p.extractPrivate true n s,p.publicFrom n s),u)) :=
(p.sampleA_meas n).comp (measurable_const.prodMk measurable_id)
have hh :=Measure.map_map (μ := (volume : MeasureI).prod volume) hm
(measurable_fst : Measurable (Prod.fst : I×I→I))
simp only [Measure.map_fst_prod, measure_univ, one_smul] at hh
exact hh.symm.trans (ha n _)
· havehm : Measurable (funu : I=> p.sampleB n ((p.extractPrivate false n s,p.publicFrom n s),u)) :=
(p.sampleB_meas n).comp (measurable_const.prodMk measurable_id)
have hh :=Measure.map_map (μ := (volume : MeasureI).prod volume) hm
(measurable_snd : Measurable (Prod.snd : I×I→I))
simp only [Measure.map_snd_prod, measure_univ, one_smul] at hh
exact hh.symm.trans (hb n _)
lemmaglobalLocalReferenceA_mean [∀ n, IsMarkovKernel (κA n)] (n : ℕ) (s : Fin n →O) (i j : ι) :
(∫ o, globalLocalReferenceA p κA eA (n+1) (Fin.snoc s o) i j
∂p.instrumentKernel κA κB n s) = globalLocalReferenceA p κA eA n s i j :=by
proof · 15
lines
unfold globalLocalReferenceA
simp_rw [p.extractPrivate_snoc, p.publicFrom_snoc]
rw [p.instrumentKernel_apply]
cases hrole : p.alice n (p.publicFrom n s) with
| true=>
simp only [↓reduceIte]
exact eA.active_mean n _ i j
| false=>
simp only [Bool.false_eq_true,↓reduceIte]
change (∫ o, eA.reference (n+1) (localPassive
(p.extractPrivate true n s,p.publicFrom n s)
(p.sendB n ((p.extractPrivate false n s,p.publicFrom n s),o))) i j
∂κB n (p.extractPrivate false n s,p.publicFrom n s)) = _
simp only [eA.passive_reference]
simp
lemmaglobalLocalReferenceB_mean [∀ n, IsMarkovKernel (κB n)] (n : ℕ) (s : Fin n →O) (i j : η) :
(∫ o, globalLocalReferenceB p κB eB (n+1) (Fin.snoc s o) i j
∂p.instrumentKernel κA κB n s) = globalLocalReferenceB p κB eB n s i j :=by
proof · 15
lines
unfold globalLocalReferenceB
simp_rw [p.extractPrivate_snoc, p.publicFrom_snoc]
rw [p.instrumentKernel_apply]
cases hrole : p.alice n (p.publicFrom n s) with
| false=>
simp only [↓reduceIte]
exact eB.active_mean n _ i j
| true=>
simp only [Bool.true_eq_false,↓reduceIte]
change (∫ o, eB.reference (n+1) (localPassive
(p.extractPrivate false n s,p.publicFrom n s)
(p.sendA n ((p.extractPrivate true n s,p.publicFrom n s),o))) i j
∂κA n (p.extractPrivate true n s,p.publicFrom n s)) = _
simp only [eB.passive_reference]
simp
lemmajointReference_density [∀ n, IsMarkovKernel (κA n)] [∀ n, IsMarkovKernel (κB n)] (n : ℕ) (s : Fin n →O) :
Density (jointReference p κA κB eA eB n s) :=by
proof · 3
lines
refine ⟨(eA.reference_density n _).1.kronecker (eB.reference_density n _).1,?_⟩
simp only [jointReference, Matrix.trace_kronecker,globalLocalReferenceA,
globalLocalReferenceB,(eA.reference_density n _).2,(eB.reference_density n _).2,one_mul]
lemmajointReference_mean [∀ n, IsMarkovKernel (κA n)] [∀ n, IsMarkovKernel (κB n)] (n : ℕ) (s : Fin n →O) (i j : ι × η) :
(∫ o, jointReference p κA κB eA eB (n+1) (Fin.snoc s o) i j
∂p.instrumentKernel κA κB n s) = jointReference p κA κB eA eB n s i j :=by
proof · 28
lines
change (∫ o, globalLocalReferenceA p κA eA (n+1) (Fin.snoc s o) i.1 j.1 *
globalLocalReferenceB p κB eB (n+1) (Fin.snoc s o) i.2 j.2
∂p.instrumentKernel κA κB n s) =
globalLocalReferenceA p κA eA n s i.1 j.1 * globalLocalReferenceB p κB eB n s i.2 j.2
simp only [globalLocalReferenceA,globalLocalReferenceB]
simp_rw [p.extractPrivate_snoc,p.publicFrom_snoc]
rw [p.instrumentKernel_apply]
cases hrole : p.alice n (p.publicFrom n s) with
| true=>
simp only [Bool.true_eq_false,↓reduceIte]
change (∫ o, eA.reference (n+1) (localActive
(p.extractPrivate true n s,p.publicFrom n s) o
(p.sendA n ((p.extractPrivate true n s,p.publicFrom n s),o))) i.1 j.1 *
eB.reference (n+1) (localPassive (p.extractPrivate false n s,p.publicFrom n s)
(p.sendA n ((p.extractPrivate true n s,p.publicFrom n s),o))) i.2 j.2
∂κA n (p.extractPrivate true n s,p.publicFrom n s)) = _
simp_rw [eB.passive_reference]
rw [integral_mul_const,eA.active_mean]
| false=>
simp only [Bool.false_eq_true,↓reduceIte]
change (∫ o, eA.reference (n+1) (localPassive
(p.extractPrivate true n s,p.publicFrom n s)
(p.sendB n ((p.extractPrivate false n s,p.publicFrom n s),o))) i.1 j.1 *
eB.reference (n+1) (localActive (p.extractPrivate false n s,p.publicFrom n s) o
(p.sendB n ((p.extractPrivate false n s,p.publicFrom n s),o))) i.2 j.2
∂κB n (p.extractPrivate false n s,p.publicFrom n s)) = _
simp_rw [eA.passive_reference]
rw [integral_const_mul,eB.active_mean]
lemmalocalRecord_replay (a : Bool) (uv : UniformTape×UniformTape) :
p.localRecord a (p.outcomeRecord uv) =
p.privateRecord a ((if a then uv.1else uv.2),p.tapeProgram.record uv) :=by
proof · 11
lines
funext n
have h := congrFun ((p.replay_matches (n+1) uv).2 a) (Fin.last n)
havehe : (funi : Fin (n+1) => p.outcomeRecord uv i) =
p.causal.history (n+1) (pairedTape uv) :=by
funext i
exact (p.causal.prefix_eq_record (n+1) (pairedTape uv) i).symm
change p.extractPrivate a (n+1) (fun i => p.outcomeRecord uv i) (Fin.last n) = _
rw [he,h]
congr 2
funext i
exact p.tapeProgram.prefix_eq_record (n+1) uv i
theoremlocal_product_reference_extension
(U : ℕ→ Ω →Matrix ι ι ℂ) (V : ℕ→ Ω →Matrix η η ℂ)
(hU : ∀ n x, Density (U n x)) (hV : ∀ n x, Density (V n x))
(hLA : LA≤ mΩ) (hLB : LB≤ mΩ)
(hmU : ∀ n, Measurable[LA] (U n)) (hmV : ∀ n, Measurable[LB] (V n))
(hrU : ∀ i j, Martingale (fun n x => (U n x i j).re) F μ)
(hiU : ∀ i j, Martingale (fun n x => (U n x i j).im) F μ)
(hrV : ∀ i j, Martingale (fun n x => (V n x i j).re) F μ)
(hiV : ∀ i j, Martingale (fun n x => (V n x i j).im) F μ)
(hrUV : ∀ i j, Martingale (fun n x => ((U n x ⊗ₖ V n x) i j).re) F μ)
(hiUV : ∀ i j, Martingale (fun n x => ((U n x ⊗ₖ V n x) i j).im) F μ) :
∃G : Ω →Matrix ι ι ℂ, ∃H : Ω →Matrix η η ℂ,
Measurable[LA] G∧Measurable[LB] H∧
(∀ x, Density (G x)) ∧ (∀ x, Density (H x)) ∧
(∀ᵐ x ∂μ, Tendsto (fun n =>U n x) atTop (𝓝 (G x))) ∧
(∀ᵐ x ∂μ, Tendsto (fun n =>V n x) atTop (𝓝 (H x))) ∧
(∀ n S, MeasurableSet[F n] S→
(∫ x inS, G x ∂μ) = ∫ x inS, U n x ∂μ) ∧
(∀ n S, MeasurableSet[F n] S→
(∫ x inS, H x ∂μ) = ∫ x inS, V n x ∂μ) ∧∃W : PositiveMatrixMeasure Ω (ι × η),
(∀S, MeasurableSetS→W.value S = ∫ x inS, G x ⊗ₖ H x ∂μ) ∧
(∀ n S, MeasurableSet[F n] S→W.value S = ∫ x inS, U n x ⊗ₖ V n x ∂μ) :=by
proof · 21
lines
obtain ⟨G,hGm,hG,hGi,hGt,hGc⟩ := local_reference_limit U hU hmU hLA hrU hiU
obtain ⟨H,hHm,hH,hHi,hHt,hHc⟩ := local_reference_limit V hV hmV hLB hrV hiV
obtain ⟨J,hJm,hJ,hJi,hJt,hJc⟩ := local_reference_limit
(fun n x =>U n x ⊗ₖ V n x)
(fun n x => density_kronecker (hU n x) (hV n x))
(fun n => measurable_matrix_kronecker ((hmU n).mono hLA le_rfl)
((hmV n).mono hLB le_rfl)) le_rfl hrUV hiUV
havehprod : (fun x =>G x ⊗ₖ H x) =ᵐ[μ] J:=by
filter_upwards [hGt,hHt,hJt] with x hx hy hz
haveht : Tendsto (fun n =>U n x ⊗ₖ V n x) atTop (𝓝 (G x ⊗ₖ H x)) :=
continuous_matrix_kronecker.continuousAt.tendsto.comp (hx.prodMk_nhds hy)
exact tendsto_nhds_unique ht hz
letW:= positiveMatrixMeasureOfDensity hJi
(Eventually.of_forall (fun x => (hJ x).1))
refine ⟨G,H,hGm,hHm,hG,hH,hGt,hHt,hGc,hHc,W,?_,?_⟩
· intro S hS
rw [positiveMatrixMeasureOfDensity_value hJi _ S hS]
exact integral_congr_ae (ae_restrict_of_ae hprod.symm)
· intro n S hS
rw [positiveMatrixMeasureOfDensity_value hJi _ S (F.le n S hS)]
exact hJc n S hS
lemmapublicFrom_eq_record (n : ℕ) (x : ℕ→O) (i : Fin n) :
p.publicFrom n (historyPrefix n x) i = p.publicRecord x i :=by
proof · 7
lines
induction n with
| zero => exact Fin.elim0 i
| succ n ih =>
refine Fin.lastCases ?_ (fun j => ?_) i
· rfl
· simp only [publicFrom,replay,Fin.snoc_castSucc]
exact ih j
lemmaextractPrivate_eq_record (a : Bool) (n : ℕ) (x : ℕ→O) (i : Fin n) :
p.extractPrivate a n (historyPrefix n x) i = p.localRecord a x i :=by
proof · 7
lines
induction n with
| zero => exact Fin.elim0 i
| succ n ih =>
refine Fin.lastCases ?_ (fun j => ?_) i
· rfl
· cases a <;> simp only [extractPrivate,replay,Bool.false_eq_true,↓reduceIte,
Fin.snoc_castSucc] <;> exact ih j
lemmalocal_history_measurable (a : Bool) (n : ℕ) :
Measurable[p.localField a] (fun x =>
(p.extractPrivate a n (historyPrefix n x),p.publicFrom n (historyPrefix n x))) :=by
proof · 12
lines
havehe : (fun x => (p.extractPrivate a n (historyPrefix n x),p.publicFrom n (historyPrefix n x))) =
fun x => ((funi : Fin n => p.localRecord a x i),funi : Fin n => p.publicRecord x i) :=by
funext x
congr 1 <;> funext i
· exact p.extractPrivate_eq_record a n x i
· exact p.publicFrom_eq_record n x i
rw [he]
let : MeasurableSpace (ℕ→O) := p.localField a
havehm : Measurable (funx : ℕ→O=> (p.localRecord a x,p.publicRecord x)) :=Measurable.of_comap_le le_rfl
exact (Measurable.of_eval (fun i => hm.fst.eval)).prodMk
(Measurable.of_eval (fun i => hm.snd.eval))
theoremfull_reference_extension
(P : Measure (ℕ→O)) [IsProbabilityMeasureP]
(hP : ∀ n, P.map (historyPrefix (n+1)) =
((P.map (historyPrefix n)) ⊗ₘ p.instrumentKernel κA κB n).map
(funpair : (Fin n →O) ×O=>Fin.snoc (α :=fun_ : Fin (n+1) =>O) pair.1 pair.2)) :
∃G : (ℕ→O) →Matrix ι ι ℂ, ∃H : (ℕ→O) →Matrix η η ℂ,
Measurable[p.localField true] G∧Measurable[p.localField false] H∧
(∀ x, Density (G x)) ∧ (∀ x, Density (H x)) ∧
(∀ n S, MeasurableSet[historyFiltration n] S→
(∫ x inS, G x ∂P) = ∫ x inS, globalLocalReferenceA p κA eA n (historyPrefix n x) ∂P) ∧
(∀ n S, MeasurableSet[historyFiltration n] S→
(∫ x inS, H x ∂P) = ∫ x inS, globalLocalReferenceB p κB eB n (historyPrefix n x) ∂P) ∧∃W : PositiveMatrixMeasure (ℕ→O) (ι × η),
(∀S, MeasurableSetS→W.value S = ∫ x inS, G x ⊗ₖ H x ∂P) ∧
(∀ n S, MeasurableSet[historyFiltration n] S→W.value S = ∫ x inS, jointReference p κA κB eA eB n (historyPrefix n x) ∂P) :=by
proof · 26
lines
letU:= globalLocalReferenceA p κA eA
letV:= globalLocalReferenceB p κB eB
have hU (n : ℕ) (s : Fin n →O) : Density (U n s) := eA.reference_density n _
have hV (n : ℕ) (s : Fin n →O) : Density (V n s) := eB.reference_density n _
have hmU := globalLocalReferenceA_measurable p κA eA
have hmV := globalLocalReferenceB_measurable p κB eB
have hmeanU := globalLocalReferenceA_mean p κA κB eA
have hmeanV := globalLocalReferenceB_mean p κA κB eB
have hrU := reference_history_martingale_re P (p.instrumentKernel κA κB) hP U hU hmU hmeanU
have hiU := reference_history_martingale_im P (p.instrumentKernel κA κB) hP U hU hmU hmeanU
have hrV := reference_history_martingale_re P (p.instrumentKernel κA κB) hP V hV hmV hmeanV
have hiV := reference_history_martingale_im P (p.instrumentKernel κA κB) hP V hV hmV hmeanV
have hrUV := reference_history_martingale_re P (p.instrumentKernel κA κB) hP
(jointReference p κA κB eA eB) (jointReference_density p κA κB eA eB)
(jointReference_measurable p κA κB eA eB) (jointReference_mean p κA κB eA eB)
have hiUV := reference_history_martingale_im P (p.instrumentKernel κA κB) hP
(jointReference p κA κB eA eB) (jointReference_density p κA κB eA eB)
(jointReference_measurable p κA κB eA eB) (jointReference_mean p κA κB eA eB)
obtain ⟨G,H,hGm,hHm,hG,hH,_,_,hGc,hHc,W,hW,hWc⟩ :=
local_product_reference_extension
(fun n x =>U n (historyPrefix n x)) (fun n x =>V n (historyPrefix n x))
(fun n x => hU n _) (fun n x => hV n _) (p.localField_le true) (p.localField_le false)
(fun n => (eA.reference_measurable n).comp (p.local_history_measurable true n))
(fun n => (eB.reference_measurable n).comp (p.local_history_measurable false n))
hrU hiU hrV hiV hrUV hiUV
exact ⟨G,H,hGm,hHm,hG,hH,hGc,hHc,W,hW,hWc⟩
lemmacondIndepFun_ae_indep_complex {Ω : Type v7253_0} {C : MeasurableSpace Ω}
{mΩ : MeasurableSpace Ω} [inst7253_0 : StandardBorelSpace Ω] {μ : Measure Ω}
[inst7253_1 : IsFiniteMeasure μ] (hC : C≤ mΩ)
{f g : Ω →ℂ}
(hf : Measurable f) (hg : Measurable g)
(h : CondIndepFunC hC f g μ) :
∀ᵐ x ∂μ.trim hC, IndepFun f g (condExpKernel μ C x) :=by
proof · 5
lines
have he := (condIndepFun_iff_map_prod_eq_prod_map_map hf hg).mp h
filter_upwards [he] with x hx
apply (indepFun_iff_map_prod_eq_prod_map_map hf.aemeasurable hg.aemeasurable).mpr
simpa only [Kernel.prod_apply, Kernel.map_apply _ (hf.prodMk hg),
Kernel.map_apply _ hf, Kernel.map_apply _ hg] using hx
lemmacondIndepFun_kernel_integral_mul {Ω : Type v7253_0} {C : MeasurableSpace Ω}
{mΩ : MeasurableSpace Ω} [inst7253_0 : StandardBorelSpace Ω] {μ : Measure Ω}
[inst7253_1 : IsFiniteMeasure μ] (hC : C≤ mΩ)
{f g : Ω →ℂ}
(hf : Measurable f) (hg : Measurable g)
(h : CondIndepFunC hC f g μ) :
∀ᵐ x ∂μ.trim hC,
(∫ y, f y * g y ∂condExpKernel μ C x) =
(∫ y, f y ∂condExpKernel μ C x) *
(∫ y, g y ∂condExpKernel μ C x) :=by
proof · 3
lines
filter_upwards [condIndepFun_ae_indep_complex hC hf hg h] with x hx
exact hx.integral_fun_mul_eq_mul_integral hf.stronglyMeasurable.aestronglyMeasurable
hg.stronglyMeasurable.aestronglyMeasurable
lemmapublicMatrix_entry (W : Ω →Matrix ι ι ℂ)
(hWi : ∀ x, IntegrableW (condExpKernel μ C x)) (x : Ω) (i j : ι) :
publicMatrix C μ W x i j = ∫ y, W y i j ∂condExpKernel μ C x :=
theoremcondIndep_publicMatrix_kronecker
(hC : C≤ mΩ) (hA : A≤ mΩ) (hB : B≤ mΩ)
(h : CondIndepCAB hC μ)
(U : Ω →Matrix ι ι ℂ) (V : Ω →Matrix κ κ ℂ)
(hUm : Measurable[A] U) (hVm : Measurable[B] V)
(hUi : ∀ x, IntegrableU (condExpKernel μ C x))
(hVi : ∀ x, IntegrableV (condExpKernel μ C x))
(hUVi : ∀ x, Integrable (fun y =>U y ⊗ₖ V y) (condExpKernel μ C x)) :
publicMatrix C μ (fun y =>U y ⊗ₖ V y) =ᵐ[μ.trim hC]
fun x => publicMatrix C μ U x ⊗ₖ publicMatrix C μ V x :=by
proof · 21
lines
have he (i j : ι) (k l : κ) :
∀ᵐ x ∂μ.trim hC,
(∫ y, U y i j * V y k l ∂condExpKernel μ C x) =
(∫ y, U y i j ∂condExpKernel μ C x) *
(∫ y, V y k l ∂condExpKernel μ C x) :=byhavehuf : Measurable[A] (fun y =>U y i j) :=
((Matrix.entryLinearMap ℂℂ i j).toContinuousLinearMap).measurable.comp hUm
havehvf : Measurable[B] (fun y =>V y k l) :=
((Matrix.entryLinearMap ℂℂ k l).toContinuousLinearMap).measurable.comp hVm
havehfg : CondIndepFunC hC (fun y =>U y i j) (fun y =>V y k l) μ :=by
exact condIndep_of_condIndep_of_le_right
(condIndep_of_condIndep_of_le_left h huf.comap_le) hvf.comap_le
exact condIndepFun_kernel_integral_mul hC (huf.mono hA le_rfl)
(hvf.mono hB le_rfl) hfg
have he' := ae_all_iff.mpr (fun i => ae_all_iff.mpr (fun j =>
ae_all_iff.mpr (fun k => ae_all_iff.mpr (he i j k))))
filter_upwards [he'] with x hx
ext ⟨i,k⟩ ⟨j,l⟩
rw [publicMatrix_entry _ hUVi, Matrix.kronecker_apply,
publicMatrix_entry _ hUi, publicMatrix_entry _ hVi]
exact hx i j k l
lemmameasurable_positive_factor {Ω : Type v7402_0} {T : Type v7402_1} [MeasurableSpace Ω]
[MeasurableSpaceT] (r : Ω →T)
(U : Ω →Matrix ι ι ℂ) (hU : ∀ x, Subdensity (U x))
(hm : Measurable[MeasurableSpace.comap r inferInstance] U) :
∃V : T→Matrix ι ι ℂ, MeasurableV∧ (∀ t, Subdensity (V t)) ∧U = V∘ r :=by
proof · 20
lines
classical
obtain ⟨V,hVm,hV⟩ := hm.exists_eq_measurable_comp
letgood : SetT:= {t | 0≤V t ∧ (trace (V t)).re ≤1}
havehg : MeasurableSet good :=
(measurableSet_le measurable_const hVm).inter
(measurableSet_le (((Matrix.traceLinearMap ι ℂℂ).toContinuousLinearMap).measurable.comp hVm).re measurable_const)
letW : T→Matrix ι ι ℂ:= good.piecewise V (fun _ =>0)
refine ⟨W,hVm.piecewise hg measurable_const,?_,?_⟩
· intro t
by_cases ht : t ∈ good
· simpa only [W,Set.piecewise_eq_of_mem good V _ ht] using
(showSubdensity (V t) from ⟨ht.1.posSemidef,ht.2⟩)
· simpa only [W,Set.piecewise_eq_of_notMem good V _ ht] using subdensity_zero (ι := ι)
· funext x
havehe : U x = V (r x) := congrFun hV x
havehgx : r x ∈ good :=by
change 0≤V (r x) ∧ (trace (V (r x))).re ≤1
rw [← he]
exact ⟨(hU x).1.nonneg,(hU x).2⟩
simpa only [Function.comp_apply,W,Set.piecewise_eq_of_mem good V _ hgx] using he
theoremterminal_public_factors
(hA : A≤ mΩ) (hB : B≤ mΩ)
(h : CondIndep (MeasurableSpace.comap r inferInstance) AB hr.comap_le μ)
(U : Bool→ Ω →Matrix ι ι ℂ) (V : Bool→ Ω →Matrix η η ℂ)
(hU : ∀ i x, Subdensity (U i x)) (hV : ∀ j x, Subdensity (V j x))
(hmU : ∀ i, Measurable[A] (U i)) (hmV : ∀ j, Measurable[B] (V j)) :
∃X : Bool→T→Matrix ι ι ℂ, ∃Y : Bool→T→Matrix η η ℂ,
(∀ i, Measurable (X i)) ∧ (∀ j, Measurable (Y j)) ∧
(∀ i t, Subdensity (X i t)) ∧ (∀ j t, Subdensity (Y j t)) ∧
(∀ i j, publicMatrix (MeasurableSpace.comap r inferInstance) μ
(fun x =>U i x ⊗ₖ V j x) =ᵐ[μ]
fun x =>X i (r x) ⊗ₖ Y j (r x)) :=by
proof · 22
lines
have hUm (i : Bool) := (hmU i).mono hA le_rfl
have hVm (j : Bool) := (hmV j).mono hB le_rfl
have hpU (i : Bool) : ∀ x, Subdensity (publicMatrix (MeasurableSpace.comap r inferInstance) μ (U i) x) :=fun x => integral_subdensity (U i) (hU i) (hUm i) (condExpKernel μ (MeasurableSpace.comap r inferInstance) x)
have hpV (j : Bool) : ∀ x, Subdensity (publicMatrix (MeasurableSpace.comap r inferInstance) μ (V j) x) :=fun x => integral_subdensity (V j) (hV j) (hVm j) (condExpKernel μ (MeasurableSpace.comap r inferInstance) x)
choose X hXm hXp hX usingfun i => measurable_positive_factor r
(publicMatrix (MeasurableSpace.comap r inferInstance) μ (U i)) (hpU i) (publicMatrix_measurable hr.comap_le (hUm i))
choose Y hYm hYp hY usingfun j => measurable_positive_factor r
(publicMatrix (MeasurableSpace.comap r inferInstance) μ (V j)) (hpV j) (publicMatrix_measurable hr.comap_le (hVm j))
refine ⟨X,Y,hXm,hYm,hXp,hYp,?_⟩
intro i j
have he := condIndep_publicMatrix_kronecker hr.comap_le hA hB h
(U i) (V j) (hmU i) (hmV j)
(fun x => integrable_subdensity (U i) (hU i) (hUm i) (condExpKernel μ (MeasurableSpace.comap r inferInstance) x))
(fun x => integrable_subdensity (V j) (hV j) (hVm j) (condExpKernel μ (MeasurableSpace.comap r inferInstance) x))
(fun x => integrable_subdensity (fun y =>U i y ⊗ₖ V j y)
(fun y => subdensity_kronecker (hU i y) (hV j y))
(measurable_matrix_kronecker (hUm i) (hVm j)) (condExpKernel μ (MeasurableSpace.comap r inferInstance) x))
have he' := ae_of_ae_trim hr.comap_le he
filter_upwards [he'] with x hx
exact hx.trans (by rw [congrFun (hX i) x,congrFun (hY j) x]; rfl)
havehe : W.entry = V.entry :=by
funext i j
refine VectorMeasure.ext_of_generateFrom C ?_ hm hC ?_
· intro S hS
exact congrArg (funM : Matrix ι ι ℂ=>M i j) (h S hS)
· exact congrArg (funM : Matrix ι ι ℂ=>M i j) hu
cases W
cases V
cases he
rfl
theoremreference_density_unique_on_filtration (F : Filtrationℕ mΩ)
(hgen : mΩ = ⨆ n, F n)
(UV : Ω →Matrix ι ι ℂ)
(hU : ∀ x, Subdensity (U x)) (hV : ∀ x, Subdensity (V x))
(hmU : MeasurableU) (hmV : MeasurableV)
(hEq : ∀ n S, MeasurableSet[F n] S→
(∫ x inS, U x ∂μ) = ∫ x inS, V x ∂μ) : U =ᵐ[μ] V:=by
proof · 23
lines
have hUi := integrable_subdensity U hU hmU μ
have hVi := integrable_subdensity V hV hmV μ
have hUe (i j : ι) : Integrable (fun x =>U x i j) μ :=
((Matrix.entryLinearMap ℂℂ i j).toContinuousLinearMap).integrable_comp hUi
have hVe (i j : ι) : Integrable (fun x =>V x i j) μ :=
((Matrix.entryLinearMap ℂℂ i j).toContinuousLinearMap).integrable_comp hVi
letP:= positiveMatrixMeasureOfDensity hUe
(Filter.Eventually.of_forall (fun x => (hU x).1))
letQ:= positiveMatrixMeasureOfDensity hVe
(Filter.Eventually.of_forall (fun x => (hV x).1))
havehpq : P = Q:=by
apply PositiveMatrixMeasure.ext_on_filtration PQF hgen
intro n S hS
dsimp only [P,Q]
rw [positiveMatrixMeasureOfDensity_value hUe _ S (F.le n S hS),
positiveMatrixMeasureOfDensity_value hVe _ S (F.le n S hS)]
exact hEq n S hS
apply Integrable.ae_eq_of_forall_setIntegral_eq UV hUi hVi
intro S hS _
have he := congrArg (funP : PositiveMatrixMeasure Ω ι =>P.value S) hpq
dsimp only [P,Q] at he
simpa only [positiveMatrixMeasureOfDensity_value hUe _ S hS,
positiveMatrixMeasureOfDensity_value hVe _ S hS] using he
state : Ω →ReferenceFunctionalA ι
positive : ∀ x, PositiveFunctional (state x)
positive_unit : (0 : A) ≤1normalized : ∀ x, trace (state x 1) = 1local_measurable : Measurable[L] (fun x => state x 1)
causality : ∀ n S, MeasurableSet[F n] S→
(∫ x inS, state x 1 ∂μ) = ∫ x inS, U n x ∂μ
lemmasetIntegral_publicMatrix (hL : L≤ mΩ) (U : Ω →Matrix ι ι ℂ)
(hU : IntegrableUP) (S : Set Ω) (hS : MeasurableSet[L] S) :
(∫ x inS, publicMatrix LPU x ∂P) = ∫ x inS, U x ∂P:=by
proof · 4
lines
calc
_ = ∫ x inS, P[U | L] x ∂P:= integral_congr_ae
(ae_restrict_of_ae (condExp_ae_eq_integral_condExpKernel hL hU).symm)
_ = _ := setIntegral_condExp hL hU hS
lemmapublic_factor_event (r : Ω →T) (hr : Measurable r)
(U : Ω →Matrix ι ι ℂ) (V : T→Matrix ι ι ℂ)
(hU : IntegrableUP) (hV : MeasurableV)
(he : publicMatrix (MeasurableSpace.comap r inferInstance) PU =ᵐ[P] V∘ r)
(S : SetT) (hS : MeasurableSetS) :
(∫ t inS, V t ∂P.map r) = ∫ x in r ⁻¹' S, U x ∂P:=by
proof · 5
lines
rw [setIntegral_map hS hV.aestronglyMeasurable hr.aemeasurable]
calc
_ = ∫ x in r ⁻¹' S, publicMatrix (MeasurableSpace.comap r inferInstance) PU x ∂P:=
integral_congr_ae (ae_restrict_of_ae he.symm)
_ = _ := setIntegral_publicMatrix hr.comap_le U hU _ ⟨S,hS,rfl⟩
theoremincoming_joint_reference_consistency [StandardBorelSpaceO] [NonemptyO] [StandardBorelSpaceM] [NonemptyM] :
∀ n S, MeasurableSet[historyFiltration n] S→
(∫ x inS, (eTA.state x 1) ⊗ₖ (eTB.state x 1) ∂P) =
∫ x inS, jointReference p κA κB eA eB n (historyPrefix n x) ∂P:=by
proof · 23
lines
obtain ⟨G,H,hGm,hHm,hG,hH,hGc,hHc,W,hW,hWc⟩ :=
full_reference_extension p κA κB eA eB P hP
havehGa : (fun x => eTA.state x 1) =ᵐ[P] G:=
reference_density_unique_on_filtration historyFiltration historyFiltration_generates
(fun x => eTA.state x 1) G
(fun x => density_subdensity (eTA.reference_density x))
(fun x => density_subdensity (hG x))
(eTA.local_measurable.mono (p.localField_le true) le_rfl)
(hGm.mono (p.localField_le true) le_rfl)
(fun n S hS => (eTA.causality n S hS).trans (hGc n S hS).symm)
havehHa : (fun x => eTB.state x 1) =ᵐ[P] H:=
reference_density_unique_on_filtration historyFiltration historyFiltration_generates
(fun x => eTB.state x 1) H
(fun x => density_subdensity (eTB.reference_density x))
(fun x => density_subdensity (hH x))
(eTB.local_measurable.mono (p.localField_le false) le_rfl)
(hHm.mono (p.localField_le false) le_rfl)
(fun n S hS => (eTB.causality n S hS).trans (hHc n S hS).symm)
intro n S hS
rw [← hWc n S hS,hW S (historyFiltration.le n S hS)]
apply integral_congr_ae
filter_upwards [ae_restrict_of_ae hGa,ae_restrict_of_ae hHa] with x hx hy
rw [hx,hy]
theoremgenuine_terminal_public_factors
(hlaw : ∀ n s, ((volume : MeasureI).prod volume).map
(fun u => p.causal.step n (s,u)) = p.instrumentKernel κA κB n s) :
∃X : Bool→ (ℕ→M) →Matrix ι ι ℂ,
∃Y : Bool→ (ℕ→M) →Matrix η η ℂ,
(∀ i, Measurable (X i)) ∧ (∀ j, Measurable (Y j)) ∧
(∀ i t, Subdensity (X i t)) ∧ (∀ j t, Subdensity (Y j t)) ∧∀ i j S, MeasurableSetS→
(∫ t inS, X i t ⊗ₖ Y j t ∂P.map p.publicRecord) =
∫ x in p.publicRecord ⁻¹' S, bA.value i x ⊗ₖ bB.value j x ∂P:=by
proof · 12
lines
obtain ⟨X,Y,hXm,hYm,hXp,hYp,hXY⟩ := terminal_public_factors p.publicRecord
p.measurable_publicRecord (p.localField_le true) (p.localField_le false)
(p.localFields_independent (p.instrumentKernel κA κB) hlaw P hP)
bA.value bB.value bA.subdensity bB.subdensity bA.measurable bB.measurable
refine ⟨X,Y,hXm,hYm,hXp,hYp,?_⟩
intro i j S hS
exact public_factor_event p.publicRecord p.measurable_publicRecord
(fun x => bA.value i x ⊗ₖ bB.value j x) (fun t =>X i t ⊗ₖ Y j t)
(integrable_subdensity _ (fun x => subdensity_kronecker (bA.subdensity i x) (bB.subdensity j x))
(measurable_matrix_kronecker ((bA.measurable i).mono (p.localField_le true) le_rfl)
((bB.measurable j).mono (p.localField_le false) le_rfl)) P)
(measurable_matrix_kronecker (hXm i) (hYm j)) (hXY i j) S hS
theoremterminal_reference_total :
(∫ x, bA.value false x ⊗ₖ bB.value false x ∂P) +
(∫ x, bA.value false x ⊗ₖ bB.value true x ∂P) +
(∫ x, bA.value true x ⊗ₖ bB.value false x ∂P) +
(∫ x, bA.value true x ⊗ₖ bB.value true x ∂P) =
jointReference p κA κB eA eB 0Fin.elim0 :=by
proof · 21
lines
have hi (i j : Bool) : Integrable (fun x => bA.value i x ⊗ₖ bB.value j x) P:=
integrable_subdensity _ (fun x => subdensity_kronecker (bA.subdensity i x) (bB.subdensity j x))
(measurable_matrix_kronecker ((bA.measurable i).mono (p.localField_le true) le_rfl)
((bB.measurable j).mono (p.localField_le false) le_rfl)) Phave h2 := (integral_add ((hi falsefalse).add (hi falsetrue)) (hi truefalse)).symm
have h3 := (integral_add (((hi falsefalse).add (hi falsetrue)).add (hi truefalse)) (hi truetrue)).symm
simp only [Pi.add_apply] at h2 h3
rw [← integral_add (hi falsefalse) (hi falsetrue),h2,h3]
have hs (x : ℕ→O) : bA.value false x ⊗ₖ bB.value false x +
bA.value false x ⊗ₖ bB.value true x + bA.value true x ⊗ₖ bB.value false x +
bA.value true x ⊗ₖ bB.value true x = eTA.state x 1 ⊗ₖ eTB.state x 1:=by
rw [← bA.sum x,← bB.sum x,Matrix.add_kronecker,Matrix.kronecker_add,Matrix.kronecker_add]
abel
simp_rw [hs]
have hc := incoming_joint_reference_consistency p κA κB eA eB P hP eTA eTB
0Set.univ MeasurableSet.univ
simp only [Measure.restrict_univ] at hc
rw [hc]
have he (x : ℕ→O) : historyPrefix 0 x = Fin.elim0 :=Subsingleton.elim _ _
simp_rw [he]
simp
theoremterminal_public_normalization
(hlaw : ∀ n s, ((volume : MeasureI).prod volume).map
(fun u => p.causal.step n (s,u)) = p.instrumentKernel κA κB n s) :
∃X : Bool→ (ℕ→M) →Matrix ι ι ℂ,
∃Y : Bool→ (ℕ→M) →Matrix η η ℂ,
(∀ i, Measurable (X i)) ∧ (∀ j, Measurable (Y j)) ∧
(∀ i t, Subdensity (X i t)) ∧ (∀ j t, Subdensity (Y j t)) ∧
(∀ i j S, MeasurableSetS→
(∫ t inS, X i t ⊗ₖ Y j t ∂P.map p.publicRecord) =
∫ x in p.publicRecord ⁻¹' S, bA.value i x ⊗ₖ bB.value j x ∂P) ∧
(∫ t, Xfalse t ⊗ₖ Yfalse t ∂P.map p.publicRecord) +
(∫ t, Xfalse t ⊗ₖ Ytrue t ∂P.map p.publicRecord) +
(∫ t, Xtrue t ⊗ₖ Yfalse t ∂P.map p.publicRecord) +
(∫ t, Xtrue t ⊗ₖ Ytrue t ∂P.map p.publicRecord) =
jointReference p κA κB eA eB 0Fin.elim0 :=by
proof · 7
lines
obtain ⟨X,Y,hXm,hYm,hX,hY,hXY⟩ := genuine_terminal_public_factors
p κA κB eA eB P hP eTA eTB bA bB hlaw
refine ⟨X,Y,hXm,hYm,hX,hY,hXY,?_⟩
have ht (i j : Bool) := hXY i j Set.univ MeasurableSet.univ
simp only [Measure.restrict_univ,Set.preimage_univ] at ht
simp_rw [ht]
exact terminal_reference_total p κA κB eA eB P hP eTA eTB bA bB
lemmasampler_law : ∀ n s, ((volume : MeasureI).prod volume).map
(fun u => d.sampler.causal.step n (s,u)) =
d.sampler.instrumentKernel d.kernelA d.kernelB n s :=by
proof · 5
lines
apply d.sampler.causal_step_law
· intro n s
exact (Classical.choose_spec (sample_instrument_kernel (d.kernelA n))).2.1 s
· intro n s
exact (Classical.choose_spec (sample_instrument_kernel (d.kernelB n))).2.1 s
have he (k : ℕ) : historyPrefix k ∘ d.sampler.causal.record =
d.sampler.causal.history k :=by
funext u i
exact (d.sampler.causal.prefix_eq_record k u i).symm
simp only [probeLaw, AdaptiveOutcomeSampler.causalRecord_eq, Measure.map_map (measurable_historyPrefix _) d.sampler.causal.measurable_record,he]
exact d.sampler.causal.prefix_law_succ _ d.sampler_law n
(positiveMatrixMeasureOfDensity (p.completeReference_entry_integrable i j)
(Eventually.of_forall (p.completeReference_positive i j))).pushforward
d.sampler.publicRecord d.sampler.measurable_publicRecord
lemmaprobeOutput_event (i j : Bool) (S : Set (ℕ→M)) (hS : MeasurableSetS) :
(p.probeOutput i j).value S =
∫ x in d.sampler.publicRecord ⁻¹' S, p.completeReference i j x ∂d.probeLaw :=by
deftoBitDensity (W : Bool→Bool→PositiveMatrixMeasure Ω ι)
(μ : Measure Ω) [SigmaFinite μ]
(hAC : ∀ i j S, MeasurableSetS→ μ S=0→ (W i j).value S=0)
(hn : (trace ((Wfalsefalse).value Set.univ)).re +
(trace ((Wfalsetrue).value Set.univ)).re +
(trace ((Wtruefalse).value Set.univ)).re +
(trace ((Wtruetrue).value Set.univ)).re = 1) : BitDensity μ ι where
body · 7
lines
block i j := (W i j).positiveDensity μ
positive i j := (W i j).positiveDensity_pos μ
measurable i j := (W i j).measurable_positiveDensity μ
integrable i j := (W i j).integrable_positiveDensity_trace μ (hAC i j)
normalized :=by
simp only [integral_positiveDensity_trace _ μ (hAC _ _)]
exact hn
theoremcanonical_density_representation :
∃τ : BitDensity d.transcriptLaw (ι × η),
∃X : Bool→ (ℕ→M) →Matrix ι ι ℂ,
∃Y : Bool→ (ℕ→M) →Matrix η η ℂ,
(∀ i t, (X i t).PosSemidef) ∧ (∀ j t, (Y j t).PosSemidef) ∧
(∀ i j t, τ.block i j t = eveBlock R (X i t ⊗ₖ Y j t)) ∧
(∀ i j, Integrable (τ.block i j) d.transcriptLaw) ∧
(∀ i j S, MeasurableSetS→ (p.canonicalOutput R i j).value S =
∫ t inS, τ.block i j t ∂d.transcriptLaw) :=by
proof · 15
lines
obtain ⟨X,Y,hXm,hYm,hX,hY,hXY,hn⟩ := p.public_factors
let τ := filteredPublicDensity d.transcriptLaw XY hXm hYm hX hY R hR hn
refine ⟨τ,fun i t => (Fintype.card ι : ℂ) • (X i t)ᵀ,
fun j t => (Fintype.card η : ℂ) • (Y j t)ᵀ,?_,?_,?_,?_,?_⟩
· intro i t
exact (hX i t).1.transpose.smul (by exact_mod_cast Nat.zero_le (Fintype.card ι))
· intro j t
exact (hY j t).1.transpose.smul (by exact_mod_cast Nat.zero_le (Fintype.card η))
· exact filteredPublicDensity_common_factors d.transcriptLaw XY hXm hYm hX hY R hR hn
· intro i j
exact integrable_filter _ (public_product_integrable d.transcriptLaw XY hXm hYm hX hY i j)
· intro i j S hS
rw [canonicalOutput,PositiveMatrixMeasure.filter_value,hXY i j S hS]
exact (integral_filter _
((public_product_integrable d.transcriptLaw XY hXm hYm hX hY i j).integrableOn)).symm
obtain ⟨L,hpos,htr,he⟩ := purification_recovery_transpose R hR P hP
refine ⟨L,hpos,htr,?_⟩
intro U
rw [purificationFilter_block,he,preparationFilter_eq_purificationFilter,
purificationFilter_block,(CFC.sqrt_nonneg R).posSemidef.isHermitian.eq]
lemmapurifiedOutput_ac [Nonempty ι] [Nonempty η] [DecidableEq κ] (i j : Bool) (S : Set (ℕ→M)) (hS : MeasurableSetS)
(hnull : d.transcriptLaw S = 0) : (p.purifiedOutput P i j).value S = 0:=by
proof · 3
lines
obtain ⟨X,Y,hXm,hYm,hX,hY,he,hn⟩ := p.public_factors
rw [purifiedOutput,PositiveMatrixMeasure.filter_value,he i j S hS,
Measure.restrict_eq_zero.mpr hnull,integral_zero_measure,Matrix.mul_zero,Matrix.zero_mul]
lemmapurifiedOutput_recovery [Nonempty ι] [Nonempty η] :
∃L : Matrix κ κ ℂ→ₗ[ℂ] Matrix (ι × η) (ι × η) ℂ,
(∀Z, Z.PosSemidef→ (LZ).PosSemidef) ∧
(∀Z, trace (LZ) = trace Z) ∧∀ i j S, L ((p.purifiedOutput P i j).value S) = (p.canonicalOutput R i j).value S:=by
proof · 5
lines
obtain ⟨L,hpos,htr,he⟩ := purification_filter_recovery R hR P hP
refine ⟨L,hpos,htr,?_⟩
intro i j S
simpa only [purifiedOutput,canonicalOutput,PositiveMatrixMeasure.filter_value] using
he ((p.probeOutput i j).value S)
obtain ⟨L,hpos,htr,he⟩ := p.purifiedOutput_recovery R hR P hP
havehh i j : trace ((p.purifiedOutput P i j).value Set.univ) =
trace ((p.canonicalOutput R i j).value Set.univ) :=by rw [← he,htr]
simp_rw [hh]
exact p.canonicalOutput_normalized R hR
PositiveMatrixMeasure.toBitDensity (p.purifiedOutput P) ν
(fun i j S hS hz => p.purifiedOutput_ac P i j S hS (hμν hz))
(p.purifiedOutput_normalized R hR P hP)
The operational bit error written directly in terms of the output entries.
(p.purifiedDensity R hR P hP (d.transcriptLaw + sigma.traceMeasure)
(Measure.AbsolutelyContinuous.rfl.add_right _)).idealBitError
(sigma.positiveDensity (d.transcriptLaw + sigma.traceMeasure))
lemmarawPurifiedSecretBitError_eq (sigma : PositiveMatrixMeasure (ℕ→M) κ) :
p.rawPurifiedSecretBitError P sigma = p.purifiedSecretBitError R hR P hP sigma := rfl
lemmaevent_trace [NonemptyO] [DecidableEq ι] (E : SetO) (hE : MeasurableSetE) :
trace (S (J.operation E1)) = (r.law.real E : ℂ) :=by
proof · 8
lines
calc
_ = ∫ o inE, trace (r.posterior o 1) ∂r.law :=by
simp only [trace,diag]
rw [integral_finsetSum _ (fun i _ => (r.integrable 1 i i).integrableOn)]
apply Finset.sum_congr rfl
intro i _
exact (r.update E hE 1 i i).symm
_ = _ :=by simp [r.posterior_trace,integral_const,Complex.real_smul,Measure.real]
lemmacoarsePosterior_singleton (i : Bool) (x : B) (k l : ι) :
(∫ b in {i}, r.coarsePosterior f b x k l ∂(r.law.map f)) =
S (J.operation (f ⁻¹' {i}) x) k l :=by
proof · 6
lines
rw [integral_singleton]
havehm : (r.law.map f).real {i} = r.coarseMass f i :=by
rw [Measure.real,Measure.map_apply hf (measurableSet_singleton i)]
rfl
rw [hm]
exact congrArg (funU : Matrix ι ι ℂ=>U k l) (r.coarsePosterior_weighted f hf i x)
lemmacoarsePosterior_integral (E : SetBool) (x : B) (k l : ι) :
(∫ b inE, r.coarsePosterior f b x k l ∂(r.law.map f)) =
S (J.operation (f ⁻¹' E) x) k l :=by
proof · 33
lines
let : IsProbabilityMeasure r.law := r.probability
let : IsProbabilityMeasure (r.law.map f) := inferInstance
havehpart : E = ∅ ∨E = {false} ∨E = {true} ∨E = Set.univ :=byby_cases h0 : false∈E <;> by_cases h1 : true∈E
· right; right; right; ext b; cases b <;> simp_all
· right; left; ext b; cases b <;> simp_all
· right; right; left; ext b; cases b <;> simp_all
· left; ext b; cases b <;> simp_all
rcases hpart with rfl | rfl | rfl | rfl
· simp only [setIntegral_empty,Set.preimage_empty]
exact (congrArg (funU : Matrix ι ι ℂ=>U k l)
(r.event_zero ∅ MeasurableSet.empty (measure_empty) x)).symm
· exact r.coarsePosterior_singleton f hf false x k l
· exact r.coarsePosterior_singleton f hf true x k l
· havehd : Disjoint (f ⁻¹' {false}) (f ⁻¹' {true}) :=by
apply Set.disjoint_left.mpr
intro o h0 h1
simp only [Set.mem_preimage,Set.mem_singleton_iff] at h0 h1
rw [h0] at h1
contradiction
havehu : (f ⁻¹' {false}) ∪ (f ⁻¹' {true}) = Set.univ :=by
ext o; cases f o <;> simp
havehb : ({false} : SetBool) ∪ {true} = Set.univ :=by ext b; cases b <;> simp
rw [← hb,setIntegral_union (by simp) (measurableSet_singleton true)
Integrable.of_finite.integrableOn Integrable.of_finite.integrableOn,
r.coarsePosterior_singleton f hf false x k l,
r.coarsePosterior_singleton f hf true x k l]
rw [← r.update _ (hf (measurableSet_singleton false)) x k l,
← r.update _ (hf (measurableSet_singleton true)) x k l]
rw [← setIntegral_union hd (hf (measurableSet_singleton true))
(r.integrable x k l).integrableOn (r.integrable x k l).integrableOn,hu]
simpa only [Set.preimage_union,Set.preimage_univ,hu] using
r.update Set.univ MeasurableSet.univ x k l
defpostprocess (hS : PositiveFunctionalS) :
InstrumentRun (J.postprocess f hf) Swhere
body · 12
lines
law := r.law.map f
probability :=bylet : IsProbabilityMeasure r.law := r.probability
exact inferInstance
posterior := r.coarsePosterior f
posterior_positive := r.coarsePosterior_positive f hf hS
posterior_trace := r.coarsePosterior_trace f hf hS
integrable x k l :=bylet : IsProbabilityMeasure r.law := r.probability
let : IsProbabilityMeasure (r.law.map f) := inferInstance
exact Integrable.of_finite
update E hE x k l := r.coarsePosterior_integral f hf E x k l
lemmaInstrumentRun.event_finset [FintypeK] [DecidableEqK] [NonemptyK] [DecidableEq ι] {J : ObservableInstrumentKAB}
{S : ReferenceFunctionalA ι} (r : InstrumentRunJS) (s : FinsetK) (x : B) :
S (J.operation s x) = ∑ k ∈ s, S (J.operation {k} x) :=by
proof · 7
lines
ext i j
simp only [Matrix.sum_apply]
rw [← r.update s (s.finite_toSet.measurableSet) x i j,
setIntegral_finset s (r.integrable x i j).integrableOn]
apply Finset.sum_congr rfl
intro k hk
rw [← r.update {k} (measurableSet_singleton k) x i j,integral_singleton]
defpostprocess (f : K→Bool) : e.BitReadout (B:=B) where
body · 9
lines
instrument x := (b.instrument x).postprocess f (measurable_of_finite f)
run x := (b.run x).postprocess f (measurable_of_finite f) (e.positive x)
positive_unit := b.positive_unit
local_measurable i :=bylet s :=Finset.univ.filter (fun k => f k = i)
havehs : (s : SetK) = f ⁻¹' {i} :=by ext k; simp [s]
change Measurable[L] (fun x => e.state x ((b.instrument x).operation (f ⁻¹' {i}) 1))
rw [← hs]
exact b.eventMeasurable s
(positiveMatrixMeasureOfDensity (p.completeReference_entry_integrable i j)
(Eventually.of_forall (p.completeReference_positive i j))).pushforward
d.sampler.publicRecord d.sampler.measurable_publicRecord
lemmaprobeOutput_event (i j : K) (S : Set (ℕ→M)) (hS : MeasurableSetS) :
(p.probeOutput i j).value S =
∫ x in d.sampler.publicRecord ⁻¹' S, p.completeReference i j x ∂d.probeLaw :=by
lemmacanonicalOutput_event (R : Matrix (ι × η) (ι × η) ℂ)
(i j : K) (S : Set (ℕ→M)) (hS : MeasurableSetS) :
(p.canonicalOutput R i j).value S =
∫ x in d.sampler.publicRecord ⁻¹' S,
preparationFilter R * p.completeReference i j x * (preparationFilter R)ᴴ ∂d.probeLaw :=by
proof · 2
lines
rw [canonicalOutput,PositiveMatrixMeasure.filter_value,p.probeOutput_event i j S hS,
integral_filter _ (p.completeReference_integrable i j).integrableOn]
lemmacompleteReference_sum [StandardBorelSpaceM] [NonemptyM] [Nonempty ι] [Nonempty η] (x : ℕ→O) :
(∑ i, ∑ j, p.completeReference i j x) =
p.incomingA.state x 1 ⊗ₖ p.incomingB.state x 1:=by
proof · 5
lines
rw [← p.readoutA.sum x,← p.readoutB.sum x]
ext a b
simp only [completeReference,Matrix.sum_apply,Matrix.kroneckerMap_apply,
Finset.sum_mul,Finset.mul_sum]
rw [Finset.sum_comm]
lemmacanonicalOutput_normalized (R : Matrix (ι × η) (ι × η) ℂ) (hR : DensityR) :
(∑ i, ∑ j, (trace ((p.canonicalOutput R i j).value Set.univ)).re) = 1:=by
proof · 3
lines
have h := congrArg (funX : Matrix (ι × η) (ι × η) ℂ=> (trace X).re)
(p.canonicalOutput_sum R hR)
simpa only [Matrix.trace_sum,Complex.re_sum,Matrix.trace_transpose,hR.2,Complex.one_re] using h
lemmapurifiedOutput_event [Nonempty ι] [Nonempty η] (P : Matrix (ι × η) κ ℂ)
(i j : K) (S : Set (ℕ→M)) (hS : MeasurableSetS) :
(p.purifiedOutput P i j).value S =
∫ x in d.sampler.publicRecord ⁻¹' S,
purificationFilter P * p.completeReference i j x * (purificationFilter P)ᴴ ∂d.probeLaw :=by
proof · 2
lines
rw [purifiedOutput,PositiveMatrixMeasure.filter_value,p.probeOutput_event i j S hS,
integral_filter _ (p.completeReference_integrable i j).integrableOn]
lemmapurifiedOutput_ac (P : Matrix (ι × η) κ ℂ) (i j : K)
(S : Set (ℕ→M)) (hS : MeasurableSetS) (hz : d.transcriptLaw S = 0) :
(p.purifiedOutput P i j).value S = 0:=by
proof · 3
lines
havehp : d.probeLaw (d.sampler.publicRecord ⁻¹' S) = 0:=by
simpa only [Discussion.transcriptLaw,Measure.map_apply d.sampler.measurable_publicRecord hS] using hz
rw [p.purifiedOutput_event P i j S hS,Measure.restrict_eq_zero.mpr hp,integral_zero_measure]
obtain ⟨L,hpos,htr,he⟩ := purification_filter_recovery R hR P hP
havehh i j : trace ((p.purifiedOutput P i j).value Set.univ) =
trace ((p.canonicalOutput R i j).value Set.univ) :=by
rw [← htr]
simpa only [purifiedOutput, canonicalOutput, PositiveMatrixMeasure.filter_value] using
congrArg trace (he ((p.probeOutput i j).value Set.univ))
simp_rw [Matrix.trace_sum,Complex.re_sum,hh]
simpa only [Matrix.trace_sum,Complex.re_sum] using p.canonicalOutput_normalized R hR
structureKeyDensity (μ : Measure Ω) (K : Type v11171_0) (ι : Type v11171_1) [FintypeK] [Fintype ι] [DecidableEq ι] where
body · 5
lines
block : K→K→ Ω →Matrix ι ι ℂmeasurable : ∀ a b, Measurable (block a b)
positive : ∀ a b t, (block a b t).PosSemidefintegrable : ∀ a b, Integrable (fun t => (trace (block a b t)).re) μ
normalized : (∑ a, ∑ b, ∫ t, (trace (block a b t)).re ∂μ) = 1
block := p.purifiedOutputDensity P ν
measurable :=fun i j => (p.purifiedOutput P i j).measurable_positiveDensity ν
positive :=fun i j => (p.purifiedOutput P i j).positiveDensity_pos ν
integrable :=fun i j => (p.purifiedOutput P i j).integrable_positiveDensity_trace ν
(funS hS hz => p.purifiedOutput_ac P i j S hS (hμν hz))
normalized :=byhave he i j := (p.purifiedOutput P i j).integral_positiveDensity_trace ν
(funS hS hz => p.purifiedOutput_ac P i j S hS (hμν hz))
change (∑ i, ∑ j, ∫ t, (trace ((p.purifiedOutput P i j).positiveDensity ν t)).re ∂ν) = 1
simp_rw [he]
simpa only [Matrix.trace_sum,Complex.re_sum] using p.purifiedOutput_normalized R hR P hP
induction n with
| zero => exact inferInstanceAs (MeasurableSpaceUnit)
| succ n ih =>letI:= ih; exact inferInstanceAs (MeasurableSpace (Bool×KeyWord n))
induction n with
| zero => exact inferInstanceAs (MeasurableSingletonClassUnit)
| succ n ih =>let:= ih; exact inferInstanceAs (MeasurableSingletonClass (Bool×KeyWord n))
structureCompletedKeyTrial {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)]
(R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ) (hR : DensityR) (ell : ℕ) where
defgroupTensor {a b c d : ℕ}
(R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ)
(S : Matrix (Fin c ×Fin d) (Fin c ×Fin d) ℂ) :
Matrix (Fin (a*c) ×Fin (b*d)) (Fin (a*c) ×Fin (b*d)) ℂ:=
body · 1
line
(R ⊗ₖ S).submatrix (groupIndex a b c d) (groupIndex a b c d)
lemmatrace_groupTensor {a b c d : ℕ}
(R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ)
(S : Matrix (Fin c ×Fin d) (Fin c ×Fin d) ℂ) :
trace (groupTensor RS) = trace R * trace S:=by
proof · 2
lines
rw [← trace_kronecker]
exact Equiv.sum_comp (groupIndex a b c d) (fun x => (R ⊗ₖ S) x x)
lemmaDensity.groupTensor {a b c d : ℕ}
{R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ}
{S : Matrix (Fin c ×Fin d) (Fin c ×Fin d) ℂ}
(hR : DensityR) (hS : DensityS) : Density (groupTensor RS) :=by
defpositiveCopies {a b : ℕ} (R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ) :
(k : ℕ) →Matrix (Fin (copyDim a k) ×Fin (copyDim b k))
(Fin (copyDim a k) ×Fin (copyDim b k)) ℂ
instancepositiveCopy_nonempty (a k : ℕ) [Nonempty (Fin a)] : Nonempty (Fin (copyDim a k)) :=by
body · 5
lines
haveha : 0 < copyDim a k :=by
induction k with
| zero => exact (show0 < a fromFin.size_positive')
| succ k ih => exact Nat.mul_pos ih (show0 < a fromFin.size_positive')
exact ⟨⟨0,ha⟩⟩
structureCompletedKeyScheme {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)]
(R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ) (hR : DensityR) where
body · 11
lines
length : ℕ→ℕtrial : (k : ℕ) →CompletedKeyTrial.{u} (positiveCopies R k) (by
induction k with
| zero => exact hR
| succ k ih =>
refine ⟨(ih.1.kronecker hR.1).submatrix _, ?_⟩
change trace (groupTensor (positiveCopies R k) R) = 1have ht :=Equiv.sum_comp (groupIndex (copyDim a k) (copyDim b k) a b)
(fun x => (Matrix.kronecker (positiveCopies R k) R) x x)
change trace (groupTensor (positiveCopies R k) R) = trace (Matrix.kronecker (positiveCopies R k) R) at ht
rw [ht, Matrix.kronecker, trace_kronecker, ih.2, hR.2, one_mul]) (length k)
defUniformProtocolGap {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)]
(R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ) (_hR : DensityR) : Prop:=
body · 16
lines
∀ (k : ℕ) (OM : Type u) [MeasurableSpaceO] [MeasurableSpaceM]
[StandardBorelSpaceO] [NonemptyO] [StandardBorelSpaceM] [NonemptyM]
(d : DiscussionOM) (AB : ℕ→Type u)
[∀ n, AddCommGroup (A n)] [∀ n, Moduleℂ (A n)] [∀ n, One (A n)] [∀ n, LE (A n)]
[∀ n, AddCommGroup (B n)] [∀ n, Moduleℂ (B n)] [∀ n, One (B n)] [∀ n, LE (B n)]
(TATBCACB : Type u)
[AddCommGroupTA] [ModuleℂTA] [OneTA] [LETA]
[AddCommGroupTB] [ModuleℂTB] [OneTB] [LETB]
[AddCommGroupCA] [ModuleℂCA] [OneCA] [LECA]
[AddCommGroupCB] [ModuleℂCB] [OneCB] [LECB]
(p : BitProtocol (ι :=Fin (copyDim a k)) (η :=Fin (copyDim b k)) d ABTATBCACB)
(e : ℕ) (P : Matrix (Fin (copyDim a k) ×Fin (copyDim b k)) (Fin e) ℂ)
(_hP : P * Pᴴ = positiveCopies R k)
(sigma : PositiveMatrixMeasure (ℕ→M) (Fin e)),
(trace (sigma.value Set.univ)).re = 1→1/5≤ p.rawPurifiedSecretBitError P sigma