Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
/- | |
Copyright (c) 2021 Riccardo Brasca. All rights reserved. | |
Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Riccardo Brasca | |
-/ | |
import ring_theory.trace | |
import ring_theory.norm | |
import number_theory.number_field | |
/-! | |
# Discriminant of a family of vectors | |
Given an `A`-algebra `B` and `b`, an `ΞΉ`-indexed family of elements of `B`, we define the | |
*discriminant* of `b` as the determinant of the matrix whose `(i j)`-th element is the trace of | |
`b i * b j`. | |
## Main definition | |
* `algebra.discr A b` : the discriminant of `b : ΞΉ β B`. | |
## Main results | |
* `algebra.discr_zero_of_not_linear_independent` : if `b` is not linear independent, then | |
`algebra.discr A b = 0`. | |
* `algebra.discr_of_matrix_vec_mul` and `discr_of_matrix_mul_vec` : formulas relating | |
`algebra.discr A ΞΉ b` with `algebra.discr A ((P.map (algebra_map A B)).vec_mul b)` and | |
`algebra.discr A ((P.map (algebra_map A B)).mul_vec b)`. | |
* `algebra.discr_not_zero_of_basis` : over a field, if `b` is a basis, then | |
`algebra.discr K b β 0`. | |
* `algebra.discr_eq_det_embeddings_matrix_reindex_pow_two` : if `L/K` is a field extension and | |
`b : ΞΉ β L`, then `discr K b` is the square of the determinant of the matrix whose `(i, j)` | |
coefficient is `Οβ±Ό (b i)`, where `Οβ±Ό : L ββ[K] E` is the embedding in an algebraically closed | |
field `E` corresponding to `j : ΞΉ` via a bijection `e : ΞΉ β (L ββ[K] E)`. | |
* `algebra.discr_of_power_basis_eq_prod` : the discriminant of a power basis. | |
* `discr_is_integral` : if `K` and `L` are fields and `is_scalar_tower R K L`, is `b : ΞΉ β L` | |
satisfies ` β i, is_integral R (b i)`, then `is_integral R (discr K b)`. | |
* `discr_mul_is_integral_mem_adjoin` : let `K` be the fraction field of an integrally closed domain | |
`R` and let `L` be a finite separable extension of `K`. Let `B : power_basis K L` be such that | |
`is_integral R B.gen`. Then for all, `z : L` we have | |
`(discr K B.basis) β’ z β adjoin R ({B.gen} : set L)`. | |
## Implementation details | |
Our definition works for any `A`-algebra `B`, but note that if `B` is not free as an `A`-module, | |
then `trace A B = 0` by definition, so `discr A b = 0` for any `b`. | |
-/ | |
universes u v w z | |
open_locale matrix big_operators | |
open matrix finite_dimensional fintype polynomial finset intermediate_field | |
namespace algebra | |
variables (A : Type u) {B : Type v} (C : Type z) {ΞΉ : Type w} | |
variables [comm_ring A] [comm_ring B] [algebra A B] [comm_ring C] [algebra A C] | |
section discr | |
/-- Given an `A`-algebra `B` and `b`, an `ΞΉ`-indexed family of elements of `B`, we define | |
`discr A ΞΉ b` as the determinant of `trace_matrix A ΞΉ b`. -/ | |
noncomputable | |
def discr (A : Type u) {B : Type v} [comm_ring A] [comm_ring B] [algebra A B] [fintype ΞΉ] | |
(b : ΞΉ β B) := by { classical, exact (trace_matrix A b).det } | |
lemma discr_def [decidable_eq ΞΉ] [fintype ΞΉ] (b : ΞΉ β B) : | |
discr A b = (trace_matrix A b).det := by convert rfl | |
variables {ΞΉ' : Type*} [fintype ΞΉ'] [fintype ΞΉ] | |
section basic | |
@[simp] lemma discr_reindex (b : basis ΞΉ A B) (f : ΞΉ β ΞΉ') : | |
discr A (b β β(f.symm)) = discr A b := | |
begin | |
classical, | |
rw [β basis.coe_reindex, discr_def, trace_matrix_reindex, det_reindex_self, β discr_def] | |
end | |
/-- If `b` is not linear independent, then `algebra.discr A b = 0`. -/ | |
lemma discr_zero_of_not_linear_independent [is_domain A] {b : ΞΉ β B} | |
(hli : Β¬linear_independent A b) : discr A b = 0 := | |
begin | |
classical, | |
obtain β¨g, hg, i, hiβ© := fintype.not_linear_independent_iff.1 hli, | |
have : (trace_matrix A b).mul_vec g = 0, | |
{ ext i, | |
have : β j, (trace A B) (b i * b j) * g j = (trace A B) (((g j) β’ (b j)) * b i), | |
{ intro j, simp [mul_comm], }, | |
simp only [mul_vec, dot_product, trace_matrix, pi.zero_apply, trace_form_apply, | |
Ξ» j, this j, β linear_map.map_sum, β sum_mul, hg, zero_mul, linear_map.map_zero] }, | |
by_contra h, | |
rw discr_def at h, | |
simpa [matrix.eq_zero_of_mul_vec_eq_zero h this] using hi, | |
end | |
variable {A} | |
/-- Relation between `algebra.discr A ΞΉ b` and | |
`algebra.discr A ((P.map (algebra_map A B)).vec_mul b)`. -/ | |
lemma discr_of_matrix_vec_mul [decidable_eq ΞΉ] (b : ΞΉ β B) (P : matrix ΞΉ ΞΉ A) : | |
discr A ((P.map (algebra_map A B)).vec_mul b) = P.det ^ 2 * discr A b := | |
by rw [discr_def, trace_matrix_of_matrix_vec_mul, det_mul, det_mul, det_transpose, mul_comm, | |
β mul_assoc, discr_def, pow_two] | |
/-- Relation between `algebra.discr A ΞΉ b` and | |
`algebra.discr A ((P.map (algebra_map A B)).mul_vec b)`. -/ | |
lemma discr_of_matrix_mul_vec [decidable_eq ΞΉ] (b : ΞΉ β B) (P : matrix ΞΉ ΞΉ A) : | |
discr A ((P.map (algebra_map A B)).mul_vec b) = P.det ^ 2 * discr A b := | |
by rw [discr_def, trace_matrix_of_matrix_mul_vec, det_mul, det_mul, det_transpose, | |
mul_comm, β mul_assoc, discr_def, pow_two] | |
end basic | |
section field | |
variables (K : Type u) {L : Type v} (E : Type z) [field K] [field L] [field E] | |
variables [algebra K L] [algebra K E] | |
variables [module.finite K L] [is_alg_closed E] | |
/-- Over a field, if `b` is a basis, then `algebra.discr K b β 0`. -/ | |
lemma discr_not_zero_of_basis [is_separable K L] (b : basis ΞΉ K L) : discr K b β 0 := | |
begin | |
casesI is_empty_or_nonempty ΞΉ, | |
{ simp [discr] }, | |
{ have := span_eq_top_of_linear_independent_of_card_eq_finrank b.linear_independent | |
(finrank_eq_card_basis b).symm, | |
rw [discr_def, trace_matrix_def], | |
simp_rw [β basis.mk_apply b.linear_independent this.ge], | |
rw [β trace_matrix_def, trace_matrix_of_basis, β bilin_form.nondegenerate_iff_det_ne_zero], | |
exact trace_form_nondegenerate _ _ }, | |
end | |
/-- Over a field, if `b` is a basis, then `algebra.discr K b` is a unit. -/ | |
lemma discr_is_unit_of_basis [is_separable K L] (b : basis ΞΉ K L) : is_unit (discr K b) := | |
is_unit.mk0 _ (discr_not_zero_of_basis _ _) | |
variables (b : ΞΉ β L) (pb : power_basis K L) | |
/-- If `L/K` is a field extension and `b : ΞΉ β L`, then `discr K b` is the square of the | |
determinant of the matrix whose `(i, j)` coefficient is `Οβ±Ό (b i)`, where `Οβ±Ό : L ββ[K] E` is the | |
embedding in an algebraically closed field `E` corresponding to `j : ΞΉ` via a bijection | |
`e : ΞΉ β (L ββ[K] E)`. -/ | |
lemma discr_eq_det_embeddings_matrix_reindex_pow_two [decidable_eq ΞΉ] [is_separable K L] | |
(e : ΞΉ β (L ββ[K] E)) : algebra_map K E (discr K b) = | |
(embeddings_matrix_reindex K E b e).det ^ 2 := | |
by rw [discr_def, ring_hom.map_det, ring_hom.map_matrix_apply, | |
trace_matrix_eq_embeddings_matrix_reindex_mul_trans, det_mul, det_transpose, pow_two] | |
/-- The discriminant of a power basis. -/ | |
lemma discr_power_basis_eq_prod (e : fin pb.dim β (L ββ[K] E)) [is_separable K L] : | |
algebra_map K E (discr K pb.basis) = | |
β i : fin pb.dim, β j in Ioi i, (e j pb.gen- (e i pb.gen)) ^ 2 := | |
begin | |
rw [discr_eq_det_embeddings_matrix_reindex_pow_two K E pb.basis e, | |
embeddings_matrix_reindex_eq_vandermonde, det_transpose, det_vandermonde, β prod_pow], | |
congr, ext i, | |
rw [β prod_pow] | |
end | |
/-- A variation of `of_power_basis_eq_prod`. -/ | |
lemma discr_power_basis_eq_prod' [is_separable K L] (e : fin pb.dim β (L ββ[K] E)) : | |
algebra_map K E (discr K pb.basis) = | |
β i : fin pb.dim, β j in Ioi i, -((e j pb.gen - e i pb.gen) * (e i pb.gen - e j pb.gen)) := | |
begin | |
rw [discr_power_basis_eq_prod _ _ _ e], | |
congr, ext i, congr, ext j, | |
ring | |
end | |
local notation `n` := finrank K L | |
/-- A variation of `of_power_basis_eq_prod`. -/ | |
lemma discr_power_basis_eq_prod'' [is_separable K L] (e : fin pb.dim β (L ββ[K] E)) : | |
algebra_map K E (discr K pb.basis) = | |
(-1) ^ (n * (n - 1) / 2) * β i : fin pb.dim, β j in Ioi i, | |
(e j pb.gen - e i pb.gen) * (e i pb.gen - e j pb.gen) := | |
begin | |
rw [discr_power_basis_eq_prod' _ _ _ e], | |
simp_rw [Ξ» i j, neg_eq_neg_one_mul ((e j pb.gen- (e i pb.gen)) * (e i pb.gen- (e j pb.gen))), | |
prod_mul_distrib], | |
congr, | |
simp only [prod_pow_eq_pow_sum, prod_const], | |
congr, | |
rw [β @nat.cast_inj β, nat.cast_sum], | |
have : β (x : fin pb.dim), (βx + 1) β€ pb.dim := by simp [nat.succ_le_iff, fin.is_lt], | |
simp_rw [fin.card_Ioi, nat.sub_sub, add_comm 1], | |
simp only [nat.cast_sub, this, finset.card_fin, nsmul_eq_mul, sum_const, sum_sub_distrib, | |
nat.cast_add, nat.cast_one, sum_add_distrib, mul_one], | |
rw [β nat.cast_sum, β @finset.sum_range β _ pb.dim (Ξ» i, i), sum_range_id ], | |
have hn : n = pb.dim, | |
{ rw [β alg_hom.card K L E, β fintype.card_fin pb.dim], | |
exact card_congr (equiv.symm e) }, | |
have hβ : 2 β£ (pb.dim * (pb.dim - 1)) := even_iff_two_dvd.1 (nat.even_mul_self_pred _), | |
have hne : ((2 : β) : β) β 0 := by simp, | |
have hle : 1 β€ pb.dim, | |
{ rw [β hn, nat.one_le_iff_ne_zero, β zero_lt_iff, finite_dimensional.finrank_pos_iff], | |
apply_instance }, | |
rw [hn, nat.cast_div hβ hne, nat.cast_mul, nat.cast_sub hle], | |
field_simp, | |
ring, | |
end | |
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/ | |
lemma discr_power_basis_eq_norm [is_separable K L] : discr K pb.basis = | |
(-1) ^ (n * (n - 1) / 2) * (norm K (aeval pb.gen (minpoly K pb.gen).derivative)) := | |
begin | |
let E := algebraic_closure L, | |
letI := Ξ» (a b : E), classical.prop_decidable (eq a b), | |
have e : fin pb.dim β (L ββ[K] E), | |
{ refine equiv_of_card_eq _, | |
rw [fintype.card_fin, alg_hom.card], | |
exact (power_basis.finrank pb).symm }, | |
have hnodup : (map (algebra_map K E) (minpoly K pb.gen)).roots.nodup := | |
nodup_roots (separable.map (is_separable.separable K pb.gen)), | |
have hroots : β Ο : L ββ[K] E, Ο pb.gen β (map (algebra_map K E) (minpoly K pb.gen)).roots, | |
{ intro Ο, | |
rw [mem_roots, is_root.def, eval_map, β aeval_def, aeval_alg_hom_apply], | |
repeat { simp [minpoly.ne_zero (is_separable.is_integral K pb.gen)] } }, | |
apply (algebra_map K E).injective, | |
rw [ring_hom.map_mul, ring_hom.map_pow, ring_hom.map_neg, ring_hom.map_one, | |
discr_power_basis_eq_prod'' _ _ _ e], | |
congr, | |
rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag], | |
conv_rhs { congr, skip, funext, | |
rw [β aeval_alg_hom_apply, aeval_root_derivative_of_splits (minpoly.monic | |
(is_separable.is_integral K pb.gen)) (is_alg_closed.splits_codomain _) (hroots Ο), | |
β finset.prod_mk _ (hnodup.erase _)] }, | |
rw [prod_sigma', prod_sigma'], | |
refine prod_bij (Ξ» i hi, β¨e i.2, e i.1 pb.genβ©) (Ξ» i hi, _) (Ξ» i hi, by simp at hi) | |
(Ξ» i j hi hj hij, _) (Ξ» Ο hΟ, _), | |
{ simp only [true_and, finset.mem_mk, mem_univ, mem_sigma], | |
rw [multiset.mem_erase_of_ne (Ξ» h, _)], | |
{ exact hroots _ }, | |
{ simp only [true_and, mem_univ, ne.def, mem_sigma, mem_compl, mem_singleton] at hi, | |
rw [β power_basis.lift_equiv_apply_coe, β power_basis.lift_equiv_apply_coe] at h, | |
exact hi (e.injective $ pb.lift_equiv.injective $ subtype.eq h.symm) } }, | |
{ simp only [equiv.apply_eq_iff_eq, heq_iff_eq] at hij, | |
have h := hij.2, | |
rw [β power_basis.lift_equiv_apply_coe, β power_basis.lift_equiv_apply_coe] at h, | |
refine sigma.eq (equiv.injective e (equiv.injective _ (subtype.eq h))) (by simp [hij.1]) }, | |
{ simp only [true_and, finset.mem_mk, mem_univ, mem_sigma] at β’ hΟ, | |
simp only [sigma.exists, exists_prop, mem_compl, mem_singleton, ne.def], | |
refine β¨e.symm (power_basis.lift pb Ο.2 _), e.symm Ο.1, β¨Ξ» h, _, sigma.eq _ _β©β©, | |
{ rw [aeval_def, evalβ_eq_eval_map, β is_root.def, β mem_roots], | |
{ exact multiset.erase_subset _ _ hΟ }, | |
{ simp [minpoly.ne_zero (is_separable.is_integral K pb.gen)] } }, | |
{ replace h := alg_hom.congr_fun (equiv.injective _ h) pb.gen, | |
rw [power_basis.lift_gen] at h, | |
rw [β h] at hΟ, | |
exact hnodup.not_mem_erase hΟ }, | |
all_goals { simp } } | |
end | |
section integral | |
variables {R : Type z} [comm_ring R] [algebra R K] [algebra R L] [is_scalar_tower R K L] | |
local notation `is_integral` := _root_.is_integral | |
/-- If `K` and `L` are fields and `is_scalar_tower R K L`, and `b : ΞΉ β L` satisfies | |
` β i, is_integral R (b i)`, then `is_integral R (discr K b)`. -/ | |
lemma discr_is_integral {b : ΞΉ β L} (h : β i, is_integral R (b i)) : | |
is_integral R (discr K b) := | |
begin | |
classical, | |
rw [discr_def], | |
exact is_integral.det (Ξ» i j, is_integral_trace (is_integral_mul (h i) (h j))) | |
end | |
/-- If `b` and `b'` are `β`-bases of a number field `K` such that | |
`β i j, is_integral β€ (b.to_matrix b' i j)` and `β i j, is_integral β€ (b'.to_matrix b i j)` then | |
`discr β b = discr β b'`. -/ | |
lemma discr_eq_discr_of_to_matrix_coeff_is_integral [number_field K] {b : basis ΞΉ β K} | |
{b' : basis ΞΉ' β K} (h : β i j, is_integral β€ (b.to_matrix b' i j)) | |
(h' : β i j, is_integral β€ (b'.to_matrix b i j)) : | |
discr β b = discr β b' := | |
begin | |
replace h' : β i j, is_integral β€ (b'.to_matrix ((b.reindex (b.index_equiv b'))) i j), | |
{ intros i j, | |
convert h' i ((b.index_equiv b').symm j), | |
simpa }, | |
classical, | |
rw [β (b.reindex (b.index_equiv b')).to_matrix_map_vec_mul b', discr_of_matrix_vec_mul, | |
β one_mul (discr β b), basis.coe_reindex, discr_reindex], | |
congr, | |
have hint : is_integral β€ (((b.reindex (b.index_equiv b')).to_matrix b').det) := | |
is_integral.det (Ξ» i j, h _ _), | |
obtain β¨r, hrβ© := is_integrally_closed.is_integral_iff.1 hint, | |
have hunit : is_unit r, | |
{ have : is_integral β€ ((b'.to_matrix (b.reindex (b.index_equiv b'))).det) := | |
is_integral.det (Ξ» i j, h' _ _), | |
obtain β¨r', hr'β© := is_integrally_closed.is_integral_iff.1 this, | |
refine is_unit_iff_exists_inv.2 β¨r', _β©, | |
suffices : algebra_map β€ β (r * r') = 1, | |
{ rw [β ring_hom.map_one (algebra_map β€ β)] at this, | |
exact (is_fraction_ring.injective β€ β) this }, | |
rw [ring_hom.map_mul, hr, hr', β det_mul, basis.to_matrix_mul_to_matrix_flip, det_one] }, | |
rw [β ring_hom.map_one (algebra_map β€ β), β hr], | |
cases int.is_unit_iff.1 hunit with hp hm, | |
{ simp [hp] }, | |
{ simp [hm] } | |
end | |
/-- Let `K` be the fraction field of an integrally closed domain `R` and let `L` be a finite | |
separable extension of `K`. Let `B : power_basis K L` be such that `is_integral R B.gen`. | |
Then for all, `z : L` that are integral over `R`, we have | |
`(discr K B.basis) β’ z β adjoin R ({B.gen} : set L)`. -/ | |
lemma discr_mul_is_integral_mem_adjoin [is_domain R] [is_separable K L] [is_integrally_closed R] | |
[is_fraction_ring R K] {B : power_basis K L} (hint : is_integral R B.gen) {z : L} | |
(hz : is_integral R z) : (discr K B.basis) β’ z β adjoin R ({B.gen} : set L) := | |
begin | |
have hinv : is_unit (trace_matrix K B.basis).det := | |
by simpa [β discr_def] using discr_is_unit_of_basis _ B.basis, | |
have H : (trace_matrix K B.basis).det β’ (trace_matrix K B.basis).mul_vec (B.basis.equiv_fun z) = | |
(trace_matrix K B.basis).det β’ (Ξ» i, trace K L (z * B.basis i)), | |
{ congr, exact trace_matrix_of_basis_mul_vec _ _ }, | |
have cramer := mul_vec_cramer (trace_matrix K B.basis) (Ξ» i, trace K L (z * B.basis i)), | |
suffices : β i, ((trace_matrix K B.basis).det β’ (B.basis.equiv_fun z)) i β (β₯ : subalgebra R K), | |
{ rw [β B.basis.sum_repr z, finset.smul_sum], | |
refine subalgebra.sum_mem _ (Ξ» i hi, _), | |
replace this := this i, | |
rw [β discr_def, pi.smul_apply, mem_bot] at this, | |
obtain β¨r, hrβ© := this, | |
rw [basis.equiv_fun_apply] at hr, | |
rw [β smul_assoc, β hr, algebra_map_smul], | |
refine subalgebra.smul_mem _ _ _, | |
rw [B.basis_eq_pow i], | |
refine subalgebra.pow_mem _ (subset_adjoin (set.mem_singleton _)) _}, | |
intro i, | |
rw [β H, β mul_vec_smul] at cramer, | |
replace cramer := congr_arg (mul_vec (trace_matrix K B.basis)β»ΒΉ) cramer, | |
rw [mul_vec_mul_vec, nonsing_inv_mul _ hinv, mul_vec_mul_vec, nonsing_inv_mul _ hinv, | |
one_mul_vec, one_mul_vec] at cramer, | |
rw [β congr_fun cramer i, cramer_apply, det_apply], | |
refine subalgebra.sum_mem _ (Ξ» Ο _, subalgebra.zsmul_mem _ (subalgebra.prod_mem _ (Ξ» j _, _)) _), | |
by_cases hji : j = i, | |
{ simp only [update_column_apply, hji, eq_self_iff_true, power_basis.coe_basis], | |
exact mem_bot.2 (is_integrally_closed.is_integral_iff.1 $ is_integral_trace $ | |
is_integral_mul hz $ is_integral.pow hint _) }, | |
{ simp only [update_column_apply, hji, power_basis.coe_basis], | |
exact mem_bot.2 (is_integrally_closed.is_integral_iff.1 $ is_integral_trace | |
$ is_integral_mul (is_integral.pow hint _) (is_integral.pow hint _)) } | |
end | |
end integral | |
end field | |
end discr | |
end algebra | |