Exact Lean source
Nonadditivity.ChannelReindex
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.ChannelsNonadditivity.EntropyProductsMathlib.LinearAlgebra.Matrix.Reindexdependency
Imported by project modules
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
15 project constants, including generated, internal and private declarations.
15 declarations
Nonadditivity.Channels.KrausChannel.complementary_conjugate_mapNonadditivity.Channels.KrausChannel.complementary_tensor_mapNonadditivity.Channels.KrausChannel.map_eq_of_kraus_equivNonadditivity.Channels.KrausChannel.reindexNonadditivity.Channels.KrausChannel.reindex._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.reindex.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.reindexKrausNonadditivity.Channels.KrausChannel.reindexKraus._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.reindexKraus_mapNonadditivity.Channels.KrausChannel.reindex_mapNonadditivity.Channels.KrausChannel.tensor_shuffle_mapNonadditivity.Entropy.DensityMatrix.reindexNonadditivity.Entropy.DensityMatrix.reindex._proof_1internal/detail/privateNonadditivity.Entropy.DensityMatrix.reindex._proof_2internal/detail/privateNonadditivity.Entropy.DensityMatrix.reindex_entropy
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.Channels7import Nonadditivity.EntropyProducts8import Mathlib.LinearAlgebra.Matrix.Reindex910/-!11# Channel reindexing and environment-coordinate identities1213These are actual finite matrix identities. In particular, complementing a tensor14product and conjugating a complement commute without an assumed entropy law.15-/1617noncomputable section1819namespace Nonadditivity2021open scoped BigOperators ComplexOrder ComplexConjugate Kronecker Matrix2223namespace Entropy2425variable {ι μ : Type*} [Fintype ι] [DecidableEq ι] [Fintype μ] [DecidableEq μ]2627/-- Relabel an actual density matrix by a basis equivalence. -/28def DensityMatrix.reindex (ρ : DensityMatrix ι) (e : ι ≃ μ) : DensityMatrix μ where29matrix := Matrix.reindex e e ρ.matrix30positive := ρ.positive.submatrix e.symm31normalized := by32change (∑ j, ρ.matrix (e.symm j) (e.symm j)) = 133exact (e.symm.sum_comp (fun i => ρ.matrix i i)).trans ρ.normalized3435/-- Relabeling preserves the actual von Neumann entropy, via characteristic roots. -/36theorem DensityMatrix.reindex_entropy (ρ : DensityMatrix ι) (e : ι ≃ μ) :37(ρ.reindex e).vonNeumann = ρ.vonNeumann := by38have hc : (ρ.reindex e).matrix.charpoly = ρ.matrix.charpoly :=39Matrix.charpoly_reindex e ρ.matrix40have he := (ρ.reindex e).positive.isHermitian.roots_charpoly_eq_eigenvalues41rw [hc, ρ.positive.isHermitian.roots_charpoly_eq_eigenvalues] at he42have hs := congrArg (fun s : Multiset ℂ =>43(s.map (fun z => z.re * Real.log z.re)).sum) he44simp only [Multiset.map_map, Function.comp_def] at hs45change (∑ i, ρ.weights i * Real.log (ρ.weights i)) =46∑ i, (ρ.reindex e).weights i * Real.log ((ρ.reindex e).weights i) at hs47exact congrArg Neg.neg hs.symm4849end Entropy5051namespace Channels.KrausChannel5253variable {ι ο κ μ ν η : Type*}54variable [Fintype ι] [DecidableEq ι] [Fintype ο] [Fintype κ]5556/-- The complement and complex conjugation have identical Kraus tensors. -/57theorem complementary_conjugate_map (T : Channels.KrausChannel ι ο κ)58(X : Matrix ι ι ℂ) :59T.conjugate.complementary.map X = T.complementary.conjugate.map X := rfl6061/-- The complement of a tensor product equals the tensor of the complements. -/62theorem complementary_tensor_map [Fintype μ] [DecidableEq μ] [Fintype ν] [Fintype η]63(T : Channels.KrausChannel ι ο κ) (S : Channels.KrausChannel μ ν η)64(X : Matrix (ι × μ) (ι × μ) ℂ) :65(T.tensor S).complementary.map X = (T.complementary.tensor S.complementary).map X := rfl6667/-- Relabel the input and output basis indices of an actual Kraus channel. -/68def reindex [Fintype μ] [DecidableEq μ] [Fintype ν]69(T : Channels.KrausChannel ι ο κ) (ei : ι ≃ μ) (eo : ο ≃ ν) :70Channels.KrausChannel μ ν κ where71kraus := fun k => (T.kraus k).submatrix eo.symm ei.symm72complete := by73simp only [Matrix.conjTranspose_submatrix, Matrix.submatrix_mul_equiv]74calc75(∑ k, ((T.kraus k).conjTranspose * T.kraus k).submatrix ei.symm ei.symm) =76(∑ k, (T.kraus k).conjTranspose * T.kraus k).submatrix ei.symm ei.symm := by77ext a b78simp only [Matrix.sum_apply, Matrix.submatrix_apply]79_ = 1 := by rw [T.complete]; exact Matrix.submatrix_one_equiv ei.symm8081/-- The channel's reindexing is the concrete conjugation of its input/output coordinates. -/82theorem reindex_map [Fintype μ] [DecidableEq μ] [Fintype ν]83(T : Channels.KrausChannel ι ο κ) (ei : ι ≃ μ) (eo : ο ≃ ν)84(X : Matrix ι ι ℂ) :85(T.reindex ei eo).map (Matrix.reindex ei ei X) = Matrix.reindex eo eo (T.map X) := by86simp only [map, reindex, Matrix.reindex_apply, Matrix.conjTranspose_submatrix,87Matrix.submatrix_mul_equiv]88ext a b89simp only [Matrix.sum_apply, Matrix.submatrix_apply]9091/-- Kraus-index equivalences do not change the actual channel map. -/92theorem map_eq_of_kraus_equiv [Fintype η]93(T : Channels.KrausChannel ι ο κ) (S : Channels.KrausChannel ι ο η)94(e : κ ≃ η) (h : ∀ l, S.kraus l = T.kraus (e.symm l)) (X : Matrix ι ι ℂ) :95S.map X = T.map X := by96simp only [map, h]97exact e.symm.sum_comp (fun k => T.kraus k * X * (T.kraus k).conjTranspose)9899/-- Relabel the environment index; the represented channel is unchanged. -/100def reindexKraus [Fintype η] (T : Channels.KrausChannel ι ο κ) (e : κ ≃ η) :101Channels.KrausChannel ι ο η where102kraus := fun l => T.kraus (e.symm l)103complete := (e.symm.sum_comp (fun k => (T.kraus k).conjTranspose * T.kraus k)).trans T.complete104105@[simp] theorem reindexKraus_map [Fintype η] (T : Channels.KrausChannel ι ο κ)106(e : κ ≃ η) (X : Matrix ι ι ℂ) : (T.reindexKraus e).map X = T.map X :=107map_eq_of_kraus_equiv T _ e (fun _ => rfl) X108109section FourFactorShuffle110111variable {i₁ i₂ i₃ i₄ o₁ o₂ o₃ o₄ k₁ k₂ k₃ k₄ : Type*}112variable [Fintype i₁] [DecidableEq i₁] [Fintype i₂] [DecidableEq i₂]113variable [Fintype i₃] [DecidableEq i₃] [Fintype i₄] [DecidableEq i₄]114variable [Fintype o₁] [Fintype o₂] [Fintype o₃] [Fintype o₄]115variable [Fintype k₁] [Fintype k₂] [Fintype k₃] [Fintype k₄]116117/-- Regroup four actual channel factors, with the input and output basis118permutations explicit. This applies to arbitrary entangled inputs. -/119theorem tensor_shuffle_map120(T₁ : Channels.KrausChannel i₁ o₁ k₁) (T₂ : Channels.KrausChannel i₂ o₂ k₂)121(T₃ : Channels.KrausChannel i₃ o₃ k₃) (T₄ : Channels.KrausChannel i₄ o₄ k₄)122(X : Matrix ((i₁ × i₂) × (i₃ × i₄)) ((i₁ × i₂) × (i₃ × i₄)) ℂ) :123((T₁.tensor T₃).tensor (T₂.tensor T₄)).map124(Matrix.reindex (Equiv.prodProdProdComm i₁ i₂ i₃ i₄)125(Equiv.prodProdProdComm i₁ i₂ i₃ i₄) X) =126Matrix.reindex (Equiv.prodProdProdComm o₁ o₂ o₃ o₄)127(Equiv.prodProdProdComm o₁ o₂ o₃ o₄)128(((T₁.tensor T₂).tensor (T₃.tensor T₄)).map X) := by129rw [← reindex_map ((T₁.tensor T₂).tensor (T₃.tensor T₄))130(Equiv.prodProdProdComm i₁ i₂ i₃ i₄) (Equiv.prodProdProdComm o₁ o₂ o₃ o₄) X]131apply map_eq_of_kraus_equiv _ _ (Equiv.prodProdProdComm k₁ k₂ k₃ k₄)132intro k133ext a b134simp [reindex, tensor, Matrix.submatrix_apply, Matrix.kroneckerMap_apply,135Equiv.prodProdProdComm]136ring137138end FourFactorShuffle139140end Channels.KrausChannel141end Nonadditivity