CompactEnsembles.lean
1module23public import SubentropyCertificates.MixedQubitExample4import all SubentropyCertificates.HelstromSpectral56/-! A compact parameter space for ensembles on two fixed finite registers.7A signal at a zero-prior label may be any density matrix. -/8@[expose] public section9noncomputable section10set_option autoImplicit false11set_option backward.isDefEq.respectTransparency false12open Matrix Set13open scoped BigOperators ComplexOrder MatrixOrder14namespace SubentropyCertificates.CompactStability15open D5.S3.Quantum.Foundation.FiniteStateChannel16open D5.S3.Quantum.Information.PartialTraceMutualInformation17open D5.S3.Quantum.Information.OrthogonalRecordEntropy18open D5.S3.Quantum.Subentropy.DensityKernel19open SubentropyCertificates.ClassicalCurve20open SubentropyCertificates.Discrimination21open SubentropyCertificates.Helstrom22open SubentropyCertificates.BinarySpectra (densityMatrix)2324variable (X B : Type*) [Fintype X] [Fintype B] [DecidableEq B]2526abbrev Signal := {A : Matrix B B ℂ // A.PosSemidef ∧ A.trace = 1}27abbrev Ensemble := ↥(probabilitySimplex X) × (X → Signal B)2829theorem compact_priors : IsCompact (probabilitySimplex X) := by30 have box := isCompact_pi_infinite (fun _ : X => isCompact_Icc (a := (0:ℝ)) (b := 1))31 apply box.of_isClosed_subset32 · change IsClosed ({p : X → ℝ | ∀ i,0 ≤ p i} ∩ {p | ∑ i,p i=1})33 apply IsClosed.inter34 · rw [Set.ofPred_forall]; exact isClosed_iInter fun i => isClosed_le continuous_const (continuous_apply i)35 · exact isClosed_eq (by fun_prop) continuous_const36 · intro p hp i37 refine ⟨hp.1 i,?_⟩38 rw [← hp.2]39 exact Finset.single_le_sum (fun x _ => hp.1 x) (Finset.mem_univ i)4041theorem compact_signals : IsCompact {A : Matrix B B ℂ | A.PosSemidef ∧ A.trace=1} := by42 apply (isCompact_effect_interval (B := B)).of_isClosed_subset43 · apply IsClosed.inter44 · change IsClosed {A : Matrix B B ℂ | A.PosSemidef}45 simpa only [← Matrix.nonneg_iff_posSemidef] using46 (isClosed_le continuous_const continuous_id : IsClosed {A : Matrix B B ℂ | 0 ≤ A})47 · exact isClosed_eq (by fun_prop) continuous_const48 · intro A h49 obtain ⟨hA,ht⟩ := h50 refine ⟨hA.nonneg,?_⟩51 let U := hA.isHermitian.eigenvectorUnitary52 let p := hA.isHermitian.eigenvalues53 obtain ⟨hp,hs⟩ := spectral_prob hA ht54 have hle (i : B) : p i ≤ 1 := by55 rw [← hs]; exact Finset.single_le_sum (fun j _ => hp j) (Finset.mem_univ i)56 have hd : A = spectralMatrix U p := hA.isHermitian.spectral_theorem57 apply sub_nonneg.mp58 rw [hd,← spectral_one U,spectral_sub]59 exact (spectral_pos U _ (fun i => sub_nonneg.mpr (hle i))).nonneg6061theorem compact_ensembles : CompactSpace (Ensemble X B) := by62 let _ : CompactSpace ↥(probabilitySimplex X) := isCompact_iff_compactSpace.mp (compact_priors X)63 let _ : CompactSpace (Signal B) := isCompact_iff_compactSpace.mp (compact_signals B)64 infer_instance6566variable {X B} [DecidableEq X]6768def asState (A : Signal B) : DensityState B :=69 ⟨CStarMatrix.ofMatrix A.val,map_nonneg CStarMatrix.ofMatrixStarAlgEquiv A.property.1.nonneg,A.property.2⟩7071/-- The coordinates cover every finite normalized ensemble. -/72def ofEnsemble (p : X → ℝ) (hp : ∀ x,0 ≤ p x) (hs : ∑ x,p x=1) (ρ : X → DensityState B) :73 Ensemble X B :=74 (⟨p,hp,hs⟩,fun x => ⟨densityMatrix (ρ x),density_posSemidef (ρ x),(ρ x).2.2⟩)7576def record (E : Ensemble X B) : DensityState (X × B) :=77 recordState E.1 E.1.property.1 E.1.property.2 (fun x => asState (E.2 x))7879def average (E : Ensemble X B) : DensityState B :=80 mixtureState E.1 E.1.property.1 E.1.property.2 (fun x => asState (E.2 x))8182theorem record_ofEnsemble (p : X → ℝ) (hp : ∀ x,0 ≤ p x) (hs : ∑ x,p x=1) (ρ : X → DensityState B) :83 record (ofEnsemble p hp hs ρ) = recordState p hp hs ρ := rfl8485end SubentropyCertificates.CompactStability
Axioms used
Choose a statement to see which axioms its proof uses.