Pratik Patil

NonCQExample.lean

1module23public import SubentropyCertificates.EqualPriorSubentropy4public import SubentropyCertificates.QubitTraceDistance5import all SubentropyCertificates.EqualPriorSubentropy67/-! The two-qubit example immediately following Corollary 16. The first column8is the unnormalized vector 2|00⟩+|11⟩, and the second is |10⟩. -/9@[expose] public section10noncomputable section11set_option autoImplicit false12set_option backward.isDefEq.respectTransparency false13open Matrix Set14open scoped BigOperators ComplexOrder MatrixOrder15namespace SubentropyCertificates.NonCQ16open D5.S3.Quantum.Foundation.FiniteStateChannel17open D5.S3.Quantum.Information.PartialTraceMutualInformation18open D5.S3.Quantum.Information.InputInformationBalance19open D5.S3.Quantum.Subentropy.Basic20open SubentropyCertificates.BinarySpectra SubentropyCertificates.ClassicalCurve21open SubentropyCertificates.MixedQubit (traceDistance)2223abbrev Bit := Fin 22425def columns : Matrix (Bit × Bit) Bit ℂ := fun i j ↦26  if j=0 then (if i=(0,0) then 2 else if i=(1,1) then 1 else 0)27  else if i=(1,0) then 1 else 02829def pair (a b : ℝ) : Matrix Bit Bit ℂ := diagonal ![(a : ℂ),(b : ℂ)]3031def sandwich (a b : ℝ) : Matrix (Bit × Bit) (Bit × Bit) ℂ :=32  columns * pair (a/5) b * (columns : Matrix _ _ ℂ).conjTranspose3334private theorem gram : (columns : Matrix _ _ ℂ).conjTranspose * columns = pair 5 1 := by35  ext i j36  fin_cases i <;> fin_cases j <;> norm_num [Matrix.mul_apply, Matrix.conjTranspose_apply,37    Fintype.sum_prod_type, Fin.sum_univ_two, columns, pair, Matrix.diagonal_apply,38    map_ofNat (starRingEnd ℂ) 2]3940private theorem gram_pair (a b : ℝ) : pair 5 1 * pair (a/5) b = pair a b := by41  unfold pair42  rw [diagonal_mul_diagonal]43  congr 144  ext i45  fin_cases i <;> simp46  ring4748theorem trace_sandwich (a b : ℝ) : (sandwich a b).trace = ((a+b : ℝ) : ℂ) := by49  rw [sandwich, Matrix.trace_mul_comm, ← Matrix.mul_assoc, gram, gram_pair]50  simp [pair, Matrix.trace, Fin.sum_univ_two]5152def state (t : ℝ) (ht : t ∈ Icc 0 1) : DensityState (Bit × Bit) := by53  refine ⟨CStarMatrix.ofMatrix (sandwich (1-t) t), ?_, ?_⟩54  · apply map_nonneg CStarMatrix.ofMatrixStarAlgEquiv55    apply Matrix.PosSemidef.nonneg56    unfold sandwich57    apply Matrix.PosSemidef.mul_mul_conjTranspose_same58    apply Matrix.PosSemidef.diagonal59    intro i60    fin_cases i61    · change (0 : ℂ) ≤ (((1-t)/5 : ℝ) : ℂ)62      exact Complex.zero_le_real.mpr (by linarith [ht.2])63    · change (0 : ℂ) ≤ (t:ℂ)64      exact Complex.zero_le_real.mpr ht.165  · change (sandwich (1-t) t).trace = 166    simp [trace_sandwich]6768/-- The genuine second marginal has eigenvalues (4+t)/5 and (1-t)/5. -/69theorem marginal_matrix (t : ℝ) (ht : t ∈ Icc 0 1) :70    densityMatrix (marginalLeft (state t ht)) = pair (1-(1-t)/5) ((1-t)/5) := by71  change partialTraceLeft (sandwich (1-t) t) = _72  ext i j73  fin_cases i <;> fin_cases j <;> norm_num [partialTraceLeft, sandwich, pair, Fin.sum_univ_two,74    Matrix.mul_apply, Matrix.conjTranspose_apply, columns, Matrix.diagonal_apply,75    map_ofNat (starRingEnd ℂ) 2]76  ring7778private theorem spectrum_sandwich (a b : ℝ) :79    nonzeroSpectrum (sandwich a b) = nonzeroSpectrum (pair a b) := by80  rw [sandwich, nonzeroSpectrum_mul_comm, ← Matrix.mul_assoc, gram, gram_pair]8182/-- Both physical spectra, with multiplicities and all endpoint degeneracies. -/83theorem spectra (t : ℝ) (ht : t ∈ Icc 0 1) :84    nonzeroSpectrum (densityMatrix (state t ht)) = ({((1-t : ℝ):ℂ),(t:ℂ)} : Multiset ℂ).filter (· ≠ 0) ∧85    nonzeroSpectrum (densityMatrix (marginalLeft (state t ht))) =86      ({((1-(1-t)/5 : ℝ):ℂ),(((1-t)/5 : ℝ):ℂ)} : Multiset ℂ).filter (· ≠ 0) := by87  exact ⟨(spectrum_sandwich _ _).trans (diagonal_pair_spectrum _ _),88    (congrArg nonzeroSpectrum (marginal_matrix _ _)).trans (diagonal_pair_spectrum _ _)⟩8990private theorem difference (t : ℝ) : sandwich (1-0) 0 - sandwich (1-t) t = sandwich t (-t) := by91  unfold sandwich92  rw [← Matrix.sub_mul, ← Matrix.mul_sub]93  congr 294  ext i j95  fin_cases i <;> fin_cases j <;> norm_num [pair, Matrix.diagonal_apply]96  ring9798private theorem abs_filter (m : Multiset ℂ) :99    ((m.filter (· ≠ 0)).map (fun z ↦ |z.re|)).sum = (m.map (fun z ↦ |z.re|)).sum := by100  induction m using Multiset.induction with101  | empty => simp102  | cons a s ih => by_cases h : a=0 <;> simp [h,ih]103104/-- The trace distance of the two joint density matrices is exactly t. -/105theorem distance (t : ℝ) (ht : t ∈ Icc 0 1) :106    traceDistance (state 0 (by norm_num)) (state t ht) = t := by107  let h := (density_posSemidef (state 0 (by norm_num))).isHermitian.sub108    (density_posSemidef (state t ht)).isHermitian109  have hd : nonzeroSpectrum (densityMatrix (state 0 (by norm_num))-densityMatrix (state t ht)) =110      nonzeroSpectrum (pair t (-t)) := by111    change nonzeroSpectrum (sandwich (1-0) 0 - sandwich (1-t) t) = _112    rw [difference, spectrum_sandwich]113  have he := congrArg (fun m : Multiset ℂ ↦ (m.map (fun z ↦ |z.re|)).sum) hd114  change (∑ i, |h.eigenvalues i|)/2 = t115  unfold nonzeroSpectrum at he116  simp only [abs_filter, h.roots_charpoly_eq_eigenvalues, Multiset.map_map,117    Finset.sum_map_val, Function.comp_apply, RCLike.ofReal_eq_complex_ofReal,118    Complex.ofReal_re] at he119  have hr (a b : ℝ) : (pair a b).charpoly.roots = {(a:ℂ),(b:ℂ)} := by120    rw [pair, Matrix.charpoly_diagonal, Fin.prod_univ_two]121    rw [Polynomial.roots_mul (mul_ne_zero (Polynomial.X_sub_C_ne_zero _) (Polynomial.X_sub_C_ne_zero _))]122    simp123  rw [he,hr]124  simp [abs_of_nonneg ht.1, Multiset.insert_eq_cons]125126def conditional (t : ℝ) (ht : t ∈ Icc 0 1) :=127  subentropy (state t ht) - subentropy (marginalLeft (state t ht))128129theorem conditional_value (t : ℝ) (ht : t ∈ Icc 0 1) :130    conditional t ht = phi 0 t - phi 0 ((1-t)/5) := by131  have h := subentropy_eq_of_nonzeroSpectrum (density_posSemidef (state t ht)).isHermitian132    (diagonal_hermitian (1-t) t) (spectrum_sandwich (1-t) t)133  change matrixSubentropy (densityMatrix (state t ht)) = _ at h134  change matrixSubentropy (densityMatrix (state t ht)) -135    matrixSubentropy (densityMatrix (marginalLeft (state t ht))) = _136  rw [h,marginal_matrix,pair,pair_subentropy,pair_subentropy]137138def changeValue (t : ℝ) := phi 0 t + phi 0 (1/5) - phi 0 ((1-t)/5)139140/-- Equation for the increase of conditional subentropy along the joint state segment. -/141theorem conditional_change (t : ℝ) (ht : t ∈ Icc 0 1) :142    conditional t ht - conditional 0 (by norm_num) = changeValue t := by143  simp only [conditional_value, phi_zero, sub_zero]144  unfold changeValue145  ring146147end SubentropyCertificates.NonCQ

Axioms used

Choose a statement to see which axioms its proof uses.