Exact Lean source
Nonadditivity.Channels
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.EntropyMathlib.Data.Matrix.BasicdependencyMathlib.LinearAlgebra.Matrix.Kroneckerdependency
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
87 project constants, including generated, internal and private declarations.
87 declarations
Nonadditivity.Channels.KrausChannelNonadditivity.Channels.KrausChannel._sizeOf_1internal/detail/privateNonadditivity.Channels.KrausChannel._sizeOf_instinternal/detail/privateNonadditivity.Channels.KrausChannel.adjointLinearMapNonadditivity.Channels.KrausChannel.adjointMapNonadditivity.Channels.KrausChannel.adjointMap.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.adjointMap_addNonadditivity.Channels.KrausChannel.adjointMap_isHermitianNonadditivity.Channels.KrausChannel.adjointMap_oneNonadditivity.Channels.KrausChannel.adjointMap_posSemidefNonadditivity.Channels.KrausChannel.adjointMap_smulNonadditivity.Channels.KrausChannel.amplifyNonadditivity.Channels.KrausChannel.amplify_posSemidefNonadditivity.Channels.KrausChannel.casesOnNonadditivity.Channels.KrausChannel.compNonadditivity.Channels.KrausChannel.comp._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.comp.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.comp_mapNonadditivity.Channels.KrausChannel.complementaryNonadditivity.Channels.KrausChannel.complementary._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.complementary.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.complementary_map_entryNonadditivity.Channels.KrausChannel.completeNonadditivity.Channels.KrausChannel.conjugateNonadditivity.Channels.KrausChannel.conjugate._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.conjugate.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.conjugate_mapNonadditivity.Channels.KrausChannel.ctorIdxNonadditivity.Channels.KrausChannel.identityNonadditivity.Channels.KrausChannel.identity._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.identity.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.identity_mapNonadditivity.Channels.KrausChannel.isometryChannelNonadditivity.Channels.KrausChannel.isometryChannel._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.isometryChannel.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.krausNonadditivity.Channels.KrausChannel.linearMapNonadditivity.Channels.KrausChannel.mapNonadditivity.Channels.KrausChannel.map.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.map_addNonadditivity.Channels.KrausChannel.map_posSemidefNonadditivity.Channels.KrausChannel.map_smulNonadditivity.Channels.KrausChannel.map_zeroNonadditivity.Channels.KrausChannel.mkNonadditivity.Channels.KrausChannel.mk._flat_ctorinternal/detail/privateNonadditivity.Channels.KrausChannel.mk.congr_simpNonadditivity.Channels.KrausChannel.mk.injNonadditivity.Channels.KrausChannel.mk.injEqNonadditivity.Channels.KrausChannel.mk.noConfusionNonadditivity.Channels.KrausChannel.mk.sizeOf_specNonadditivity.Channels.KrausChannel.noConfusionNonadditivity.Channels.KrausChannel.noConfusionTypeNonadditivity.Channels.KrausChannel.outputNonadditivity.Channels.KrausChannel.output._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.output._proof_2internal/detail/privateNonadditivity.Channels.KrausChannel.output_matrixNonadditivity.Channels.KrausChannel.randomUnitaryNonadditivity.Channels.KrausChannel.randomUnitary._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.randomUnitary._simp_1internal/detail/privateNonadditivity.Channels.KrausChannel.randomUnitary.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.randomUnitary_mapNonadditivity.Channels.KrausChannel.recNonadditivity.Channels.KrausChannel.recOnNonadditivity.Channels.KrausChannel.stinespringNonadditivity.Channels.KrausChannel.stinespring.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.stinespringChannelNonadditivity.Channels.KrausChannel.stinespringChannel.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.stinespringChannel_mapNonadditivity.Channels.KrausChannel.stinespring_isometryNonadditivity.Channels.KrausChannel.stinespring_partialTrace_environmentNonadditivity.Channels.KrausChannel.stinespring_partialTrace_outputNonadditivity.Channels.KrausChannel.tensorNonadditivity.Channels.KrausChannel.tensor._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.tensor._simp_1internal/detail/privateNonadditivity.Channels.KrausChannel.tensor.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.tensor_mapNonadditivity.Channels.KrausChannel.trace_dualityNonadditivity.Channels.KrausChannel.trace_mapNonadditivity.Channels.KrausChannel.uniformUnitaryNonadditivity.Channels.KrausChannel.uniformUnitary._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.uniformUnitary._proof_2internal/detail/privateNonadditivity.Channels.KrausChannel.uniformUnitary._simp_1internal/detail/privateNonadditivity.Channels.KrausChannel.unitaryChannelNonadditivity.Channels.KrausChannel.unitaryChannel._proof_1internal/detail/privateNonadditivity.Channels.KrausChannel.unitaryChannel._simp_1internal/detail/privateNonadditivity.Channels.KrausChannel.unitaryChannel.eq_1internal/detail/privateNonadditivity.Channels.KrausChannel.unitaryChannel_map
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.Entropy7import Mathlib.Data.Matrix.Basic8import Mathlib.LinearAlgebra.Matrix.Kronecker910/-!11# Concrete finite-dimensional channels1213Channels are finite rectangular Kraus families satisfying the actual matrix14completeness equation. Positivity, trace preservation, ancilla positivity,15composition, tensor products and conjugate channels are proved from that data.16No abstract channel-property hypotheses are used to establish these facts.17-/1819noncomputable section2021namespace Nonadditivity.Channels2223open scoped BigOperators ComplexOrder ComplexConjugate Kronecker Matrix24open Nonadditivity.Entropy2526variable {ι ο κ μ ν η : Type*}2728/-- A finite Kraus realization of a completely positive trace-preserving map. -/29structure KrausChannel (ι ο κ : Type*) [Fintype ι] [DecidableEq ι]30[Fintype ο] [Fintype κ] where31kraus : κ → Matrix ο ι ℂ32complete : ∑ k, (kraus k).conjTranspose * kraus k = 13334namespace KrausChannel3536variable [Fintype ι] [DecidableEq ι] [Fintype ο] [Fintype κ]3738/-- The Schrödinger map is the finite Kraus sum. -/39def map (T : KrausChannel ι ο κ) (X : Matrix ι ι ℂ) : Matrix ο ο ℂ :=40∑ k, T.kraus k * X * (T.kraus k).conjTranspose4142@[simp] theorem map_add (T : KrausChannel ι ο κ) (X Y : Matrix ι ι ℂ) :43T.map (X + Y) = T.map X + T.map Y := by44simp [map, Matrix.mul_add, Matrix.add_mul, Finset.sum_add_distrib]4546@[simp] theorem map_smul (T : KrausChannel ι ο κ) (c : ℂ) (X : Matrix ι ι ℂ) :47T.map (c • X) = c • T.map X := by48simp [map, Matrix.mul_smul, Matrix.smul_mul, Finset.smul_sum]4950@[simp] theorem map_zero (T : KrausChannel ι ο κ) : T.map 0 = 0 := by simp [map]5152/-- The Kraus map as an actual complex linear map. -/53def linearMap (T : KrausChannel ι ο κ) : Matrix ι ι ℂ →ₗ[ℂ] Matrix ο ο ℂ where54toFun := T.map55map_add' := T.map_add56map_smul' := T.map_smul5758/-- Positivity is derived from the Kraus matrices by congruence. -/59theorem map_posSemidef (T : KrausChannel ι ο κ) (X : Matrix ι ι ℂ)60(hX : X.PosSemidef) : (T.map X).PosSemidef := by61exact Matrix.posSemidef_sum Finset.univ (fun k _ =>62hX.mul_mul_conjTranspose_same (T.kraus k))6364/-- Trace preservation holds for every input matrix. -/65@[simp] theorem trace_map (T : KrausChannel ι ο κ) (X : Matrix ι ι ℂ) :66(T.map X).trace = X.trace := by67calc68(T.map X).trace = ∑ k, (X * ((T.kraus k).conjTranspose * T.kraus k)).trace := by69simp only [map, Matrix.trace_sum]70apply Finset.sum_congr rfl71intro k _72rw [Matrix.trace_mul_cycle, Matrix.trace_mul_comm]73_ = (X * (∑ k, (T.kraus k).conjTranspose * T.kraus k)).trace := by74rw [Matrix.mul_sum, Matrix.trace_sum]75_ = X.trace := by rw [T.complete, Matrix.mul_one]7677/-- Applying a concrete channel produces a concrete density matrix. -/78def output [DecidableEq ο] (T : KrausChannel ι ο κ) (ρ : DensityMatrix ι) :79DensityMatrix ο where80matrix := T.map ρ.matrix81positive := T.map_posSemidef ρ.matrix ρ.positive82normalized := (T.trace_map ρ.matrix).trans ρ.normalized8384@[simp] theorem output_matrix [DecidableEq ο] (T : KrausChannel ι ο κ)85(ρ : DensityMatrix ι) : (T.output ρ).matrix = T.map ρ.matrix := rfl8687/-- A single identity Kraus operator. -/88def identity : KrausChannel ι ι Unit where89kraus := fun _ => 190complete := by simp9192@[simp] theorem identity_map (X : Matrix ι ι ℂ) :93(identity : KrausChannel ι ι Unit).map X = X := by simp [identity, map]9495/-- A single unitary Kraus operator. -/96def unitaryChannel (U : unitary (Matrix ι ι ℂ)) : KrausChannel ι ι Unit where97kraus := fun _ => U98complete := by simp [← Matrix.star_eq_conjTranspose]99100@[simp] theorem unitaryChannel_map (U : unitary (Matrix ι ι ℂ)) (X : Matrix ι ι ℂ) :101(unitaryChannel U).map X = (U : Matrix ι ι ℂ) * X * (U : Matrix ι ι ℂ).conjTranspose := by102simp [unitaryChannel, map]103104/-- The Hilbert–Schmidt adjoint channel on observables. -/105def adjointMap (T : KrausChannel ι ο κ) (Y : Matrix ο ο ℂ) : Matrix ι ι ℂ :=106∑ k, (T.kraus k).conjTranspose * Y * T.kraus k107108@[simp] theorem adjointMap_add (T : KrausChannel ι ο κ) (X Y : Matrix ο ο ℂ) :109T.adjointMap (X + Y) = T.adjointMap X + T.adjointMap Y := by110simp [adjointMap, Matrix.mul_add, Matrix.add_mul, Finset.sum_add_distrib]111112@[simp] theorem adjointMap_smul (T : KrausChannel ι ο κ) (c : ℂ) (X : Matrix ο ο ℂ) :113T.adjointMap (c • X) = c • T.adjointMap X := by114simp [adjointMap, Matrix.mul_smul, Matrix.smul_mul, Finset.smul_sum]115116/-- The adjoint on observables as an actual complex linear map. -/117def adjointLinearMap (T : KrausChannel ι ο κ) : Matrix ο ο ℂ →ₗ[ℂ] Matrix ι ι ℂ where118toFun := T.adjointMap119map_add' := T.adjointMap_add120map_smul' := T.adjointMap_smul121122/-- The adjoint preserves Hermitian observables, including nonpositive ones. -/123theorem adjointMap_isHermitian (T : KrausChannel ι ο κ) (Y : Matrix ο ο ℂ)124(hY : Y.IsHermitian) : (T.adjointMap Y).IsHermitian := by125change Y.conjTranspose = Y at hY126unfold Matrix.IsHermitian adjointMap127simp only [Matrix.conjTranspose_sum, Matrix.conjTranspose_mul,128Matrix.conjTranspose_conjTranspose, hY, Matrix.mul_assoc]129130/-- Positivity of the channel adjoint is also derived from its Kraus operators. -/131theorem adjointMap_posSemidef (T : KrausChannel ι ο κ) (Y : Matrix ο ο ℂ)132(hY : Y.PosSemidef) : (T.adjointMap Y).PosSemidef := by133exact Matrix.posSemidef_sum Finset.univ (fun k _ =>134hY.conjTranspose_mul_mul_same (T.kraus k))135136@[simp] theorem adjointMap_one [DecidableEq ο] (T : KrausChannel ι ο κ) :137T.adjointMap 1 = 1 := by simp [adjointMap, T.complete]138139/-- The defining trace duality is proved directly, including rectangular Kraus operators. -/140theorem trace_duality (T : KrausChannel ι ο κ) (X : Matrix ι ι ℂ) (Y : Matrix ο ο ℂ) :141(T.map X * Y).trace = (X * T.adjointMap Y).trace := by142simp only [map, adjointMap, Matrix.sum_mul, Matrix.mul_sum, Matrix.trace_sum]143apply Finset.sum_congr rfl144intro k _145calc146((T.kraus k * X * (T.kraus k).conjTranspose) * Y).trace =147(T.kraus k * (X * (T.kraus k).conjTranspose * Y)).trace := by148simp only [Matrix.mul_assoc]149_ = ((X * (T.kraus k).conjTranspose * Y) * T.kraus k).trace :=150Matrix.trace_mul_comm _ _151_ = (X * ((T.kraus k).conjTranspose * Y * T.kraus k)).trace := by152simp only [Matrix.mul_assoc]153154/-- A random unitary channel with any genuine probability distribution. -/155def randomUnitary (p : κ → ℝ) (hp : ∀ k, 0 ≤ p k) (hsum : ∑ k, p k = 1)156(U : κ → unitary (Matrix ι ι ℂ)) : KrausChannel ι ι κ where157kraus := fun k => (Real.sqrt (p k) : ℂ) • (U k : Matrix ι ι ℂ)158complete := by159have hTerm (k : κ) :160((Real.sqrt (p k) : ℂ) • (U k : Matrix ι ι ℂ)).conjTranspose *161((Real.sqrt (p k) : ℂ) • (U k : Matrix ι ι ℂ)) = (p k : ℂ) • (1 : Matrix ι ι ℂ) := by162simp only [Matrix.conjTranspose_smul, Matrix.smul_mul, Matrix.mul_smul, smul_smul]163rw [← Matrix.star_eq_conjTranspose]164simp [← Complex.ofReal_mul, Real.mul_self_sqrt (hp k)]165simp_rw [hTerm]166rw [← Finset.sum_smul]167have hSum : ∑ k, (p k : ℂ) = 1 := by exact_mod_cast hsum168rw [hSum, one_smul]169170/-- The random-unitary channel's map is the advertised convex combination. -/171theorem randomUnitary_map (p : κ → ℝ) (hp : ∀ k, 0 ≤ p k)172(hsum : ∑ k, p k = 1) (U : κ → unitary (Matrix ι ι ℂ)) (X : Matrix ι ι ℂ) :173(randomUnitary p hp hsum U).map X =174∑ k, (p k : ℂ) • ((U k : Matrix ι ι ℂ) * X * (U k : Matrix ι ι ℂ).conjTranspose) := by175simp only [map, randomUnitary]176apply Finset.sum_congr rfl177intro k _178simp only [Matrix.conjTranspose_smul, Matrix.smul_mul, Matrix.mul_smul, smul_smul]179simp [← Complex.ofReal_mul, Real.mul_self_sqrt (hp k)]180181/-- Uniform mixing of an arbitrary nonempty finite unitary family. -/182def uniformUnitary [Nonempty κ] (U : κ → unitary (Matrix ι ι ℂ)) :183KrausChannel ι ι κ :=184randomUnitary (fun _ => 1 / (Fintype.card κ : ℝ)) (fun _ => by positivity)185(by simp [Fintype.card_ne_zero]) U186187/-- The complementary channel swaps the output and environment coordinates188of the Stinespring Kraus tensor. -/189def complementary (T : KrausChannel ι ο κ) : KrausChannel ι κ ο where190kraus := fun b e a => T.kraus e b a191complete := by192ext i j193have h := congrArg (fun M : Matrix ι ι ℂ => M i j) T.complete194simp only [Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply] at h ⊢195rw [Finset.sum_comm]196exact h197198/-- The environment output entries are the overlaps of the Kraus branches. -/199theorem complementary_map_entry (T : KrausChannel ι ο κ) (X : Matrix ι ι ℂ)200(e f : κ) :201(T.complementary.map X) e f =202(T.kraus e * X * (T.kraus f).conjTranspose).trace := by203simp only [map, complementary, Matrix.trace, Matrix.diag, Matrix.mul_apply,204Matrix.conjTranspose_apply, Matrix.sum_apply]205206/-- A trace-preserving isometric embedding, with one rectangular Kraus operator. -/207def isometryChannel (V : Matrix ο ι ℂ) (hV : V.conjTranspose * V = 1) :208KrausChannel ι ο Unit where209kraus := fun _ => V210complete := by simpa using hV211212/-- The actual Stinespring isometry, retaining both output and environment indices. -/213def stinespring (T : KrausChannel ι ο κ) : Matrix (ο × κ) ι ℂ :=214fun z a => T.kraus z.2 z.1 a215216/-- Kraus completeness proves the Stinespring matrix is isometric. -/217theorem stinespring_isometry (T : KrausChannel ι ο κ) :218T.stinespring.conjTranspose * T.stinespring = 1 := by219ext i j220have h := congrArg (fun M : Matrix ι ι ℂ => M i j) T.complete221simp only [Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply] at h222simp only [stinespring, Matrix.mul_apply, Matrix.conjTranspose_apply, Fintype.sum_prod_type]223rw [Finset.sum_comm]224exact h225226/-- A genuine joint-output channel, before either subsystem is traced out. -/227def stinespringChannel (T : KrausChannel ι ο κ) : KrausChannel ι (ο × κ) Unit :=228isometryChannel T.stinespring T.stinespring_isometry229230@[simp] theorem stinespringChannel_map (T : KrausChannel ι ο κ) (X : Matrix ι ι ℂ) :231T.stinespringChannel.map X = T.stinespring * X * T.stinespring.conjTranspose := by232simp [stinespringChannel, isometryChannel, map]233234/-- Tracing out the environment of the joint channel gives the original channel. -/235theorem stinespring_partialTrace_environment (T : KrausChannel ι ο κ)236(X : Matrix ι ι ℂ) (b c : ο) :237(∑ e, (T.stinespringChannel.map X) (b,e) (c,e)) = T.map X b c := by238simp [stinespringChannel, isometryChannel, stinespring, map, Matrix.sum_apply,239Matrix.mul_apply, Matrix.conjTranspose_apply]240241/-- Tracing out the output of the same joint channel gives the complementary channel. -/242theorem stinespring_partialTrace_output (T : KrausChannel ι ο κ)243(X : Matrix ι ι ℂ) (e f : κ) :244(∑ b, (T.stinespringChannel.map X) (b,e) (b,f)) = T.complementary.map X e f := by245simp [stinespringChannel, isometryChannel, stinespring, map, complementary,246Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply]247248end KrausChannel249250section Operations251252variable [Fintype ι] [DecidableEq ι] [Fintype ο] [DecidableEq ο]253variable [Fintype κ] [Fintype μ] [DecidableEq μ] [Fintype ν] [Fintype η]254255namespace KrausChannel256257/-- Compose two channels by multiplying their Kraus operators. -/258def comp (S : KrausChannel ο μ η) (T : KrausChannel ι ο κ) :259KrausChannel ι μ (κ × η) where260kraus := fun z => S.kraus z.2 * T.kraus z.1261complete := by262simp only [Matrix.conjTranspose_mul, Fintype.sum_prod_type]263calc264(∑ k, ∑ l, (T.kraus k).conjTranspose * (S.kraus l).conjTranspose *265(S.kraus l * T.kraus k)) =266∑ k, (T.kraus k).conjTranspose *267(∑ l, (S.kraus l).conjTranspose * S.kraus l) * T.kraus k := by268simp only [Matrix.mul_sum, Matrix.sum_mul, Matrix.mul_assoc]269_ = 1 := by simp [S.complete, T.complete]270271omit [DecidableEq μ] in272theorem comp_map (S : KrausChannel ο μ η) (T : KrausChannel ι ο κ)273(X : Matrix ι ι ℂ) : (S.comp T).map X = S.map (T.map X) := by274simp only [map, comp, Matrix.conjTranspose_mul, Fintype.sum_prod_type,275Matrix.mul_sum, Matrix.sum_mul]276rw [Finset.sum_comm]277simp only [Matrix.mul_assoc]278279/-- Tensor channels use the Kronecker products of their Kraus operators. -/280def tensor (T : KrausChannel ι ο κ) (S : KrausChannel μ ν η) :281KrausChannel (ι × μ) (ο × ν) (κ × η) where282kraus := fun z => T.kraus z.1 ⊗ₖ S.kraus z.2283complete := by284simp only [Matrix.conjTranspose_kronecker, ← Matrix.mul_kronecker_mul,285Fintype.sum_prod_type]286calc287(∑ k, ∑ l, ((T.kraus k).conjTranspose * T.kraus k) ⊗ₖ288((S.kraus l).conjTranspose * S.kraus l)) =289(∑ k, (T.kraus k).conjTranspose * T.kraus k) ⊗ₖ290(∑ l, (S.kraus l).conjTranspose * S.kraus l) := by291ext ⟨a,b⟩ ⟨c,d⟩292simp only [Matrix.sum_apply, Matrix.kroneckerMap_apply, Finset.mul_sum, Finset.sum_mul]293rw [Finset.sum_comm]294_ = 1 := by rw [T.complete, S.complete, Matrix.one_kronecker_one]295296omit [DecidableEq ο] in297/-- Tensor channels map product inputs to product outputs. -/298theorem tensor_map (T : KrausChannel ι ο κ) (S : KrausChannel μ ν η)299(X : Matrix ι ι ℂ) (Y : Matrix μ μ ℂ) :300(T.tensor S).map (X ⊗ₖ Y) = T.map X ⊗ₖ S.map Y := by301simp only [map, tensor, Matrix.conjTranspose_kronecker, ← Matrix.mul_kronecker_mul,302Fintype.sum_prod_type]303ext ⟨a,b⟩ ⟨c,d⟩304simp only [Matrix.sum_apply, Matrix.kroneckerMap_apply, Finset.mul_sum, Finset.sum_mul]305rw [Finset.sum_comm]306307/-- An arbitrary finite ancilla is the tensor product with the identity channel. -/308def amplify (T : KrausChannel ι ο κ) (a : Type*) [Fintype a] [DecidableEq a] :309KrausChannel (a × ι) (a × ο) (Unit × κ) := identity.tensor T310311omit [DecidableEq ο] in312/-- Complete positivity: every finite ancilla amplification preserves positivity. -/313theorem amplify_posSemidef (T : KrausChannel ι ο κ) (a : Type*)314[Fintype a] [DecidableEq a] (X : Matrix (a × ι) (a × ι) ℂ)315(hX : X.PosSemidef) : ((T.amplify a).map X).PosSemidef :=316(T.amplify a).map_posSemidef X hX317318/-- Complex conjugation of every Kraus operator. -/319def conjugate (T : KrausChannel ι ο κ) : KrausChannel ι ο κ where320kraus := fun k => (T.kraus k).map star321complete := by322have h := congrArg (fun M : Matrix ι ι ℂ => M.map star) T.complete323ext i j324have hij := congrArg (fun M : Matrix ι ι ℂ => M i j) h325simpa [Matrix.mul_apply, Matrix.conjTranspose_apply, Matrix.map_apply, Matrix.one_apply,326Matrix.sum_apply, map_sum, mul_comm] using hij327328omit [DecidableEq ο] in329/-- Conjugating both a channel and its input conjugates the output. -/330theorem conjugate_map (T : KrausChannel ι ο κ) (X : Matrix ι ι ℂ) :331T.conjugate.map (X.map star) = (T.map X).map star := by332ext i j333simp [map, conjugate, Matrix.mul_apply, Matrix.conjTranspose_apply,334Matrix.map_apply, Matrix.sum_apply, map_sum, mul_comm]335336end KrausChannel337end Operations338339end Nonadditivity.Channels