Skip to content

Commit

Permalink
feat: Matrix.abs_det_submatrix_equiv_equiv (#19332)
Browse files Browse the repository at this point in the history
  • Loading branch information
madvorak committed Nov 22, 2024
1 parent d511775 commit dc8fc4e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Mathlib/Algebra/Order/Ring/Abs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Mathlib.Algebra.Order.Group.Abs
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.Algebra.Order.Ring.Int
import Mathlib.Algebra.Ring.Divisibility.Basic
import Mathlib.Algebra.Ring.Int.Units
import Mathlib.Data.Nat.Cast.Order.Ring

/-!
Expand Down Expand Up @@ -151,6 +152,9 @@ theorem abs_sub_sq (a b : α) : |a - b| * |a - b| = a * a + b * b - (1 + 1) * a
simp only [mul_add, add_comm, add_left_comm, mul_comm, sub_eq_add_neg, mul_one, mul_neg,
neg_add_rev, neg_neg, add_assoc]

lemma abs_unit_intCast (a : ℤˣ) : |((a : ℤ) : α)| = 1 := by
cases Int.units_eq_one_or a <;> simp_all

end LinearOrderedCommRing

section
Expand Down
11 changes: 11 additions & 0 deletions Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@ theorem det_submatrix_equiv_self (e : n ≃ m) (A : Matrix m m R) :
intro i
rw [Equiv.permCongr_apply, Equiv.symm_apply_apply, submatrix_apply]

/-- Permuting rows and columns with two equivalences does not change the absolute value of the
determinant. -/
@[simp]
theorem abs_det_submatrix_equiv_equiv {R : Type*} [LinearOrderedCommRing R]
(e₁ e₂ : n ≃ m) (A : Matrix m m R) :
|(A.submatrix e₁ e₂).det| = |A.det| := by
have hee : e₂ = e₁.trans (e₁.symm.trans e₂) := by ext; simp
rw [hee]
show |((A.submatrix id (e₁.symm.trans e₂)).submatrix e₁ e₁).det| = |A.det|
rw [Matrix.det_submatrix_equiv_self, Matrix.det_permute', abs_mul, abs_unit_intCast, one_mul]

/-- Reindexing both indices along the same equivalence preserves the determinant.
For the `simp` version of this lemma, see `det_submatrix_equiv_self`; this one is unsuitable because
Expand Down

0 comments on commit dc8fc4e

Please sign in to comment.