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

Commit a75460f

Browse files
committed
feat(algebra/module/pid): Classification of finitely generated torsion modules over a PID (#13524)
A finitely generated torsion module over a PID is isomorphic to a direct sum of some `R ⧸ R ∙ (p i ^ e i)` where the `p i ^ e i` are prime powers. (TODO : This part should be generalisable to a Dedekind domain, see https://en.wikipedia.org/wiki/Dedekind_domain#Finitely_generated_modules_over_a_Dedekind_domain . Part of the proof is already generalised). More generally, a finitely generated module over a PID is isomorphic to the product of a free module and a direct sum of some `R ⧸ R ∙ (p i ^ e i)`. (TODO : prove this decomposition is unique.) (TODO : deduce the structure theorem for finite(ly generated) abelian groups). - [x] depends on: #13414 - [x] depends on: #14376 - [x] depends on: #14573 Co-authored-by: pbazin <75327486+pbazin@users.noreply.github.com>
1 parent 3225926 commit a75460f

File tree

10 files changed

+369
-16
lines changed

10 files changed

+369
-16
lines changed

docs/overview.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ Linear algebra:
158158
finite-dimensionality : 'finite_dimensional'
159159
isomorphism with $K^n$: 'basis.equiv_fun'
160160
isomorphism with bidual: 'module.eval_equiv'
161+
Finitely generated modules over a PID:
162+
structure theorem: 'module.equiv_free_prod_direct_sum'
161163
Matrices:
162164
ring-valued matrix: 'matrix'
163165
matrix representation of a linear map: 'linear_map.to_matrix'

src/algebra/big_operators/associated.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ variables [comm_monoid α]
109109
theorem prod_mk {p : multiset α} : (p.map associates.mk).prod = associates.mk p.prod :=
110110
multiset.induction_on p (by simp) $ λ a s ih, by simp [ih, associates.mk_mul_mk]
111111

112+
theorem finset_prod_mk {p : finset β} {f : β → α} :
113+
∏ i in p, associates.mk (f i) = associates.mk (∏ i in p, f i) :=
114+
by rw [finset.prod_eq_multiset_prod, ← multiset.map_map, prod_mk, ← finset.prod_eq_multiset_prod]
115+
112116
theorem rel_associated_iff_map_eq_map {p q : multiset α} :
113117
multiset.rel associated p q ↔ p.map associates.mk = q.map associates.mk :=
114118
by { rw [← multiset.rel_eq, multiset.rel_map], simp only [mk_eq_mk_iff_associated] }

src/algebra/direct_sum/module.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ lequiv_congr_left R h f k = f (h.symm k) := equiv_congr_left_apply _ _ _
210210
end congr_left
211211

212212
section sigma
213-
variables {α : ι → Type u} {δ : Π i, α i → Type w}
213+
variables {α : ι → Type*} {δ : Π i, α i → Type w}
214214
variables [Π i j, add_comm_monoid (δ i j)] [Π i j, module R (δ i j)]
215215

216216
/--`curry` as a linear map.-/
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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.torsion
7+
import ring_theory.dedekind_domain.ideal
8+
9+
/-!
10+
# Modules over a Dedekind domain
11+
12+
Over a Dedekind domain, a `I`-torsion module is the internal direct sum of its `p i ^ e i`-torsion
13+
submodules, where `I = ∏ i, p i ^ e i` is its unique decomposition in prime ideals.
14+
Therefore, as any finitely generated torsion module is `I`-torsion for some `I`, it is an internal
15+
direct sum of its `p i ^ e i`-torsion submodules for some prime ideals `p i` and numbers `e i`.
16+
-/
17+
18+
universes u v
19+
open_locale big_operators
20+
21+
variables {R : Type u} [comm_ring R] [is_domain R] {M : Type v} [add_comm_group M] [module R M]
22+
23+
open_locale direct_sum
24+
25+
namespace submodule
26+
variables [is_dedekind_domain R]
27+
open unique_factorization_monoid
28+
29+
/--Over a Dedekind domain, a `I`-torsion module is the internal direct sum of its `p i ^ e i`-
30+
torsion submodules, where `I = ∏ i, p i ^ e i` is its unique decomposition in prime ideals.-/
31+
lemma is_internal_prime_power_torsion_of_is_torsion_by_ideal {I : ideal R} (hI : I ≠ ⊥)
32+
(hM : module.is_torsion_by_set R M I) :
33+
∃ (P : finset $ ideal R) [decidable_eq P] [∀ p ∈ P, prime p] (e : P → ℕ),
34+
by exactI direct_sum.is_internal (λ p : P, torsion_by_set R M (p ^ e p : ideal R)) :=
35+
begin
36+
classical,
37+
let P := factors I,
38+
have prime_of_mem := λ p (hp : p ∈ P.to_finset), prime_of_factor p (multiset.mem_to_finset.mp hp),
39+
refine ⟨P.to_finset, infer_instance, prime_of_mem, λ i, P.count i, _⟩,
40+
apply @torsion_by_set_is_internal _ _ _ _ _ _ _ _ (λ p, p ^ P.count p) _,
41+
{ convert hM,
42+
rw [← finset.inf_eq_infi, is_dedekind_domain.inf_prime_pow_eq_prod,
43+
← finset.prod_multiset_count, ← associated_iff_eq],
44+
{ exact factors_prod hI },
45+
{ exact prime_of_mem }, { exact λ _ _ _ _ ij, ij } },
46+
{ intros p hp q hq pq, dsimp,
47+
rw irreducible_pow_sup,
48+
{ suffices : (normalized_factors _).count p = 0,
49+
{ rw [this, zero_min, pow_zero, ideal.one_eq_top] },
50+
{ rw [multiset.count_eq_zero, normalized_factors_of_irreducible_pow
51+
(prime_of_mem q hq).irreducible, multiset.mem_repeat],
52+
exact λ H, pq $ H.2.trans $ normalize_eq q } },
53+
{ rw ← ideal.zero_eq_bot, apply pow_ne_zero, exact (prime_of_mem q hq).ne_zero },
54+
{ exact (prime_of_mem p hp).irreducible } }
55+
end
56+
57+
/--A finitely generated torsion module over a Dedekind domain is an internal direct sum of its
58+
`p i ^ e i`-torsion submodules for some prime ideals `p i` and numbers `e i`.-/
59+
theorem is_internal_prime_power_torsion [module.finite R M] (hM : module.is_torsion R M) :
60+
∃ (P : finset $ ideal R) [decidable_eq P] [∀ p ∈ P, prime p] (e : P → ℕ),
61+
by exactI direct_sum.is_internal (λ p : P, torsion_by_set R M (p ^ e p : ideal R)) :=
62+
begin
63+
obtain ⟨I, hI, hM'⟩ := is_torsion_by_ideal_of_finite_of_is_torsion hM,
64+
refine is_internal_prime_power_torsion_of_is_torsion_by_ideal _ hM',
65+
rw set.ne_empty_iff_nonempty at hI, rw submodule.ne_bot_iff,
66+
obtain ⟨x, H, hx⟩ := hI, exact ⟨x, H, non_zero_divisors.ne_zero hx⟩
67+
end
68+
69+
end submodule

src/algebra/module/pid.lean

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
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

src/algebra/module/torsion.lean

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ import ring_theory.finiteness
3636
* `torsion_by_set_eq_torsion_by_span` : torsion by a set is torsion by the ideal generated by it.
3737
* `submodule.torsion_by_is_torsion_by` : the `a`-torsion submodule is a `a`-torsion module.
3838
Similar lemmas for `torsion'` and `torsion`.
39-
* `submodule.torsion_is_internal` : a `∏ i, p i`-torsion module is the internal direct sum of its
40-
`p i`-torsion submodules when the `p i` are pairwise coprime.
39+
* `submodule.torsion_by_is_internal` : a `∏ i, p i`-torsion module is the internal direct sum of its
40+
`p i`-torsion submodules when the `p i` are pairwise coprime. A more general version with coprime
41+
ideals is `submodule.torsion_by_set_is_internal`.
4142
* `submodule.no_zero_smul_divisors_iff_torsion_bot` : a module over a domain has
4243
`no_zero_smul_divisors` (that is, there is no non-zero `a`, `x` such that `a • x = 0`)
4344
iff its torsion submodule is trivial.
@@ -67,19 +68,6 @@ variables {R M}
6768
@[simp] lemma mem_torsion_of_iff (x : M) (a : R) : a ∈ torsion_of R M x ↔ a • x = 0 := iff.rfl
6869
end
6970

70-
lemma sup_eq_top_iff_is_coprime {R : Type*} [comm_semiring R] (x y : R) :
71-
span ({x} : set R) ⊔ span {y} = ⊤ ↔ is_coprime x y :=
72-
begin
73-
rw [eq_top_iff_one, submodule.mem_sup],
74-
split,
75-
{ rintro ⟨u, hu, v, hv, h1⟩,
76-
rw mem_span_singleton' at hu hv,
77-
rw [← hu.some_spec, ← hv.some_spec] at h1,
78-
exact ⟨_, _, h1⟩ },
79-
{ exact λ ⟨u, v, h1⟩,
80-
⟨_, mem_span_singleton'.mpr ⟨_, rfl⟩, _, mem_span_singleton'.mpr ⟨_, rfl⟩, h1⟩ },
81-
end
82-
8371
section
8472
variables (R M : Type*) [ring R] [add_comm_group M] [module R M]
8573
/--The span of `x` in `M` is isomorphic to `R` quotiented by the torsion ideal of `x`.-/

src/data/multiset/bind.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ multiset.induction_on m (by simp) ( by simp)
131131
lemma count_bind [decidable_eq α] {m : multiset β} {f : β → multiset α} {a : α} :
132132
count a (bind m f) = sum (m.map $ λ b, count a $ f b) := count_sum
133133

134+
lemma le_bind {α β : Type*} {f : α → multiset β} (S : multiset α) {x : α} (hx : x ∈ S) :
135+
f x ≤ S.bind f :=
136+
begin
137+
classical,
138+
rw le_iff_count, intro a,
139+
rw count_bind, apply le_sum_of_mem,
140+
rw mem_map, exact ⟨x, hx, rfl⟩
141+
end
134142
end bind
135143

136144
/-! ### Product of two multisets -/

0 commit comments

Comments
 (0)