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 |
|---|---|---|---|---|---|
1,273 | leanexplore_declaration | leanexplore:377900 | leanexplore_sqlite | leanexplore_declarations | @[fun_prop]
theorem Continuous_negLog : Continuous negLog := by
--Thanks Aristotle
have h_cont_at_zero : ContinuousAt —log 0 := by
unfold Prob.negLog
rw [ContinuousAt, if_pos rfl, ENNReal.tendsto_nhds_top_iff_nnreal]
intro x
rw [Metric.eventually_nhds_iff]
use Real.exp (-x), by positivity
ri... |
337 | leanexplore_declaration | leanexplore:377901 | leanexplore_sqlite | leanexplore_declarations | /-- A ket as a vector of unit norm. We follow the convention in `Matrix` of vectors as simple functions
from a Fintype. Kets are distinctly not a vector space in our notion, as they represent only normalized
states and so cannot (in general) be added or scaled. -/
structure Ket where
vec : d → ℂ
normalized' : ∑ x... |
254 | leanexplore_declaration | leanexplore:377902 | leanexplore_sqlite | leanexplore_declarations | /-- A bra is identical in definition to a `Ket`, but are separate to avoid complex conjugation confusion.
They can be interconverted with the adjoint: `Ket.to_bra` and `Bra.to_ket` -/
structure Bra where
vec : d → ℂ
normalized' : ∑ x, ‖vec x‖ ^ 2 =1 |
47 | leanexplore_declaration | leanexplore:377903 | leanexplore_sqlite | leanexplore_declarations | scoped notation:max "〈" ψ:90 "∣" => (ψ : Bra _) |
47 | leanexplore_declaration | leanexplore:377904 | leanexplore_sqlite | leanexplore_declarations | scoped notation:max "∣" ψ:90 "〉" => (ψ : Ket _) |
116 | leanexplore_declaration | leanexplore:377905 | leanexplore_sqlite | leanexplore_declarations | instance instFunLikeKet : FunLike (Ket d) d ℂ where
coe ψ := ψ.vec
coe_injective' _ _ h := by rwa [Ket.mk.injEq] |
68 | leanexplore_declaration | leanexplore:377906 | leanexplore_sqlite | leanexplore_declarations | lemma _root_.Ket.coe_fun_eq (ψ : Ket d) : (ψ : d → ℂ) = ψ.vec := rfl |
116 | leanexplore_declaration | leanexplore:377907 | leanexplore_sqlite | leanexplore_declarations | instance instFunLikeBra : FunLike (Bra d) d ℂ where
coe ψ := ψ.vec
coe_injective' _ _ h := by rwa [Bra.mk.injEq] |
68 | leanexplore_declaration | leanexplore:377908 | leanexplore_sqlite | leanexplore_declarations | lemma _root_.Bra.coe_fun_eq (ψ : Bra d) : (ψ : d → ℂ) = ψ.vec := rfl |
57 | leanexplore_declaration | leanexplore:377909 | leanexplore_sqlite | leanexplore_declarations | def dot (ξ : Bra d) (ψ : Ket d) : ℂ := ∑ x, (ξ x) * (ψ x) |
68 | leanexplore_declaration | leanexplore:377910 | leanexplore_sqlite | leanexplore_declarations | scoped notation "〈" ξ:90 "‖" ψ:90 "〉" => dot (ξ : Bra _) (ψ : Ket _) |
93 | leanexplore_declaration | leanexplore:377911 | leanexplore_sqlite | leanexplore_declarations | theorem dot_eq_dotProduct (ψ : Bra d) (φ : Ket d) :〈ψ‖φ〉= dotProduct (m := d) ψ φ := by
rfl |
62 | leanexplore_declaration | leanexplore:377912 | leanexplore_sqlite | leanexplore_declarations | theorem Ket.apply (ψ : Ket d) (i : d) : ψ i = ψ.vec i :=
rfl |
62 | leanexplore_declaration | leanexplore:377913 | leanexplore_sqlite | leanexplore_declarations | theorem Bra.apply (ψ : Bra d) (i : d) : ψ i = ψ.vec i :=
rfl |
89 | leanexplore_declaration | leanexplore:377914 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem Ket.ext {ξ ψ : Ket d} (h : ∀ x, ξ x = ψ x) : ξ = ψ :=
DFunLike.ext ξ ψ h |
68 | leanexplore_declaration | leanexplore:377915 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem Ket.ext {ξ ψ : Ket d} (h : ∀ x, ξ x = ψ x) : ξ = ψ := |
89 | leanexplore_declaration | leanexplore:377916 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem Bra.ext {ξ ψ : Bra d} (h : ∀ x, ξ x = ψ x) : ξ = ψ :=
DFunLike.ext ξ ψ h |
68 | leanexplore_declaration | leanexplore:377917 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem Bra.ext {ξ ψ : Bra d} (h : ∀ x, ξ x = ψ x) : ξ = ψ := |
135 | leanexplore_declaration | leanexplore:377918 | leanexplore_sqlite | leanexplore_declarations | theorem Ket.normalized (ψ : Ket d) : ∑ x, Complex.normSq (ψ x) = 1 := by
convert ψ.normalized'
rw [Complex.normSq_eq_norm_sq]
rfl |
135 | leanexplore_declaration | leanexplore:377919 | leanexplore_sqlite | leanexplore_declarations | theorem Bra.normalized (ψ : Bra d) : ∑ x, Complex.normSq (ψ x) = 1 := by
convert ψ.normalized'
rw [Complex.normSq_eq_norm_sq]
rfl |
144 | leanexplore_declaration | leanexplore:377920 | leanexplore_sqlite | leanexplore_declarations | /-- Any Bra can be turned into a Ket by conjugating the elements. -/
@[coe]
def Ket.to_bra (ψ : Ket d) : Bra d :=
⟨conj ψ, by simpa using ψ.2⟩ |
144 | leanexplore_declaration | leanexplore:377921 | leanexplore_sqlite | leanexplore_declarations | /-- Any Ket can be turned into a Bra by conjugating the elements. -/
@[coe]
def Bra.to_ket (ψ : Bra d) : Ket d :=
⟨conj ψ, by simpa using ψ.2⟩ |
59 | leanexplore_declaration | leanexplore:377922 | leanexplore_sqlite | leanexplore_declarations | instance instBraOfKet : Coe (Ket d) (Bra d) := ⟨Ket.to_bra⟩ |
59 | leanexplore_declaration | leanexplore:377923 | leanexplore_sqlite | leanexplore_declarations | instance instKetOfBra : Coe (Bra d) (Ket d) := ⟨Bra.to_ket⟩ |
78 | leanexplore_declaration | leanexplore:377924 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem Bra.eq_conj (ψ : Ket d) (x : d) :〈ψ∣ x = conj (∣ψ〉 x) :=
rfl |
72 | leanexplore_declaration | leanexplore:377925 | leanexplore_sqlite | leanexplore_declarations | theorem Bra.apply' (ψ : Ket d) (i : d) : 〈ψ∣ i = conj (ψ.vec i) :=
rfl |
353 | leanexplore_declaration | leanexplore:377926 | leanexplore_sqlite | leanexplore_declarations | theorem Ket.exists_ne_zero (ψ : Ket d) : ∃ x, ψ x ≠ 0 := by
have hzerolt : ∑ x : d, Complex.normSq (ψ x) > ∑ x : d, 0 := by rw [ψ.normalized, Finset.sum_const_zero]; exact zero_lt_one
have hpos : ∃ x ∈ Finset.univ, 0 < Complex.normSq (ψ x) := Finset.exists_lt_of_sum_lt hzerolt
obtain ⟨x, _, hpos⟩ := hpos
rw [Co... |
353 | leanexplore_declaration | leanexplore:377927 | leanexplore_sqlite | leanexplore_declarations | theorem Bra.exists_ne_zero (ψ : Bra d) : ∃ x, ψ x ≠ 0 := by
have hzerolt : ∑ x : d, Complex.normSq (ψ x) > ∑ x : d, 0 := by rw [ψ.normalized, Finset.sum_const_zero]; exact zero_lt_one
have hpos : ∃ x ∈ Finset.univ, 0 < Complex.normSq (ψ x) := Finset.exists_lt_of_sum_lt hzerolt
obtain ⟨x, _, hpos⟩ := hpos
rw [Co... |
796 | leanexplore_declaration | leanexplore:377928 | leanexplore_sqlite | leanexplore_declarations | /-- Create a ket out of a vector given it has a nonzero component -/
def Ket.normalize (v : d → ℂ) (h : ∃ x, v x ≠ 0) : Ket d :=
{ vec := fun x ↦ v x / √(∑ x : d, ‖v x‖ ^ 2),
normalized' := by
simp only [← Complex.normSq_eq_norm_sq, Complex.normSq_div,
Complex.normSq_ofReal, ←sq]
have hnonneg ... |
243 | leanexplore_declaration | leanexplore:377929 | leanexplore_sqlite | leanexplore_declarations | /-- A ket is already normalized -/
theorem Ket.normalize_ket_eq_self (ψ : Ket d) : Ket.normalize (ψ.vec) (Ket.exists_ne_zero ψ) = ψ := by
ext x
unfold normalize
simp only [apply, ψ.normalized', Real.sqrt_one, Complex.ofReal_one, div_one] |
794 | leanexplore_declaration | leanexplore:377930 | leanexplore_sqlite | leanexplore_declarations | /-- Create a bra out of a vector given it has a nonzero component -/
def Bra.normalize (v : d → ℂ) (h : ∃ x, v x ≠ 0) : Bra d :=
{ vec := fun x ↦ v x / √(∑ x : d, ‖v x‖ ^ 2),
normalized' := by
simp only [← Complex.normSq_eq_norm_sq, Complex.normSq_div,
Complex.normSq_ofReal, ←sq]
have hnonneg : ... |
239 | leanexplore_declaration | leanexplore:377931 | leanexplore_sqlite | leanexplore_declarations | /-- A bra is already normalized -/
def Bra.normalize_ket_eq_self (ψ : Bra d) : Bra.normalize (ψ.vec) (Bra.exists_ne_zero ψ) = ψ := by
ext x
unfold normalize
simp only [apply, ψ.normalized', Real.sqrt_one, Complex.ofReal_one, div_one] |
356 | leanexplore_declaration | leanexplore:377932 | leanexplore_sqlite | leanexplore_declarations | /-- Ket form by the superposition of all elements in `d`.
Commonly denoted by |+⟩, especially for qubits -/
def uniform_superposition [hdne : Nonempty d] : Ket d := by
let f : d → ℂ := fun _ ↦ 1
have hfnezero : ∃ x, f x ≠ 0 := by
obtain ⟨i⟩ := hdne
use i
simp only [f, ne_eq, one_ne_zero, not_false_eq_tr... |
185 | leanexplore_declaration | leanexplore:377933 | leanexplore_sqlite | leanexplore_declarations | /-- There exists a ket for every nonempty `d`.
Here, we use the uniform superposition -/
instance instInhabited [Nonempty d] : Inhabited (Ket d) where
default := uniform_superposition |
163 | leanexplore_declaration | leanexplore:377934 | leanexplore_sqlite | leanexplore_declarations | /-- Construct the Ket corresponding to a basis vector, with a +1 phase. -/
def Ket.basis (i : d) : Ket d :=
⟨fun j ↦ if i = j then 1 else 0, by simp [apply_ite]⟩ |
163 | leanexplore_declaration | leanexplore:377935 | leanexplore_sqlite | leanexplore_declarations | /-- Construct the Bra corresponding to a basis vector, with a +1 phase. -/
def Bra.basis (i : d) : Bra d :=
⟨fun j ↦ if i = j then 1 else 0, by simp [apply_ite]⟩ |
243 | leanexplore_declaration | leanexplore:377936 | leanexplore_sqlite | leanexplore_declarations | /-- A Bra can be viewed as a function from Ket's to ℂ. -/
instance instFunLikeBraket : FunLike (Bra d) (Ket d) ℂ where
coe ξ := dot ξ
coe_injective' x y h := by
ext i
simpa [Ket.basis, dot, Ket.apply] using congrFun h (Ket.basis i) |
296 | leanexplore_declaration | leanexplore:377937 | leanexplore_sqlite | leanexplore_declarations | /-- The inner product of any state with itself is 1. -/
@[simp]
theorem Braket.dot_self_eq_one (ψ : Ket d) :〈ψ‖ψ〉= 1 := by
have h₁ x : conj (ψ x) * ψ x = Complex.normSq (ψ x) := by
rw [Complex.normSq_eq_conj_mul_self]
simpa [dot, Bra.eq_conj, h₁] using congr(Complex.ofReal $ψ.normalized) |
309 | leanexplore_declaration | leanexplore:377938 | leanexplore_sqlite | leanexplore_declarations | /-- The outer product of two kets, creating an unentangled state. -/
def Ket.prod (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) : Ket (d₁ × d₂) where
vec := fun (i,j) ↦ ψ₁ i * ψ₂ j
normalized' := by
simp [Fintype.sum_prod_type, ← Complex.normSq_eq_norm_sq, mul_pow,
← Finset.mul_sum, ψ₁.normalized, ψ₂.normalized] |
120 | leanexplore_declaration | leanexplore:377940 | leanexplore_sqlite | leanexplore_declarations | /-- A Ket is a product if it's `Ket.prod` of two kets. -/
def Ket.IsProd (ψ : Ket (d₁ × d₂)) : Prop := ∃ ξ φ, ψ = ξ ⊗ᵠ φ |
121 | leanexplore_declaration | leanexplore:377941 | leanexplore_sqlite | leanexplore_declarations | /-- A Ket is entangled if it's not `Ket.prod` of two kets. -/
def Ket.IsEntangled (ψ : Ket (d₁ × d₂)) : Prop := ¬ψ.IsProd |
145 | leanexplore_declaration | leanexplore:377942 | leanexplore_sqlite | leanexplore_declarations | /-- `Ket.prod` states are product states. -/
@[simp]
theorem Ket.IsProd_prod (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) : (ψ₁.prod ψ₂).IsProd :=
⟨ψ₁, ψ₂, rfl⟩ |
176 | leanexplore_declaration | leanexplore:377943 | leanexplore_sqlite | leanexplore_declarations | /-- `Ket.prod` states are not entangled states. -/
@[simp]
theorem Ket.not_IsEntangled_prod (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) : ¬(ψ₁.prod ψ₂).IsEntangled :=
(· (ψ₁.IsProd_prod ψ₂)) |
3,789 | leanexplore_declaration | leanexplore:377944 | leanexplore_sqlite | leanexplore_declarations | /-- A ket is a product state iff its components are cross-multiplicative. -/
theorem Ket.IsProd_iff_mul_eq_mul (ψ : Ket (d₁ × d₂)) : ψ.IsProd ↔
∀ i₁ i₂ j₁ j₂, ψ (i₁,j₁) * ψ (i₂,j₂) = ψ (i₁,j₂) * ψ (i₂,j₁) := by
constructor
· rintro ⟨ξ,φ,rfl⟩ i₁ i₂ j₁ j₂
simp only [prod, apply]
ring_nf
· intro hcrossm... |
407 | leanexplore_declaration | leanexplore:377945 | leanexplore_sqlite | leanexplore_declarations | /-- The Maximally Entangled State, or MES, on a d×d system. In principle there are many, this
is specifically the MES with an all-positive phase. For instance on `d := Fin 2`, this is the
Bell state. -/
def Ket.MES (d) [Fintype d] [Nonempty d] : Ket (d × d) where
vec := fun (i,j) ↦ if i = j then 1 / Real.sqrt (Fintyp... |
317 | leanexplore_declaration | leanexplore:377946 | leanexplore_sqlite | leanexplore_declarations | /-- On any space of dimension at least two, the maximally entangled state `MES` is entangled. -/
theorem Ket.MES_isEntangled [Nontrivial d] : (Ket.MES d).IsEntangled := by
obtain ⟨x, y, h⟩ := @Nontrivial.exists_pair_ne d _
rw [IsEntangled, MES, IsProd_iff_mul_eq_mul]
push Not
use x, y, x, y
simp [apply, h] |
539 | leanexplore_declaration | leanexplore:377947 | leanexplore_sqlite | leanexplore_declarations | /-- The transpose trick -/
theorem transposeTrick {d} [Fintype d] [Nonempty d] [DecidableEq d] {M : Matrix d d ℂ} :
(M ⊗ₖ 1) *ᵥ (Ket.MES d).vec = (1 ⊗ₖ M.transpose) *ᵥ (Ket.MES d).vec := by
ext i
simp only [Ket.MES, Matrix.mulVec, dotProduct, Matrix.kroneckerMap, Matrix.one_apply]
simp
conv =>
enter [1,... |
559 | leanexplore_declaration | leanexplore:377948 | leanexplore_sqlite | leanexplore_declarations | /-- The equivalence relation on `Ket` where two kets equivalent if they are equal up to a
global phase, i.e. `∃ z, ‖z‖ = 1 ∧ a.vec = z • b.vec -/
def Ket.PhaseEquiv : Setoid (Ket d) where
r a b := ∃ z : ℂ, ‖z‖ = 1 ∧ a.vec = z • b.vec
iseqv := {
refl := fun x ↦ ⟨1, by simp⟩,
symm := fun ⟨z,h₁,h₂⟩ ↦ ⟨conj z,
... |
233 | leanexplore_declaration | leanexplore:377949 | leanexplore_sqlite | leanexplore_declarations | /-- The type of `Ket`s up to a global phase equivalence, as given by `Ket.PhaseEquiv`.
In particular, `MState`s really only care about a KetUpToPhase, and not Kets themselves. -/
def KetUpToPhase :=
@Quotient (Ket d) Ket.PhaseEquiv |
262 | leanexplore_declaration | leanexplore:377950 | leanexplore_sqlite | leanexplore_declarations | /-- Lift a function on `Ket d` to `KetUpToPhase d`, given that it respects phase equivalence. -/
def KetUpToPhase.lift {α : Sort*} (f : Ket d → α)
(hf : ∀ ψ φ, Ket.PhaseEquiv.r ψ φ → f ψ = f φ) : KetUpToPhase d → α :=
@Quotient.lift _ _ Ket.PhaseEquiv f hf |
189 | leanexplore_declaration | leanexplore:377951 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem KetUpToPhase.lift_mk {α : Sort*} (f : Ket d → α)
(hf : ∀ ψ φ, Ket.PhaseEquiv.r ψ φ → f ψ = f φ) (ψ : Ket d) :
KetUpToPhase.lift f hf (KetUpToPhase.mk ψ) = f ψ := rfl |
148 | leanexplore_declaration | leanexplore:377952 | leanexplore_sqlite | leanexplore_declarations | theorem KetUpToPhase.ind {p : KetUpToPhase d → Prop}
(h : ∀ ψ : Ket d, p (KetUpToPhase.mk ψ)) : ∀ q, p q :=
@Quotient.ind _ Ket.PhaseEquiv p h |
188 | leanexplore_declaration | leanexplore:377953 | leanexplore_sqlite | leanexplore_declarations | theorem KetUpToPhase.surjective_mk : Function.Surjective (KetUpToPhase.mk (d := d)) :=
fun q => @Quotient.ind _ Ket.PhaseEquiv (fun q => ∃ a, KetUpToPhase.mk a = q) (fun a => ⟨a, rfl⟩) q |
142 | leanexplore_declaration | leanexplore:377954 | leanexplore_sqlite | leanexplore_declarations | /-- Hermitian-preserving linear maps. -/
structure HPMap extends MatrixMap dIn dOut 𝕜 where
HP : MatrixMap.IsHermitianPreserving toLinearMap |
162 | leanexplore_declaration | leanexplore:377955 | leanexplore_sqlite | leanexplore_declarations | /-- Unital linear maps. -/
structure UnitalMap [DecidableEq dIn] [DecidableEq dOut]
extends MatrixMap dIn dOut R where
unital : MatrixMap.Unital toLinearMap |
163 | leanexplore_declaration | leanexplore:377956 | leanexplore_sqlite | leanexplore_declarations | /-- Trace-preserving linear maps. -/
structure TPMap [Fintype dIn] [Fintype dOut] extends MatrixMap dIn dOut R where
TP : MatrixMap.IsTracePreserving toLinearMap |
182 | leanexplore_declaration | leanexplore:377957 | leanexplore_sqlite | leanexplore_declarations | /-- Positive linear maps. -/
structure PMap [Fintype dIn] [Fintype dOut]
extends HPMap dIn dOut 𝕜 where
pos : MatrixMap.IsPositive toLinearMap
HP := pos.IsHermitianPreserving |
209 | leanexplore_declaration | leanexplore:377958 | leanexplore_sqlite | leanexplore_declarations | /-- Completely positive linear maps. -/
structure CPMap [Fintype dIn] [Fintype dOut] [DecidableEq dIn]
extends PMap dIn dOut 𝕜 where
cp : MatrixMap.IsCompletelyPositive toLinearMap
pos := cp.IsPositive |
227 | leanexplore_declaration | leanexplore:377959 | leanexplore_sqlite | leanexplore_declarations | /-- Positive trace-preserving linear maps. These includes all channels, but aren't
necessarily *completely* positive, see `CPTPMap`. -/
structure PTPMap [Fintype dIn] [Fintype dOut]
extends PMap dIn dOut 𝕜, TPMap dIn dOut 𝕜 |
271 | leanexplore_declaration | leanexplore:377960 | leanexplore_sqlite | leanexplore_declarations | /-- Positive unital maps. These are important because they are the
dual to `PTPMap`: they are the most general way to map *observables*. -/
structure PUMap [Fintype dIn] [Fintype dOut] [DecidableEq dIn] [DecidableEq dOut]
extends PMap dIn dOut 𝕜, UnitalMap dIn dOut 𝕜 |
309 | leanexplore_declaration | leanexplore:377961 | leanexplore_sqlite | leanexplore_declarations | /-- Completely positive trace-preserving linear maps. This is the most common
meaning of "channel", often described as "the most general physically realizable
quantum operation". -/
structure CPTPMap [Fintype dIn] [Fintype dOut] [DecidableEq dIn]
extends PTPMap dIn dOut (𝕜 := 𝕜), CPMap dIn dOut 𝕜 where |
291 | leanexplore_declaration | leanexplore:377962 | leanexplore_sqlite | leanexplore_declarations | /-- Completely positive unital maps. These are important because they are the
dual to `CPTPMap`: they are the physically realizable ways to map *observables*. -/
structure CPUMap [Fintype dIn] [Fintype dOut] [DecidableEq dIn] [DecidableEq dOut]
extends CPMap dIn dOut 𝕜, PUMap dIn dOut 𝕜 |
73 | leanexplore_declaration | leanexplore:377963 | leanexplore_sqlite | leanexplore_declarations | abbrev map (M : HPMap dIn dOut 𝕜) : MatrixMap dIn dOut 𝕜 := M.toLinearMap |
79 | leanexplore_declaration | leanexplore:377964 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem ext (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by
rwa [HPMap.mk.injEq] |
56 | leanexplore_declaration | leanexplore:377965 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem ext (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by |
369 | leanexplore_declaration | leanexplore:377966 | leanexplore_sqlite | leanexplore_declarations | /-- Two maps are equal if they agree on all Hermitian inputs. -/
theorem funext_hermitian (h : ∀ M : HermitianMat dIn ℂ, CΛ₁.map M = CΛ₂.map M) :
CΛ₁ = CΛ₂ := by
ext M : 2
have hH := h (realPart M)
have hA := h (imaginaryPart M)
convert congr($hH + Complex.I • $hA)
<;> rw (occs := [1]) [← realPart_add_I_s... |
357 | leanexplore_declaration | leanexplore:377967 | leanexplore_sqlite | leanexplore_declarations | /-- Two maps are equal if they agree on all positive inputs. -/
theorem funext_pos [Fintype dIn] (h : ∀ M : HermitianMat dIn ℂ, 0 ≤ M → CΛ₁.map M = CΛ₂.map M) :
CΛ₁ = CΛ₂ := by
classical
open scoped HermitianMat in
apply funext_hermitian
intro M
rw [← M.posPart_add_negPart]
simp [HermitianMat.posPart_no... |
639 | leanexplore_declaration | leanexplore:377968 | leanexplore_sqlite | leanexplore_declarations | /-- Two maps are equal if they agree on all positive inputs with trace one -/
theorem funext_pos_trace [Fintype dIn]
(h : ∀ M : HermitianMat dIn ℂ, 0 ≤ M → M.trace = 1 → CΛ₁.map M = CΛ₂.map M) :
CΛ₁ = CΛ₂ := by
apply funext_pos
intro M hM'
rcases hM'.eq_or_lt with rfl | hM
· simp
have h_tr : 0 < M.trace... |
266 | leanexplore_declaration | leanexplore:377969 | leanexplore_sqlite | leanexplore_declarations | /-- Two maps are equal if they agree on all `MState`s. -/
theorem funext_mstate [Fintype dIn] [DecidableEq dIn] {Λ₁ Λ₂ : HPMap dIn dOut ℂ}
(h : ∀ ρ : MState dIn, Λ₁.map ρ.m = Λ₂.map ρ.m) :
Λ₁ = Λ₂ :=
funext_pos_trace fun M hM_pos hM_tr ↦ h ⟨M, hM_pos, hM_tr⟩ |
318 | leanexplore_declaration | leanexplore:377970 | leanexplore_sqlite | leanexplore_declarations | /-- Hermitian-preserving maps are functions from `HermitianMat`s to `HermitianMat`s. -/
noncomputable instance instFunLike : FunLike (HPMap dIn dOut ℂ) (HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
coe Λ ρ := ⟨Λ.map ρ.1, Λ.HP ρ.2⟩
coe_injective' x y h := funext_hermitian fun M ↦
by simpa using congrFun h M |
116 | leanexplore_declaration | leanexplore:377971 | leanexplore_sqlite | leanexplore_declarations | lemma apply_hermitianMat_eq (Λ : HPMap dIn dOut ℂ) (ρ : HermitianMat dIn ℂ) :
Λ ρ = ⟨Λ.map ρ.1, Λ.HP ρ.2⟩ := rfl |
322 | leanexplore_declaration | leanexplore:377972 | leanexplore_sqlite | leanexplore_declarations | instance [Fintype dIn] : ContinuousLinearMapClass
(HPMap dIn dOut ℂ) ℝ (HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
map_add f x y := HermitianMat.ext <| LinearMap.map_add f.toLinearMap x y
map_smulₛₗ f c x := HermitianMat.ext <| by simp [apply_hermitianMat_eq]
map_continuous f := .subtype_mk (by fun_prop)... |
123 | leanexplore_declaration | leanexplore:377973 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem ext {Λ₁ Λ₂ : PMap dIn dOut 𝕜} (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by
rw [PMap.mk.injEq]
exact HPMap.ext h |
82 | leanexplore_declaration | leanexplore:377974 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem ext {Λ₁ Λ₂ : PMap dIn dOut 𝕜} (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by |
127 | leanexplore_declaration | leanexplore:377975 | leanexplore_sqlite | leanexplore_declarations | theorem injective_toHPMap : (PMap.toHPMap (dIn := dIn) (dOut := dOut) (𝕜 := 𝕜)).Injective :=
fun _ _ ↦ (mk.injEq _ _ _ _).mpr |
286 | leanexplore_declaration | leanexplore:377976 | leanexplore_sqlite | leanexplore_declarations | /-- Positive maps are functions from `HermitianMat`s to `HermitianMat`s. -/
noncomputable instance instFunLike : FunLike (PMap dIn dOut ℂ) (HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
coe := DFunLike.coe ∘ toHPMap
coe_injective' := DFunLike.coe_injective'.comp injective_toHPMap |
115 | leanexplore_declaration | leanexplore:377977 | leanexplore_sqlite | leanexplore_declarations | lemma apply_hermitianMat_eq (Λ : PMap dIn dOut ℂ) (ρ : HermitianMat dIn ℂ) :
Λ ρ = ⟨Λ.map ρ.1, Λ.HP ρ.2⟩ := rfl |
262 | leanexplore_declaration | leanexplore:377978 | leanexplore_sqlite | leanexplore_declarations | instance instLinearMapClass : LinearMapClass (PMap dIn dOut ℂ) ℝ (HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
map_add f x y := HermitianMat.ext <| LinearMap.map_add f.toLinearMap x y
map_smulₛₗ f c x := HermitianMat.ext <| by simp [apply_hermitianMat_eq] |
252 | leanexplore_declaration | leanexplore:377979 | leanexplore_sqlite | leanexplore_declarations | instance instContinuousOrderHomClass : ContinuousOrderHomClass (PMap dIn dOut ℂ)
(HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
map_continuous f := ContinuousMapClass.map_continuous f.toHPMap
map_monotone f x y h := by
simpa using f.pos h |
269 | leanexplore_declaration | leanexplore:377980 | leanexplore_sqlite | leanexplore_declarations | /-- Positive-presering maps also preserve positivity on, specifically, Hermitian matrices. -/
@[simp]
theorem pos_Hermitian (M : PMap dIn dOut ℂ) {x : HermitianMat dIn ℂ} (h : 0 ≤ x) : 0 ≤ M x := by
simpa only [map_zero] using ContinuousOrderHomClass.map_monotone M h |
203 | leanexplore_declaration | leanexplore:377981 | leanexplore_sqlite | leanexplore_declarations | def of_kraus_CPMap {κ : Type*} [Fintype κ] [DecidableEq dIn] (M : κ → Matrix dOut dIn 𝕜) : CPMap dIn dOut 𝕜 where
toLinearMap := MatrixMap.of_kraus M M
cp := MatrixMap.of_kraus_isCompletelyPositive M |
126 | leanexplore_declaration | leanexplore:377982 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem ext {Λ₁ Λ₂ : PTPMap dIn dOut 𝕜} (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by
rw [PTPMap.mk.injEq]
exact PMap.ext h |
84 | leanexplore_declaration | leanexplore:377983 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem ext {Λ₁ Λ₂ : PTPMap dIn dOut 𝕜} (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by |
127 | leanexplore_declaration | leanexplore:377984 | leanexplore_sqlite | leanexplore_declarations | theorem injective_toPMap : (PTPMap.toPMap (dIn := dIn) (dOut := dOut) (𝕜 := 𝕜)).Injective :=
fun _ _ ↦ (mk.injEq _ _ _ _).mpr |
303 | leanexplore_declaration | leanexplore:377985 | leanexplore_sqlite | leanexplore_declarations | /-- Positive trace-preserving maps are functions from `HermitianMat`s to `HermitianMat`s. -/
noncomputable instance instFunLike : FunLike (PTPMap dIn dOut ℂ) (HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
coe := DFunLike.coe ∘ toPMap
coe_injective' := DFunLike.coe_injective'.comp injective_toPMap |
113 | leanexplore_declaration | leanexplore:377986 | leanexplore_sqlite | leanexplore_declarations | lemma apply_hermitianMat_eq_toPMap (Λ : PTPMap dIn dOut ℂ) (ρ : HermitianMat dIn ℂ) :
Λ ρ = Λ.toPMap ρ := rfl |
234 | leanexplore_declaration | leanexplore:377987 | leanexplore_sqlite | leanexplore_declarations | instance instLinearMapClass : LinearMapClass (PTPMap dIn dOut ℂ) ℝ (HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
map_add f x y := by simp [apply_hermitianMat_eq_toPMap]
map_smulₛₗ f c x := by simp [apply_hermitianMat_eq_toPMap] |
254 | leanexplore_declaration | leanexplore:377988 | leanexplore_sqlite | leanexplore_declarations | instance instHContinuousOrderHomClass : ContinuousOrderHomClass (PTPMap dIn dOut ℂ)
(HermitianMat dIn ℂ) (HermitianMat dOut ℂ) where
map_continuous f := ContinuousMapClass.map_continuous f.toPMap
map_monotone f x y h := by
simpa using f.pos h |
241 | leanexplore_declaration | leanexplore:377989 | leanexplore_sqlite | leanexplore_declarations | /-- PTP maps also preserve positivity on Hermitian matrices. -/
@[simp]
theorem pos_Hermitian (M : PTPMap dIn dOut ℂ) {x : HermitianMat dIn ℂ} (h : 0 ≤ x) : 0 ≤ M x := by
simpa only [map_zero] using ContinuousOrderHomClass.map_monotone M h |
550 | leanexplore_declaration | leanexplore:377990 | leanexplore_sqlite | leanexplore_declarations | /-- `PTPMap`s are functions from `MState`s to `MState`s. -/
noncomputable instance instMFunLike [DecidableEq dIn] [DecidableEq dOut] :
FunLike (PTPMap dIn dOut) (MState dIn) (MState dOut) where
coe Λ ρ := MState.mk
(Λ.toHPMap ρ.M) (HermitianMat.zero_le_iff.mpr (Λ.pos ρ.psd)) (by
rw [HermitianMat.trace_e... |
273 | leanexplore_declaration | leanexplore:377991 | leanexplore_sqlite | leanexplore_declarations | lemma apply_mstate_eq [DecidableEq dIn] [DecidableEq dOut] (Λ : PTPMap dIn dOut ℂ) (ρ : MState dIn) :
Λ ρ = MState.mk
(Λ.toHPMap ρ.M) (HermitianMat.zero_le_iff.mpr (Λ.pos ρ.psd)) (by
rw [HermitianMat.trace_eq_one_iff, ← ρ.tr']
exact Λ.TP ρ) := rfl |
275 | leanexplore_declaration | leanexplore:377992 | leanexplore_sqlite | leanexplore_declarations | instance instMContinuousMapClass [DecidableEq dIn] [DecidableEq dOut] :
ContinuousMapClass (PTPMap dIn dOut) (MState dIn) (MState dOut) where
map_continuous f := by
rw [continuous_induced_rng]
exact (map_continuous f.toHPMap).comp MState.Continuous_HermitianMat |
151 | leanexplore_declaration | leanexplore:377993 | leanexplore_sqlite | leanexplore_declarations | theorem val_apply_MState [DecidableEq dIn] (M : PTPMap dIn dOut) (ρ : MState dIn) :
(M ρ : HermitianMat dOut ℂ) = (instFunLike.coe M) ρ := by
rfl |
427 | leanexplore_declaration | leanexplore:377994 | leanexplore_sqlite | leanexplore_declarations | theorem nonemptyOut (Λ : PTPMap dIn dOut) [hIn : Nonempty dIn] [DecidableEq dIn] : Nonempty dOut := by
by_contra h
simp only [not_nonempty_iff] at h
let M := (1 : Matrix dIn dIn ℂ)
have := calc (Finset.univ.card (α := dIn) : ℂ)
_ = M.trace := by simp [Matrix.trace, M]
_ = (Λ.map M).trace := (Λ.TP M).sym... |
195 | leanexplore_declaration | leanexplore:377995 | leanexplore_sqlite | leanexplore_declarations | /-- Two `CPTPMap`s are equal if their `MatrixMap`s are equal. -/
@[ext]
theorem ext {Λ₁ Λ₂ : CPTPMap dIn dOut 𝕜} (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by
rw [CPTPMap.mk.injEq]
exact PTPMap.ext h |
85 | leanexplore_declaration | leanexplore:377996 | leanexplore_sqlite | leanexplore_declarations | @[ext]
theorem ext {Λ₁ Λ₂ : CPTPMap dIn dOut 𝕜} (h : Λ₁.map = Λ₂.map) : Λ₁ = Λ₂ := by |
132 | leanexplore_declaration | leanexplore:377997 | leanexplore_sqlite | leanexplore_declarations | theorem injective_toPTPMap : (CPTPMap.toPTPMap (dIn := dIn) (dOut := dOut) (𝕜 := 𝕜)).Injective :=
fun _ _ ↦ (mk.injEq _ _ _ _).mpr |
278 | leanexplore_declaration | leanexplore:377998 | leanexplore_sqlite | leanexplore_declarations | /-- `CPTPMap`s are functions from `MState`s to `MState`s. -/
noncomputable instance instMFunLike [DecidableEq dOut] : FunLike (CPTPMap dIn dOut) (MState dIn) (MState dOut) where
coe := DFunLike.coe ∘ toPTPMap
coe_injective' := DFunLike.coe_injective'.comp injective_toPTPMap |
121 | leanexplore_declaration | leanexplore:377999 | leanexplore_sqlite | leanexplore_declarations | lemma apply_mState_eq_toPTPMap [DecidableEq dOut] (Λ : CPTPMap dIn dOut) (ρ : MState dIn) :
Λ ρ = Λ.toPTPMap ρ := rfl |
94 | leanexplore_declaration | leanexplore:378000 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem IsTracePreserving (Λ : CPTPMap dIn dOut 𝕜) : Λ.map.IsTracePreserving :=
Λ.TP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.