|
| 1 | +/- |
| 2 | +Copyright (c) 2022 Pierre-Alexandre Bazin. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Pierre-Alexandre Bazin |
| 5 | +-/ |
| 6 | +import algebra.module.dedekind_domain |
| 7 | +import linear_algebra.free_module.pid |
| 8 | +import algebra.module.projective |
| 9 | +import algebra.category.Module.biproducts |
| 10 | + |
| 11 | +/-! |
| 12 | +# Structure of finitely generated modules over a PID |
| 13 | +
|
| 14 | +## Main statements |
| 15 | +
|
| 16 | +* `module.equiv_direct_sum_of_is_torsion` : A finitely generated torsion module over a PID is |
| 17 | + isomorphic to a direct sum of some `R ⧸ R ∙ (p i ^ e i)` where the `p i ^ e i` are prime powers. |
| 18 | +* `module.equiv_free_prod_direct_sum` : A finitely generated module over a PID is isomorphic to the |
| 19 | + product of a free module (its torsion free part) and a direct sum of the form above (its torsion |
| 20 | + submodule). |
| 21 | +
|
| 22 | +## Notation |
| 23 | +
|
| 24 | +* `R` is a PID and `M` is a (finitely generated for main statements) `R`-module, with additional |
| 25 | + torsion hypotheses in the intermediate lemmas. |
| 26 | +* `N` is a `R`-module lying over a higher type universe than `R`. This assumption is needed on the |
| 27 | + final statement for technical reasons. |
| 28 | +* `p` is an irreducible element of `R` or a tuple of these. |
| 29 | +
|
| 30 | +## Implementation details |
| 31 | +
|
| 32 | +We first prove (`submodule.is_internal_prime_power_torsion_of_pid`) that a finitely generated |
| 33 | +torsion module is the internal direct sum of its `p i ^ e i`-torsion submodules for some |
| 34 | +(finitely many) prime powers `p i ^ e i`. This is proved in more generality for a Dedekind domain |
| 35 | +at `submodule.is_internal_prime_power_torsion`. |
| 36 | +
|
| 37 | +Then we treat the case of a `p ^ ∞`-torsion module (that is, a module where all elements are |
| 38 | +cancelled by scalar multiplication by some power of `p`) and apply it to the `p i ^ e i`-torsion |
| 39 | +submodules (that are `p i ^ ∞`-torsion) to get the result for torsion modules. |
| 40 | +
|
| 41 | +Then we get the general result using that a torsion free module is free (which has been proved at |
| 42 | +`module.free_of_finite_type_torsion_free'` at `linear_algebra/free_module/pid.lean`.) |
| 43 | +
|
| 44 | +## Tags |
| 45 | +
|
| 46 | +Finitely generated module, principal ideal domain, classification, structure theorem |
| 47 | +-/ |
| 48 | + |
| 49 | +universes u v |
| 50 | +open_locale big_operators |
| 51 | + |
| 52 | +variables {R : Type u} [comm_ring R] [is_domain R] [is_principal_ideal_ring R] |
| 53 | +variables {M : Type v} [add_comm_group M] [module R M] |
| 54 | +variables {N : Type (max u v)} [add_comm_group N] [module R N] |
| 55 | + |
| 56 | +open_locale direct_sum |
| 57 | +open submodule |
| 58 | + |
| 59 | +/--A finitely generated torsion module over a PID is an internal direct sum of its |
| 60 | +`p i ^ e i`-torsion submodules for some primes `p i` and numbers `e i`.-/ |
| 61 | +theorem submodule.is_internal_prime_power_torsion_of_pid |
| 62 | + [module.finite R M] (hM : module.is_torsion R M) : |
| 63 | + ∃ (ι : Type u) [fintype ι] [decidable_eq ι] (p : ι → R) [∀ i, irreducible $ p i] (e : ι → ℕ), |
| 64 | + by exactI direct_sum.is_internal (λ i, torsion_by R M $ p i ^ e i) := |
| 65 | +begin |
| 66 | + obtain ⟨P, dec, hP, e, this⟩ := is_internal_prime_power_torsion hM, |
| 67 | + refine ⟨P, infer_instance, dec, λ p, is_principal.generator (p : ideal R), _, e, _⟩, |
| 68 | + { rintro ⟨p, hp⟩, |
| 69 | + haveI := ideal.is_prime_of_prime (hP p hp), |
| 70 | + exact (is_principal.prime_generator_of_is_prime p (hP p hp).ne_zero).irreducible }, |
| 71 | + { convert this, ext p : 1, |
| 72 | + rw [← torsion_by_span_singleton_eq, ideal.submodule_span_eq, ← ideal.span_singleton_pow, |
| 73 | + ideal.span_singleton_generator] } |
| 74 | +end |
| 75 | + |
| 76 | +namespace module |
| 77 | +section p_torsion |
| 78 | +variables {p : R} (hp : irreducible p) (hM : module.is_torsion' M (submonoid.powers p)) |
| 79 | +variables [dec : Π x : M, decidable (x = 0)] |
| 80 | + |
| 81 | +open ideal submodule.is_principal |
| 82 | +include dec |
| 83 | + |
| 84 | +include hp hM |
| 85 | +lemma _root_.ideal.torsion_of_eq_span_pow_p_order (x : M) : |
| 86 | + torsion_of R M x = span {p ^ p_order hM x} := |
| 87 | +begin |
| 88 | + dunfold p_order, |
| 89 | + rw [← (torsion_of R M x).span_singleton_generator, ideal.span_singleton_eq_span_singleton, |
| 90 | + ← associates.mk_eq_mk_iff_associated, associates.mk_pow], |
| 91 | + have prop : (λ n : ℕ, p ^ n • x = 0) = |
| 92 | + λ n : ℕ, (associates.mk $ generator $ torsion_of R M x) ∣ associates.mk p ^ n, |
| 93 | + { ext n, rw [← associates.mk_pow, associates.mk_dvd_mk, ← mem_iff_generator_dvd], refl }, |
| 94 | + have := (is_torsion'_powers_iff p).mp hM x, rw prop at this, |
| 95 | + classical, |
| 96 | + convert associates.eq_pow_find_of_dvd_irreducible_pow ((associates.irreducible_mk p).mpr hp) |
| 97 | + this.some_spec, |
| 98 | +end |
| 99 | + |
| 100 | +lemma p_pow_smul_lift {x y : M} {k : ℕ} (hM' : module.is_torsion_by R M (p ^ p_order hM y)) |
| 101 | + (h : p ^ k • x ∈ R ∙ y) : ∃ a : R, p ^ k • x = p ^ k • a • y := |
| 102 | +begin |
| 103 | + by_cases hk : k ≤ p_order hM y, |
| 104 | + { let f := ((R ∙ p ^ (p_order hM y - k) * p ^ k).quot_equiv_of_eq _ _).trans |
| 105 | + (quot_torsion_of_equiv_span_singleton R M y), |
| 106 | + have : f.symm ⟨p ^ k • x, h⟩ ∈ |
| 107 | + R ∙ ideal.quotient.mk (R ∙ p ^ (p_order hM y - k) * p ^ k) (p ^ k), |
| 108 | + { rw [← quotient.torsion_by_eq_span_singleton, mem_torsion_by_iff, ← f.symm.map_smul], |
| 109 | + convert f.symm.map_zero, ext, |
| 110 | + rw [coe_smul_of_tower, coe_mk, coe_zero, smul_smul, ← pow_add, nat.sub_add_cancel hk, @hM' x], |
| 111 | + { exact mem_non_zero_divisors_of_ne_zero (pow_ne_zero _ hp.ne_zero) } }, |
| 112 | + rw submodule.mem_span_singleton at this, obtain ⟨a, ha⟩ := this, use a, |
| 113 | + rw [f.eq_symm_apply, ← ideal.quotient.mk_eq_mk, ← quotient.mk_smul] at ha, |
| 114 | + dsimp only [smul_eq_mul, f, linear_equiv.trans_apply, submodule.quot_equiv_of_eq_mk, |
| 115 | + quot_torsion_of_equiv_span_singleton_apply_mk] at ha, |
| 116 | + rw [smul_smul, mul_comm], exact congr_arg coe ha.symm, |
| 117 | + { symmetry, convert ideal.torsion_of_eq_span_pow_p_order hp hM y, |
| 118 | + rw [← pow_add, nat.sub_add_cancel hk] } }, |
| 119 | + { use 0, rw [zero_smul, smul_zero, ← nat.sub_add_cancel (le_of_not_le hk), |
| 120 | + pow_add, mul_smul, hM', smul_zero] } |
| 121 | +end |
| 122 | + |
| 123 | +open submodule.quotient |
| 124 | + |
| 125 | +lemma exists_smul_eq_zero_and_mk_eq {z : M} (hz : module.is_torsion_by R M (p ^ p_order hM z)) |
| 126 | + {k : ℕ} (f : (R ⧸ R ∙ p ^ k) →ₗ[R] M ⧸ R ∙ z) : |
| 127 | + ∃ x : M, p ^ k • x = 0 ∧ submodule.quotient.mk x = f 1 := |
| 128 | +begin |
| 129 | + have f1 := mk_surjective (R ∙ z) (f 1), |
| 130 | + have : p ^ k • f1.some ∈ R ∙ z, |
| 131 | + { rw [← quotient.mk_eq_zero, mk_smul, f1.some_spec, ← f.map_smul], |
| 132 | + convert f.map_zero, change _ • submodule.quotient.mk _ = _, |
| 133 | + rw [← mk_smul, quotient.mk_eq_zero, algebra.id.smul_eq_mul, mul_one], |
| 134 | + exact mem_span_singleton_self _ }, |
| 135 | + obtain ⟨a, ha⟩ := p_pow_smul_lift hp hM hz this, |
| 136 | + refine ⟨f1.some - a • z, by rw [smul_sub, sub_eq_zero, ha], _⟩, |
| 137 | + rw [mk_sub, mk_smul, (quotient.mk_eq_zero _).mpr $ mem_span_singleton_self _, |
| 138 | + smul_zero, sub_zero, f1.some_spec] |
| 139 | +end |
| 140 | + |
| 141 | +open finset multiset |
| 142 | +omit dec hM |
| 143 | + |
| 144 | +/--A finitely generated `p ^ ∞`-torsion module over a PID is isomorphic to a direct sum of some |
| 145 | + `R ⧸ R ∙ (p ^ e i)` for some `e i`.-/ |
| 146 | +theorem torsion_by_prime_power_decomposition (hN : module.is_torsion' N (submonoid.powers p)) |
| 147 | + [h' : module.finite R N] : |
| 148 | + ∃ (d : ℕ) (k : fin d → ℕ), nonempty $ N ≃ₗ[R] ⨁ (i : fin d), R ⧸ R ∙ (p ^ (k i : ℕ)) := |
| 149 | +begin |
| 150 | + obtain ⟨d, s, hs⟩ := @module.finite.exists_fin _ _ _ _ _ h', use d, clear h', |
| 151 | + unfreezingI { induction d with d IH generalizing N }, |
| 152 | + { use λ i, fin_zero_elim i, |
| 153 | + rw [set.range_eq_empty, submodule.span_empty] at hs, |
| 154 | + haveI : unique N := ⟨⟨0⟩, λ x, by { rw [← mem_bot _, hs], trivial }⟩, |
| 155 | + exact ⟨0⟩ }, |
| 156 | + { haveI : Π x : N, decidable (x = 0), classical, apply_instance, |
| 157 | + obtain ⟨j, hj⟩ := exists_is_torsion_by hN d.succ d.succ_ne_zero s hs, |
| 158 | + let s' : fin d → N ⧸ R ∙ s j := submodule.quotient.mk ∘ s ∘ j.succ_above, |
| 159 | + obtain ⟨k, ⟨f⟩⟩ := IH _ s' _; clear IH, |
| 160 | + { have : ∀ i : fin d, ∃ x : N, |
| 161 | + p ^ k i • x = 0 ∧ f (submodule.quotient.mk x) = direct_sum.lof R _ _ i 1, |
| 162 | + { intro i, |
| 163 | + let fi := f.symm.to_linear_map.comp (direct_sum.lof _ _ _ i), |
| 164 | + obtain ⟨x, h0, h1⟩ := exists_smul_eq_zero_and_mk_eq hp hN hj fi, refine ⟨x, h0, _⟩, rw h1, |
| 165 | + simp only [linear_map.coe_comp, f.symm.coe_to_linear_map, f.apply_symm_apply] }, |
| 166 | + refine ⟨_, ⟨((( |
| 167 | + @lequiv_prod_of_right_split_exact _ _ _ _ _ _ _ _ _ _ _ _ |
| 168 | + ((f.trans ulift.module_equiv.{u u v}.symm).to_linear_map.comp $ mkq _) |
| 169 | + ((direct_sum.to_module _ _ _ $ λ i, (liftq_span_singleton.{u u} (p ^ k i) |
| 170 | + (linear_map.to_span_singleton _ _ _) (this i).some_spec.left : R ⧸ _ →ₗ[R] _)).comp |
| 171 | + ulift.module_equiv.to_linear_map) |
| 172 | + (R ∙ s j).injective_subtype _ _).symm.trans $ |
| 173 | + ((quot_torsion_of_equiv_span_singleton _ _ _).symm.trans $ |
| 174 | + quot_equiv_of_eq _ _ $ ideal.torsion_of_eq_span_pow_p_order hp hN _).prod $ |
| 175 | + ulift.module_equiv).trans $ |
| 176 | + (@direct_sum.lequiv_prod_direct_sum R _ _ _ |
| 177 | + (λ i, R ⧸ R ∙ p ^ @option.rec _ (λ _, ℕ) (p_order hN $ s j) k i) _ _).symm).trans $ |
| 178 | + direct_sum.lequiv_congr_left R (fin_succ_equiv d).symm⟩⟩, |
| 179 | + { rw [range_subtype, linear_equiv.to_linear_map_eq_coe, linear_equiv.ker_comp, ker_mkq] }, |
| 180 | + { rw [linear_equiv.to_linear_map_eq_coe, ← f.comp_coe, linear_map.comp_assoc, |
| 181 | + linear_map.comp_assoc, ← linear_equiv.to_linear_map_eq_coe, |
| 182 | + linear_equiv.to_linear_map_symm_comp_eq, linear_map.comp_id, |
| 183 | + ← linear_map.comp_assoc, ← linear_map.comp_assoc], |
| 184 | + suffices : (f.to_linear_map.comp (R ∙ s j).mkq).comp _ = linear_map.id, |
| 185 | + { rw [← f.to_linear_map_eq_coe, this, linear_map.id_comp] }, |
| 186 | + ext i : 3, |
| 187 | + simp only [linear_map.coe_comp, function.comp_app, mkq_apply], |
| 188 | + rw [linear_equiv.coe_to_linear_map, linear_map.id_apply, direct_sum.to_module_lof, |
| 189 | + liftq_span_singleton_apply, linear_map.to_span_singleton_one, |
| 190 | + ideal.quotient.mk_eq_mk, map_one, (this i).some_spec.right] } }, |
| 191 | + { exact (mk_surjective _).forall.mpr |
| 192 | + (λ x, ⟨(@hN x).some, by rw [← quotient.mk_smul, (@hN x).some_spec, quotient.mk_zero]⟩) }, |
| 193 | + { have hs' := congr_arg (submodule.map $ mkq $ R ∙ s j) hs, |
| 194 | + rw [submodule.map_span, submodule.map_top, range_mkq] at hs', simp only [mkq_apply] at hs', |
| 195 | + simp only [s'], rw [set.range_comp (_ ∘ s), fin.range_succ_above], |
| 196 | + rw [← set.range_comp, ← set.insert_image_compl_eq_range _ j, function.comp_apply, |
| 197 | + (quotient.mk_eq_zero _).mpr (mem_span_singleton_self _), span_insert_zero] at hs', |
| 198 | + exact hs' } } |
| 199 | +end |
| 200 | +end p_torsion |
| 201 | + |
| 202 | +/--A finitely generated torsion module over a PID is isomorphic to a direct sum of some |
| 203 | + `R ⧸ R ∙ (p i ^ e i)` where the `p i ^ e i` are prime powers.-/ |
| 204 | +theorem equiv_direct_sum_of_is_torsion [h' : module.finite R N] (hN : module.is_torsion R N) : |
| 205 | + ∃ (ι : Type u) [fintype ι] (p : ι → R) [∀ i, irreducible $ p i] (e : ι → ℕ), |
| 206 | + nonempty $ N ≃ₗ[R] ⨁ (i : ι), R ⧸ R ∙ (p i ^ e i) := |
| 207 | +begin |
| 208 | + obtain ⟨I, fI, _, p, hp, e, h⟩ := submodule.is_internal_prime_power_torsion_of_pid hN, |
| 209 | + haveI := fI, |
| 210 | + have : ∀ i, ∃ (d : ℕ) (k : fin d → ℕ), |
| 211 | + nonempty $ torsion_by R N (p i ^ e i) ≃ₗ[R] ⨁ j, R ⧸ R ∙ (p i ^ k j), |
| 212 | + { haveI := is_noetherian_of_fg_of_noetherian' (module.finite_def.mp h'), |
| 213 | + haveI := λ i, is_noetherian_submodule' (torsion_by R N $ p i ^ e i), |
| 214 | + exact λ i, torsion_by_prime_power_decomposition (hp i) |
| 215 | + ((is_torsion'_powers_iff $ p i).mpr $ λ x, ⟨e i, smul_torsion_by _ _⟩) }, |
| 216 | + refine ⟨Σ i, fin (this i).some, infer_instance, |
| 217 | + λ ⟨i, j⟩, p i, λ ⟨i, j⟩, hp i, λ ⟨i, j⟩, (this i).some_spec.some j, |
| 218 | + ⟨(linear_equiv.of_bijective (direct_sum.coe_linear_map _) h.1 h.2).symm.trans $ |
| 219 | + (dfinsupp.map_range.linear_equiv $ λ i, (this i).some_spec.some_spec.some).trans $ |
| 220 | + (direct_sum.sigma_lcurry_equiv R).symm.trans |
| 221 | + (dfinsupp.map_range.linear_equiv $ λ i, quot_equiv_of_eq _ _ _)⟩⟩, |
| 222 | + cases i with i j, simp only |
| 223 | +end |
| 224 | + |
| 225 | +/--**Structure theorem of finitely generated modules over a PID** : A finitely generated |
| 226 | + module over a PID is isomorphic to the product of a free module and a direct sum of some |
| 227 | + `R ⧸ R ∙ (p i ^ e i)` where the `p i ^ e i` are prime powers.-/ |
| 228 | +theorem equiv_free_prod_direct_sum [h' : module.finite R N] : |
| 229 | + ∃ (n : ℕ) (ι : Type u) [fintype ι] (p : ι → R) [∀ i, irreducible $ p i] (e : ι → ℕ), |
| 230 | + nonempty $ N ≃ₗ[R] (fin n →₀ R) × ⨁ (i : ι), R ⧸ R ∙ (p i ^ e i) := |
| 231 | +begin |
| 232 | + haveI := is_noetherian_of_fg_of_noetherian' (module.finite_def.mp h'), |
| 233 | + haveI := is_noetherian_submodule' (torsion R N), |
| 234 | + haveI := module.finite.of_surjective _ (torsion R N).mkq_surjective, |
| 235 | + obtain ⟨I, fI, p, hp, e, ⟨h⟩⟩ := equiv_direct_sum_of_is_torsion (@torsion_is_torsion R N _ _ _), |
| 236 | + obtain ⟨n, ⟨g⟩⟩ := @module.free_of_finite_type_torsion_free' R _ _ _ (N ⧸ torsion R N) _ _ _ _, |
| 237 | + haveI : module.projective R (N ⧸ torsion R N) := module.projective_of_basis ⟨g⟩, |
| 238 | + obtain ⟨f, hf⟩ := module.projective_lifting_property _ linear_map.id (torsion R N).mkq_surjective, |
| 239 | + refine ⟨n, I, fI, p, hp, e, |
| 240 | + ⟨(lequiv_prod_of_right_split_exact (torsion R N).injective_subtype _ hf).symm.trans $ |
| 241 | + (h.prod g).trans $ linear_equiv.prod_comm R _ _⟩⟩, |
| 242 | + rw [range_subtype, ker_mkq] |
| 243 | +end |
| 244 | +end module |
0 commit comments