Skip to content

Commit 6aee244

Browse files
committed
1 parent f2e29b6 commit 6aee244

File tree

4 files changed

+77
-28
lines changed

4 files changed

+77
-28
lines changed

Mathlib/Algebra/Module/Zlattice.lean

Lines changed: 64 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ variable [NormedAddCommGroup E] [NormedSpace K E]
5555

5656
variable (b : Basis ι K E)
5757

58+
theorem span_top : span K (span ℤ (Set.range b) : Set E) = ⊤ := by simp [span_span_of_tower]
59+
5860
/-- The fundamental domain of the ℤ-lattice spanned by `b`. See `Zspan.isAddFundamentalDomain`
5961
for the proof that it is a fundamental domain. -/
6062
def fundamentalDomain : Set E := {m | ∀ i, b.repr m i ∈ Set.Ico (0 : K) 1}
@@ -310,6 +312,10 @@ instance [Finite ι] : DiscreteTopology (span ℤ (Set.range b)) := by
310312
· exact discreteTopology_pi_basisFun
311313
· refine Subtype.map_injective _ (Basis.equivFun b).injective
312314

315+
instance [Fintype ι] : DiscreteTopology (span ℤ (Set.range b)).toAddSubgroup := by
316+
change DiscreteTopology (span ℤ (Set.range b))
317+
infer_instance
318+
313319
@[measurability]
314320
theorem fundamentalDomain_measurableSet [MeasurableSpace E] [OpensMeasurableSpace E] [Finite ι] :
315321
MeasurableSet (fundamentalDomain b) := by
@@ -367,14 +373,26 @@ end Zspan
367373

368374
section Zlattice
369375

370-
open Submodule
376+
open Submodule FiniteDimensional
377+
378+
-- TODO: generalize this class to other rings than `ℤ`
379+
/-- An `L : Addsubgroup E` where `E` is a vector space over a normed field `K` is a `ℤ`-lattice if
380+
it is discrete and spans `E` over `K`. -/
381+
class IsZlattice (K : Type*) [NormedField K] {E : Type*} [NormedAddCommGroup E] [NormedSpace K E]
382+
(L : AddSubgroup E) [DiscreteTopology L] : Prop where
383+
/-- `L` spans the full space `E` over `K`. -/
384+
span_top : span K (L : Set E) = ⊤
385+
386+
theorem _root_.Zspan.isZlattice {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
387+
[Fintype ι] (b : Basis ι ℝ E) :
388+
IsZlattice ℝ (span ℤ (Set.range b)).toAddSubgroup where
389+
span_top := Zspan.span_top b
371390

372391
variable (K : Type*) [NormedLinearOrderedField K] [HasSolidNorm K] [FloorRing K]
373392
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace K E] [FiniteDimensional K E]
374-
variable [ProperSpace E] {L : AddSubgroup E} [DiscreteTopology L]
375-
variable (hs : span K (L : Set E) = ⊤)
393+
variable [ProperSpace E] (L : AddSubgroup E) [DiscreteTopology L]
376394

377-
theorem Zlattice.FG : AddSubgroup.FG L := by
395+
theorem Zlattice.FG [hs : IsZlattice K L] : AddSubgroup.FG L := by
378396
suffices (AddSubgroup.toIntSubmodule L).FG by exact (fg_iff_add_subgroup_fg _).mp this
379397
obtain ⟨s, ⟨h_incl, ⟨h_span, h_lind⟩⟩⟩ := exists_linearIndependent K (L : Set E)
380398
-- Let `s` be a maximal `K`-linear independent family of elements of `L`. We show that
@@ -386,7 +404,7 @@ theorem Zlattice.FG : AddSubgroup.FG L := by
386404
-- so there are finitely many since `fundamentalDomain b` is bounded.
387405
refine fg_def.mpr ⟨map (span ℤ s).mkQ (AddSubgroup.toIntSubmodule L), ?_, span_eq _⟩
388406
let b := Basis.mk h_lind (by
389-
rw [← hs, ← h_span]
407+
rw [← hs.span_top, ← h_span]
390408
exact span_mono (by simp only [Subtype.range_coe_subtype, Set.setOf_mem_eq, subset_rfl]))
391409
rw [show span ℤ s = span ℤ (Set.range b) by simp [b, Basis.coe_mk, Subtype.range_coe_subtype]]
392410
have : Fintype s := h_lind.setFinite.fintype
@@ -409,24 +427,53 @@ theorem Zlattice.FG : AddSubgroup.FG L := by
409427
rw [ker_mkQ, inf_of_le_right (span_le.mpr h_incl)]
410428
exact fg_span (LinearIndependent.setFinite h_lind)
411429

412-
theorem Zlattice.module_finite : Module.Finite ℤ L :=
413-
Module.Finite.iff_addGroup_fg.mpr ((AddGroup.fg_iff_addSubgroup_fg L).mpr (FG K hs))
414-
415-
theorem Zlattice.module_free : Module.Free ℤ L := by
416-
have : Module.Finite ℤ L := module_finite K hs
430+
theorem Zlattice.module_finite [IsZlattice K L] : Module.Finite ℤ L :=
431+
Module.Finite.iff_addGroup_fg.mpr ((AddGroup.fg_iff_addSubgroup_fg L).mpr (FG K L))
432+
433+
instance instModuleFinite_of_discrete_addSubgroup {E : Type*} [NormedAddCommGroup E]
434+
[NormedSpace ℝ E] [FiniteDimensional ℝ E] (L : AddSubgroup E) [DiscreteTopology L] :
435+
Module.Finite ℤ L := by
436+
let f := (span ℝ (L : Set E)).subtype
437+
let L₀ := (AddSubgroup.toIntSubmodule L).comap (f.restrictScalars ℤ)
438+
have h_img : f '' L₀ = L := by
439+
rw [← LinearMap.coe_restrictScalars ℤ f, ← Submodule.map_coe (f.restrictScalars ℤ),
440+
Submodule.map_comap_eq_self, AddSubgroup.coe_toIntSubmodule]
441+
exact fun x hx ↦ LinearMap.mem_range.mpr ⟨⟨x, Submodule.subset_span hx⟩, rfl⟩
442+
suffices Module.Finite ℤ L₀ by
443+
have : L₀.map (f.restrictScalars ℤ) = (AddSubgroup.toIntSubmodule L) :=
444+
SetLike.ext'_iff.mpr h_img
445+
convert this ▸ Module.Finite.map L₀ (f.restrictScalars ℤ)
446+
have : DiscreteTopology L₀.toAddSubgroup := by
447+
refine DiscreteTopology.preimage_of_continuous_injective (L : Set E) ?_ (injective_subtype _)
448+
exact LinearMap.continuous_of_finiteDimensional f
449+
have : IsZlattice ℝ L₀.toAddSubgroup := ⟨by
450+
rw [← (Submodule.map_injective_of_injective (injective_subtype _)).eq_iff, Submodule.map_span,
451+
Submodule.map_top, range_subtype, coe_toAddSubgroup, h_img]⟩
452+
exact Zlattice.module_finite ℝ L₀.toAddSubgroup
453+
454+
theorem Zlattice.module_free [IsZlattice K L] : Module.Free ℤ L := by
455+
have : Module.Finite ℤ L := module_finite K L
417456
have : Module ℚ E := Module.compHom E (algebraMap ℚ K)
418457
have : NoZeroSMulDivisors ℤ E := RatModule.noZeroSMulDivisors
419458
have : NoZeroSMulDivisors ℤ L := by
420459
change NoZeroSMulDivisors ℤ (AddSubgroup.toIntSubmodule L)
421460
exact noZeroSMulDivisors _
422461
infer_instance
423462

424-
open FiniteDimensional
463+
instance instModuleFree__of_discrete_addSubgroup {E : Type*} [NormedAddCommGroup E]
464+
[NormedSpace ℝ E] [FiniteDimensional ℝ E] (L : AddSubgroup E) [DiscreteTopology L] :
465+
Module.Free ℤ L := by
466+
have : Module ℚ E := Module.compHom E (algebraMap ℚ ℝ)
467+
have : NoZeroSMulDivisors ℤ E := RatModule.noZeroSMulDivisors
468+
have : NoZeroSMulDivisors ℤ L := by
469+
change NoZeroSMulDivisors ℤ (AddSubgroup.toIntSubmodule L)
470+
exact noZeroSMulDivisors _
471+
infer_instance
425472

426-
theorem Zlattice.rank : finrank ℤ L = finrank K E := by
473+
theorem Zlattice.rank [hs : IsZlattice K L] : finrank ℤ L = finrank K E := by
427474
classical
428-
have : Module.Finite ℤ L := module_finite K hs
429-
have : Module.Free ℤ L := module_free K hs
475+
have : Module.Finite ℤ L := module_finite K L
476+
have : Module.Free ℤ L := module_free K L
430477
have : Module ℚ E := Module.compHom E (algebraMap ℚ K)
431478
let b₀ := Module.Free.chooseBasis ℤ L
432479
-- Let `b` be a `ℤ`-basis of `L` formed of vectors of `E`
@@ -439,7 +486,9 @@ theorem Zlattice.rank : finrank ℤ L = finrank K E := by
439486
· rw [map_span, Set.range_comp]
440487
rfl
441488
· exact (map_subtype_top _).symm
442-
have h_spanE : span K (Set.range b) = ⊤ := by rwa [← span_span_of_tower (R := ℤ), h_spanL]
489+
have h_spanE : span K (Set.range b) = ⊤ := by
490+
rw [← span_span_of_tower (R := ℤ), h_spanL]
491+
exact hs.span_top
443492
have h_card : Fintype.card (Module.Free.ChooseBasisIndex ℤ L) =
444493
(Set.range b).toFinset.card := by
445494
rw [Set.toFinset_range, Finset.univ.card_image_of_injective]

Mathlib/NumberTheory/NumberField/CanonicalEmbedding.lean

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,10 +1078,6 @@ theorem exists_ne_zero_mem_ideal_of_norm_le {B : ℝ}
10781078
have : Countable (span ℤ (Set.range (fractionalIdealLatticeBasis K I))).toAddSubgroup := by
10791079
change Countable (span ℤ (Set.range (fractionalIdealLatticeBasis K I)): Set (E K))
10801080
infer_instance
1081-
have : DiscreteTopology
1082-
(span ℤ (Set.range (fractionalIdealLatticeBasis K I))).toAddSubgroup := by
1083-
change DiscreteTopology (span ℤ (Set.range (fractionalIdealLatticeBasis K I)): Set (E K))
1084-
infer_instance
10851081
obtain ⟨⟨x, hx⟩, h_nz, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
10861082
h_fund (fun _ ↦ convexBodySum_neg_mem K B) (convexBodySum_convex K B)
10871083
(convexBodySum_compact K B) h

Mathlib/NumberTheory/NumberField/Units.lean

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,22 +478,18 @@ instance instDiscrete_unitLattice : DiscreteTopology (unitLattice K) := by
478478
rintro ⟨x, hx, rfl⟩
479479
exact ⟨Subtype.mem x, hx⟩
480480

481+
instance instZlattice_unitLattice : IsZlattice ℝ (unitLattice K) where
482+
span_top := unitLattice_span_eq_top K
483+
481484
protected theorem finrank_eq_rank :
482485
finrank ℝ ({w : InfinitePlace K // w ≠ w₀} → ℝ) = Units.rank K := by
483486
simp only [finrank_fintype_fun_eq_card, Fintype.card_subtype_compl,
484487
Fintype.card_ofSubsingleton, rank]
485488

486-
instance instModuleFree_unitLattice : Module.Free ℤ (unitLattice K) :=
487-
Zlattice.module_free ℝ (unitLattice_span_eq_top K)
488-
489-
instance instModuleFinite_unitLattice : Module.Finite ℤ (unitLattice K) :=
490-
Zlattice.module_finite ℝ (unitLattice_span_eq_top K)
491-
492489
@[simp]
493490
theorem unitLattice_rank :
494491
finrank ℤ (unitLattice K) = Units.rank K := by
495-
rw [← Units.finrank_eq_rank]
496-
exact Zlattice.rank ℝ (unitLattice_span_eq_top K)
492+
rw [← Units.finrank_eq_rank, Zlattice.rank ℝ]
497493

498494
/-- The linear equivalence between `unitLattice` and `(𝓞 K)ˣ ⧸ (torsion K)` as an additive
499495
`ℤ`-module. -/
@@ -514,7 +510,7 @@ def unitLatticeEquiv : (unitLattice K) ≃ₗ[ℤ] Additive ((𝓞 K)ˣ ⧸ (tor
514510
rfl
515511

516512
instance : Module.Free ℤ (Additive ((𝓞 K)ˣ ⧸ (torsion K))) :=
517-
(instModuleFree_unitLattice K).of_equiv' (unitLatticeEquiv K)
513+
Module.Free.of_equiv (unitLatticeEquiv K)
518514

519515
instance : Module.Finite ℤ (Additive ((𝓞 K)ˣ ⧸ (torsion K))) :=
520516
Module.Finite.equiv (unitLatticeEquiv K)

Mathlib/Topology/Constructions.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,14 @@ theorem DiscreteTopology.of_subset {X : Type*} [TopologicalSpace X] {s t : Set X
12091209
(embedding_inclusion ts).discreteTopology
12101210
#align discrete_topology.of_subset DiscreteTopology.of_subset
12111211

1212+
/-- Let `s` be a discrete subset of a topological space. Then the preimage of `s` by
1213+
a continuous injective map is also discrete. -/
1214+
theorem DiscreteTopology.preimage_of_continuous_injective {X Y : Type*} [TopologicalSpace X]
1215+
[TopologicalSpace Y] (s : Set Y) [DiscreteTopology s] {f : X → Y} (hc : Continuous f)
1216+
(hinj : Function.Injective f) : DiscreteTopology (f ⁻¹' s) :=
1217+
DiscreteTopology.of_continuous_injective (β := s) (Continuous.restrict
1218+
(by exact fun _ x ↦ x) hc) ((Set.MapsTo.restrict_inj _).mpr <| Set.injOn_of_injective hinj _)
1219+
12121220
end Subtype
12131221

12141222
section Quotient

0 commit comments

Comments
 (0)