AFTD Auto-Formalizing Theoretical Domains

Matrix.trace_submatrix

theoremverifiedformalizationimported Lean

Matrix.trace_submatrix

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
variable {α : Type*} [AddCommMonoid α] in
variable {d₁ dā‚‚ : Type*} [Fintype d₁] [Fintype dā‚‚] in
@[simp]
theorem Matrix.trace_submatrix
  (A : Matrix d₁ d₁ α) (e : dā‚‚ ā‰ƒ d₁) :
    (A.submatrix e e).trace = A.trace
Formalizes
QuantumInfo, `Matrix.trace_submatrix`
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
variable {α : Type*} [AddCommMonoid α] in
variable {d₁ dā‚‚ : Type*} [Fintype d₁] [Fintype dā‚‚] in
@[simp]
theorem Matrix.trace_submatrix
  (A : Matrix d₁ d₁ α) (e : dā‚‚ ā‰ƒ d₁) :
    (A.submatrix e e).trace = A.trace := by
  simpa [Matrix.trace] using e.sum_comp (fun x ↦ A x x)
See it in the graphDiscuss this resultChallenge it