Documentation

TauCeti.LinearAlgebra.Matrix.LeibnizPart

The even and odd parts of the Leibniz expansion #

The Leibniz formula writes the determinant of a square matrix as a signed sum over permutations. Grouping its terms by the sign of the permutation gives two sums, P over the even and N over the odd permutations, with det M = P - N and permanent M = P + N. A permutation of the rows or of the columns of M either fixes both sums or exchanges them, according to its sign, so the symmetric functions P + N and P * N are invariant under such permutations while det M is only invariant up to sign. Together with (P - N) ^ 2 = (P + N) ^ 2 - 4 * (P * N) this is the engine of Stickelberger's congruence for discriminants of number fields.

Main definitions #

Main results #

References #

def Matrix.leibnizPart {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (s : ℤˣ) :
R

The part of the Leibniz expansion of M indexed by the permutations of sign s: the sum of ∏ i, M (σ i) i over the permutations σ with Equiv.Perm.sign σ = s.

Instances For
    theorem Matrix.leibnizPart_def {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (s : ℤˣ) :
    M.leibnizPart s = ∑ σ : Equiv.Perm n with Equiv.Perm.sign σ = s, ∏ i : n, M (σ i) i

    The defining sum of a Leibniz part.

    theorem Matrix.leibnizPart_eq_sum_ite {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (s : ℤˣ) :
    M.leibnizPart s = ∑ σ : Equiv.Perm n, if Equiv.Perm.sign σ = s then ∏ i : n, M (σ i) i else 0

    The Leibniz part as a sum over all permutations, the terms of the wrong sign being zero.

    The even part plus the odd part of the Leibniz expansion is the permanent.

    @[simp]
    theorem Matrix.leibnizPart_submatrix_left {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (ρ : Equiv.Perm n) (s : ℤˣ) :

    Permuting the rows by ρ multiplies the sign index of a Leibniz part by sign ρ.

    @[simp]
    theorem Matrix.leibnizPart_transpose {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (s : ℤˣ) :

    A Leibniz part is unchanged by transposition.

    @[simp]
    theorem Matrix.leibnizPart_submatrix_right {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (ρ : Equiv.Perm n) (s : ℤˣ) :

    Permuting the columns by ρ multiplies the sign index of a Leibniz part by sign ρ.

    The product of the even and the odd Leibniz parts is invariant under permutations of the rows.

    The product of the even and the odd Leibniz parts is invariant under permutations of the columns.

    @[simp]
    theorem Matrix.leibnizPart_map {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} {S : Type u_3} [CommSemiring R] [CommSemiring S] {F : Type u_4} [FunLike F R S] [RingHomClass F R S] (f : F) (M : Matrix n n R) (s : ℤˣ) :
    (M.map ⇑f).leibnizPart s = f (M.leibnizPart s)

    A ring homomorphism carries a Leibniz part of M to the Leibniz part of the mapped matrix.

    theorem Matrix.leibnizPart_one_sub_leibnizPart_neg_one {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_4} [CommRing R] (M : Matrix n n R) :

    The even part minus the odd part of the Leibniz expansion is the determinant.

    theorem Matrix.det_sq_eq_permanent_sq_sub_four_mul {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_4} [CommRing R] (M : Matrix n n R) :
    M.det ^ 2 = M.permanent ^ 2 - 4 * (M.leibnizPart 1 * M.leibnizPart (-1))

    The discriminant identity (P - N) ^ 2 = (P + N) ^ 2 - 4 * (P * N) for the two parts of the Leibniz expansion.