Pratik Patil

BinaryBasisGuessing.lean

1module23public import SubentropyCertificates.CounterexampleState4public import D5.S3.Quantum.Subentropy.GuessingProbability56/-! A binary discrimination problem whose difference of density matrices7is supported on two computational basis vectors. -/8@[expose] public section9noncomputable section10set_option autoImplicit false11set_option backward.isDefEq.respectTransparency false12open Matrix Set13open scoped ComplexOrder MatrixOrder BigOperators14namespace SubentropyCertificates.QuantumCounterexample15open D5.S3.Quantum.Foundation.FiniteStateChannel16open D5.S3.Quantum.Subentropy.GuessingProbability1718variable {D : Type*} [Fintype D] [DecidableEq D]19abbrev mat (ρ : DensityState D) := CStarMatrix.ofMatrix.symm ρ.120def fair (_ : Bit) : ℝ := 1/221def basisProjector (u : D) : Matrix D D ℂ := diagonal (fun i => if i=u then 1 else 0)2223/-- Read a binary function of the computational basis outcome. -/24def basisReadout (read : D → Bit) (x : Bit) : Matrix D D ℂ :=25  diagonal (fun i => if read i=x then 1 else 0)2627omit [Fintype D] in28theorem basis_readout_is_povm (read : D → Bit) :29    (∀ x, (basisReadout read x).PosSemidef) ∧ ∑ x, basisReadout read x = 1 := by30  constructor31  · intro x32    apply Matrix.PosSemidef.diagonal33    intro i34    by_cases h : read i=x <;> simp [h]35  · rw [Fin.sum_univ_two]36    ext i j37    by_cases hij : i=j38    · subst j39      have cases (x : Bit) : x=0 ∨ x=1 := by fin_cases x <;> simp40      rcases cases (read i) with hx | hx <;> simp [basisReadout,hx]41    · simp [basisReadout, hij]4243private theorem trace_projector (M : Matrix D D ℂ) (u : D) :44    (M * basisProjector u).trace = M u u := by45  simp [Matrix.trace, basisProjector, Matrix.mul_diagonal]4647/-- For equal priors and density difference c(Pu-Pv), only two diagonal48entries of the first effect can change the success probability. -/49theorem binary_success_of_difference (ρ : Bit → DensityState D) (u v : D) (c : ℝ)50    (hd : mat (ρ 0) - mat (ρ 1) = c • (basisProjector u - basisProjector v))51    (M : Bit → Matrix D D ℂ) (hs : ∑ x, M x = 1) :52    successProbability fair ρ M =53      1/2 + c/2 * ((M 0 u u).re - (M 0 v v).re) := by54  rw [Fin.sum_univ_two] at hs55  have hm : M 1 = 1 - M 0 := by rw [← hs]; abel56  have htr : (mat (ρ 1)).trace = 1 := (ρ 1).2.257  have h : (M 0 * mat (ρ 0)).trace + (M 1 * mat (ρ 1)).trace =58      1 + (c : ℂ)*(M 0 u u - M 0 v v) := by59    rw [hm, Matrix.sub_mul, Matrix.one_mul, Matrix.trace_sub, htr]60    rw [show ∀ a b : ℂ, a+(1-b)=1+(a-b) by intros; ring,61      ← Matrix.trace_sub, ← Matrix.mul_sub, hd, Matrix.mul_smul,62      Matrix.trace_smul, Matrix.mul_sub, Matrix.trace_sub,63      trace_projector, trace_projector, Complex.real_smul]64  have hr := congrArg Complex.re h65  simp [Complex.mul_re] at hr66  unfold successProbability67  rw [Fin.sum_univ_two]68  change 1/2 * (M 0 * mat (ρ 0)).trace.re + 1/2 * (M 1 * mat (ρ 1)).trace.re = _69  linarith7071/-- A computational basis readout distinguishing u and v attains the72supremum over all binary POVMs when c is nonnegative. -/73theorem basis_optimal_of_difference (ρ : Bit → DensityState D) (u v : D) (c : ℝ)74    (hc : 0 ≤ c) (hd : mat (ρ 0) - mat (ρ 1) = c • (basisProjector u - basisProjector v))75    (read : D → Bit) (hu : read u = 0) (hv : read v = 1) :76    successProbability fair ρ (basisReadout read) = 1/2+c/2 ∧ pGuess fair ρ = 1/2+c/2 := by77  obtain ⟨hpos, hsum⟩ := basis_readout_is_povm read78  have hatt : successProbability fair ρ (basisReadout read) = 1/2+c/2 := by79    rw [binary_success_of_difference ρ u v c hd _ hsum]80    simp [basisReadout, hu, hv]81  refine ⟨hatt, ?_⟩82  have hmem : 1/2+c/2 ∈ successProbabilitySet fair ρ :=83    ⟨basisReadout read,hpos,hsum,hatt.symm⟩84  have hub : ∀ r ∈ successProbabilitySet fair ρ, r ≤ 1/2+c/2 := by85    rintro _ ⟨M,hM,hs,rfl⟩86    rw [binary_success_of_difference ρ u v c hd M hs]87    have hz (x : Bit) (i : D) : 0 ≤ (M x i i).re :=88      (RCLike.nonneg_iff.mp ((hM x).diag_nonneg (i := i))).189    rw [Fin.sum_univ_two] at hs90    have hnorm := congrArg (fun N : Matrix D D ℂ => (N u u).re) hs91    simp only [Matrix.add_apply, Complex.add_re, Matrix.one_apply_eq, Complex.one_re] at hnorm92    have hle : (M 0 u u).re - (M 0 v v).re ≤ 1 := by linarith [hz 1 u,hz 0 v]93    linarith [mul_le_mul_of_nonneg_left hle (show 0 ≤ c/2 by positivity)]94  exact le_antisymm (csSup_le ⟨_,hmem⟩ hub) (le_csSup ⟨_,hub⟩ hmem)9596end SubentropyCertificates.QuantumCounterexample

Axioms used

Choose a statement to see which axioms its proof uses.