File: Mathlib/LinearAlgebra/Trace.lean

full_name: LinearMap.traceAux
code: /-- The trace of an endomorphism given a basis. -/
def traceAux : (M →ₗ[R] M) →ₗ[R] R 
goal: (M →ₗ[R] M) →ₗ[R] R

full_name: LinearMap.traceAux_def
code: theorem traceAux_def (b : Basis ι R M) (f : M →ₗ[R] M) :
    traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) 
goal: (LinearMap.traceAux R b) f = ((LinearMap.toMatrix b b) f).trace

full_name: LinearMap.traceAux_eq
code: theorem traceAux_eq : traceAux R b = traceAux R c 
goal: LinearMap.traceAux R b = LinearMap.traceAux R c

full_name: LinearMap.trace
code: /-- Trace of an endomorphism independent of basis. -/
def trace : (M →ₗ[R] M) →ₗ[R] R 
goal: (M →ₗ[R] M) →ₗ[R] R

full_name: LinearMap.trace_eq_matrix_trace_of_finset
code: /-- Auxiliary lemma for `trace_eq_matrix_trace`. -/
theorem trace_eq_matrix_trace_of_finset {s : Finset M} (b : Basis s R M) (f : M →ₗ[R] M) :
    trace R M f = Matrix.trace (LinearMap.toMatrix b b f) 
goal: (LinearMap.trace R M) f = ((LinearMap.toMatrix b b) f).trace

full_name: LinearMap.trace_eq_matrix_trace
code: theorem trace_eq_matrix_trace (f : M →ₗ[R] M) :
    trace R M f = Matrix.trace (LinearMap.toMatrix b b f) 
goal: (LinearMap.trace R M) f = ((LinearMap.toMatrix b b) f).trace

full_name: LinearMap.trace_mul_comm
code: theorem trace_mul_comm (f g : M →ₗ[R] M) : trace R M (f * g) = trace R M (g * f) 
goal: (LinearMap.trace R M) (f * g) = (LinearMap.trace R M) (g * f)

full_name: LinearMap.trace_mul_cycle
code: lemma trace_mul_cycle (f g h : M →ₗ[R] M) :
    trace R M (f * g * h) = trace R M (h * f * g) 
goal: (LinearMap.trace R M) (f * g * h) = (LinearMap.trace R M) (h * f * g)

full_name: LinearMap.trace_mul_cycle'
code: lemma trace_mul_cycle' (f g h : M →ₗ[R] M) :
    trace R M (f * (g * h)) = trace R M (h * (f * g)) 
goal: (LinearMap.trace R M) (f * (g * h)) = (LinearMap.trace R M) (h * (f * g))

full_name: LinearMap.trace_conj
code: /-- The trace of an endomorphism is invariant under conjugation -/
@[simp]
theorem trace_conj (g : M →ₗ[R] M) (f : (M →ₗ[R] M)ˣ) :
    trace R M (↑f * g * ↑f⁻¹) = trace R M g 
goal: (LinearMap.trace R M) (↑f * g * ↑f⁻¹) = (LinearMap.trace R M) g

full_name: LinearMap.trace_lie
code: @[simp]
lemma trace_lie {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (f g : Module.End R M) :
    trace R M ⁅f, g⁆ = 0 
goal: (LinearMap.trace R M) ⁅f, g⁆ = 0

full_name: LinearMap.trace_eq_contract_of_basis
code: /-- The trace of a linear map correspond to the contraction pairing under the isomorphism
 `End(M) ≃ M* ⊗ M`-/
theorem trace_eq_contract_of_basis [Finite ι] (b : Basis ι R M) :
    LinearMap.trace R M ∘ₗ dualTensorHom R M M = contractLeft R M 
goal: LinearMap.trace R M ∘ₗ dualTensorHom R M M = contractLeft R M

full_name: LinearMap.trace_eq_contract_of_basis'
code: /-- The trace of a linear map correspond to the contraction pairing under the isomorphism
 `End(M) ≃ M* ⊗ M`-/
theorem trace_eq_contract_of_basis' [Fintype ι] [DecidableEq ι] (b : Basis ι R M) :
    LinearMap.trace R M = contractLeft R M ∘ₗ (dualTensorHomEquivOfBasis b).symm.toLinearMap 
goal: LinearMap.trace R M = contractLeft R M ∘ₗ ↑(dualTensorHomEquivOfBasis b).symm

full_name: LinearMap.trace_eq_contract
code: /-- 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 trace_eq_contract : LinearMap.trace R M ∘ₗ dualTensorHom R M M = contractLeft R M 
goal: LinearMap.trace R M ∘ₗ dualTensorHom R M M = contractLeft R M

full_name: LinearMap.trace_eq_contract_apply
code: @[simp]
theorem trace_eq_contract_apply (x : Module.Dual R M ⊗[R] M) :
    (LinearMap.trace R M) ((dualTensorHom R M M) x) = contractLeft R M x 
goal: (LinearMap.trace R M) ((dualTensorHom R M M) x) = (contractLeft R M) x

full_name: LinearMap.trace_eq_contract'
code: /-- When `M` is finite free, the trace of a linear map correspond to the contraction pairing under
the isomorphism `End(M) ≃ M* ⊗ M`-/
theorem trace_eq_contract' :
    LinearMap.trace R M = contractLeft R M ∘ₗ (dualTensorHomEquiv R M M).symm.toLinearMap 
goal: LinearMap.trace R M = contractLeft R M ∘ₗ ↑(dualTensorHomEquiv R M M).symm

full_name: LinearMap.trace_one
code: /-- The trace of the identity endomorphism is the dimension of the free module -/
@[simp]
theorem trace_one : trace R M 1 = (finrank R M : R) 
goal: (LinearMap.trace R M) 1 = ↑(FiniteDimensional.finrank R M)

full_name: LinearMap.trace_id
code: /-- The trace of the identity endomorphism is the dimension of the free module -/
@[simp]
theorem trace_id : trace R M id = (finrank R M : R) 
goal: (LinearMap.trace R M) LinearMap.id = ↑(FiniteDimensional.finrank R M)

full_name: LinearMap.trace_transpose
code: @[simp]
theorem trace_transpose : trace R (Module.Dual R M) ∘ₗ Module.Dual.transpose = trace R M 
goal: LinearMap.trace R (Module.Dual R M) ∘ₗ Module.Dual.transpose = LinearMap.trace R M

full_name: LinearMap.trace_prodMap
code: theorem trace_prodMap :
    trace R (M × N) ∘ₗ prodMapLinear R M N M N R =
      (coprod id id : R × R →ₗ[R] R) ∘ₗ prodMap (trace R M) (trace R N) 
goal: 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)

full_name: LinearMap.trace_prodMap'
code: theorem trace_prodMap' (f : M →ₗ[R] M) (g : N →ₗ[R] N) :
    trace R (M × N) (prodMap f g) = trace R M f + trace R N g 
goal: (LinearMap.trace R (M × N)) (f.prodMap g) = (LinearMap.trace R M) f + (LinearMap.trace R N) g

full_name: LinearMap.trace_tensorProduct
code: theorem trace_tensorProduct : compr₂ (mapBilinear R M N M N) (trace R (M ⊗ N)) =
    compl₁₂ (lsmul R R : R →ₗ[R] R →ₗ[R] R) (trace R M) (trace R N) 
goal: (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)

full_name: LinearMap.trace_comp_comm
code: theorem trace_comp_comm :
    compr₂ (llcomp R M N M) (trace R M) = compr₂ (llcomp R N M N).flip (trace R N) 
goal: (LinearMap.llcomp R M N M).compr₂ (LinearMap.trace R M) = (LinearMap.llcomp R N M N).flip.compr₂ (LinearMap.trace R N)

full_name: LinearMap.trace_transpose'
code: @[simp]
theorem trace_transpose' (f : M →ₗ[R] M) :
    trace R _ (Module.Dual.transpose (R := R) f) = trace R M f 
goal: (LinearMap.trace R (Module.Dual R M)) (Module.Dual.transpose f) = (LinearMap.trace R M) f

full_name: LinearMap.trace_tensorProduct'
code: theorem trace_tensorProduct' (f : M →ₗ[R] M) (g : N →ₗ[R] N) :
    trace R (M ⊗ N) (map f g) = trace R M f * trace R N g 
goal: (LinearMap.trace R (TensorProduct R M N)) (TensorProduct.map f g) = (LinearMap.trace R M) f * (LinearMap.trace R N) g

full_name: LinearMap.trace_comp_comm'
code: theorem trace_comp_comm' (f : M →ₗ[R] N) (g : N →ₗ[R] M) :
    trace R M (g ∘ₗ f) = trace R N (f ∘ₗ g) 
goal: (LinearMap.trace R M) (g ∘ₗ f) = (LinearMap.trace R N) (f ∘ₗ g)

full_name: LinearMap.trace_comp_cycle
code: lemma trace_comp_cycle (f : M →ₗ[R] N) (g : N →ₗ[R] P) (h : P →ₗ[R] M) :
    trace R P (g ∘ₗ f ∘ₗ h) = trace R N (f ∘ₗ h ∘ₗ g) 
goal: (LinearMap.trace R P) (g ∘ₗ f ∘ₗ h) = (LinearMap.trace R N) (f ∘ₗ h ∘ₗ g)

full_name: LinearMap.trace_comp_cycle'
code: lemma trace_comp_cycle' (f : M →ₗ[R] N) (g : N →ₗ[R] P) (h : P →ₗ[R] M) :
    trace R P ((g ∘ₗ f) ∘ₗ h) = trace R M ((h ∘ₗ g) ∘ₗ f) 
goal: (LinearMap.trace R P) ((g ∘ₗ f) ∘ₗ h) = (LinearMap.trace R M) ((h ∘ₗ g) ∘ₗ f)

full_name: LinearMap.trace_conj'
code: @[simp]
theorem trace_conj' (f : M →ₗ[R] M) (e : M ≃ₗ[R] N) : trace R N (e.conj f) = trace R M f 
goal: (LinearMap.trace R N) (e.conj f) = (LinearMap.trace R M) f

full_name: LinearMap.IsProj.trace
code: theorem IsProj.trace {p : Submodule R M} {f : M →ₗ[R] M} (h : IsProj p f) [Module.Free R p]
    [Module.Finite R p] [Module.Free R (ker f)] [Module.Finite R (ker f)] :
    trace R M f = (finrank R p : R) 
goal: (LinearMap.trace R M) f = ↑(FiniteDimensional.finrank R ↥p)

full_name: LinearMap.isNilpotent_trace_of_isNilpotent
code: lemma isNilpotent_trace_of_isNilpotent {f : M →ₗ[R] M} (hf : IsNilpotent f) :
    IsNilpotent (trace R M f) 
goal: IsNilpotent ((LinearMap.trace R M) f)

full_name: LinearMap.trace_comp_eq_mul_of_commute_of_isNilpotent
code: lemma trace_comp_eq_mul_of_commute_of_isNilpotent [IsReduced R] {f g : Module.End R M}
    (μ : R) (h_comm : Commute f g) (hg : IsNilpotent (g - algebraMap R _ μ)) :
    trace R M (f ∘ₗ g) = μ * trace R M f 
goal: (LinearMap.trace R M) (f ∘ₗ g) = μ * (LinearMap.trace R M) f

full_name: LinearMap.trace_baseChange
code: @[simp]
lemma trace_baseChange [Module.Free R M] [Module.Finite R M]
    (f : M →ₗ[R] M) (A : Type*) [CommRing A] [Algebra R A] :
    trace A _ (f.baseChange A) = algebraMap R A (trace R _ f) 
goal: (LinearMap.trace A (TensorProduct R A M)) (LinearMap.baseChange A f) = (algebraMap R A) ((LinearMap.trace R M) f)