Exact Lean source
Nonadditivity.ConditionalStates
Download original .lean · View on GitHub · Jump to source
Direct imports
Imported by project modules
2 direct reverse imports
Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.
Declarations in this module
9 project constants, including generated, internal and private declarations.
9 declarations
Nonadditivity.Entropy.normalizePositiveNonadditivity.Entropy.normalizePositive._proof_1internal/detail/privateNonadditivity.Entropy.normalizePositive._proof_2internal/detail/privateNonadditivity.Entropy.normalizePositive._simp_1internal/detail/privateNonadditivity.Entropy.normalizePositive.congr_simpNonadditivity.Entropy.normalizePositive.eq_1internal/detail/privateNonadditivity.Entropy.positive_trace_re_nonnegNonadditivity.Entropy.positive_trace_realNonadditivity.Entropy.trace_smul_normalizePositive
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.StateEnsembles78/-! # Normalizing subnormalized positive states910Zero-probability branches are handled explicitly. This is the matrix11decomposition needed when a classical input register is measured.12-/1314noncomputable section1516namespace Nonadditivity.Entropy1718open scoped BigOperators ComplexOrder Matrix1920variable {ι : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι]2122omit [DecidableEq ι] [Nonempty ι] in23theorem positive_trace_real (A : Matrix ι ι ℂ) (hA : A.PosSemidef) :24(A.trace.re : ℂ) = A.trace := by25exact (Complex.eq_re_of_ofReal_le hA.trace_nonneg).symm2627omit [DecidableEq ι] [Nonempty ι] in28theorem positive_trace_re_nonneg (A : Matrix ι ι ℂ) (hA : A.PosSemidef) :290 ≤ A.trace.re := (Complex.nonneg_iff.mp hA.trace_nonneg).13031/-- Conditional state of a positive matrix, with an arbitrary fixed state on32the zero-probability branch. -/33def normalizePositive (A : Matrix ι ι ℂ) (hA : A.PosSemidef) : DensityMatrix ι :=34if h : A.trace.re = 0 then maximallyMixed ι else35{ matrix := (((A.trace.re)⁻¹ : ℝ) : ℂ) • A36positive := hA.smul (by exact_mod_cast inv_nonneg.mpr (positive_trace_re_nonneg A hA))37normalized := by38rw [Matrix.trace_smul, smul_eq_mul, ← positive_trace_real A hA]39simp only [Complex.ofReal_re, ← Complex.ofReal_mul, inv_mul_cancel₀ h,40Complex.ofReal_one] }4142/-- Renormalization exactly recovers the original positive matrix, including43the zero-trace case. -/44theorem trace_smul_normalizePositive (A : Matrix ι ι ℂ) (hA : A.PosSemidef) :45(A.trace.re : ℂ) • (normalizePositive A hA).matrix = A := by46by_cases h : A.trace.re = 047· have hz : A.trace = 0 := by rw [← positive_trace_real A hA, h]; simp48have hzero := hA.trace_eq_zero_iff.mp hz49simp [hzero]50· simp only [normalizePositive, dif_neg h, smul_smul, ← Complex.ofReal_mul,51mul_inv_cancel₀ h, Complex.ofReal_one, one_smul]5253end Nonadditivity.Entropy