chars
int64
40
24k
content_type
stringclasses
9 values
id
stringlengths
13
64
source
stringclasses
5 values
subset
stringclasses
31 values
text
stringlengths
40
24k
347
leanexplore_declaration
leanexplore:378103
leanexplore_sqlite
leanexplore_declarations
/-- The defining property of a dual channel, as specialized to `MState.exp_val`. -/ theorem exp_val_Dual (ℰ : CPTPMap dIn dOut) (ρ : MState dIn) (T : HermitianMat dOut ℂ) : (ℰ ρ).exp_val T = ρ.exp_val (ℰ.dual T) := by simp only [MState.exp_val, HermitianMat.inner_eq_re_trace, RCLike.re_to_complex] congr 1 ap...
2,013
leanexplore_declaration
leanexplore:378104
leanexplore_sqlite
leanexplore_declarations
def HPMap.ofHermitianMat {dOut : Type*} (f : HermitianMat dIn ℂ →ₗ[ℝ] HermitianMat dOut ℂ) : HPMap dIn dOut where toFun x := f (realPart x) + Complex.I • f (imaginaryPart x) map_add' x y := by simp only [map_add, HermitianMat.mat_add, smul_add] abel map_smul' c m := by have h_expand : realPart (c • m)...
533
leanexplore_declaration
leanexplore:378105
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem HPMap.linearMap_ofHermitianMat (f : HermitianMat dIn ℂ →ₗ[ℝ] HermitianMat dOut ℂ) : LinearMapClass.linearMap (HPMap.ofHermitianMat f) = f := by ext1 ⟨x, hx⟩ ext1 simp only [ofHermitianMat, LinearMap.coe_coe] simp only [HPMap.apply_hermitianMat_eq, HPMap.map, HermitianMat.mat_mk, LinearMa...
639
leanexplore_declaration
leanexplore:378106
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem HPMap.ofHermitianMat_linearMap (f : HPMap dIn dOut ℂ) : ofHermitianMat (LinearMapClass.linearMap f) = f := by ext : 3 simp only [map, ofHermitianMat, instFunLike, LinearMap.coe_coe, HermitianMat.val_eq_coe, HermitianMat.mat_mk, LinearMap.coe_mk, AddHom.coe_mk, ← map_smul, ← map_add] si...
98
leanexplore_declaration
leanexplore:378107
leanexplore_sqlite
leanexplore_declarations
def HPMap.hermDual : HPMap dOut dIn := HPMap.ofHermitianMat (LinearMapClass.linearMap f).adjoint
89
leanexplore_declaration
leanexplore:378108
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem HPMap.hermDual_hermDual : f.hermDual.hermDual = f := by simp [hermDual]
367
leanexplore_declaration
leanexplore:378109
leanexplore_sqlite
leanexplore_declarations
/-- The defining property of a dual map: inner products are preserved on the opposite argument. -/ theorem HPMap.inner_hermDual (B : HermitianMat dOut ℂ) : ⟪f A, B⟫ = ⟪A, f.hermDual B⟫ := by change ⟪(LinearMapClass.linearMap f) A, B⟫ = ⟪A, (LinearMapClass.linearMap f.hermDual) B⟫ rw [hermDual, ← LinearMap.adjoi...
214
leanexplore_declaration
leanexplore:378110
leanexplore_sqlite
leanexplore_declarations
/-- Version of `HPMap.inner_hermDual` that uses HermitiaMat.inner directly. TODO cleanup -/ theorem HPMap.inner_hermDual' (B : HermitianMat dOut ℂ) : ⟪f A, B⟫ = ⟪A, f.hermDual B⟫ := HPMap.inner_hermDual f A B
708
leanexplore_declaration
leanexplore:378111
leanexplore_sqlite
leanexplore_declarations
/-- The dual of a `IsPositive` map also `IsPositive`. -/ theorem MatrixMap.IsPositive.hermDual (h : MatrixMap.IsPositive f.map) : f.hermDual.map.IsPositive := by unfold IsPositive at h ⊢ intro x hx set xH : HermitianMat dOut ℂ := ⟨x, hx.left⟩ with hxH have hx' : x = xH := rfl; clear_value xH; subst x; clear hxH...
671
leanexplore_declaration
leanexplore:378112
leanexplore_sqlite
leanexplore_declarations
/-- The dual of TracePreserving map is *not* trace-preserving, it's *unital*, that is, M*(I) = I. -/ theorem HPMap.hermDual_Unital [DecidableEq dIn] [DecidableEq dOut] (h : MatrixMap.IsTracePreserving f.map) : f.hermDual.map.Unital := by suffices f.hermDual 1 = 1 by --todo: make this is an accessible 'constructor...
67
leanexplore_declaration
leanexplore:378113
leanexplore_sqlite
leanexplore_declarations
alias MatrixMap.IsTracePreserving.hermDual := HPMap.hermDual_Unital
139
leanexplore_declaration
leanexplore:378114
leanexplore_sqlite
leanexplore_declarations
def hermDual (M : PTPMap dIn dOut) : PUMap dOut dIn where toHPMap := M.toHPMap.hermDual pos := M.pos.hermDual unital := M.TP.hermDual
146
leanexplore_declaration
leanexplore:378115
leanexplore_sqlite
leanexplore_declarations
theorem hermDual_pos (M : PTPMap dIn dOut) {T : HermitianMat dOut ℂ} (hT : 0 ≤ T) : 0 ≤ M.hermDual T := by exact M.hermDual.pos_Hermitian hT
450
leanexplore_declaration
leanexplore:378116
leanexplore_sqlite
leanexplore_declarations
/-- The dual of a PTP map preserves POVMs. Stated here just for two-element POVMs, that is, an operator `T` between 0 and 1. -/ theorem hermDual.PTP_POVM (M : PTPMap dIn dOut) {T : HermitianMat dOut ℂ} (hT : 0 ≤ T ∧ T ≤ 1) : (0 ≤ M.hermDual T ∧ M.hermDual T ≤ 1) := by rcases hT with ⟨hT₁, hT₂⟩ have hT_psd := He...
288
leanexplore_declaration
leanexplore:378117
leanexplore_sqlite
leanexplore_declarations
/-- The defining property of a dual channel, as specialized to `MState.exp_val`. -/ theorem exp_val_hermDual (ℰ : PTPMap dIn dOut) (ρ : MState dIn) (T : HermitianMat dOut ℂ) : (ℰ ρ).exp_val T = ρ.exp_val (ℰ.hermDual T) := by simp only [MState.exp_val] apply HPMap.inner_hermDual'
171
leanexplore_declaration
leanexplore:378118
leanexplore_sqlite
leanexplore_declarations
/-- A `MatrixMap` is a linear map between squares matrices of size A to size B, over R. -/ abbrev MatrixMap (A B R : Type*) [Semiring R] := Matrix A A R →ₗ[R] Matrix B B R
116
leanexplore_declaration
leanexplore:378119
leanexplore_sqlite
leanexplore_declarations
/-- Alias of LinearMap.id, but specifically as a MatrixMap. -/ @[reducible] def id : MatrixMap A A R := LinearMap.id
404
leanexplore_declaration
leanexplore:378120
leanexplore_sqlite
leanexplore_declarations
/-- Choi matrix of a given linear matrix map. Note that this is defined even for things that aren't CPTP, it's just rarely talked about in those contexts. This is the inverse of `MatrixMap.of_choi_matrix`. Compare with `MatrixMap.toMatrix`, which gives the transfer matrix. -/ def choi_matrix (M : MatrixMap A B R) :...
508
leanexplore_declaration
leanexplore:378121
leanexplore_sqlite
leanexplore_declarations
/-- Given the Choi matrix, generate the corresponding R-linear map between matrices as a MatrixMap. This is the inverse of `MatrixMap.choi_matrix`. -/ def of_choi_matrix (M : Matrix (B × A) (B × A) R) : MatrixMap A B R where toFun X := fun b₁ b₂ ↦ ∑ (a₁ : A), ∑ (a₂ : A), X a₁ a₂ * M (b₁, a₁) (b₂, a₂) map_add' x y :...
269
leanexplore_declaration
leanexplore:378122
leanexplore_sqlite
leanexplore_declarations
/-- Proves that `MatrixMap.of_choi_matrix` and `MatrixMap.choi_matrix` inverses. -/ @[simp] theorem map_choi_inv (M : Matrix (B × A) (B × A) R) : choi_matrix (of_choi_matrix M) = M := by ext ⟨i₁,i₂⟩ ⟨j₁,j₂⟩ simp [of_choi_matrix, choi_matrix, Matrix.single, ite_and]
1,026
leanexplore_declaration
leanexplore:378123
leanexplore_sqlite
leanexplore_declarations
/-- Proves that `MatrixMap.choi_matrix` and `MatrixMap.of_choi_matrix` inverses. -/ @[simp] theorem choi_map_inv (M : MatrixMap A B R) : of_choi_matrix (choi_matrix M) = M := by -- By definition of `MatrixMap.of_choi_matrix`, we know that applying it to the Choi matrix of `M` reconstructs `M`. ext X b₁ b₂; simp [Ma...
227
leanexplore_declaration
leanexplore:378124
leanexplore_sqlite
leanexplore_declarations
/-- The correspondence induced by `MatrixMap.of_choi_matrix` is injective. -/ theorem choi_matrix_inj : Function.Injective (@choi_matrix A B R _ _) := by intro _ _ h simpa only [choi_map_inv] using congrArg of_choi_matrix h
348
leanexplore_declaration
leanexplore:378125
leanexplore_sqlite
leanexplore_declarations
/-- The linear equivalence between linear maps of matrices,and Choi matrices.-/ @[simps] def choi_equiv : MatrixMap A B R ≃ₗ[R] Matrix (B × A) (B × A) R where toFun := choi_matrix invFun := of_choi_matrix left_inv _ := by simp right_inv _ := by simp map_add' _ _ := by ext; simp [choi_matrix] map_smul' _ _ :...
101
leanexplore_declaration
leanexplore:378126
leanexplore_sqlite
leanexplore_declarations
@[simps] def choi_equiv : MatrixMap A B R ≃ₗ[R] Matrix (B × A) (B × A) R where toFun := choi_matrix
348
leanexplore_declaration
leanexplore:378128
leanexplore_sqlite
leanexplore_declarations
/-- The linear equivalence between MatrixMap's and transfer matrices on a larger space. Compare with `MatrixMap.choi_matrix`, which gives the Choi matrix instead of the transfer matrix. -/ noncomputable def toMatrix [Fintype B] : MatrixMap A B R ≃ₗ[R] Matrix (B × B) (A × A) R := LinearMap.toMatrix (Matrix.stdBasis R ...
306
leanexplore_declaration
leanexplore:378129
leanexplore_sqlite
leanexplore_declarations
/-- Multiplication of transfer matrices, `MatrixMap.toMatrix`, is equivalent to composition of maps. -/ theorem toMatrix_comp [Fintype B] [Fintype C] [DecidableEq B] (M₁ : MatrixMap A B R) (M₂ : MatrixMap B C R) : toMatrix (M₂ ∘ₗ M₁) = (toMatrix M₂) * (toMatrix M₁) := LinearMap.toMatrix_comp _ _ _ M₂ M₁
389
leanexplore_declaration
leanexplore:378130
leanexplore_sqlite
leanexplore_declarations
/-- Construct a matrix map out of families of matrices M N : Σ → Matrix B A R indexed by κ via X ↦ ∑ k : κ, (M k) * X * (N k)ᴴ -/ def of_kraus (M N : κ → Matrix B A R) : MatrixMap A B R := ∑ k : κ, { toFun X := M k * X * (N k).conjTranspose map_add' x y := by rw [Matrix.mul_add, Matrix.add_mul] map_smul' ...
109
leanexplore_declaration
leanexplore:378131
leanexplore_sqlite
leanexplore_declarations
def exists_kraus (Φ : MatrixMap A B R) : ∃ r : ℕ, ∃ (M N : Fin r → Matrix B A R), Φ = of_kraus M N := sorry
266
leanexplore_declaration
leanexplore:378132
leanexplore_sqlite
leanexplore_declarations
/-- The `MatrixMap` corresponding to applying a `submatrix` operation on each side. -/ @[simps] def submatrix (f : B → A) : MatrixMap A B R where toFun x := x.submatrix f f map_add' := by simp [Matrix.submatrix_add] map_smul' := by simp [Matrix.submatrix_smul]
87
leanexplore_declaration
leanexplore:378133
leanexplore_sqlite
leanexplore_declarations
@[simps] def submatrix (f : B → A) : MatrixMap A B R where toFun x := x.submatrix f f
80
leanexplore_declaration
leanexplore:378134
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem submatrix_id : submatrix R _root_.id = id A R := by ext1; simp
132
leanexplore_declaration
leanexplore:378135
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem submatrix_comp (f : C → B) (g : B → A) : submatrix R f ∘ₗ submatrix R g = submatrix R (g ∘ f) := by ext1; simp
745
leanexplore_declaration
leanexplore:378136
leanexplore_sqlite
leanexplore_declarations
/-- The Kronecker product of MatrixMaps. Defined here using `TensorProduct.map M₁ M₂`, with appropriate reindexing operations and `LinearMap.toMatrix`/`Matrix.toLin`. Notation `⊗ₖₘ`. -/ noncomputable def kron [CommSemiring R] (M₁ : MatrixMap A B R) (M₂ : MatrixMap C D R) : MatrixMap (A × C) (B × D) R := let h₁ := (Li...
54
leanexplore_declaration
leanexplore:378137
leanexplore_sqlite
leanexplore_declarations
scoped[MatrixMap] infixl:100 " ⊗ₖₘ " => MatrixMap.kron
3,637
leanexplore_declaration
leanexplore:378138
leanexplore_sqlite
leanexplore_declarations
/-- The extensional definition of the Kronecker product `MatrixMap.kron`, in terms of the entries of its image. -/ theorem kron_def [CommSemiring R] (M₁ : MatrixMap A B R) (M₂ : MatrixMap C D R) (M : Matrix (A × C) (A × C) R) : (M₁ ⊗ₖₘ M₂) M (b₁, d₁) (b₂, d₂) = ∑ a₁, ∑ a₂, ∑ c₁, ∑ c₂, (M₁ (Matrix.single a₁ a₂...
184
leanexplore_declaration
leanexplore:378139
leanexplore_sqlite
leanexplore_declarations
theorem add_kron (ML₁ ML₂ : MatrixMap A B R) (MR : MatrixMap C D R) : (ML₁ + ML₂) ⊗ₖₘ MR = ML₁ ⊗ₖₘ MR + ML₂ ⊗ₖₘ MR := by simp [kron, TensorProduct.map_add_left, Matrix.submatrix_add]
186
leanexplore_declaration
leanexplore:378140
leanexplore_sqlite
leanexplore_declarations
theorem kron_add (ML : MatrixMap A B R) (MR₁ MR₂ : MatrixMap C D R) : ML ⊗ₖₘ (MR₁ + MR₂) = ML ⊗ₖₘ MR₁ + ML ⊗ₖₘ MR₂ := by simp [kron, TensorProduct.map_add_right, Matrix.submatrix_add]
179
leanexplore_declaration
leanexplore:378141
leanexplore_sqlite
leanexplore_declarations
theorem smul_kron (r : R) (ML : MatrixMap A B R) (MR : MatrixMap C D R) : (r • ML) ⊗ₖₘ MR = r • (ML ⊗ₖₘ MR) := by simp [kron, TensorProduct.map_smul_left, Matrix.submatrix_smul]
180
leanexplore_declaration
leanexplore:378142
leanexplore_sqlite
leanexplore_declarations
theorem kron_smul (r : R) (ML : MatrixMap A B R) (MR : MatrixMap C D R) : ML ⊗ₖₘ (r • MR) = r • (ML ⊗ₖₘ MR) := by simp [kron, TensorProduct.map_smul_right, Matrix.submatrix_smul]
103
leanexplore_declaration
leanexplore:378143
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem zero_kron (MR : MatrixMap C D R) : (0 : MatrixMap A B R) ⊗ₖₘ MR = 0 := by simp [kron]
103
leanexplore_declaration
leanexplore:378144
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem kron_zero (ML : MatrixMap A B R) : ML ⊗ₖₘ (0 : MatrixMap C D R) = 0 := by simp [kron]
75
leanexplore_declaration
leanexplore:378145
leanexplore_sqlite
leanexplore_declarations
theorem kron_id_id : (id A R ⊗ₖₘ id B R) = id (A × B) R := by simp [kron]
416
leanexplore_declaration
leanexplore:378146
leanexplore_sqlite
leanexplore_declarations
/-- For maps L₁, L₂, R₁, and R₂, the product (L₂ ∘ₗ L₁) ⊗ₖₘ (R₂ ∘ₗ R₁) = (L₂ ⊗ₖₘ R₂) ∘ₗ (L₁ ⊗ₖₘ R₁) -/ theorem kron_comp_distrib (L₁ : MatrixMap Dl₁ Dl₂ R) (L₂ : MatrixMap Dl₂ Dl₃ R) (R₁ : MatrixMap Dr₁ Dr₂ R) (R₂ : MatrixMap Dr₂ Dr₃ R) : (L₂ ∘ₗ L₁) ⊗ₖₘ (R₂ ∘ₗ R₁) = (L₂ ⊗ₖₘ R₂) ∘ₗ (L₁ ⊗ₖₘ R₁) := by simp [kron, Te...
1,709
leanexplore_declaration
leanexplore:378147
leanexplore_sqlite
leanexplore_declarations
/-- The operational definition of the Kronecker product `MatrixMap.kron`, that it maps a Kronecker product of inputs to the Kronecker product of outputs. It is the unique bilinear map doing so. -/ theorem kron_map_of_kron_state [CommRing R] (M₁ : MatrixMap A B R) (M₂ : MatrixMap C D R) (MA : Matrix A A R) (MC : Matrix ...
890
leanexplore_declaration
leanexplore:378148
leanexplore_sqlite
leanexplore_declarations
theorem choi_matrix_state_rep {B : Type*} [Fintype B] [Nonempty A] (M : MatrixMap A B ℂ) : M.choi_matrix = (↑(Fintype.card (α := A)) : ℂ) • (M ⊗ₖₘ (LinearMap.id : MatrixMap A A ℂ)) (MState.pure (Ket.MES A)).m := by ext i j simp [choi_matrix, kron_def M, Ket.MES, Ket.apply, Finset.mul_sum] conv => rhs ...
216
leanexplore_declaration
leanexplore:378149
leanexplore_sqlite
leanexplore_declarations
theorem submatrix_kron_submatrix [CommSemiring R] (f : B → A) (g : D → C) : submatrix R f ⊗ₖₘ submatrix R g = submatrix R (Prod.map f g) := by ext m i j rw [kron_def] simp [Prod.map, Matrix.single, ite_and]
164
leanexplore_declaration
leanexplore:378150
leanexplore_sqlite
leanexplore_declarations
theorem submatrix_kron_id [CommSemiring R] (f : B → A) : submatrix R f ⊗ₖₘ id C R = submatrix R (Prod.map f _root_.id) := by simp [← submatrix_kron_submatrix]
164
leanexplore_declaration
leanexplore:378151
leanexplore_sqlite
leanexplore_declarations
theorem id_kron_submatrix [CommSemiring R] (f : B → A) : id C R ⊗ₖₘ submatrix R f = submatrix R (Prod.map _root_.id f) := by simp [← submatrix_kron_submatrix]
434
leanexplore_declaration
leanexplore:378152
leanexplore_sqlite
leanexplore_declarations
/-- Like `Basis.tensorProduct`, but for `PiTensorProduct` -/ noncomputable opaque _root_.Module.Basis.piTensorProduct [∀i, Fintype (L i)] (b : (i:ι) → Module.Basis (L i) R (s i)) : Module.Basis ((i:ι) → L i) R (PiTensorProduct R s) := --Marking as opaque so that ATPs don't run into unpacking the sorried dat...
884
leanexplore_declaration
leanexplore:378153
leanexplore_sqlite
leanexplore_declarations
/-- Finite Pi-type tensor product of MatrixMaps. Defined as `PiTensorProduct.tprod` of the underlying Linear maps. Notation `⨂ₜₘ[R] i, f i`, eventually. -/ noncomputable def piProd (Λi : ∀ i, MatrixMap (dI i) (dO i) R) : MatrixMap (∀i, dI i) (∀i, dO i) R := let map₁ := PiTensorProduct.map Λi; let map₂ := LinearMap....
525
leanexplore_declaration
leanexplore:378154
leanexplore_sqlite
leanexplore_declarations
/-- Composition of `MatrixMap.piProd` maps distributes over the tensor product. -/ theorem piProd_comp {d₁ d₂ d₃ : ι → Type*} [∀ i, Fintype (d₁ i)] [∀ i, DecidableEq (d₁ i)] [∀ i, Fintype (d₂ i)] [∀ i, DecidableEq (d₂ i)] [∀ i, Fintype (d₃ i)] [∀ i, DecidableEq (d₃ i)] (Λ₁ : ∀ i, MatrixMap (d₁ i) (d₂ i) R) (Λ...
198
leanexplore_declaration
leanexplore:378155
leanexplore_sqlite
leanexplore_declarations
/-- A linear matrix map is *trace preserving* if trace of the output equals trace of the input. -/ def IsTracePreserving (M : MatrixMap A B R) : Prop := ∀ (x : Matrix A A R), (M x).trace = x.trace
1,015
leanexplore_declaration
leanexplore:378156
leanexplore_sqlite
leanexplore_declarations
/-- A map is trace preserving iff the partial trace of the Choi matrix is the identity. -/ theorem IsTracePreserving_iff_trace_choi [DecidableEq A] (M : MatrixMap A B R) : M.IsTracePreserving ↔ M.choi_matrix.traceLeft = 1 := by constructor · intro h ext a₁ a₂ replace h := h (Matrix.single a₁ a₂ 1) s...
213
leanexplore_declaration
leanexplore:378157
leanexplore_sqlite
leanexplore_declarations
/-- Simp lemma: the trace of the image of a IsTracePreserving map is the same as the original trace. -/ @[simp] theorem apply_trace (h : M.IsTracePreserving) (ρ : Matrix A A R) : (M ρ).trace = ρ.trace := h ρ
322
leanexplore_declaration
leanexplore:378158
leanexplore_sqlite
leanexplore_declarations
/-- The trace of a Choi matrix of a TP map is the cardinality of the input space. -/ theorem trace_choi [DecidableEq A] (h : M.IsTracePreserving) : M.choi_matrix.trace = (Finset.univ (α := A)).card := by rw [← Matrix.traceLeft_trace, (IsTracePreserving_iff_trace_choi M).mp h, Matrix.trace_one, Finset.card_uni...
212
leanexplore_declaration
leanexplore:378159
leanexplore_sqlite
leanexplore_declarations
/-- The composition of IsTracePreserving maps is also trace preserving. -/ theorem comp (h₁ : M.IsTracePreserving) (h₂ : M₂.IsTracePreserving) : IsTracePreserving (M₂ ∘ₗ M) := by intro x simp [h₂ _, h₁ _]
143
leanexplore_declaration
leanexplore:378160
leanexplore_sqlite
leanexplore_declarations
/-- The identity MatrixMap IsTracePreserving. -/ @[simp] theorem id : (id A R).IsTracePreserving := by simp [IsTracePreserving, MatrixMap.id]
330
leanexplore_declaration
leanexplore:378161
leanexplore_sqlite
leanexplore_declarations
/-- Unit linear combinations of IsTracePreserving maps are IsTracePreserving. -/ theorem unit_linear {M₁ M₂ : MatrixMap A B R} {x y : R} (h₁ : M₁.IsTracePreserving) (h₂ : M₂.IsTracePreserving) (hxy : x + y = 1) : (x • M₁ + y • M₂).IsTracePreserving := by rw [IsTracePreserving] at h₁ h₂ ⊢ simp [h₁, h₂, ← add...
1,209
leanexplore_declaration
leanexplore:378162
leanexplore_sqlite
leanexplore_declarations
/-- The kronecker product of IsTracePreserving maps is also trace preserving. -/ theorem kron {M₁ : MatrixMap A B R} {M₂ : MatrixMap C D R} (h₁ : M₁.IsTracePreserving) (h₂ : M₂.IsTracePreserving) : (M₁ ⊗ₖₘ M₂).IsTracePreserving := by intro x simp_rw [Matrix.trace, Matrix.diag] rw [Fintype.sum_prod_type, Finty...
586
leanexplore_declaration
leanexplore:378163
leanexplore_sqlite
leanexplore_declarations
/-- The channel X ↦ ∑ k : κ, (M k) * X * (N k)ᴴ formed by Kraus operators M, N : κ → Matrix B A R is trace-preserving if ∑ k : κ, (N k)ᴴ * (M k) = 1 -/ theorem of_kraus_isTracePreserving (M N : κ → Matrix B A S) (hTP : (∑ k, (N k).conjTranspose * (M k)) = 1) : (MatrixMap.of_kraus M N).IsTracePreserving := by in...
181
leanexplore_declaration
leanexplore:378164
leanexplore_sqlite
leanexplore_declarations
/-- `MatrixMap.submatrix` is trace-preserving when the function is an equivalence. -/ theorem submatrix (e : A ≃ B) : (MatrixMap.submatrix R e).IsTracePreserving := by intro; simp
121
leanexplore_declaration
leanexplore:378165
leanexplore_sqlite
leanexplore_declarations
/-- A linear matrix map is *unital* if it preserves the identity. -/ def Unital (M : MatrixMap A B R) : Prop := M 1 = 1
53
leanexplore_declaration
leanexplore:378166
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem map_1 (h : M.Unital) : M 1 = 1 := h
117
leanexplore_declaration
leanexplore:378167
leanexplore_sqlite
leanexplore_declarations
/-- The identity `MatrixMap` is `Unital`. -/ @[simp] theorem id : (id A R).Unital := by simp [Unital, MatrixMap.id]
203
leanexplore_declaration
leanexplore:378168
leanexplore_sqlite
leanexplore_declarations
/-- A linear matrix map is *Hermitian preserving* if it maps `IsHermitian` matrices to `IsHermitian`.-/ def IsHermitianPreserving (M : MatrixMap A B R) : Prop := ∀⦃x⦄, x.IsHermitian → (M x).IsHermitian
200
leanexplore_declaration
leanexplore:378169
leanexplore_sqlite
leanexplore_declarations
/-- A linear matrix map is *positive* if it maps `PosSemidef` matrices to `PosSemidef`.-/ def IsPositive [Fintype A] [Fintype B] (M : MatrixMap A B R) : Prop := ∀⦃x⦄, x.PosSemidef → (M x).PosSemidef
292
leanexplore_declaration
leanexplore:378170
leanexplore_sqlite
leanexplore_declarations
/-- A linear matrix map is *completely positive* if, for any integer n, the tensor product with `I(n)` is positive. -/ def IsCompletelyPositive [Fintype A] [Fintype B] [DecidableEq A] (M : MatrixMap A B R) : Prop := ∀ (n : ℕ), (M ⊗ₖₘ (LinearMap.id : MatrixMap (Fin n) (Fin n) R)).IsPositive
102
leanexplore_declaration
leanexplore:378171
leanexplore_sqlite
leanexplore_declarations
/-- The identity MatrixMap IsHermitianPreserving. -/ theorem id : (id A R).IsPositive := fun _ h ↦ h
269
leanexplore_declaration
leanexplore:378172
leanexplore_sqlite
leanexplore_declarations
/-- The composition of IsHermitianPreserving maps is also Hermitian preserving. -/ theorem comp {M₁ : MatrixMap A B R} {M₂ : MatrixMap B C R} (h₁ : M₁.IsHermitianPreserving) (h₂ : M₂.IsHermitianPreserving) : IsHermitianPreserving (M₂ ∘ₗ M₁) := fun _ h ↦ h₂ (h₁ h)
510
leanexplore_declaration
leanexplore:378173
leanexplore_sqlite
leanexplore_declarations
theorem IsHermitianPreserving {M : MatrixMap A B R} (hM : IsPositive M) : IsHermitianPreserving M := by intro x hx let xH : HermitianMat _ _ := ⟨x, hx⟩ classical --because PosPart requires DecidableEq have hMPos := hM (HermitianMat.zero_le_iff.mp xH.posPart_nonneg) have hMNeg := hM (HermitianMat.zero_le_i...
213
leanexplore_declaration
leanexplore:378174
leanexplore_sqlite
leanexplore_declarations
/-- The composition of IsPositive maps is also positive. -/ theorem comp {M₁ : MatrixMap A B R} {M₂ : MatrixMap B C R} (h₁ : M₁.IsPositive) (h₂ : M₂.IsPositive) : IsPositive (M₂ ∘ₗ M₁) := fun _ h ↦ h₂ (h₁ h)
99
leanexplore_declaration
leanexplore:378175
leanexplore_sqlite
leanexplore_declarations
/-- The identity MatrixMap IsPositive. -/ @[simp] theorem id : (id A R).IsPositive := fun _ h ↦ h
204
leanexplore_declaration
leanexplore:378176
leanexplore_sqlite
leanexplore_declarations
/-- Sums of IsPositive maps are IsPositive. -/ theorem add {M₁ M₂ : MatrixMap A B R} (h₁ : M₁.IsPositive) (h₂ : M₂.IsPositive) : (M₁ + M₂).IsPositive := fun _ h ↦ Matrix.PosSemidef.add (h₁ h) (h₂ h)
193
leanexplore_declaration
leanexplore:378177
leanexplore_sqlite
leanexplore_declarations
/-- Nonnegative scalings of IsPositive maps are IsPositive. -/ theorem smul {M : MatrixMap A B R} (hM : M.IsPositive) {x : R} (hx : 0 ≤ x) : (x • M).IsPositive := fun _ h ↦ (hM h).smul hx
1,387
leanexplore_declaration
leanexplore:378178
leanexplore_sqlite
leanexplore_declarations
/-- Definition of a CP map, but with `Fintype T` in the definition instead of a `Fin n`. -/ theorem of_Fintype {M : MatrixMap A B R} (h : IsCompletelyPositive M) (T : Type*) [Fintype T] [DecidableEq T] : (M.kron (LinearMap.id : MatrixMap T T R)).IsPositive := by obtain ⟨n, ⟨e⟩⟩ : ∃ n : ℕ, Nonempty (T ≃ Fin n...
928
leanexplore_declaration
leanexplore:378179
leanexplore_sqlite
leanexplore_declarations
theorem IsPositive {M : MatrixMap A B R} (hM : IsCompletelyPositive M) : IsPositive M := by intro x hx let x' : Matrix (A × Fin 1) (A × Fin 1) R := x ⊗ₖ 1 let eqA : (A × Fin 1) ≃ A := (Equiv.prodCongrRight (fun _ ↦ finOneEquiv)).trans (Equiv.prodPUnit A) let eqB : (B × Fin 1) ≃ B := (Equiv.prodCongr...
536
leanexplore_declaration
leanexplore:378180
leanexplore_sqlite
leanexplore_declarations
/-- The composition of IsCompletelyPositive maps is also completely positive. -/ theorem comp [DecidableEq B] {M₁ : MatrixMap A B R} {M₂ : MatrixMap B C R} (h₁ : M₁.IsCompletelyPositive) (h₂ : M₂.IsCompletelyPositive) : IsCompletelyPositive (M₂ ∘ₗ M₁) := by --sketch: (M₂ ∘ₗ M₁) ⊗ₖₘ id[n] = (M₂ ⊗ₖₘ id[n]) ∘ₗ (M₁ ⊗...
194
leanexplore_declaration
leanexplore:378181
leanexplore_sqlite
leanexplore_declarations
/-- The identity MatrixMap IsCompletelyPositive. -/ @[simp] theorem id : (id A R).IsCompletelyPositive := by intro n ρ h rwa [show LinearMap.id = MatrixMap.id (Fin n) R from rfl, kron_id_id]
293
leanexplore_declaration
leanexplore:378182
leanexplore_sqlite
leanexplore_declarations
/-- Sums of IsCompletelyPositive maps are IsCompletelyPositive. -/ theorem add {M₁ M₂ : MatrixMap A B R} (h₁ : M₁.IsCompletelyPositive) (h₂ : M₂.IsCompletelyPositive) : (M₁ + M₂).IsCompletelyPositive := fun n _ h ↦ by simpa only [add_kron] using Matrix.PosSemidef.add (h₁ n h) (h₂ n h)
283
leanexplore_declaration
leanexplore:378183
leanexplore_sqlite
leanexplore_declarations
/-- Nonnegative scalings of `IsCompletelyPositive` maps are `IsCompletelyPositive`. -/ theorem smul {M : MatrixMap A B R} (hM : M.IsCompletelyPositive) {x : R} (hx : 0 ≤ x) : (x • M).IsCompletelyPositive := fun n ρ h ↦ by rw [MatrixMap.smul_kron] exact (hM n h).smul hx
156
leanexplore_declaration
leanexplore:378184
leanexplore_sqlite
leanexplore_declarations
/-- The zero map `IsCompletelyPositive`. -/ theorem zero : (0 : MatrixMap A B R).IsCompletelyPositive := fun _ _ _ ↦ by simpa using Matrix.PosSemidef.zero
286
leanexplore_declaration
leanexplore:378185
leanexplore_sqlite
leanexplore_declarations
/-- A finite sum of completely positive maps is completely positive. -/ theorem finset_sum {ι : Type*} [Fintype ι] {m : ι → MatrixMap A B R} (hm : ∀ i, (m i).IsCompletelyPositive) : (∑ i, m i).IsCompletelyPositive := Finset.sum_induction m _ (fun _ _ ↦ add) (.zero A B) (by simpa)
2,456
leanexplore_declaration
leanexplore:378186
leanexplore_sqlite
leanexplore_declarations
/-- The map that takes M and returns M ⊗ₖ C, where C is positive semidefinite, is a completely positive map. -/ theorem kron_kronecker_const {C : Matrix d d R} (h : C.PosSemidef) {h₁ h₂ : _} : IsCompletelyPositive (⟨⟨fun M => M ⊗ₖ C, h₁⟩, h₂⟩ : MatrixMap A (A × d) R) := by intros n x hx have h_kronecker_pos : (...
1,105
leanexplore_declaration
leanexplore:378187
leanexplore_sqlite
leanexplore_declarations
theorem choi_of_kraus (K : κ → Matrix B A 𝕜) : (MatrixMap.of_kraus K K).choi_matrix = ∑ k, Matrix.vecMulVec (fun (x : B × A) => K k x.1 x.2) (fun (x : B × A) => star (K k x.1 x.2)) := by -- By definition of Choi matrix, we can expand the left-hand side using the linearity of the map and the properties of the Cho...
325
leanexplore_declaration
leanexplore:378188
leanexplore_sqlite
leanexplore_declarations
/-- The linear map of conjugating a matrix by another, `x → y * x * yᴴ`. -/ @[simps] def _root_.MatrixMap.conj (y : Matrix B A R) : MatrixMap A B R where toFun x := y * x * y.conjTranspose map_add' x y := by rw [Matrix.mul_add, Matrix.add_mul] map_smul' r x := by rw [RingHom.id_apply, Matrix.mul_smul, Matrix.smul...
114
leanexplore_declaration
leanexplore:378189
leanexplore_sqlite
leanexplore_declarations
@[simps] def _root_.MatrixMap.conj (y : Matrix B A R) : MatrixMap A B R where toFun x := y * x * y.conjTranspose
122
leanexplore_declaration
leanexplore:378190
leanexplore_sqlite
leanexplore_declarations
theorem conj_isPositive (M : Matrix B A 𝕜) : (conj M).IsPositive := by exact fun X hX => hX.mul_mul_conjTranspose_same M
702
leanexplore_declaration
leanexplore:378191
leanexplore_sqlite
leanexplore_declarations
theorem IsPositive_sum {ι : Type*} [Fintype ι] (f : ι → MatrixMap A B ℂ) (h : ∀ i, (f i).IsPositive) : (∑ i, f i).IsPositive := by intro X hX; replace hX : ∀ i, ((f i) X).PosSemidef := fun i => h i hX; simp [Matrix.posSemidef_iff_dotProduct_mulVec, Matrix.IsHermitian] at hX ⊢ simp [Matrix.conjTranspose_sum,...
167
leanexplore_declaration
leanexplore:378192
leanexplore_sqlite
leanexplore_declarations
theorem of_kraus_isPositive (K : κ → Matrix B A ℂ) : (of_kraus K K).IsPositive := by rw [of_kraus] apply IsPositive_sum intro k exact conj_isPositive (K k)
2,499
leanexplore_declaration
leanexplore:378193
leanexplore_sqlite
leanexplore_declarations
theorem conj_kron (M : Matrix B A 𝕜) (N : Matrix D C 𝕜) [DecidableEq C] : conj M ⊗ₖₘ conj N = conj (M ⊗ₖ N) := by apply LinearMap.ext intro x have h_eq : ∀ (X : Matrix A A 𝕜) (Y : Matrix C C 𝕜), (conj M ⊗ₖₘ conj N) (X ⊗ₖ Y) = (conj (Matrix.kroneckerMap (fun x1 x2 => x1 * x2) M N)) (X ⊗ₖ Y) := by intro...
101
leanexplore_declaration
leanexplore:378194
leanexplore_sqlite
leanexplore_declarations
theorem congruence_one_eq_id : conj (1 : Matrix A A ℂ) = MatrixMap.id A ℂ := by ext x simp [conj]
488
leanexplore_declaration
leanexplore:378195
leanexplore_sqlite
leanexplore_declarations
theorem congruence_CP {A B : Type*} [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B] (M : Matrix B A 𝕜) : (conj M).IsCompletelyPositive := by intro n; -- The tensor product of congruence maps is a congruence map. have h_tensor_congruence : conj M ⊗ₖₘ LinearMap.id = conj (M ⊗ₖ (1 : Matrix (Fin n) (Fin n) �...
220
leanexplore_declaration
leanexplore:378196
leanexplore_sqlite
leanexplore_declarations
theorem IsCompletelyPositive_sum {ι : Type*} [Fintype ι] (f : ι → MatrixMap A B ℂ) (h : ∀ i, (f i).IsCompletelyPositive) : (∑ i, f i).IsCompletelyPositive := by convert IsCompletelyPositive.finset_sum h using 1
134
leanexplore_declaration
leanexplore:378197
leanexplore_sqlite
leanexplore_declarations
theorem of_kraus_eq_sum_conj (K : κ → Matrix B A 𝕜) : of_kraus K K = ∑ k, conj (K k) := by ext simp [MatrixMap.of_kraus, conj]
748
leanexplore_declaration
leanexplore:378198
leanexplore_sqlite
leanexplore_declarations
theorem of_kraus_CP (K : κ → Matrix B A 𝕜) : (of_kraus K K).IsCompletelyPositive := by -- By definition of `MatrixMap.of_kraus`, we know that it is a sum of congruence maps. have h_sum_congruence : MatrixMap.of_kraus K K = ∑ k, conj (K k) := by -- By definition of `MatrixMap.of_kraus`, we know that it is equal...
614
leanexplore_declaration
leanexplore:378199
leanexplore_sqlite
leanexplore_declarations
theorem exists_kraus_of_choi_PSD (C : Matrix (B × A) (B × A) 𝕜) (hC : C.PosSemidef) : ∃ (K : (B × A) → Matrix B A 𝕜), C = (MatrixMap.of_kraus K K).choi_matrix := by classical use fun k i j => ( hC.1.eigenvectorUnitary.val : Matrix _ _ 𝕜 ) (i, j) k * ( hC.1.eigenvalues k |> RCLike.ofReal |> Real.sqrt) c...
681
leanexplore_declaration
leanexplore:378200
leanexplore_sqlite
leanexplore_declarations
theorem choi_matrix_eq_map_proj (M : MatrixMap A B R) : M.choi_matrix = (M ⊗ₖₘ MatrixMap.id A R) (Matrix.vecMulVec (fun (x : A × A) => if x.1 = x.2 then 1 else 0) (fun (x : A × A) => star (if x.1 = x.2 then 1 else 0))) := by have h_choi : ∀ (M : MatrixMap A B R), MatrixMap.kron M (MatrixMap.id A R) (Matrix.vecMul...
548
leanexplore_declaration
leanexplore:378201
leanexplore_sqlite
leanexplore_declarations
/-- Choi's theorem on completely positive maps: A map `IsCompletelyPositive` iff its Choi Matrix is PSD. -/ theorem choi_PSD_iff_CP_map (M : MatrixMap A B R) : M.IsCompletelyPositive ↔ M.choi_matrix.PosSemidef := by constructor · intro hcp have := MatrixMap.IsCompletelyPositive.of_Fintype hcp A rw [ Mat...
173
leanexplore_declaration
leanexplore:378202
leanexplore_sqlite
leanexplore_declarations
theorem conj_eq_mulRightLinearMap_comp_mulRightLinearMap (y : Matrix B A R) : conj y = mulRightLinearMap B R y.conjTranspose ∘ₗ mulLeftLinearMap A R y := by ext1; simp
3,440
leanexplore_declaration
leanexplore:378203
leanexplore_sqlite
leanexplore_declarations
/-- The act of conjugating (not necessarily by a unitary, just by any matrix at all) is completely positive. -/ theorem conj_isCompletelyPositive (M : Matrix B A R) : (conj M).IsCompletelyPositive := by --TODO: This is identical to congruence_CP intro n m h classical open ComplexOrder in open Kronecker in s...