DephasingEnsemble.lean
1module23public import SubentropyCertificates.CounterexampleState45/-! The original qubit ensemble, its isometric encoding into BC, and its6computational basis dephasing obtained by taking the partial trace. -/7@[expose] public section8noncomputable section9set_option autoImplicit false10set_option backward.isDefEq.respectTransparency false11open Matrix12open scoped ComplexOrder MatrixOrder BigOperators13namespace SubentropyCertificates.QuantumCounterexample14open D5.S3.Quantum.Foundation.FiniteStateChannel15open D5.S3.Quantum.Information.PartialTraceMutualInformation1617variable {D : Type*} [Fintype D] [DecidableEq D]18local notation "conjTwo" => (map_ofNat (starRingEnd ℂ) 2)1920def signalMatrix {I : Type*} (v : I → ℂ) : Matrix I I ℂ :=21 (1/5 : ℝ) • vecMulVec v (star v)2223def normalizedSignal (v : D → ℂ) (ht : (signalMatrix v).trace = 1) : DensityState D :=24 ⟨CStarMatrix.ofMatrix (signalMatrix v), map_nonneg CStarMatrix.ofMatrixStarAlgEquiv25 ((Matrix.posSemidef_vecMulVec_self_star v).smul (by norm_num : (0 : ℝ) ≤ 1/5)).nonneg, ht⟩2627def inputSignal (a : Bit) : DensityState Bit :=28 normalizedSignal (fun b => signals (b,b) a) (by29 fin_cases a <;> norm_num [signalMatrix, Matrix.trace, Fin.sum_univ_two, signals,30 Matrix.vecMulVec_apply, Complex.real_smul, conjTwo])3132def encodedSignal (a : Bit) : DensityState (Bit × Bit) :=33 normalizedSignal (fun u => signals u a) (by34 fin_cases a <;> norm_num [signalMatrix, Matrix.trace, Fintype.sum_prod_type, Fin.sum_univ_two,35 signals, Matrix.vecMulVec_apply, Complex.real_smul, conjTwo])3637def outputSignal (a : Bit) := marginalRight (encodedSignal a)3839theorem encoded_entries (a b c j k : Bit) :40 (encodedSignal a).1 (b,c) (j,k) =41 if c=b ∧ k=j then (inputSignal a).1 b j else 0 := by42 change signalMatrix _ (b,c) (j,k) = if _ then signalMatrix _ b j else 043 by_cases h : c=b <;> by_cases g : k=j <;>44 simp_all [signalMatrix, signals, Matrix.vecMulVec_apply, eq_comm]4546/-- Tracing out C is precisely the unread computational basis measurement:47the output has the same diagonal entries as the input and zero coherences. -/48theorem output_is_dephasing (a : Bit) :49 CStarMatrix.ofMatrix.symm (outputSignal a).1 =50 diagonal (fun i => (inputSignal a).1 i i) := by51 ext b j52 change (∑ c : Bit, (encodedSignal a).1 (b,c) (j,c)) = _53 simp only [encoded_entries]54 by_cases h : b=j55 · subst j; simp56 · have hz (c : Bit) : ¬(c=b ∧ c=j) := fun hc => h (hc.1.symm.trans hc.2)57 simp [hz,h]5859/-- The output puts probability 4/5 on the coordinate equal to the label. -/60theorem output_weights (a : Bit) :61 CStarMatrix.ofMatrix.symm (outputSignal a).1 =62 diagonal (fun i => if i=a then (4/5 : ℂ) else 1/5) := by63 rw [output_is_dephasing]64 apply congrArg diagonal65 funext i66 change signalMatrix _ i i = _67 by_cases h : i=a <;> norm_num [signalMatrix,signals,h,Matrix.vecMulVec_apply,68 Complex.real_smul,conjTwo]6970/-- The diagonal label blocks of the v19 joint state are the encoded71signals weighted by the equal priors; off-label blocks vanish. -/72theorem state_encoded_blocks (a d : Bit) (u v : Bit × Bit) :73 state.1 ((a,u.1),u.2) ((d,v.1),v.2) =74 if a=d then (1/2 : ℂ)*(encodedSignal a).1 u v else 0 := by75 rw [state_entries]76 by_cases h : a=d77 · simp only [h,ite_true]78 change _ = (1/2 : ℂ)*signalMatrix _ u v79 simp [signalMatrix, Matrix.vecMulVec_apply, Complex.real_smul]80 ring81 · simp [h]8283end SubentropyCertificates.QuantumCounterexample
Axioms used
Choose a statement to see which axioms its proof uses.