Pratik Patil

PureMarginalDiagonal.lean

1module23public import SubentropyCertificates.MarginalPurity45/-! If both marginals are diagonal and a marginal has all its mass6on one coordinate, the joint state is diagonal in these coordinates. -/7@[expose] public section8noncomputable section9set_option autoImplicit false10set_option backward.isDefEq.respectTransparency false11open Matrix12open scoped BigOperators ComplexOrder MatrixOrder13namespace SubentropyCertificates.DeterminantComparison14open D5.S3.Quantum.Information.PartialTraceMutualInformation15open SubentropyCertificates.QuantumEquality16variable {D F : Type*} [Fintype D] [DecidableEq D] [Fintype F] [DecidableEq F]1718private theorem zero_column {M : Matrix D D ℂ} (hM : M.PosSemidef) {v : D}19    (hv : (M v v).re = 0) (u : D) : M u v = 0 := by20  have hdiag : M v v = 0 := Complex.ext hv (RCLike.nonneg_iff.mp (hM.diag_nonneg (i := v))).221  let e : D → ℂ := Pi.single v 122  have h : star e ⬝ᵥ (M *ᵥ e) = 0 := by23    simpa [e, Matrix.mulVec_single_one, dotProduct, Pi.single_apply] using hdiag24  have hz := congrFun (hM.dotProduct_mulVec_zero_iff.mp h) u25  simpa [e, Matrix.mulVec_single_one] using hz2627private theorem diagonal_single_row {K : Matrix (D × F) (D × F) ℂ} (hK : K.PosSemidef)28    (i₀ : D) (b : F → ℝ)29    (hR : partialTraceRight K = diagonal (fun i => (pointMass i₀ i : ℂ)))30    (hL : partialTraceLeft K = diagonal (fun j => (b j : ℂ))) :31    ∀ u v, u ≠ v → K u v = 0 := by32  have hzero (i : D) (hi : i ≠ i₀) (j : F) : (K (i,j) (i,j)).re = 0 := by33    have hs := congrArg (fun M : Matrix D D ℂ => (M i i).re) hR34    simp only [partialTraceRight, diagonal_apply_eq, Complex.re_sum, Complex.ofReal_re,35      pointMass] at hs36    simp [hi] at hs37    exact (Finset.sum_eq_zero_iff_of_nonneg (fun k _ =>38      (RCLike.nonneg_iff.mp (hK.diag_nonneg (i := (i,k)))).1)).mp hs j (Finset.mem_univ j)39  rintro ⟨i,j⟩ ⟨k,l⟩ hne40  by_cases hk : k = i₀41  · subst k42    by_cases hi : i = i₀43    · subst i44      have hjl : j ≠ l := fun eq => hne (Prod.ext rfl eq)45      have h := congrArg (fun M : Matrix F F ℂ => M j l) hL46      change (∑ r, K (r,j) (r,l)) = _ at h47      rw [Finset.sum_eq_single_of_mem i₀ (Finset.mem_univ i₀)48        (fun r _ hr => zero_column hK (hzero r hr l) (r,j))] at h49      simpa [hjl] using h50    · have h := zero_column hK (hzero i hi j) (i₀,l)51      have hs := hK.isHermitian.apply (i,j) (i₀,l)52      simpa [h] using hs.symm53  · exact zero_column hK (hzero k hk l) (i,j)5455/-- A point-mass spectrum on either diagonal marginal forces the whole56matrix to be diagonal. This includes product states with a mixed other marginal. -/57theorem diagonal_of_point_marginal {K : Matrix (D × F) (D × F) ℂ} (hK : K.PosSemidef)58    (a : D → ℝ) (b : F → ℝ)59    (hR : partialTraceRight K = diagonal (fun i => (a i : ℂ)))60    (hL : partialTraceLeft K = diagonal (fun j => (b j : ℂ)))61    (hp : (∃ i, a = pointMass i) ∨ (∃ j, b = pointMass j)) :62    K = diagonal (fun u => ((K u u).re : ℂ)) := by63  have hoff : ∀ u v, u ≠ v → K u v = 0 := by64    rcases hp with ⟨i, rfl⟩ | ⟨j, rfl⟩65    · exact diagonal_single_row hK i b hR hL66    · let e := Equiv.prodComm F D67      have h := diagonal_single_row (hK.submatrix e) j a hL hR68      intro u v hne69      exact h (e.symm u) (e.symm v) (fun eq => hne (e.symm.injective eq))70  ext u v71  by_cases huv : u=v72  · subst v; rw [diagonal_apply_eq]73    exact Complex.ext rfl (RCLike.nonneg_iff.mp (hK.diag_nonneg (i := u))).274  · simp [huv, hoff u v huv]7576end SubentropyCertificates.DeterminantComparison

Axioms used

Choose a statement to see which axioms its proof uses.