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

Commit ed90a7d

Browse files
committed
refactor(ring_theory): submodules that are units are finitely generated (#18510)
+ generalize from fractional_ideal to submodule. + the algebra doesn't have to be commutative. + introduce `fractional_ideal.coe_submodule_hom`. Potential future project: since we have [fractional_ideal.is_fractional_of_fg](https://leanprover-community.github.io/mathlib_docs/ring_theory/fractional_ideal.html#fractional_ideal.is_fractional_of_fg), submodules in a localization that are units are automatically fractional ideals, so [class_group](https://leanprover-community.github.io/mathlib_docs/ring_theory/class_group.html#class_group) could be defined as the invertible submodules in the fraction_ring modulo principal ones, without mentioning `is_fractional`. This might make `class_group` less complicated and therefore faster.
1 parent 8f66c29 commit ed90a7d

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

src/ring_theory/finiteness.lean

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ lemma _root_.subalgebra.fg_bot_to_submodule {R A : Type*}
126126
(⊥ : subalgebra R A).to_submodule.fg :=
127127
⟨{1}, by simp [algebra.to_submodule_bot] ⟩
128128

129+
lemma fg_unit {R A : Type*} [comm_semiring R] [semiring A] [algebra R A]
130+
(I : (submodule R A)ˣ) : (I : submodule R A).fg :=
131+
begin
132+
have : (1 : A) ∈ (I * ↑I⁻¹ : submodule R A),
133+
{ rw I.mul_inv, exact one_le.mp le_rfl },
134+
obtain ⟨T, T', hT, hT', one_mem⟩ := mem_span_mul_finite_of_mem_mul this,
135+
refine ⟨T, span_eq_of_le _ hT _⟩,
136+
rw [← one_mul ↑I, ← mul_one (span R ↑T)],
137+
conv_rhs { rw [← I.inv_mul, ← mul_assoc] },
138+
refine mul_le_mul_left (le_trans _ $ mul_le_mul_right $ span_le.mpr hT'),
139+
rwa [one_le, span_mul_span],
140+
end
141+
142+
lemma fg_of_is_unit {R A : Type*} [comm_semiring R] [semiring A] [algebra R A]
143+
{I : submodule R A} (hI : is_unit I) : I.fg := fg_unit hI.unit
144+
129145
theorem fg_span {s : set M} (hs : s.finite) : fg (span R s) :=
130146
⟨hs.to_finset, by rw [hs.coe_to_finset]⟩
131147

@@ -534,14 +550,6 @@ instance module.finite.tensor_product [comm_semiring R]
534550
[hM : module.finite R M] [hN : module.finite R N] : module.finite R (tensor_product R M N) :=
535551
{ out := (tensor_product.map₂_mk_top_top_eq_top R M N).subst (hM.out.map₂ _ hN.out) }
536552

537-
namespace algebra
538-
539-
variables [comm_ring R] [comm_ring A] [algebra R A] [comm_ring B] [algebra R B]
540-
variables [add_comm_group M] [module R M]
541-
variables [add_comm_group N] [module R N]
542-
543-
end algebra
544-
545553
end module_and_algebra
546554

547555
namespace ring_hom

src/ring_theory/fractional_ideal.lean

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,12 @@ instance : comm_semiring (fractional_ideal S P) :=
494494
function.injective.comm_semiring coe subtype.coe_injective
495495
coe_zero coe_one coe_add coe_mul (λ _ _, coe_nsmul _ _) coe_pow coe_nat_cast
496496

497+
variables (S P)
498+
/-- `fractional_ideal.submodule.has_coe` as a bundled `ring_hom`. -/
499+
@[simps] def coe_submodule_hom : fractional_ideal S P →+* submodule R P :=
500+
⟨coe, coe_one, coe_mul, coe_zero, coe_add⟩
501+
variables {S P}
502+
497503
section order
498504

499505
lemma add_le_add_left {I J : fractional_ideal S P} (hIJ : I ≤ J) (J' : fractional_ideal S P) :
@@ -710,21 +716,11 @@ variables {S}
710716

711717
lemma fg_unit (I : (fractional_ideal S P)ˣ) :
712718
fg (I : submodule R P) :=
713-
begin
714-
have : (1 : P) ∈ (I * ↑I⁻¹ : fractional_ideal S P),
715-
{ rw units.mul_inv, exact one_mem_one _ },
716-
obtain ⟨T, T', hT, hT', one_mem⟩ := mem_span_mul_finite_of_mem_mul this,
717-
refine ⟨T, submodule.span_eq_of_le _ hT _⟩,
718-
rw [← one_mul ↑I, ← mul_one (span R ↑T)],
719-
conv_rhs { rw [← coe_one, ← units.mul_inv I, coe_mul, mul_comm ↑↑I, ← mul_assoc] },
720-
refine submodule.mul_le_mul_left
721-
(le_trans _ (submodule.mul_le_mul_right (submodule.span_le.mpr hT'))),
722-
rwa [submodule.one_le, submodule.span_mul_span]
723-
end
719+
submodule.fg_unit $ units.map (coe_submodule_hom S P).to_monoid_hom I
724720

725721
lemma fg_of_is_unit (I : fractional_ideal S P) (h : is_unit I) :
726722
fg (I : submodule R P) :=
727-
by { rcases h with ⟨I, rfl⟩, exact fg_unit I }
723+
fg_unit h.unit
728724

729725
lemma _root_.ideal.fg_of_is_unit (inj : function.injective (algebra_map R P))
730726
(I : ideal R) (h : is_unit (I : fractional_ideal S P)) :

0 commit comments

Comments
 (0)