Documentation

Mathlib.LinearAlgebra.Trace

Trace of a linear map #

This file defines the trace of a linear map.

See also LinearAlgebra/Matrix/Trace.lean for the trace of a matrix.

Tags #

linear_map, trace, diagonal

def LinearMap.traceAux (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] {ι : Type w} [DecidableEq ι] [Fintype ι] (b : Basis ι R M) :
(M →ₗ[R] M) →ₗ[R] R

The trace of an endomorphism given a basis.

Equations
Instances For
    theorem LinearMap.traceAux_def (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] {ι : Type w} [DecidableEq ι] [Fintype ι] (b : Basis ι R M) (f : M →ₗ[R] M) :
    (LinearMap.traceAux R b) f = ((LinearMap.toMatrix b b) f).trace
    theorem LinearMap.traceAux_eq (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] {ι : Type w} [DecidableEq ι] [Fintype ι] {κ : Type u_1} [DecidableEq κ] [Fintype κ] (b : Basis ι R M) (c : Basis κ R M) :
    def LinearMap.trace (R : Type u) [CommSemiring R] (M : Type v) [AddCommMonoid M] [Module R M] :
    (M →ₗ[R] M) →ₗ[R] R

    Trace of an endomorphism independent of basis.

    Equations
    Instances For
      theorem LinearMap.trace_eq_matrix_trace_of_finset (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] {s : Finset M} (b : Basis { x : M // x s } R M) (f : M →ₗ[R] M) :
      (LinearMap.trace R M) f = ((LinearMap.toMatrix b b) f).trace

      Auxiliary lemma for trace_eq_matrix_trace.

      theorem LinearMap.trace_eq_matrix_trace (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] {ι : Type w} [DecidableEq ι] [Fintype ι] (b : Basis ι R M) (f : M →ₗ[R] M) :
      (LinearMap.trace R M) f = ((LinearMap.toMatrix b b) f).trace
      theorem LinearMap.trace_mul_comm (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] (f : M →ₗ[R] M) (g : M →ₗ[R] M) :
      (LinearMap.trace R M) (f * g) = (LinearMap.trace R M) (g * f)
      theorem LinearMap.trace_mul_cycle (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] (f : M →ₗ[R] M) (g : M →ₗ[R] M) (h : M →ₗ[R] M) :
      (LinearMap.trace R M) (f * g * h) = (LinearMap.trace R M) (h * f * g)
      theorem LinearMap.trace_mul_cycle' (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] (f : M →ₗ[R] M) (g : M →ₗ[R] M) (h : M →ₗ[R] M) :
      (LinearMap.trace R M) (f * (g * h)) = (LinearMap.trace R M) (h * (f * g))
      @[simp]
      theorem LinearMap.trace_conj (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] (g : M →ₗ[R] M) (f : (M →ₗ[R] M)ˣ) :
      (LinearMap.trace R M) (f * g * f⁻¹) = (LinearMap.trace R M) g

      The trace of an endomorphism is invariant under conjugation

      @[simp]
      theorem LinearMap.trace_lie {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (f : Module.End R M) (g : Module.End R M) :
      theorem LinearMap.trace_eq_contract_of_basis {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {ι : Type u_5} [Finite ι] (b : Basis ι R M) :

      The trace of a linear map correspond to the contraction pairing under the isomorphism End(M) ≃ M* ⊗ M

      theorem LinearMap.trace_eq_contract_of_basis' {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {ι : Type u_5} [Fintype ι] [DecidableEq ι] (b : Basis ι R M) :

      The trace of a linear map correspond to the contraction pairing under the isomorphism End(M) ≃ M* ⊗ M

      @[simp]
      theorem LinearMap.trace_eq_contract (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] :

      When M is finite free, the trace of a linear map correspond to the contraction pairing under the isomorphism End(M) ≃ M* ⊗ M

      @[simp]
      theorem LinearMap.trace_eq_contract_apply (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] (x : TensorProduct R (Module.Dual R M) M) :
      (LinearMap.trace R M) ((dualTensorHom R M M) x) = (contractLeft R M) x
      theorem LinearMap.trace_eq_contract' (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] :
      LinearMap.trace R M = contractLeft R M ∘ₗ (dualTensorHomEquiv R M M).symm

      When M is finite free, the trace of a linear map correspond to the contraction pairing under the isomorphism End(M) ≃ M* ⊗ M

      @[simp]
      theorem LinearMap.trace_one (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] :

      The trace of the identity endomorphism is the dimension of the free module

      @[simp]
      theorem LinearMap.trace_id (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] :
      (LinearMap.trace R M) LinearMap.id = (Module.finrank R M)

      The trace of the identity endomorphism is the dimension of the free module

      @[simp]
      theorem LinearMap.trace_transpose (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] :
      LinearMap.trace R (Module.Dual R M) ∘ₗ Module.Dual.transpose = LinearMap.trace R M
      theorem LinearMap.trace_prodMap (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] (N : Type u_3) [AddCommGroup N] [Module R N] [Module.Free R M] [Module.Finite R M] [Module.Free R N] [Module.Finite R N] :
      LinearMap.trace R (M × N) ∘ₗ LinearMap.prodMapLinear R M N M N R = LinearMap.id.coprod LinearMap.id ∘ₗ (LinearMap.trace R M).prodMap (LinearMap.trace R N)
      theorem LinearMap.trace_prodMap' {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {N : Type u_3} [AddCommGroup N] [Module R N] [Module.Free R M] [Module.Finite R M] [Module.Free R N] [Module.Finite R N] (f : M →ₗ[R] M) (g : N →ₗ[R] N) :
      (LinearMap.trace R (M × N)) (f.prodMap g) = (LinearMap.trace R M) f + (LinearMap.trace R N) g
      theorem LinearMap.trace_tensorProduct (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] (N : Type u_3) [AddCommGroup N] [Module R N] [Module.Free R M] [Module.Finite R M] [Module.Free R N] [Module.Finite R N] :
      (TensorProduct.mapBilinear R M N M N).compr₂ (LinearMap.trace R (TensorProduct R M N)) = (LinearMap.lsmul R R).compl₁₂ (LinearMap.trace R M) (LinearMap.trace R N)
      theorem LinearMap.trace_comp_comm (R : Type u_1) [CommRing R] (M : Type u_2) [AddCommGroup M] [Module R M] (N : Type u_3) [AddCommGroup N] [Module R N] [Module.Free R M] [Module.Finite R M] [Module.Free R N] [Module.Finite R N] :
      (LinearMap.llcomp R M N M).compr₂ (LinearMap.trace R M) = (LinearMap.llcomp R N M N).flip.compr₂ (LinearMap.trace R N)
      @[simp]
      theorem LinearMap.trace_transpose' {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] (f : M →ₗ[R] M) :
      (LinearMap.trace R (Module.Dual R M)) (Module.Dual.transpose f) = (LinearMap.trace R M) f
      theorem LinearMap.trace_tensorProduct' {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {N : Type u_3} [AddCommGroup N] [Module R N] [Module.Free R M] [Module.Finite R M] [Module.Free R N] [Module.Finite R N] (f : M →ₗ[R] M) (g : N →ₗ[R] N) :
      theorem LinearMap.trace_comp_comm' {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {N : Type u_3} [AddCommGroup N] [Module R N] [Module.Free R M] [Module.Finite R M] [Module.Free R N] [Module.Finite R N] (f : M →ₗ[R] N) (g : N →ₗ[R] M) :
      (LinearMap.trace R M) (g ∘ₗ f) = (LinearMap.trace R N) (f ∘ₗ g)
      theorem LinearMap.trace_comp_cycle {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {N : Type u_3} {P : Type u_4} [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [Module.Free R N] [Module.Finite R N] [Module.Free R P] [Module.Finite R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (h : P →ₗ[R] M) :
      (LinearMap.trace R P) (g ∘ₗ f ∘ₗ h) = (LinearMap.trace R N) (f ∘ₗ h ∘ₗ g)
      theorem LinearMap.trace_comp_cycle' {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {N : Type u_3} {P : Type u_4} [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [Module.Free R M] [Module.Finite R M] [Module.Free R P] [Module.Finite R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (h : P →ₗ[R] M) :
      (LinearMap.trace R P) ((g ∘ₗ f) ∘ₗ h) = (LinearMap.trace R M) ((h ∘ₗ g) ∘ₗ f)
      @[simp]
      theorem LinearMap.trace_conj' {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {N : Type u_3} [AddCommGroup N] [Module R N] (f : M →ₗ[R] M) (e : M ≃ₗ[R] N) :
      (LinearMap.trace R N) (e.conj f) = (LinearMap.trace R M) f
      theorem LinearMap.IsProj.trace {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] {p : Submodule R M} {f : M →ₗ[R] M} (h : LinearMap.IsProj p f) [Module.Free R p] [Module.Finite R p] [Module.Free R (LinearMap.ker f)] [Module.Finite R (LinearMap.ker f)] :
      (LinearMap.trace R M) f = (Module.finrank R p)
      theorem LinearMap.trace_comp_eq_mul_of_commute_of_isNilpotent {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] [IsReduced R] {f : Module.End R M} {g : Module.End R M} (μ : R) (h_comm : Commute f g) (hg : IsNilpotent (g - (algebraMap R (Module.End R M)) μ)) :
      (LinearMap.trace R M) (f ∘ₗ g) = μ * (LinearMap.trace R M) f
      @[simp]
      theorem LinearMap.trace_baseChange {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] (f : M →ₗ[R] M) (A : Type u_6) [CommRing A] [Algebra R A] :