AFTD Auto-Formalizing Theoretical Domains

Matrix.PosSemidef.trace_pos

theoremverifiedformalizationimported Lean

Matrix.PosSemidef.trace_pos

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open BigOperators in
variable {n ๐•œ : Type*} in
variable [RCLike ๐•œ] [DecidableEq n] in
open scoped ComplexOrder MatrixOrder in
open ComplexOrder in
theorem Matrix.PosSemidef.trace_pos {n ๐•œ : Type*} [Fintype n] [RCLike ๐•œ]
    {A : Matrix n n ๐•œ} (hA : A.PosSemidef) (h : A โ‰  0) : 0 < A.trace
Formalizes
QuantumInfo, `Matrix.PosSemidef.trace_pos`
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.
Verified
16 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open BigOperators in
variable {n ๐•œ : Type*} in
variable [RCLike ๐•œ] [DecidableEq n] in
open scoped ComplexOrder MatrixOrder in
open ComplexOrder in
theorem Matrix.PosSemidef.trace_pos {n ๐•œ : Type*} [Fintype n] [RCLike ๐•œ]
    {A : Matrix n n ๐•œ} (hA : A.PosSemidef) (h : A โ‰  0) : 0 < A.trace := by
  apply hA.trace_nonneg.lt_of_ne'
  classical
  rw [hA.left.trace_eq_sum_eigenvalues]
  suffices โˆ‘ i, hA.left.eigenvalues i โ‰  0 from mod_cast this
  rwa [ne_eq, Fintype.sum_eq_zero_iff_of_nonneg hA.eigenvalues_nonneg,
    hA.left.eigenvalues_eq_zero_iff]
See it in the graphDiscuss this resultChallenge it