Skip to content

Commit db6eeb1

Browse files
xroblotriccardobrasca
authored andcommitted
feat(NumberTheory.NumberField.Basic): add mem_span_integralBasis (#5996)
Add the following result: ```lean theorem mem_span_integralBasis {x : K} : x ∈ Submodule.span ℤ (Set.range (integralBasis K)) ↔ x ∈ 𝓞 K ``` that is, `integralBasis` is indeed a `ℤ`-basis of the ring of integers. Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>
1 parent ce1c219 commit db6eeb1

6 files changed

Lines changed: 38 additions & 12 deletions

File tree

Mathlib/Algebra/Algebra/Subalgebra/Tower.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,19 @@ def ofRestrictScalars (U : Subalgebra S A) (f : U →ₐ[S] B) : U.restrictScala
129129

130130
end Semiring
131131

132+
section CommSemiring
133+
134+
@[simp]
135+
lemma range_isScalarTower_toAlgHom [CommSemiring R] [CommSemiring A]
136+
[Algebra R A] (S : Subalgebra R A) :
137+
LinearMap.range (IsScalarTower.toAlgHom R S A) = Subalgebra.toSubmodule S := by
138+
ext
139+
simp only [← Submodule.range_subtype (Subalgebra.toSubmodule S), LinearMap.mem_range,
140+
IsScalarTower.coe_toAlgHom', Subalgebra.mem_toSubmodule]
141+
rfl
142+
143+
end CommSemiring
144+
132145
end Subalgebra
133146

134147
namespace IsScalarTower

Mathlib/LinearAlgebra/FreeModule/PID.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ noncomputable def Module.basisOfFiniteTypeTorsionFree [Fintype ι] {s : ι → M
385385
have : LinearMap.range φ ≤ N := by
386386
-- as announced, `A • M ⊆ N`
387387
suffices ∀ i, φ (s i) ∈ N by
388-
rw [LinearMap.range_eq_map, ← hs, φ.map_span_le]
388+
rw [LinearMap.range_eq_map, ← hs, map_span_le]
389389
rintro _ ⟨i, rfl⟩
390390
apply this
391391
intro i

Mathlib/LinearAlgebra/Span.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ variable {x : M} (p p' : Submodule R M)
4040

4141
variable [Semiring R₂] {σ₁₂ : R →+* R₂}
4242

43-
variable [AddCommMonoid M₂] [Module R₂ M₂]
43+
variable [AddCommMonoid M₂] [Module R₂ M₂] {F : Type _} [SemilinearMapClass F σ₁₂ M M₂]
4444

4545
section
4646

@@ -92,7 +92,7 @@ theorem span_coe_eq_restrictScalars [Semiring S] [SMul S R] [Module S M] [IsScal
9292
span_eq (p.restrictScalars S)
9393
#align submodule.span_coe_eq_restrict_scalars Submodule.span_coe_eq_restrictScalars
9494

95-
theorem map_span [RingHomSurjective σ₁₂] (f : M →ₛₗ[σ₁₂] M₂) (s : Set M) :
95+
theorem map_span [RingHomSurjective σ₁₂] (f : F) (s : Set M) :
9696
(span R s).map f = span R₂ (f '' s) :=
9797
Eq.symm <|
9898
span_eq_of_le _ (Set.image_subset f subset_span) <|
@@ -102,9 +102,9 @@ theorem map_span [RingHomSurjective σ₁₂] (f : M →ₛₗ[σ₁₂] M₂) (
102102
alias Submodule.map_span ← _root_.LinearMap.map_span
103103
#align linear_map.map_span LinearMap.map_span
104104

105-
theorem map_span_le [RingHomSurjective σ₁₂] (f : M →ₛₗ[σ₁₂] M₂) (s : Set M) (N : Submodule R₂ M₂) :
105+
theorem map_span_le [RingHomSurjective σ₁₂] (f : F) (s : Set M) (N : Submodule R₂ M₂) :
106106
map f (span R s) ≤ N ↔ ∀ m ∈ s, f m ∈ N := by
107-
rw [f.map_span, span_le, Set.image_subset_iff]
107+
rw [map_span, span_le, Set.image_subset_iff]
108108
exact Iff.rfl
109109
#align submodule.map_span_le Submodule.map_span_le
110110

@@ -119,7 +119,7 @@ theorem span_insert_zero : span R (insert (0 : M) s) = span R s := by
119119
#align submodule.span_insert_zero Submodule.span_insert_zero
120120

121121
-- See also `span_preimage_eq` below.
122-
theorem span_preimage_le (f : M →ₛₗ[σ₁₂] M₂) (s : Set M₂) :
122+
theorem span_preimage_le (f : F) (s : Set M₂) :
123123
span R (f ⁻¹' s) ≤ (span R₂ s).comap f := by
124124
rw [span_le, comap_coe]
125125
exact preimage_mono subset_span
@@ -583,18 +583,18 @@ theorem span_singleton_eq_span_singleton {R M : Type _} [Ring R] [AddCommGroup M
583583
#align submodule.span_singleton_eq_span_singleton Submodule.span_singleton_eq_span_singleton
584584

585585
@[simp]
586-
theorem span_image [RingHomSurjective σ₁₂] (f : M →ₛₗ[σ₁₂] M₂) :
586+
theorem span_image [RingHomSurjective σ₁₂] (f : F) :
587587
span R₂ (f '' s) = map f (span R s) :=
588588
(map_span f s).symm
589589
#align submodule.span_image Submodule.span_image
590590

591-
theorem apply_mem_span_image_of_mem_span [RingHomSurjective σ₁₂] (f : M →ₛₗ[σ₁₂] M₂) {x : M}
591+
theorem apply_mem_span_image_of_mem_span [RingHomSurjective σ₁₂] (f : F) {x : M}
592592
{s : Set M} (h : x ∈ Submodule.span R s) : f x ∈ Submodule.span R₂ (f '' s) := by
593593
rw [Submodule.span_image]
594594
exact Submodule.mem_map_of_mem h
595595
#align submodule.apply_mem_span_image_of_mem_span Submodule.apply_mem_span_image_of_mem_span
596596

597-
theorem apply_mem_span_image_iff_mem_span [RingHomSurjective σ₁₂] {f : M →ₛₗ[σ₁₂] M₂} {x : M}
597+
theorem apply_mem_span_image_iff_mem_span [RingHomSurjective σ₁₂] {f : F} {x : M}
598598
{s : Set M} (hf : Function.Injective f) :
599599
f x ∈ Submodule.span R₂ (f '' s) ↔ x ∈ Submodule.span R s := by
600600
rw [← Submodule.mem_comap, ← Submodule.map_span, Submodule.comap_map_eq_of_injective hf]
@@ -605,7 +605,7 @@ theorem map_subtype_span_singleton {p : Submodule R M} (x : p) :
605605
#align submodule.map_subtype_span_singleton Submodule.map_subtype_span_singleton
606606

607607
/-- `f` is an explicit argument so we can `apply` this theorem and obtain `h` as a new goal. -/
608-
theorem not_mem_span_of_apply_not_mem_span_image [RingHomSurjective σ₁₂] (f : M →ₛₗ[σ₁₂] M₂) {x : M}
608+
theorem not_mem_span_of_apply_not_mem_span_image [RingHomSurjective σ₁₂] (f : F) {x : M}
609609
{s : Set M} (h : f x ∉ Submodule.span R₂ (f '' s)) : x ∉ Submodule.span R s :=
610610
h.imp (apply_mem_span_image_of_mem_span f)
611611
#align submodule.not_mem_span_of_apply_not_mem_span_image Submodule.not_mem_span_of_apply_not_mem_span_image
@@ -837,7 +837,7 @@ variable [Ring R] [AddCommGroup M] [Module R M]
837837
theorem span_neg (s : Set M) : span R (-s) = span R s :=
838838
calc
839839
span R (-s) = span R ((-LinearMap.id : M →ₗ[R] M) '' s) := by simp
840-
_ = map (-LinearMap.id) (span R s) := ((-LinearMap.id).map_span _).symm
840+
_ = map (-LinearMap.id) (span R s) := (map_span (-LinearMap.id) _).symm
841841
_ = span R s := by simp
842842
#align submodule.span_neg Submodule.span_neg
843843

Mathlib/NumberTheory/NumberField/Basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ theorem integralBasis_apply (i : Free.ChooseBasisIndex ℤ (𝓞 K)) :
168168
Basis.localizationLocalization_apply ℚ (nonZeroDivisors ℤ) K (RingOfIntegers.basis K) i
169169
#align number_field.integral_basis_apply NumberField.integralBasis_apply
170170

171+
theorem mem_span_integralBasis {x : K} :
172+
x ∈ Submodule.span ℤ (Set.range (integralBasis K)) ↔ x ∈ 𝓞 K := by
173+
rw [integralBasis, Basis.localizationLocalization_span, Subalgebra.range_isScalarTower_toAlgHom,
174+
Subalgebra.mem_toSubmodule]
175+
171176
theorem RingOfIntegers.rank : FiniteDimensional.finrank ℤ (𝓞 K) = FiniteDimensional.finrank ℚ K :=
172177
IsIntegralClosure.rank ℤ ℚ K (𝓞 K)
173178
#align number_field.ring_of_integers.rank NumberField.RingOfIntegers.rank

Mathlib/RingTheory/Finiteness.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ theorem fg_of_fg_map_injective (f : M →ₗ[R] P) (hf : Function.Injective f) {
213213
let ⟨t, ht⟩ := hfn
214214
⟨t.preimage f fun x _ y _ h => hf h,
215215
Submodule.map_injective_of_injective hf <| by
216-
rw [f.map_span, Finset.coe_preimage, Set.image_preimage_eq_inter_range,
216+
rw [map_span, Finset.coe_preimage, Set.image_preimage_eq_inter_range,
217217
Set.inter_eq_self_of_subset_left, ht]
218218
rw [← LinearMap.range_coe, ← span_le, ht, ← map_top]
219219
exact map_mono le_top⟩

Mathlib/RingTheory/Localization/Module.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ theorem Basis.localizationLocalization_repr_algebraMap {ι : Type _} (b : Basis
140140
_ = algebraMap R Rₛ (b.repr x i) := by simp [Algebra.smul_def]
141141
#align basis.localization_localization_repr_algebra_map Basis.localizationLocalization_repr_algebraMap
142142

143+
theorem Basis.localizationLocalization_span {ι : Type _} (b : Basis ι R A) :
144+
Submodule.span R (Set.range (b.localizationLocalization Rₛ S Aₛ)) =
145+
LinearMap.range (IsScalarTower.toAlgHom R A Aₛ) :=
146+
calc span R (Set.range ↑(localizationLocalization Rₛ S Aₛ b))
147+
_ = span R (↑(IsScalarTower.toAlgHom R A Aₛ) '' Set.range ↑b) := by congr; ext; simp
148+
_ = map (IsScalarTower.toAlgHom R A Aₛ) (span R (Set.range b)) := by rw [Submodule.map_span]
149+
_ = LinearMap.range (IsScalarTower.toAlgHom R A Aₛ) := by rw [b.span_eq, Submodule.map_top]
150+
143151
end LocalizationLocalization
144152

145153
end Localization

0 commit comments

Comments
 (0)