Matrix.diag_mul_of_blockTriangular_id
theoremverifiedformalizationimported Lean
For upper-triangular matrices, the diagonal of a product is the product of the diagonals. This is a specific case of a more general property for block-triangular matrices.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open scoped BigOperators Topology in variable {π m n : Type*} in variable [RCLike π] in attribute [local instance] Matrix.linftyOpNormedAlgebra in attribute [local instance] Matrix.linftyOpNormedRing in attribute [local instance] Matrix.instCompleteSpace in variable [Fintype m] [LinearOrder m] in lemma Matrix.diag_mul_of_blockTriangular_id {A B : Matrix m m π} (hA : BlockTriangular A id) (hB : BlockTriangular B id) : (A * B).diag = A.diag * B.diag
- Formalizes
- Physlib, `Matrix.diag_mul_of_blockTriangular_id`
- Lean proof
- By Matteo Cipollina, from github.com/leanprover-community/physlib at
e411c6e89692(Copyright (c) 2025 Matteo Cipollina. 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.diag_mul_of_blockTriangular_id← Matrix.diag_mul_of_blockTriangular_id (Physlib/Mathematics/ForMathlib/DataStructures/Matrix/LieTrace.lean:72): verbatim
- Verified
- 09 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 2
- TotalPreorderA total preorder: a preorder where
β€is total (complete). This is weaker thanLinearOrderβ it does NOT require antisymmetry orβ¦ - LinearOrder.toTotalPreorderEvery
LinearOrderis aTotalPreorder.
- TotalPreorderA total preorder: a preorder where
- Used by 1
- Matrix.diag_pow_of_blockTriangular_idFor an upper-triangular matrix, the diagonal of a power is the power of the diagonal.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen scoped BigOperators Topology invariable {π m n : Type*} invariable [RCLike π] inattribute [local instance] Matrix.linftyOpNormedAlgebra inattribute [local instance] Matrix.linftyOpNormedRing inattribute [local instance] Matrix.instCompleteSpace invariable [Fintype m] [LinearOrder m] in/-- For upper-triangular matrices, the diagonal of a product is the product of the diagonals. This is a specific case of a more general property for block-triangular matrices. -/lemma Matrix.diag_mul_of_blockTriangular_id {A B : Matrix m m π} (hA : BlockTriangular A id) (hB : BlockTriangular B id) : (A * B).diag = A.diag * B.diag := by ext i simp only [diag_apply, mul_apply, Pi.mul_apply] apply Finset.sum_eq_single i Β· intro j _ j_ne_i cases lt_or_gt_of_ne j_ne_i with | inl h => rw [hA h, zero_mul] -- j < i | inr h => rw [hB h, mul_zero] -- i < j Β· intro; simp_all only [Finset.mem_univ, not_true_eq_false]