OrthogonalMeasurement.lean
1module23public import SubentropyCertificates.GuessingAttainment4public import Mathlib.Analysis.InnerProductSpace.Projection.Basic5public import Mathlib.Analysis.InnerProductSpace.Adjoint67/-! Projective discrimination of mutually orthogonal signal supports.8The unused orthogonal complement is assigned to one label. -/9@[expose] public section10noncomputable section11set_option autoImplicit false12set_option backward.isDefEq.respectTransparency false13open Matrix14open scoped BigOperators ComplexOrder MatrixOrder15namespace SubentropyCertificates.ZeroConditional16open D5.S3.Quantum.Foundation.FiniteStateChannel17open D5.S3.Quantum.Subentropy.GuessingProbability18open SubentropyCertificates.Discrimination1920variable {X B : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B]2122/-- In finite dimension the support of a density operator is its range. -/23def signalSupport (σ : DensityState B) : Submodule ℂ (EuclideanSpace ℂ B) :=24 LinearMap.range (CStarMatrix.ofMatrix.symm σ.1).toEuclideanLin2526def orthogonalSupports (p : X → ℝ) (ρ : X → DensityState B) : Prop :=27 ∀ x y, x ≠ y → 0 < p x → 0 < p y → signalSupport (ρ x) ⟂ signalSupport (ρ y)2829private def projection (K : Submodule ℂ (EuclideanSpace ℂ B)) : Matrix B B ℂ :=30 Matrix.toEuclideanLin.symm K.starProjection.toLinearMap3132private theorem projection_lin (K : Submodule ℂ (EuclideanSpace ℂ B)) :33 (projection K).toEuclideanLin = K.starProjection.toLinearMap :=34 Matrix.toEuclideanLin.apply_symm_apply _3536private theorem projection_star (K : Submodule ℂ (EuclideanSpace ℂ B)) :37 IsStarProjection (projection K) := by38 refine ⟨?_, Matrix.isHermitian_iff_isSelfAdjoint.mp39 (Matrix.isSymmetric_toEuclideanLin_iff.mp (by rw [projection_lin]; exact K.starProjection_isSymmetric))⟩40 change projection K * projection K = projection K41 apply Matrix.toEuclideanLin.injective42 rw [Matrix.toLpLin_mul_same, projection_lin]43 exact congrArg ContinuousLinearMap.toLinearMap K.isIdempotentElem_starProjection4445/-- Given pairwise orthogonal subspaces, a labelled projective measurement can46fix every vector in its own subspace, even if their span is proper. -/47theorem projective_measurement_of_orthogonal_subspaces (i : X)48 (K : X → Submodule ℂ (EuclideanSpace ℂ B)) (hK : Pairwise (fun x y => K x ⟂ K y)) :49 ∃ M : X → Matrix B B ℂ, (∀ x, IsStarProjection (M x)) ∧ ∑ x, M x = 1 ∧50 ∀ x v, v ∈ K x → (M x).toEuclideanLin v = v := by51 classical52 let P (x : X) := projection (K x)53 let T := Finset.univ.erase i54 let S := ∑ x ∈ T, P x55 have hoff {x y : X} (hxy : x ≠ y) : P x * P y = 0 := by56 apply Matrix.toEuclideanLin.injective57 rw [Matrix.toLpLin_mul_same, map_zero, projection_lin, projection_lin]58 exact congrArg ContinuousLinearMap.toLinearMap ((hK hxy).starProjection_comp_starProjection)59 have hS : IsStarProjection S := by60 refine ⟨?_, isSelfAdjoint_sum _ (fun x _ => (projection_star (K x)).isSelfAdjoint)⟩61 change S * S = S62 dsimp only [S]63 rw [Matrix.sum_mul]64 apply Finset.sum_congr rfl65 intro x hx66 rw [Matrix.mul_sum, Finset.sum_eq_single_of_mem x hx (fun y _ hy => hoff hy.symm)]67 exact (projection_star (K x)).isIdempotentElem68 let M (x : X) := if x = i then 1 - S else P x69 refine ⟨M, ?_, ?_, ?_⟩70 · intro x71 by_cases hx : x = i72 · simpa only [M, ite_eq_left hx] using hS.one_sub73 · simpa only [M, ite_eq_right hx] using projection_star (K x)74 · rw [← Finset.sum_erase_add _ M (Finset.mem_univ i)]75 have hsum : ∑ x ∈ T, M x = S := Finset.sum_congr rfl (fun x hx =>76 ite_eq_right (Finset.mem_erase.mp hx).1)77 change (∑ x ∈ T, M x) + M i = 178 rw [hsum]79 simp [M]80 · intro x v hv81 by_cases hx : x = i82 · subst x83 have hz : S.toEuclideanLin v = 0 := by84 change Matrix.toEuclideanLin (∑ x ∈ T, P x) v = 085 rw [map_sum, LinearMap.sum_apply]86 apply Finset.sum_eq_zero87 intro x hx88 rw [projection_lin]89 exact (Submodule.starProjection_apply_eq_zero_iff (K := K x)).mpr90 ((hK (Finset.mem_erase.mp hx).1.symm) hv)91 simp [M, map_sub, Matrix.toLpLin_one, hz]92 · change Matrix.toEuclideanLin (if x = i then 1 - S else P x) v = v93 rw [ite_eq_right hx, projection_lin]94 exact Submodule.starProjection_eq_self_iff.mpr hv9596/-- Zero-prior signals are unrestricted. The measurement is projective and97its actual success probability equals one. -/98theorem perfect_projective_measurement_of_orthogonal_supports99 (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B)100 (ho : orthogonalSupports p ρ) :101 ∃ M : X → Matrix B B ℂ, (∀ x, IsStarProjection (M x)) ∧ ∑ x, M x = 1 ∧102 successProbability p ρ M = 1 := by103 classical104 have hX : Nonempty X := by105 by_contra h106 have : IsEmpty X := not_nonempty_iff.mp h107 simp at hs108 let K (x : X) := if 0 < p x then signalSupport (ρ x) else ⊥109 have hK : Pairwise (fun x y => K x ⟂ K y) := by110 intro x y hxy111 by_cases hx : 0 < p x <;> by_cases hy : 0 < p y <;> simp [K, hx, hy, ho x y hxy]112 obtain ⟨M, hM, hsM, hfix⟩ := projective_measurement_of_orthogonal_subspaces113 (Classical.choice hX) K hK114 refine ⟨M, hM, hsM, ?_⟩115 unfold successProbability116 rw [← hs]117 apply Finset.sum_congr rfl118 intro x _119 by_cases hx : 0 < p x120 · let A := CStarMatrix.ofMatrix.symm (ρ x).1121 have hMA : M x * A = A := by122 apply Matrix.toEuclideanLin.injective123 rw [Matrix.toLpLin_mul_same]124 apply LinearMap.ext125 intro v126 apply hfix x127 rw [show K x = signalSupport (ρ x) from ite_eq_left hx]128 exact ⟨v, rfl⟩129 change p x * (M x * A).trace.re = p x130 rw [hMA, show A.trace = 1 from (ρ x).2.2]131 simp132 · simp [le_antisymm (le_of_not_gt hx) (hp x)]133134end SubentropyCertificates.ZeroConditional
Axioms used
Choose a statement to see which axioms its proof uses.