Documentation

QuantumInfo.ForMathlib.Matrix

theorem Matrix.zero_rank_eq_zero {n : Type u_1} {š•œ : Type u_2} [RCLike š•œ] [DecidableEq n] {A : Matrix n n š•œ} [Fintype n] (hA : A.rank = 0) :
A = 0
theorem Matrix.IsHermitian.smul_selfAdjoint {n : Type u_1} {š•œ : Type u_2} [RCLike š•œ] {A : Matrix n n š•œ} (hA : A.IsHermitian) {c : š•œ} (hc : IsSelfAdjoint c) :
theorem Matrix.IsHermitian.smul_im_zero {n : Type u_1} {š•œ : Type u_2} [RCLike š•œ] {A : Matrix n n š•œ} (hA : A.IsHermitian) {c : š•œ} (h : RCLike.im c = 0) :
theorem Matrix.IsHermitian.smul_real {n : Type u_1} {š•œ : Type u_2} [RCLike š•œ] {A : Matrix n n š•œ} (hA : A.IsHermitian) (c : ā„) :
def Matrix.IsHermitian.HermitianSubspace (n : Type u_3) (š•œ : Type u_4) [Fintype n] [RCLike š•œ] :
Subspace ā„ (Matrix n n š•œ)
Equations
Instances For
    @[simp]
    theorem Matrix.IsHermitian.re_trace_eq_trace {n : Type u_1} {š•œ : Type u_2} [RCLike š•œ] {A : Matrix n n š•œ} (hA : A.IsHermitian) [Fintype n] :
    ↑(RCLike.re A.trace) = A.trace
    theorem Matrix.IsHermitian.sum_eigenvalues_eq_trace {n : Type u_1} {š•œ : Type u_2} [RCLike š•œ] [DecidableEq n] {A : Matrix n n š•œ} (hA : A.IsHermitian) [Fintype n] :
    ↑(āˆ‘ i : n, hA.eigenvalues i) = A.trace

    The sum of the eigenvalues of a Hermitian matrix is equal to its trace.

    theorem Matrix.IsHermitian.eigenvalues_zero_eq_zero {n : Type u_1} {š•œ : Type u_2} [RCLike š•œ] [DecidableEq n] {A : Matrix n n š•œ} (hA : A.IsHermitian) [Fintype n] (h : āˆ€ (i : n), hA.eigenvalues i = 0) :
    A = 0

    If all eigenvalues are equal to zero, then the matrix is zero.

    theorem Matrix.kroneckerMap_conjTranspose {R : Type u_3} {m : Type u_4} {n : Type u_1} [CommRing R] [StarRing R] (A : Matrix m m R) (B : Matrix n n R) :
    (kroneckerMap (fun (x1 x2 : R) => x1 * x2) A B).conjTranspose = kroneckerMap (fun (x1 x2 : R) => x1 * x2) A.conjTranspose B.conjTranspose
    theorem Matrix.kroneckerMap_IsHermitian {R : Type u_3} {m : Type u_4} {n : Type u_1} [CommRing R] [StarRing R] {A : Matrix m m R} {B : Matrix n n R} (hA : A.IsHermitian) (hB : B.IsHermitian) :
    (kroneckerMap (fun (x1 x2 : R) => x1 * x2) A B).IsHermitian
    theorem Matrix.PosSemidef.diag_nonneg {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} (hA : A.PosSemidef) (i : m) :
    0 ≤ A.diag i
    theorem Matrix.PosSemidef.trace_zero {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} (hA : A.PosSemidef) :
    A.trace = 0 → A = 0
    @[simp]
    theorem Matrix.PosSemidef.trace_zero_iff {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} (hA : A.PosSemidef) :
    A.trace = 0 ↔ A = 0
    theorem RCLike.normSq_eq_conj_mul_self {š•œ : Type u_5} [RCLike š•œ] {z : š•œ} :
    ↑(normSq z) = (starRingEnd š•œ) z * z
    theorem Matrix.PosSemidef.outer_self_conj {n : Type u_4} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] (v : n → š•œ) :
    (vecMulVec v ((starRingEnd (n → š•œ)) v)).PosSemidef
    theorem Matrix.PosSemidef.convex_cone {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A B : Matrix m m š•œ} (hA : A.PosSemidef) (hB : B.PosSemidef) {c₁ cā‚‚ : š•œ} (hc₁ : 0 ≤ c₁) (hcā‚‚ : 0 ≤ cā‚‚) :
    (c₁ • A + cā‚‚ • B).PosSemidef
    theorem Matrix.PosSemidef.stdBasisMatrix_iff_eq {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] [dm : DecidableEq m] (i j : m) {c : š•œ} (hc : 0 < c) :

    A standard basis matrix (with a positive entry) is positive semidefinite iff the entry is on the diagonal.

    theorem Matrix.PosSemidef.PosSemidef_kronecker {m : Type u_3} {n : Type u_4} {š•œ : Type u_5} [Fintype m] [Fintype n] [RCLike š•œ] [dn : DecidableEq n] {A : Matrix m m š•œ} {B : Matrix n n š•œ} (hA : A.PosSemidef) (hB : B.PosSemidef) :
    (kroneckerMap (fun (x1 x2 : š•œ) => x1 * x2) A B).PosSemidef
    theorem Matrix.PosSemidef.zero_dotProduct_zero_iff {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} (hA : A.PosSemidef) :
    (āˆ€ (x : m → š•œ), 0 = star x ā¬įµ„ A.mulVec x) ↔ A = 0
    theorem Matrix.PosSemidef.nonneg_smul {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} {c : š•œ} (hA : A.PosSemidef) (hc : 0 ≤ c) :
    theorem Matrix.PosSemidef.pos_smul {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} {c : š•œ} (hA : (c • A).PosSemidef) (hc : 0 < c) :
    theorem Matrix.PosSemidef.nonneg_smul_Real_smul {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} {c : ā„} (hA : A.PosSemidef) (hc : 0 ≤ c) :
    theorem Matrix.PosSemidef.pos_Real_smul {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} {c : ā„} (hA : (c • A).PosSemidef) (hc : 0 < c) :
    theorem Matrix.PosSemidef.zero_posSemidef_neg_posSemidef_iff {m : Type u_3} {š•œ : Type u_5} [Fintype m] [RCLike š•œ] {A : Matrix m m š•œ} :
    theorem Matrix.PosDef.toLin_ker_eq_bot {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] [DecidableEq n] {A : Matrix n n š•œ} (hA : A.PosDef) :
    theorem Matrix.PosDef.of_toLin_ker_eq_bot {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] [DecidableEq n] {A : Matrix n n š•œ} (hA : LinearMap.ker (toLin' A) = ⊄) (hAā‚‚ : A.PosSemidef) :
    instance Matrix.PosSemidef.instOrderedCancelAddCommMonoid {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] :
    instance Matrix.PosSemidef.instStarOrderedRing {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] :
    StarOrderedRing (Matrix n n š•œ)

    Basically, the instance states A ≤ B ↔ B = A + Sį““ * S

    theorem Matrix.PosSemidef.le_of_nonneg_imp {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] {A B : Matrix n n š•œ} {R : Type u_6} [AddCommGroup R] [PartialOrder R] [IsOrderedAddMonoid R] (f : Matrix n n š•œ →+ R) (h : āˆ€ (A : Matrix n n š•œ), A.PosSemidef → 0 ≤ f A) :
    A ≤ B → f A ≤ f B
    theorem Matrix.PosSemidef.le_of_nonneg_imp' {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] {R : Type u_6} [AddCommGroup R] [PartialOrder R] [IsOrderedAddMonoid R] {x y : R} (f : R →+ Matrix n n š•œ) (h : āˆ€ (x : R), 0 ≤ x → (f x).PosSemidef) :
    x ≤ y → f x ≤ f y
    theorem Matrix.PosSemidef.mul_mul_conjTranspose_mono {n : Type u_3} {m : Type u_4} {š•œ : Type u_5} [Fintype n] [Fintype m] [RCLike š•œ] {A B : Matrix n n š•œ} (C : Matrix m n š•œ) :
    A ≤ B → C * A * C.conjTranspose ≤ C * B * C.conjTranspose
    theorem Matrix.PosSemidef.conjTranspose_mul_mul_mono {n : Type u_3} {m : Type u_4} {š•œ : Type u_5} [Fintype n] [Fintype m] [RCLike š•œ] {A B : Matrix n n š•œ} (C : Matrix n m š•œ) :
    A ≤ B → C.conjTranspose * A * C ≤ C.conjTranspose * B * C
    theorem Matrix.PosSemidef.nonneg_iff_eigenvalue_nonneg {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] {A : Matrix n n š•œ} (hA : A.IsHermitian) [DecidableEq n] :
    0 ≤ A ↔ āˆ€ (x : n), 0 ≤ hA.eigenvalues x
    theorem Matrix.PosSemidef.diag_monotone {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] :
    theorem Matrix.PosSemidef.diag_mono {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] {A B : Matrix n n š•œ} :
    A ≤ B → āˆ€ (i : n), A.diag i ≤ B.diag i
    theorem Matrix.PosSemidef.trace_monotone {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] :
    theorem Matrix.PosSemidef.trace_mono {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] {A B : Matrix n n š•œ} :
    A ≤ B → A.trace ≤ B.trace
    theorem Matrix.PosSemidef.diagonal_monotone {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] [DecidableEq n] :
    theorem Matrix.PosSemidef.diagonal_mono {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] [DecidableEq n] {d₁ dā‚‚ : n → š•œ} :
    d₁ ≤ dā‚‚ → diagonal d₁ ≤ diagonal dā‚‚
    theorem Matrix.PosSemidef.diagonal_le_iff {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] [DecidableEq n] {d₁ dā‚‚ : n → š•œ} :
    d₁ ≤ dā‚‚ ↔ diagonal d₁ ≤ diagonal dā‚‚
    theorem Matrix.PosSemidef.le_smul_one_of_eigenvalues_iff {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] {A : Matrix n n š•œ} [DecidableEq n] (hA : A.IsHermitian) (c : ā„) :
    (āˆ€ (i : n), hA.eigenvalues i ≤ c) ↔ A ≤ c • 1
    theorem Matrix.PosSemidef.smul_one_le_of_eigenvalues_iff {n : Type u_3} {š•œ : Type u_5} [Fintype n] [RCLike š•œ] {A : Matrix n n š•œ} [DecidableEq n] (hA : A.IsHermitian) (c : ā„) :
    (āˆ€ (i : n), c ≤ hA.eigenvalues i) ↔ c • 1 ≤ A
    def Matrix.traceLeft {R : Type u_3} {d : Type u_4} [AddCommMonoid R] [Fintype d] {d₁ : Type u_5} {dā‚‚ : Type u_6} (m : Matrix (d Ɨ d₁) (d Ɨ dā‚‚) R) :
    Matrix d₁ dā‚‚ R
    Equations
    • m.traceLeft = Matrix.of fun (i₁ : d₁) (j₁ : dā‚‚) => āˆ‘ iā‚‚ : d, m (iā‚‚, i₁) (iā‚‚, j₁)
    Instances For
      def Matrix.traceRight {R : Type u_3} {d : Type u_4} [AddCommMonoid R] [Fintype d] {d₁ : Type u_5} {dā‚‚ : Type u_6} (m : Matrix (d₁ Ɨ d) (dā‚‚ Ɨ d) R) :
      Matrix d₁ dā‚‚ R
      Equations
      • m.traceRight = Matrix.of fun (iā‚‚ : d₁) (jā‚‚ : dā‚‚) => āˆ‘ i₁ : d, m (iā‚‚, i₁) (jā‚‚, i₁)
      Instances For
        @[simp]
        theorem Matrix.traceLeft_trace {R : Type u_5} {d₁ : Type u_4} {dā‚‚ : Type u_3} [AddCommMonoid R] [Fintype d₁] [Fintype dā‚‚] (A : Matrix (d₁ Ɨ dā‚‚) (d₁ Ɨ dā‚‚) R) :
        @[simp]
        theorem Matrix.traceRight_trace {R : Type u_5} {d₁ : Type u_4} {dā‚‚ : Type u_3} [AddCommMonoid R] [Fintype d₁] [Fintype dā‚‚] (A : Matrix (d₁ Ɨ dā‚‚) (d₁ Ɨ dā‚‚) R) :
        theorem Matrix.IsHermitian.traceLeft {R : Type u_5} {d : Type u_4} [AddCommMonoid R] [Fintype d] [StarAddMonoid R] {d₁ : Type u_3} {A : Matrix (d Ɨ d₁) (d Ɨ d₁) R} (hA : A.IsHermitian) :
        theorem Matrix.IsHermitian.traceRight {R : Type u_5} {d : Type u_4} [AddCommMonoid R] [Fintype d] [StarAddMonoid R] {d₁ : Type u_3} {A : Matrix (d₁ Ɨ d) (d₁ Ɨ d) R} (hA : A.IsHermitian) :
        theorem Matrix.PosSemidef.traceLeft {š•œ : Type u_2} [RCLike š•œ] {d₁ : Type u_3} {dā‚‚ : Type u_4} {A : Matrix (d₁ Ɨ dā‚‚) (d₁ Ɨ dā‚‚) š•œ} [Fintype dā‚‚] [Fintype d₁] [DecidableEq d₁] (hA : A.PosSemidef) :
        theorem Matrix.PosSemidef.traceRight {š•œ : Type u_2} [RCLike š•œ] {d₁ : Type u_3} {dā‚‚ : Type u_4} {A : Matrix (d₁ Ɨ dā‚‚) (d₁ Ɨ dā‚‚) š•œ} [Fintype dā‚‚] [Fintype d₁] [DecidableEq dā‚‚] (hA : A.PosSemidef) :
        theorem Matrix.PosDef.kron {d₁ : Type u_3} {dā‚‚ : Type u_4} {š•œ : Type u_5} [Fintype d₁] [DecidableEq d₁] [Fintype dā‚‚] [DecidableEq dā‚‚] [RCLike š•œ] {A : Matrix d₁ d₁ š•œ} {B : Matrix dā‚‚ dā‚‚ š•œ} (hA : A.PosDef) (hB : B.PosDef) :
        (kroneckerMap (fun (x1 x2 : š•œ) => x1 * x2) A B).PosDef
        theorem Matrix.PosDef.submatrix {d₁ : Type u_3} {dā‚‚ : Type u_4} {š•œ : Type u_5} [Fintype d₁] [DecidableEq d₁] [Fintype dā‚‚] [DecidableEq dā‚‚] [RCLike š•œ] {M : Matrix d₁ d₁ š•œ} (hM : M.PosDef) {e : dā‚‚ → d₁} (he : Function.Injective e) :
        theorem Matrix.PosDef.reindex {d₁ : Type u_3} {dā‚‚ : Type u_4} {š•œ : Type u_5} [Fintype d₁] [DecidableEq d₁] [Fintype dā‚‚] [DecidableEq dā‚‚] [RCLike š•œ] {M : Matrix d₁ d₁ š•œ} (hM : M.PosDef) (e : d₁ ā‰ƒ dā‚‚) :
        @[simp]
        theorem Matrix.PosDef.reindex_iff {d₁ : Type u_3} {dā‚‚ : Type u_4} {š•œ : Type u_5} [Fintype d₁] [DecidableEq d₁] [Fintype dā‚‚] [DecidableEq dā‚‚] [RCLike š•œ] {M : Matrix d₁ d₁ š•œ} (e : d₁ ā‰ƒ dā‚‚) :
        theorem Matrix.PosSemidef.rsmul {n : Type u_3} [Fintype n] {M : Matrix n n ā„‚} (hM : M.PosSemidef) {c : ā„} (hc : 0 ≤ c) :
        theorem Matrix.PosDef_iff_eigenvalues' {d : Type u_3} {š•œ : Type u_4} [Fintype d] [DecidableEq d] [RCLike š•œ] (M : Matrix d d š•œ) :
        M.PosDef ↔ ∃ (h : M.IsHermitian), āˆ€ (i : d), 0 < h.eigenvalues i
        theorem Multiset.map_univ_eq_iff {α : Type u_5} {β : Type u_6} [Fintype α] [DecidableEq β] (f g : α → β) :
        map f Finset.univ.val = map g Finset.univ.val ↔ ∃ (e : α ā‰ƒ α), f = g ∘ ⇑e
        theorem Matrix.IsHermitian.cfc_eigenvalues {d : Type u_3} {š•œ : Type u_4} [Fintype d] [DecidableEq d] [RCLike š•œ] {M : Matrix d d š•œ} (hM : M.IsHermitian) (f : ā„ → ā„) :
        ∃ (e : d ā‰ƒ d), eigenvalues ⋯ = f ∘ hM.eigenvalues ∘ ⇑e
        @[simp]
        theorem Matrix.toEuclideanLin_one {α : Type u_3} {n : Type u_4} [RCLike α] [Fintype n] [DecidableEq n] :
        @[simp]
        theorem Matrix.cfc_diagonal {d : Type u_3} {š•œ : Type u_4} [Fintype d] [DecidableEq d] [RCLike š•œ] (g : d → ā„) (f : ā„ → ā„) :
        cfc f (diagonal fun (x : d) => ↑(g x)) = diagonal (RCLike.ofReal ∘ f ∘ g)
        theorem Matrix.PosSemidef.pos_of_mem_spectrum {d : Type u_3} {š•œ : Type u_4} [Fintype d] [DecidableEq d] [RCLike š•œ] {A : Matrix d d š•œ} (hA : A.PosSemidef) (r : ā„) :
        r ∈ spectrum ā„ A → 0 ≤ r
        theorem Matrix.PosSemidef.pow_add {d : Type u_3} {š•œ : Type u_4} [Fintype d] [DecidableEq d] [RCLike š•œ] {A : Matrix d d š•œ} (hA : A.PosSemidef) {x y : ā„} (hxy : x + y ≠ 0) :
        cfc (fun (x_1 : ā„) => x_1 ^ (x + y)) A = cfc (fun (r : ā„) => r ^ x * r ^ y) A
        theorem Matrix.PosSemidef.pow_mul {d : Type u_3} {š•œ : Type u_4} [Fintype d] [DecidableEq d] [RCLike š•œ] {A : Matrix d d š•œ} {x y : ā„} (hA : A.PosSemidef) :
        cfc (fun (x_1 : ā„) => x_1 ^ (x * y)) A = cfc (fun (r : ā„) => (r ^ x) ^ y) A
        @[simp]
        theorem Matrix.trace_submatrix {α : Type u_3} [AddCommMonoid α] {d₁ : Type u_4} {dā‚‚ : Type u_5} [Fintype d₁] [Fintype dā‚‚] (A : Matrix d₁ d₁ α) (e : dā‚‚ ā‰ƒ d₁) :
        (A.submatrix ⇑e ⇑e).trace = A.trace
        theorem Matrix.spectrum_prod {d : Type u_3} {dā‚‚ : Type u_4} [Fintype d] [DecidableEq d] [Fintype dā‚‚] [DecidableEq dā‚‚] {A : Matrix d d ā„‚} {B : Matrix dā‚‚ dā‚‚ ā„‚} (hA : A.IsHermitian) (hB : B.IsHermitian) :
        spectrum ā„ (kroneckerMap (fun (x1 x2 : ā„‚) => x1 * x2) A B) = spectrum ā„ A * spectrum ā„ B