# mathlibdocumentation

ring_theory.trace

# Trace for (finite) ring extensions. #

Suppose we have an R-algebra S with a finite basis. For each s : S, the trace of the linear map given by multiplying by s gives information about the roots of the minimal polynomial of s over R.

## Main definitions #

• algebra.trace R S x: the trace of an element s of an R-algebra S
• algebra.trace_form R S: bilinear form sending x, y to the trace of x * y
• algebra.trace_matrix R b: the matrix whose (i j)-th element is the trace of b i * b j.
• algebra.embeddings_matrix A C b : matrix κ (B →ₐ[A] C) C is the matrix whose (i, σ) coefficient is σ (b i).
• algebra.embeddings_matrix_reindex A C b e : matrix κ κ C is the matrix whose (i, j) coefficient is σⱼ (b i), where σⱼ : B →ₐ[A] C is the embedding corresponding to j : κ given by a bijection e : κ ≃ (B →ₐ[A] C).

## Main results #

• trace_algebra_map_of_basis, trace_algebra_map: if x : K, then Tr_{L/K} x = [L : K] x
• trace_trace_of_basis, trace_trace: Tr_{L/K} (Tr_{F/L} x) = Tr_{F/K} x
• trace_eq_sum_roots: the trace of x : K(x) is the sum of all conjugate roots of x
• trace_eq_sum_embeddings: the trace of x : K(x) is the sum of all embeddings of x into an algebraically closed field
• trace_form_nondegenerate: the trace form over a separable extension is a nondegenerate bilinear form

## Implementation notes #

Typically, the trace is defined specifically for finite field extensions. The definition is as general as possible and the assumption that we have fields or that the extension is finite is added to the lemmas as needed.

We only define the trace for left multiplication (algebra.left_mul_matrix, i.e. linear_map.mul_left). For now, the definitions assume S is commutative, so the choice doesn't matter anyway.

## References #

noncomputable def algebra.trace (R : Type u_1) (S : Type u_2) [comm_ring R] [comm_ring S] [ S] :

The trace of an element s of an R-algebra is the trace of (*) s, as an R-linear map.

Equations
theorem algebra.trace_apply (R : Type u_1) {S : Type u_2} [comm_ring R] [comm_ring S] [ S] (x : S) :
S) x = S) ( S) x)
theorem algebra.trace_eq_zero_of_not_exists_basis (R : Type u_1) {S : Type u_2} [comm_ring R] [comm_ring S] [ S] (h : ¬∃ (s : finset S), nonempty (basis s R S)) :
= 0
theorem algebra.trace_eq_matrix_trace {R : Type u_1} {S : Type u_2} [comm_ring R] [comm_ring S] [ S] {ι : Type w} [fintype ι] [decidable_eq ι] (b : R S) (s : S) :
S) s = s).trace
theorem algebra.trace_algebra_map_of_basis {R : Type u_1} {S : Type u_2} [comm_ring R] [comm_ring S] [ S] {ι : Type w} [fintype ι] (b : R S) (x : R) :
S) ( S) x) =

If x is in the base field K, then the trace is [L : K] * x.

@[simp]
theorem algebra.trace_algebra_map {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] (x : K) :
L) ( L) x) =

If x is in the base field K, then the trace is [L : K] * x.

(If L is not finite-dimensional over K, then trace and finrank return 0.)

theorem algebra.trace_trace_of_basis {R : Type u_1} {S : Type u_2} {T : Type u_3} [comm_ring R] [comm_ring S] [comm_ring T] [ S] [ T] [ T] [ T] {ι : Type u_4} {κ : Type u_5} [fintype ι] [fintype κ] (b : R S) (c : S T) (x : T) :
S) ( T) x) = T) x
theorem algebra.trace_comp_trace_of_basis {R : Type u_1} {S : Type u_2} {T : Type u_3} [comm_ring R] [comm_ring S] [comm_ring T] [ S] [ T] [ T] [ T] {ι : Type u_4} {κ : Type u_5} [fintype ι] [fintype κ] (b : R S) (c : S T) :
S).comp T)) =
@[simp]
theorem algebra.trace_trace {T : Type u_3} [comm_ring T] {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] [ T] [ T] [ T] [ L] [ T] (x : T) :
L) ( T) x) = T) x
@[simp]
theorem algebra.trace_comp_trace {T : Type u_3} [comm_ring T] {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] [ T] [ T] [ T] [ L] [ T] :
L).comp T)) =
noncomputable def algebra.trace_form (R : Type u_1) (S : Type u_2) [comm_ring R] [comm_ring S] [ S] :
S

The trace_form maps x y : S to the trace of x * y. It is a symmetric bilinear form and is nondegenerate if the extension is separable.

Equations
@[simp]
theorem algebra.trace_form_apply (R : Type u_1) {S : Type u_2} [comm_ring R] [comm_ring S] [ S] (x y : S) :
S) x y = S) (x * y)
theorem algebra.trace_form_is_symm (R : Type u_1) {S : Type u_2} [comm_ring R] [comm_ring S] [ S] :
theorem algebra.trace_form_to_matrix (R : Type u_1) {S : Type u_2} [comm_ring R] [comm_ring S] [ S] {ι : Type w} [fintype ι] (b : R S) [decidable_eq ι] (i j : ι) :
S) i j = S) (b i * b j)
theorem algebra.trace_form_to_matrix_power_basis (R : Type u_1) {S : Type u_2} [comm_ring R] [comm_ring S] [ S] (h : S) :
S) = matrix.of (λ (i j : fin h.dim), S) (h.gen ^ (i + j)))
theorem power_basis.trace_gen_eq_next_coeff_minpoly {S : Type u_2} [comm_ring S] {K : Type u_4} [field K] [ S] [nontrivial S] (pb : S) :

Given pb : power_basis K S, the trace of pb.gen is -(minpoly K pb.gen).next_coeff.

theorem power_basis.trace_gen_eq_sum_roots {S : Type u_2} [comm_ring S] {K : Type u_4} [field K] {F : Type u_6} [field F] [ S] [ F] [nontrivial S] (pb : S) (hf : (minpoly K pb.gen)) :
F) ( S) pb.gen) = (polynomial.map F) (minpoly K pb.gen)).roots.sum

Given pb : power_basis K S, then the trace of pb.gen is ((minpoly K pb.gen).map (algebra_map K F)).roots.sum.

theorem intermediate_field.adjoin_simple.trace_gen_eq_zero {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] {x : L} (hx : ¬ x) :
= 0
theorem intermediate_field.adjoin_simple.trace_gen_eq_sum_roots {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] {F : Type u_6} [field F] [ F] (x : L) (hf : (minpoly K x)) :
theorem trace_eq_trace_adjoin (K : Type u_4) {L : Type u_5} [field K] [field L] [ L] [ L] (x : L) :
L) x =
theorem trace_eq_sum_roots {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] {F : Type u_6} [field F] [ F] [ L] {x : L} (hF : (minpoly K x)) :
F) ( L) x) = (polynomial.map F) (minpoly K x)).roots.sum
theorem algebra.is_integral_trace {R : Type u_1} [comm_ring R] {L : Type u_5} [field L] {F : Type u_6} [field F] [ L] [ F] [ F] [ F] [ F] {x : F} (hx : x) :
( F) x)
theorem trace_eq_sum_embeddings_gen {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] (E : Type u_7) [field E] [ E] (pb : L) (hE : (minpoly K pb.gen)) (hfx : (minpoly K pb.gen).separable) :
E) ( L) pb.gen) = finset.univ.sum (λ (σ : L →ₐ[K] E), σ pb.gen)
theorem sum_embeddings_eq_finrank_mul {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] (F : Type u_6) [field F] [ F] [ F] [ F] (E : Type u_7) [field E] [ E] [ F] [ F] (pb : L) :
finset.univ.sum (λ (σ : F →ₐ[K] E), σ ( F) pb.gen)) = finset.univ.sum (λ (σ : L →ₐ[K] E), σ pb.gen)
theorem trace_eq_sum_embeddings {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] (E : Type u_7) [field E] [ E] [ L] [ L] {x : L} :
E) ( L) x) = finset.univ.sum (λ (σ : L →ₐ[K] E), σ x)
theorem trace_eq_sum_automorphisms {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] (x : L) [ L] [ L] :
L) ( L) x) = finset.univ.sum (λ (σ : L ≃ₐ[K] L), σ x)
@[simp]
noncomputable def algebra.trace_matrix {κ : Type w} (A : Type u) {B : Type v} [comm_ring A] [comm_ring B] [ B] (b : κ → B) :
κ A

Given an A-algebra B and b, an κ-indexed family of elements of B, we define trace_matrix A b as the matrix whose (i j)-th element is the trace of b i * b j.

Equations
• i j = B) (b i) (b j)
theorem algebra.trace_matrix_def {κ : Type w} (A : Type u) {B : Type v} [comm_ring A] [comm_ring B] [ B] (b : κ → B) :
= matrix.of (λ (i j : κ), B) (b i) (b j))
theorem algebra.trace_matrix_reindex {κ : Type w} (A : Type u) {B : Type v} [comm_ring A] [comm_ring B] [ B] {κ' : Type u_1} (b : A B) (f : κ κ') :
(b.reindex f) = f)
theorem algebra.trace_matrix_of_matrix_vec_mul {κ : Type w} {A : Type u} {B : Type v} [comm_ring A] [comm_ring B] [ B] [fintype κ] (b : κ → B) (P : κ A) :
(P.map B))) = (P.transpose.mul b)).mul P
theorem algebra.trace_matrix_of_matrix_mul_vec {κ : Type w} {A : Type u} {B : Type v} [comm_ring A] [comm_ring B] [ B] [fintype κ] (b : κ → B) (P : κ A) :
((P.map B)).mul_vec b) = (P.mul b)).mul P.transpose
theorem algebra.trace_matrix_of_basis {κ : Type w} {A : Type u} {B : Type v} [comm_ring A] [comm_ring B] [ B] [fintype κ] [decidable_eq κ] (b : A B) :
theorem algebra.trace_matrix_of_basis_mul_vec {ι : Type w} [fintype ι] {A : Type u} {B : Type v} [comm_ring A] [comm_ring B] [ B] (b : A B) (z : B) :
.mul_vec ((b.equiv_fun) z) = λ (i : ι), B) (z * b i)
@[simp]
def algebra.embeddings_matrix {κ : Type w} (A : Type u) {B : Type v} (C : Type z) [comm_ring A] [comm_ring B] [ B] [comm_ring C] [ C] (b : κ → B) :
(B →ₐ[A] C) C

embeddings_matrix A C b : matrix κ (B →ₐ[A] C) C is the matrix whose (i, σ) coefficient is σ (b i). It is mostly useful for fields when fintype.card κ = finrank A B and C is algebraically closed.

Equations
• i σ = σ (b i)
def algebra.embeddings_matrix_reindex {κ : Type w} (A : Type u) {B : Type v} (C : Type z) [comm_ring A] [comm_ring B] [ B] [comm_ring C] [ C] (b : κ → B) (e : κ (B →ₐ[A] C)) :
κ C

embeddings_matrix_reindex A C b e : matrix κ κ C is the matrix whose (i, j) coefficient is σⱼ (b i), where σⱼ : B →ₐ[A] C is the embedding corresponding to j : κ given by a bijection e : κ ≃ (B →ₐ[A] C). It is mostly useful for fields and C is algebraically closed. In this case, in presence of h : fintype.card κ = finrank A B, one can take e := equiv_of_card_eq ((alg_hom.card A B C).trans h.symm).

Equations
theorem algebra.embeddings_matrix_reindex_eq_vandermonde {A : Type u} {B : Type v} (C : Type z) [comm_ring A] [comm_ring B] [ B] [comm_ring C] [ C] (pb : B) (e : fin pb.dim (B →ₐ[A] C)) :
e = (matrix.vandermonde (λ (i : fin pb.dim), (e i) pb.gen)).transpose
theorem algebra.trace_matrix_eq_embeddings_matrix_mul_trans (K : Type u_4) {L : Type u_5} [field K] [field L] [ L] {κ : Type w} (E : Type z) [field E] [ E] [ L] [ L] (b : κ → L) :
b).map E) = b).mul b).transpose
theorem algebra.trace_matrix_eq_embeddings_matrix_reindex_mul_trans (K : Type u_4) {L : Type u_5} [field K] [field L] [ L] {κ : Type w} (E : Type z) [field E] [ E] [ L] [ L] (b : κ → L) [fintype κ] (e : κ (L →ₐ[K] E)) :
b).map E) = e).mul e).transpose
theorem det_trace_matrix_ne_zero' {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] (pb : L) [ L] :
(pb.basis)).det 0
theorem det_trace_form_ne_zero {K : Type u_4} {L : Type u_5} [field K] [field L] [ L] {ι : Type w} [fintype ι] [ L] [decidable_eq ι] (b : K L) :
L)).det 0
theorem trace_form_nondegenerate (K : Type u_4) (L : Type u_5) [field K] [field L] [ L] [ L] [ L] :