Matrix.PosSemidef.traceLeft
theoremverifiedformalizationimported Lean
Matrix.PosSemidef.traceLeft
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Matrix in open BigOperators in variable {n ๐ : Type*} in variable [RCLike ๐] [DecidableEq n] in open scoped ComplexOrder MatrixOrder in variable [AddCommMonoid R] [Fintype d] in open ComplexOrder in variable {dโ dโ : Type*} {A : Matrix (dโ ร dโ) (dโ ร dโ) ๐} in variable [Fintype dโ] [Fintype dโ] in theorem Matrix.PosSemidef.traceLeft [DecidableEq dโ] (hA : A.PosSemidef) : A.traceLeft.PosSemidef
- Formalizes
- QuantumInfo, `Matrix.PosSemidef.traceLeft`
- Lean proof
- By Alex Meiburg, from github.com/leanprover-community/physlib at
e411c6e89692(Copyright (c) 2025 Alex Meiburg. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.Matrix.PosSemidef.traceLeft← Matrix.PosSemidef.traceLeft (QuantumInfo/ForMathlib/Matrix.lean:660): verbatim
- Verified
- 17 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 2
- Matrix.traceLeftMatrix.traceLeft
- Matrix.IsHermitian.traceLeftMatrix.IsHermitian.traceLeft
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Matrix in open BigOperators in variable {n ๐ : Type*} in variable [RCLike ๐] [DecidableEq n] in open scoped ComplexOrder MatrixOrder in variable [AddCommMonoid R] [Fintype d] in open ComplexOrder in variable {dโ dโ : Type*} {A : Matrix (dโ ร dโ) (dโ ร dโ) ๐} in variable [Fintype dโ] [Fintype dโ] in theorem Matrix.PosSemidef.traceLeft [DecidableEq dโ] (hA : A.PosSemidef) : A.traceLeft.PosSemidef := by rw [Matrix.posSemidef_iff_dotProduct_mulVec] at hA โข constructor ยท exact hA.1.traceLeft ยท intro x convert Finset.sum_nonneg (s := .univ) (fun (i : dโ) _ โฆ hA.2 (fun (j,k) โฆ if i = j then x k else 0)) simp_rw [Matrix.traceLeft, dotProduct_mulVec] simpa [dotProduct, vecMul_eq_sum, ite_apply, Fintype.sum_prod_type, Finset.mul_sum, Finset.sum_mul, apply_ite] using Finset.sum_comm_cycle