import Mathlib.Analysis.Complex.Basic import Mathlib.Topology.Algebra.Order.Archimedean import Mathlib.Topology.NhdsWithin import Mathlib.Algebra.Ring.Subring.Basic import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.NormNum /-! # Localized Coefficient Density -/ namespace OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.LocalizedCoefficientDensity noncomputable section /-! Density from one inverted positive integer and one nonreal coefficient. The dense sets are explicit subrings and affine sets of coefficient vectors. No arithmetic-group density or approximation theorem is assumed. -/ def realInvertedIntegerRing (b : ℕ) : Subring ℝ := Subring.closure {(b : ℝ)⁻¹} theorem realInvertedIntegerRing_dense (b : ℕ) (hb : 2 ≤ b) : Dense (realInvertedIntegerRing b : Set ℝ) := by have hb1 : (1 : ℝ) < b := by exact_mod_cast hb have hb0 : (0 : ℝ) < b := lt_trans zero_lt_one hb1 apply (realInvertedIntegerRing b).toAddSubgroup.dense_of_not_isolated_zero intro ε hε obtain ⟨n, hn⟩ := exists_pow_lt_of_lt_one hε (inv_lt_one_of_one_lt₀ hb1) refine ⟨(b : ℝ)⁻¹ ^ n, ?_, pow_pos (inv_pos.mpr hb0) n, hn⟩ exact (realInvertedIntegerRing b).pow_mem (Subring.subset_closure (by simp)) n theorem complex_subring_dense_of_inverted_integer_nonreal (S : Subring ℂ) (b : ℕ) (hb : 2 ≤ b) (hbS : (b : ℂ)⁻¹ ∈ S) (z : ℂ) (hzS : z ∈ S) (hz : z.im ≠ 0) : Dense (S : Set ℂ) := by have hreal : realInvertedIntegerRing b ≤ S.comap Complex.ofRealHom := by apply Subring.closure_le.mpr intro a ha obtain rfl := Set.mem_singleton_iff.mp ha simpa using hbS let f : ℝ × ℝ → ℂ := fun a => (a.1 : ℂ) + (a.2 : ℂ) * z have hf : Continuous f := (Complex.continuous_ofReal.comp continuous_fst).add ((Complex.continuous_ofReal.comp continuous_snd).mul continuous_const) have hsurj : Function.Surjective f := by intro w refine ⟨(w.re - (w.im / z.im) * z.re, w.im / z.im), ?_⟩ apply Complex.ext · simp [f] · simp [f, hz] apply hsurj.denseRange.dense_of_mapsTo hf ((realInvertedIntegerRing_dense b hb).prod (realInvertedIntegerRing_dense b hb)) intro a ha exact S.add_mem (hreal ha.1) (S.mul_mem (hreal ha.2) hzS) /-- The coefficient ring generated by the inverted integer and the chosen nonreal coefficient. Its elements are actual polynomial combinations. -/ def complexLocalizedCoefficientRing (b : ℕ) (z : ℂ) : Subring ℂ := Subring.closure {(b : ℂ)⁻¹, z} theorem complexLocalizedCoefficientRing_dense (b : ℕ) (hb : 2 ≤ b) (z : ℂ) (hz : z.im ≠ 0) : Dense (complexLocalizedCoefficientRing b z : Set ℂ) := complex_subring_dense_of_inverted_integer_nonreal (complexLocalizedCoefficientRing b z) b hb (Subring.subset_closure (by simp)) z (Subring.subset_closure (by simp)) hz def affineCoefficientVectors {I : Type*} (S : Subring ℂ) (v₀ : I → ℂ) (m : ℂ) : Set (I → ℂ) := (fun v : I → ℂ => v₀ + m • v) '' Set.pi Set.univ (fun _ => (S : Set ℂ)) theorem affineCoefficientVectors_dense {I : Type*} (S : Subring ℂ) (hS : Dense (S : Set ℂ)) (v₀ : I → ℂ) (m : ℂ) (hm : m ≠ 0) : Dense (affineCoefficientVectors S v₀ m) := by have hf : Continuous (fun v : I → ℂ => v₀ + m • v) := continuous_const.add ((show Continuous (fun _ : I → ℂ => m) from continuous_const).smul (show Continuous (fun v : I → ℂ => v) from continuous_id)) have hsurj : Function.Surjective (fun v : I → ℂ => v₀ + m • v) := by intro v refine ⟨m⁻¹ • (v - v₀), ?_⟩ change v₀ + m • (m⁻¹ • (v - v₀)) = v rw [smul_smul, mul_inv_cancel₀ hm, one_smul] abel exact hsurj.denseRange.dense_image hf (dense_pi Set.univ (fun _ _ => hS)) end end OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.LocalizedCoefficientDensity