AFTD Auto-Formalizing Theoretical Domains

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.
Verified
09 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • TotalPreorderA total preorder: a preorder where ≀ is total (complete). This is weaker than LinearOrder β€” it does NOT require antisymmetry or…
  • LinearOrder.toTotalPreorderEvery LinearOrder is a TotalPreorder.
Used by 1

Lean source view module on GitHub

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]
See it in the graphDiscuss this resultChallenge it