Documentation

CslibFrontier.Foundations.LinearAlgebra.Matrix.GlueDeterminant

Glued determinants, and expanding a determinant along rows λ • v + e #

Let the rows and the columns of a square matrix fall into two groups. Matrix.glue rg cg N₁ N₂ has the entries of N₁ where both the row and the column are in the first group, those of N₂ where both are in the second, and 0 elsewhere. Its determinant is 0 unless the two first groups have the same size (Matrix.det_glue_eq_zero_of_card_ne), and in general it is a product of a function of N₁ and a function of N₂ (Matrix.exists_det_glue_eq_mul).

A determinant whose rows indexed by m are l r • v r + e r is the sum over the sets T of these rows of ∏_{r ∈ T} l r times the determinant with the rows v r for r ∈ T and e r otherwise (Matrix.det_sumElim_smul_add), by multilinearity.

Main definitions #

Main results #

References #

def Matrix.glue {ι : Type u_1} {R : Type u_2} [Zero R] (rg cg : ι → Prop) [DecidablePred rg] [DecidablePred cg] (N₁ N₂ : Matrix ι ι R) :
Matrix ι ι R

The matrix with the entries of N₁ in the rows and columns of the first group, those of N₂ in the rows and columns of the second, and zeros elsewhere.

@[simp]
theorem Matrix.glue_apply {ι : Type u_1} {R : Type u_2} [Zero R] (rg cg : ι → Prop) [DecidablePred rg] [DecidablePred cg] (N₁ N₂ : Matrix ι ι R) (i j : ι) :
glue rg cg N₁ N₂ i j = if rg i then if cg j then N₁ i j else 0 else if cg j then 0 else N₂ i j
theorem Matrix.det_glue_eq_zero_of_card_ne {ι : Type u_1} [Fintype ι] [DecidableEq ι] {R : Type u_2} [CommRing R] (rg cg : ι → Prop) [DecidablePred rg] [DecidablePred cg] (N₁ N₂ : Matrix ι ι R) (h : (Finset.filter rg Finset.univ).card ≠ (Finset.filter cg Finset.univ).card) :
(glue rg cg N₁ N₂).det = 0
theorem Matrix.exists_det_glue_eq_mul {ι : Type u_1} [Fintype ι] [DecidableEq ι] {R : Type u_2} [CommRing R] (rg cg : ι → Prop) [DecidablePred rg] [DecidablePred cg] :
∃ (α : Matrix ι ι R → R) (β : Matrix ι ι R → R), ∀ (N₁ N₂ : Matrix ι ι R), (glue rg cg N₁ N₂).det = α N₁ * β N₂

A glued determinant is a product.

theorem Matrix.det_sumElim_smul_add {n : Type u_1} {m : Type u_2} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] {R : Type u_3} [CommRing R] (P : n → n ⊕ m → R) (l : m → R) (v e : m → n ⊕ m → R) :
(of (Sum.elim P fun (r : m) => l r • v r + e r)).det = ∑ T : Finset m, (∏ r ∈ T, l r) * (of (Sum.elim P (T.piecewise v e))).det

Expansion of a determinant in the rows λ_r v_r + e_r.

theorem Matrix.dvd_det_sub {R : Type u_1} {n : Type u_2} [CommRing R] [Fintype n] [DecidableEq n] (d : R) (M N : Matrix n n R) (h : ∀ (i j : n), d ∣ M i j - N i j) :
d ∣ M.det - N.det

Congruent matrices have congruent determinants.