import OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.AdelicData import Mathlib.Topology.Algebra.Valued.WithZeroMulInt /-! # Adelic Neighborhoods -/ namespace OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.AdelicNeighborhoods noncomputable section section /-! A nonzero integer multiple of the local integer ring fits inside any zero-neighborhood in each finite completion. This is the local step in the finite-adelic principal-congruence neighborhood argument. -/ open IsDedekindDomain IsDedekindDomain.HeightOneSpectrum open scoped _root_.Topology theorem adic_integer_multiple_small (v : HeightOneSpectrum β„€) (U : Set (v.adicCompletion β„š)) (hU : U ∈ 𝓝 (0 : v.adicCompletion β„š)) : βˆƒ n : β„€, n β‰  0 ∧ βˆ€ a ∈ v.adicCompletionIntegers β„š, algebraMap β„€ (v.adicCompletion β„š) n * a ∈ U := by obtain ⟨γ, hγ⟩ := Valued.mem_nhds_zero.mp hU obtain βŸ¨Ο–, hΟ–βŸ© := intValuation_exists_uniformizer v have hΟ–0 : Ο– β‰  0 := by intro h rw [h, map_zero] at hΟ– exact (WithZero.exp_ne_zero : WithZero.exp (-1 : β„€) β‰  0) hΟ–.symm have hval : Valued.v (algebraMap β„€ (v.adicCompletion β„š) Ο–) = WithZero.exp (-1 : β„€) := by simpa only [valuedAdicCompletion_eq_valuation, valuation_of_algebraMap] using hΟ– have hlt : Valued.v (algebraMap β„€ (v.adicCompletion β„š) Ο–) < 1 := by rw [hval, ← WithZero.exp_zero, WithZero.exp_lt_exp] norm_num have ht := Valued.tendsto_zero_pow_of_v_lt_one hlt have hball : {x : v.adicCompletion β„š | Valued.v.restrict x < Ξ³} ∈ 𝓝 (0 : v.adicCompletion β„š) := Valued.mem_nhds_zero.mpr ⟨γ, Set.Subset.rfl⟩ obtain ⟨r, hr⟩ := Filter.eventually_atTop.mp (ht hball) refine βŸ¨Ο– ^ r, pow_ne_zero r hΟ–0, ?_⟩ intro a ha have ha' : Valued.v.restrict a ≀ 1 := (Valued.v.restrict_le_one_iff).mpr ((mem_adicCompletionIntegers β„€ β„š v).mp ha) apply hΞ³ change Valued.v.restrict (algebraMap β„€ (v.adicCompletion β„š) (Ο– ^ r) * a) < Ξ³ rw [map_mul, map_pow] exact (calc Valued.v.restrict ((algebraMap β„€ (v.adicCompletion β„š) Ο–) ^ r) * Valued.v.restrict a ≀ Valued.v.restrict ((algebraMap β„€ (v.adicCompletion β„š) Ο–) ^ r) * 1 := mul_le_mul_right ha' _ _ = _ := mul_one _).trans_lt (hr r le_rfl) end /-! Nonzero integer multiples of the integral finite adeles form a basis of zero-neighborhoods inside the rational finite adele ring. The proof combines finitely many local valuation bounds in the product of local integer rings. -/ open IsDedekindDomain IsDedekindDomain.HeightOneSpectrum open scoped Classical _root_.Topology abbrev IntegralAdeleProduct := βˆ€ v : HeightOneSpectrum β„€, v.adicCompletionIntegers β„š def integralAdeleProductMap : IntegralAdeleProduct β†’ AdelicData.RationalFiniteAdeles := RestrictedProduct.structureMap (fun v : HeightOneSpectrum β„€ => v.adicCompletion β„š) (fun v => (v.adicCompletionIntegers β„š : Set (v.adicCompletion β„š))) Filter.cofinite theorem integralAdeleProductMap_continuous : Continuous integralAdeleProductMap := RestrictedProduct.isEmbedding_structureMap.continuous theorem integralAdeleProductMap_zero : integralAdeleProductMap 0 = 0 := rfl theorem local_integer_multiple_small (v : HeightOneSpectrum β„€) (W : Set (v.adicCompletionIntegers β„š)) (hW : W ∈ 𝓝 (0 : v.adicCompletionIntegers β„š)) : βˆƒ n : β„€, n β‰  0 ∧ βˆ€ a : v.adicCompletionIntegers β„š, n β€’ a ∈ W := by rw [nhds_subtype_eq_comap] at hW obtain ⟨U, hU, hUW⟩ := Filter.mem_comap.mp hW obtain ⟨n, hn, hsmall⟩ := adic_integer_multiple_small v U hU refine ⟨n, hn, fun a => hUW ?_⟩ change ((n β€’ a : v.adicCompletionIntegers β„š) : v.adicCompletion β„š) ∈ U have h := hsmall a.val a.property have hcoe : ((n β€’ a : v.adicCompletionIntegers β„š) : v.adicCompletion β„š) = n β€’ a.val := map_zsmul (v.adicCompletionIntegers β„š).toSubring.subtype n a rw [hcoe, zsmul_eq_mul] rw [← map_intCast (algebraMap β„€ (v.adicCompletion β„š)) n] exact h theorem finite_adele_integer_multiple_small (U : Set AdelicData.RationalFiniteAdeles) (hU : U ∈ 𝓝 (0 : AdelicData.RationalFiniteAdeles)) : βˆƒ n : β„€, n β‰  0 ∧ βˆ€ a ∈ AdelicData.integralFiniteAdeles, n β€’ a ∈ U := by have hpre : integralAdeleProductMap ⁻¹' U ∈ 𝓝 (0 : IntegralAdeleProduct) := integralAdeleProductMap_continuous.continuousAt.preimage_mem_nhds hU rw [nhds_pi] at hpre obtain ⟨I, W, hW, hsub⟩ := Filter.mem_pi'.mp hpre choose n hn hsmall using fun v => local_integer_multiple_small v (W v) (hW v) refine ⟨∏ v ∈ I, n v, Finset.prod_ne_zero_iff.mpr (fun v _ => hn v), ?_⟩ intro a ha let b : IntegralAdeleProduct := fun v => ⟨a v, ha v⟩ have hb : (∏ v ∈ I, n v) β€’ b ∈ Set.pi (I : Set (HeightOneSpectrum β„€)) W := by intro v hv obtain ⟨c, hc⟩ := Finset.dvd_prod_of_mem n hv change (∏ v ∈ I, n v) β€’ b v ∈ W v rw [hc, mul_smul] exact hsmall v (c β€’ b v) have hmem := hsub hb have he : integralAdeleProductMap ((∏ v ∈ I, n v) β€’ b) = (∏ v ∈ I, n v) β€’ a := by apply IsDedekindDomain.FiniteAdeleRing.ext intro v rfl exact he β–Έ hmem end end OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.AdelicNeighborhoods