Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 90b0d53

Browse files
feat(linear_algebra/free_module/ideal_quotient): prove dimension of quotient by ideal equals degree of norm of generator (#19121)
Also refactor file into `namespace ideal`. Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
1 parent e1e7190 commit 90b0d53

2 files changed

Lines changed: 100 additions & 19 deletions

File tree

src/linear_algebra/free_module/ideal_quotient.lean

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@ import linear_algebra.quotient_pi
2222
2323
-/
2424

25-
open_locale big_operators direct_sum
25+
namespace ideal
2626

27-
variables {ι R S : Type*} [comm_ring R] [comm_ring S] [algebra R S]
28-
variables [is_domain R] [is_principal_ideal_ring R] [is_domain S] [fintype ι]
27+
open_locale big_operators direct_sum polynomial
28+
29+
variables {R S ι : Type*} [comm_ring R] [comm_ring S] [algebra R S]
30+
variables [is_domain R] [is_principal_ideal_ring R] [is_domain S] [finite ι]
2931

3032
/-- We can write the quotient of an ideal over a PID as a product of quotients by principal ideals.
3133
-/
32-
noncomputable def ideal.quotient_equiv_pi_span
34+
noncomputable def quotient_equiv_pi_span
3335
(I : ideal S) (b : basis ι R S) (hI : I ≠ ⊥) :
34-
(S ⧸ I) ≃ₗ[R] Π i, (R ⧸ ideal.span ({I.smith_coeffs b hI i} : set R)) :=
36+
(S ⧸ I) ≃ₗ[R] Π i, (R ⧸ span ({I.smith_coeffs b hI i} : set R)) :=
3537
begin
38+
haveI := fintype.of_finite ι,
3639
-- Choose `e : S ≃ₗ I` and a basis `b'` for `S` that turns the map
3740
-- `f := ((submodule.subtype I).restrict_scalars R).comp e` into a diagonal matrix:
3841
-- there is an `a : ι → ℤ` such that `f (b' i) = a i • b' i`.
@@ -57,10 +60,10 @@ begin
5760

5861
-- Now we map everything through the linear equiv `S ≃ₗ (ι → R)`,
5962
-- which maps `I` to `I' := Π i, a i ℤ`.
60-
let I' : submodule R (ι → R) := submodule.pi set.univ (λ i, ideal.span ({a i} : set R)),
63+
let I' : submodule R (ι → R) := submodule.pi set.univ (λ i, span ({a i} : set R)),
6164
have : submodule.map (b'.equiv_fun : S →ₗ[R] (ι → R)) (I.restrict_scalars R) = I',
6265
{ ext x,
63-
simp only [submodule.mem_map, submodule.mem_pi, ideal.mem_span_singleton, set.mem_univ,
66+
simp only [submodule.mem_map, submodule.mem_pi, mem_span_singleton, set.mem_univ,
6467
submodule.restrict_scalars_mem, mem_I_iff, smul_eq_mul, forall_true_left,
6568
linear_equiv.coe_coe, basis.equiv_fun_apply],
6669
split,
@@ -73,18 +76,18 @@ begin
7376
refine (submodule.quotient.equiv (I.restrict_scalars R) I' b'.equiv_fun this).trans _,
7477
any_goals { apply ring_hom.id }, any_goals { apply_instance },
7578
classical,
76-
let := submodule.quotient_pi (show Π i, submodule R R, from λ i, ideal.span ({a i} : set R)),
79+
let := submodule.quotient_pi (show Π i, submodule R R, from λ i, span ({a i} : set R)),
7780
exact this
7881
end
7982

8083
/-- Ideal quotients over a free finite extension of `ℤ` are isomorphic to a direct product of
8184
`zmod`. -/
82-
noncomputable def ideal.quotient_equiv_pi_zmod
85+
noncomputable def quotient_equiv_pi_zmod
8386
(I : ideal S) (b : basis ι ℤ S) (hI : I ≠ ⊥) :
8487
(S ⧸ I) ≃+ Π i, (zmod (I.smith_coeffs b hI i).nat_abs) :=
8588
let a := I.smith_coeffs b hI,
8689
e := I.quotient_equiv_pi_span b hI,
87-
e' : (Π (i : ι), (ℤ ⧸ ideal.span ({a i} : set ℤ))) ≃+ Π (i : ι), zmod (a i).nat_abs :=
90+
e' : (Π (i : ι), (ℤ ⧸ span ({a i} : set ℤ))) ≃+ Π (i : ι), zmod (a i).nat_abs :=
8891
add_equiv.Pi_congr_right (λ i, ↑(int.quotient_span_equiv_zmod (a i)))
8992
in (↑(e : (S ⧸ I) ≃ₗ[ℤ] _) : (S ⧸ I ≃+ _)).trans e'
9093

@@ -93,38 +96,41 @@ in (↑(e : (S ⧸ I) ≃ₗ[ℤ] _) : (S ⧸ I ≃+ _)).trans e'
9396
Can't be an instance because of the side condition `I ≠ ⊥`, and more importantly,
9497
because the choice of `fintype` instance is non-canonical.
9598
-/
96-
noncomputable def ideal.fintype_quotient_of_free_of_ne_bot [module.free ℤ S] [module.finite ℤ S]
99+
noncomputable def fintype_quotient_of_free_of_ne_bot [module.free ℤ S] [module.finite ℤ S]
97100
(I : ideal S) (hI : I ≠ ⊥) :
98101
fintype (S ⧸ I) :=
99102
let b := module.free.choose_basis ℤ S,
100103
a := I.smith_coeffs b hI,
101104
e := I.quotient_equiv_pi_zmod b hI
102105
in by haveI : ∀ i, ne_zero (a i).nat_abs :=
103-
(λ i, ⟨int.nat_abs_ne_zero_of_ne_zero (ideal.smith_coeffs_ne_zero b I hI i)⟩); classical;
106+
(λ i, ⟨int.nat_abs_ne_zero_of_ne_zero (smith_coeffs_ne_zero b I hI i)⟩); classical;
104107
exact fintype.of_equiv (Π i, zmod (a i).nat_abs) e.symm
105108

106109
variables (F : Type*) [comm_ring F] [algebra F R] [algebra F S] [is_scalar_tower F R S]
107110
(b : basis ι R S) {I : ideal S} (hI : I ≠ ⊥)
108111

109112
/-- Decompose `S⧸I` as a direct sum of cyclic `R`-modules
110113
(quotients by the ideals generated by Smith coefficients of `I`). -/
111-
noncomputable def ideal.quotient_equiv_direct_sum :
112-
(S ⧸ I) ≃ₗ[F] ⨁ i, R ⧸ ideal.span ({I.smith_coeffs b hI i} : set R) :=
114+
noncomputable def quotient_equiv_direct_sum :
115+
(S ⧸ I) ≃ₗ[F] ⨁ i, R ⧸ span ({I.smith_coeffs b hI i} : set R) :=
113116
begin
117+
haveI := fintype.of_finite ι,
114118
apply ((I.quotient_equiv_pi_span b _).restrict_scalars F).trans
115119
(direct_sum.linear_equiv_fun_on_fintype _ _ _).symm,
116120
exact linear_map.is_scalar_tower.compatible_smul
117121
-- why doesn't it automatically apply?
118122
-- even after `change linear_map.compatible_smul _ (Π i, R ⧸ span _) F R`
119123
end
120124

121-
lemma ideal.finrank_quotient_eq_sum [nontrivial F]
122-
[∀ i, module.free F (R ⧸ ideal.span ({I.smith_coeffs b hI i} : set R))]
123-
[∀ i, module.finite F (R ⧸ ideal.span ({I.smith_coeffs b hI i} : set R))] :
125+
lemma finrank_quotient_eq_sum {ι} [fintype ι] (b : basis ι R S) [nontrivial F]
126+
[∀ i, module.free F (R ⧸ span ({I.smith_coeffs b hI i} : set R))]
127+
[∀ i, module.finite F (R ⧸ span ({I.smith_coeffs b hI i} : set R))] :
124128
finite_dimensional.finrank F (S ⧸ I)
125-
= ∑ i, finite_dimensional.finrank F (R ⧸ ideal.span ({I.smith_coeffs b hI i} : set R)) :=
129+
= ∑ i, finite_dimensional.finrank F (R ⧸ span ({I.smith_coeffs b hI i} : set R)) :=
126130
begin
127-
rw [linear_equiv.finrank_eq $ ideal.quotient_equiv_direct_sum F b hI,
131+
rw [linear_equiv.finrank_eq $ quotient_equiv_direct_sum F b hI,
128132
finite_dimensional.finrank_direct_sum]
129133
-- slow, and dot notation doesn't work
130134
end
135+
136+
end ideal
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/-
2+
Copyright (c) 2023 Junyan Xu. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Junyan Xu
5+
-/
6+
7+
import linear_algebra.free_module.ideal_quotient
8+
import ring_theory.norm
9+
10+
/-!
11+
# Norms on free modules over principal ideal domains
12+
-/
13+
14+
open ideal polynomial
15+
16+
open_locale big_operators polynomial
17+
18+
variables {R S ι : Type*} [comm_ring R] [is_domain R] [is_principal_ideal_ring R] [comm_ring S]
19+
[is_domain S] [algebra R S]
20+
21+
section comm_ring
22+
23+
variables (F : Type*) [comm_ring F] [algebra F R] [algebra F S] [is_scalar_tower F R S]
24+
25+
/-- For a nonzero element `f` in an algebra `S` over a principal ideal domain `R` that is finite and
26+
free as an `R`-module, the norm of `f` relative to `R` is associated to the product of the Smith
27+
coefficients of the ideal generated by `f`. -/
28+
lemma associated_norm_prod_smith [fintype ι] (b : basis ι R S) {f : S} (hf : f ≠ 0) :
29+
associated (algebra.norm R f) (∏ i, smith_coeffs b _ (span_singleton_eq_bot.not.2 hf) i) :=
30+
begin
31+
have hI := span_singleton_eq_bot.not.2 hf,
32+
let b' := ring_basis b (span {f}) hI,
33+
classical,
34+
rw [← matrix.det_diagonal, ← linear_map.det_to_lin b'],
35+
let e := (b'.equiv ((span {f}).self_basis b hI) $ equiv.refl _).trans
36+
((linear_equiv.coord S S f hf).restrict_scalars R),
37+
refine (linear_map.associated_det_of_eq_comp e _ _ _).symm,
38+
dsimp only [e, linear_equiv.trans_apply],
39+
simp_rw [← linear_equiv.coe_to_linear_map, ← linear_map.comp_apply, ← linear_map.ext_iff],
40+
refine b'.ext (λ i, _),
41+
simp_rw [linear_map.comp_apply, linear_equiv.coe_to_linear_map, matrix.to_lin_apply,
42+
basis.repr_self, finsupp.single_eq_pi_single, matrix.diagonal_mul_vec_single, pi.single_apply,
43+
ite_smul, zero_smul, finset.sum_ite_eq', mul_one, if_pos (finset.mem_univ _), b'.equiv_apply],
44+
change _ = f * _,
45+
rw [mul_comm, ← smul_eq_mul, linear_equiv.restrict_scalars_apply, linear_equiv.coord_apply_smul,
46+
ideal.self_basis_def],
47+
refl
48+
end
49+
50+
end comm_ring
51+
52+
section field
53+
54+
variables {F : Type*} [field F] [algebra F[X] S] [finite ι]
55+
56+
instance (b : basis ι F[X] S) {I : ideal S} (hI : I ≠ ⊥) (i : ι) :
57+
finite_dimensional F (F[X] ⧸ span ({I.smith_coeffs b hI i} : set F[X])) :=
58+
(adjoin_root.power_basis $ I.smith_coeffs_ne_zero b hI i).finite_dimensional
59+
60+
/-- For a nonzero element `f` in a `F[X]`-module `S`, the dimension of $S/\langle f \rangle$ as an
61+
`F`-vector space is the degree of the norm of `f` relative to `F[X]`. -/
62+
lemma finrank_quotient_span_eq_nat_degree_norm [algebra F S] [is_scalar_tower F F[X] S]
63+
(b : basis ι F[X] S) {f : S} (hf : f ≠ 0) :
64+
finite_dimensional.finrank F (S ⧸ span ({f} : set S)) = (algebra.norm F[X] f).nat_degree :=
65+
begin
66+
haveI := fintype.of_finite ι,
67+
have h := span_singleton_eq_bot.not.2 hf,
68+
rw [nat_degree_eq_of_degree_eq (degree_eq_degree_of_associated $ associated_norm_prod_smith b hf),
69+
nat_degree_prod _ _ (λ i _, smith_coeffs_ne_zero b _ h i), finrank_quotient_eq_sum F h b],
70+
-- finrank_quotient_eq_sum slow
71+
congr' with i,
72+
exact (adjoin_root.power_basis $ smith_coeffs_ne_zero b _ h i).finrank
73+
end
74+
75+
end field

0 commit comments

Comments
 (0)