Documentation

Mathlib.LinearAlgebra.Trace

Trace of a linear map #

This file defines the trace of a linear map.

See also Mathlib/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 : Module.Basis ฮน R M) :

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 : Module.Basis ฮน R M) (f : M โ†’โ‚—[R] M) :
      (traceAux R b) f = ((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 : Module.Basis ฮน R M) (c : Module.Basis ฮบ R M) :

      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 : Module.Basis (โ†ฅs) R M) (f : M โ†’โ‚—[R] M) :
          (trace R M) f = ((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 : Module.Basis ฮน R M) (f : M โ†’โ‚—[R] M) :
          (trace R M) f = ((toMatrix b b) f).trace
          @[simp]
          theorem Matrix.trace_toLin_eq {R : Type u} [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] {ฮน : Type w} [DecidableEq ฮน] [Fintype ฮน] (A : Matrix ฮน ฮน R) (b : Module.Basis ฮน R M) :
          (LinearMap.trace R M) ((toLin b b) A) = A.trace
          @[simp]
          theorem Matrix.trace_toLin'_eq {R : Type u} [CommSemiring R] {ฮน : Type w} [DecidableEq ฮน] [Fintype ฮน] (A : Matrix ฮน ฮน R) :
          (LinearMap.trace R (ฮน โ†’ R)) (toLin' A) = A.trace
          theorem LinearMap.trace_mul_comm (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] (f g : M โ†’โ‚—[R] M) :
          (trace R M) (f * g) = (trace R M) (g * f)
          theorem LinearMap.trace_mul_cycle (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] (f g h : M โ†’โ‚—[R] M) :
          (trace R M) (f * g * h) = (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 g h : M โ†’โ‚—[R] M) :
          (trace R M) (f * (g * h)) = (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)หฃ) :
          (trace R M) (โ†‘f * g * โ†‘fโปยน) = (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 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 : Module.Basis ฮน R M) :

          The trace of a linear map corresponds 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 : Module.Basis ฮน R M) :

          The trace of a linear map corresponds to the contraction pairing under the isomorphism End(M) โ‰ƒ M* โŠ— M.

          @[simp]

          When M is finite free, the trace of a linear map corresponds 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) :
          (trace R M) ((dualTensorHom R M M) x) = (contractLeft R M) x

          When M is finite free, the trace of a linear map corresponds 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] :
          (trace R M) 1 = โ†‘(Module.finrank 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] :
          (trace R M) id = โ†‘(Module.finrank R M)

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

          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) :
          (trace R (M ร— N)) (f.prodMap g) = (trace R M) f + (trace R N) g
          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] :
          (llcomp R M N M).comprโ‚‚ (trace R M) = (llcomp R N M N).flip.comprโ‚‚ (trace R N)
          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) :
          (trace R (TensorProduct R M N)) (TensorProduct.map f g) = (trace R M) f * (trace R N) g
          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) :
          (trace R M) (g โˆ˜โ‚— f) = (trace R N) (f โˆ˜โ‚— g)
          @[simp]
          theorem LinearMap.trace_smulRight {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] R) (x : M) :
          (trace R M) (f.smulRight x) = f x
          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) :
          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) :
          @[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) :
          (trace R N) (e.conj f) = (trace R M) f
          @[simp]
          theorem LinearMap.trace_map {K : Type u_6} {V : Type u_7} {W : Type u_8} [Field K] [AddCommGroup V] [Module K V] [AddCommGroup W] [Module K W] {F : Type u_9} [EquivLike F (Module.End K V) (Module.End K W)] [AlgEquivClass F K (Module.End K V) (Module.End K W)] (f : F) (x : Module.End K V) :
          (trace K W) (f x) = (trace K V) x
          @[simp]
          theorem Matrix.trace_map {K : Type u_6} {m : Type u_7} {n : Type u_8} [Field K] [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] {F : Type u_9} [EquivLike F (Matrix m m K) (Matrix n n K)] [AlgEquivClass F K (Matrix m m K) (Matrix n n K)] (f : F) (x : Matrix m m K) :
          (f x).trace = x.trace
          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 : IsProj p f) [Module.Free R โ†ฅp] [Module.Finite R โ†ฅp] [Module.Free R โ†ฅf.ker] [Module.Finite R โ†ฅf.ker] :
          (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] [IsReduced R] {f g : Module.End R M} (ฮผ : R) (h_comm : Commute f g) (hg : IsNilpotent (g - (algebraMap R (Module.End R M)) ฮผ)) :
          (trace R M) (f โˆ˜โ‚— g) = ฮผ * (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] :
          (trace A (TensorProduct R A M)) (baseChange A f) = (algebraMap R A) ((trace R M) f)