@@ -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)) :=
3537begin
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
7881end
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) :=
8588let 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)))
8992in (↑(e : (S ⧸ I) ≃ₗ[ℤ] _) : (S ⧸ I ≃+ _)).trans e'
9093
@@ -93,38 +96,41 @@ in (↑(e : (S ⧸ I) ≃ₗ[ℤ] _) : (S ⧸ I ≃+ _)).trans e'
9396Can't be an instance because of the side condition `I ≠ ⊥`, and more importantly,
9497because 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) :=
99102let b := module.free.choose_basis ℤ S,
100103 a := I.smith_coeffs b hI,
101104 e := I.quotient_equiv_pi_zmod b hI
102105in 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
106109variables (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) :=
113116begin
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`
119123end
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)) :=
126130begin
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
130134end
135+
136+ end ideal
0 commit comments