module public import Aesop.BuiltinRules import Mathlib.Data.Set.Finite.Monad import Mathlib.FieldTheory.Galois.Profinite import Mathlib.Topology.Algebra.ClopenNhdofOne import TauCeti.NumberTheory.Chebotarev.Density.ResidueDegree import TauCeti.NumberTheory.NumberField.ResidueDegree public import Lib.Adelic.Adeles.Basic public import Lib.ClassField.Places.GaloisDefs import Lib.ClassField.GaloisCohomology.KummerCyclicClasses import Lib.ClassField.Places.DecompositionCompletion import Lib.ClassField.Places.ProfiniteGalois /-! # Chebotarev: Frobenii at primes of degree one in every nonempty open set The qualitative form of Chebotarev's theorem used in the proof: `New.chebotarev`, deduced from Tau Ceti's Chebotarev density theorem for primes of residue degree one over `ℚ` (`NumberField.Chebotarev.infinite_frobeniusPrimeSet_inter_setOf_inertiaDeg_eq_one`). Notions from other files: * `New.IsFrob`: `σ` stabilises the valuation subring `A` and `σ • x ≡ x ^ q` modulo the maximal ideal for all `x ∈ A`. * `New.IsPlaceOver`: `IsPlaceOver A v` says that the valuation subring `A` of `Ω` lies over the prime `v` of `K`: an integer of `K` is in the maximal ideal of `A` exactly when it lies in `v`. ## Relation to the literature Known result: Chebotarev's density theorem, existence form. Only existence is proved, namely that Frobenius elements at primes of degree one outside a finite set are dense in the absolute Galois group, and no density value is given. The proof here goes through Tau Ceti's degree-one Chebotarev density theorem. Source: J. S. Milne, Class Field Theory, VIII 7.4; Stevenhagen–Lenstra, Chebotarëv and his density theorem, Math. Intelligencer 18 (1996). -/ @[expose] public section open Subgroup New Nat open scoped NumberField /-- If `w` is a finite place of a finite normal intermediate field `L / K` lying over `v : FinPlace K` and `τ : Gal(Ω/K)` is an arithmetic Frobenius at `placeOver w` for `v.q`, then the restriction `τ.restrictNormal L` is an arithmetic Frobenius at `w.asIdeal` over `𝓞 K`. -/ private lemma New.IsFrob.isArithFrobAt_restrictNormal {K : Type} [Field K] [NumberField K] [Algebra K Ω] {L : IntermediateField K Ω} [Normal K L] [NumberField L] {v : FinPlace K} {w : FinPlace L} [w.asIdeal.LiesOver v.asIdeal] {τ : Gal(Ω/K)} (hτ : IsFrob (placeOver w) v.q τ) : IsArithFrobAt (𝓞 K) (τ.restrictNormal L) w.asIdeal := by intro x have h_mem : τ.restrictNormal L • x - x ^ v.q ∈ w.asIdeal := w.isPlaceOver_placeOver.sub_pow_mem_asIdeal hτ (by simp [AlgEquiv.restrictNormal_commutes]) simpa [← w.asIdeal.over_def v.asIdeal, FinPlace.q, Ideal.absNorm_apply, Submodule.cardQuot_apply] using h_mem /-- Chebotarev's theorem, existence form (no density is given). Let `W` be a nonempty open subset of the absolute Galois group `Gal(Ω/K)` of the number field `K`, and `S` a finite set of finite places of `K`. Then (a) some place `v ∉ S` has prime norm `v.q` (the size of its residue field), with a place `A` of `Ω` over it (a valuation subring, `New.IsPlaceOver`); (b) some arithmetic Frobenius at `A` for `v.q` lies in `W`; (c) every arithmetic Frobenius at `A` for `v.q` lies in `W`. -/ lemma New.chebotarev {K : Type} [Field K] [NumberField K] [Algebra K Ω] {W : Set Gal(Ω/K)} (hW : IsOpen W) (hW_ne : W.Nonempty) {S : Set (FinPlace K)} (hS : S.Finite) : -- (a) ∃ v : FinPlace K, v ∉ S ∧ v.q.Prime ∧ ∃ A : ClosurePlace, IsPlaceOver A v ∧ -- (b) ∃ σ ∈ W, IsFrob A v.q σ ∧ -- (c) ∀ τ : Gal(Ω/K), IsFrob A v.q τ → τ ∈ W := by -- Take `g ∈ W`, an open normal `U` with `g U ⊆ W`, and its finite Galois fixed field `L`. -- Tau Ceti's Chebotarev theorem gives a prime `v ∉ S` of residue degree one over `ℚ`, unramified -- in `L`, whose Artin class in `Gal(L/K)` is that of `g|_L`. obtain ⟨g, hg_mem⟩ : ∃ g : Gal(Ω/K), g ∈ W := hW_ne have h_one_mem : (1 : Gal(Ω/K)) ∈ (fun x : Gal(Ω/K) ↦ g * x) ⁻¹' W := by simpa using hg_mem obtain ⟨⟨U, hU_normal⟩, hU : ∀ x ∈ U.toSubgroup, g * x ∈ W⟩ := ProfiniteGrp.exist_openNormalSubgroup_sub_open_nhds_of_one (hW.preimage (continuous_const_mul g)) h_one_mem have : Fact U.toSubgroup.IsOpen := ⟨U.isOpen'⟩ let L : IntermediateField K Ω := fixedFieldOf U.toSubgroup let gL : L ≃ₐ[K] L := g.restrictNormal L have h_inf : (NumberField.Chebotarev.frobeniusPrimeSet K L (ConjClasses.mk gL) ∩ {v : FinPlace K | v.asIdeal.inertiaDeg ℤ = 1}).Infinite := NumberField.Chebotarev.infinite_frobeniusPrimeSet_inter_setOf_inertiaDeg_eq_one K L _ obtain ⟨(v : FinPlace K), ⟨hv_frob, hv_deg⟩, hv_notMem⟩ := (h_inf.sdiff hS).nonempty have hv_prime : v.q.Prime := by rw [FinPlace.q, TauCeti.absNorm_eq_rationalPrimeBelow_pow, hv_deg, pow_one] exact TauCeti.prime_rationalPrimeBelow v -- Realise `gL` as the arithmetic Frobenius at a prime `Q` of `𝓞 L` over `v`, and lift `Q` to a -- place `A = placeOver w` of `Ω`. obtain ⟨⟨Q, hQ_prime, hQ_over⟩, hgL_frob⟩ := NumberField.Chebotarev.exists_isArithFrobAt_of_mem_frobeniusPrimeSet_mk hv_frob have : Algebra.IsUnramifiedAt (𝓞 K) Q := NumberField.Chebotarev.isUnramifiedAt_of_mem_frobeniusPrimeSet hv_frob Q let w : FinPlace L := ⟨Q, hQ_prime, Ideal.ne_bot_of_liesOver_of_ne_bot v.ne_bot Q⟩ have hw_below : w.below K = v := IsDedekindDomain.HeightOneSpectrum.ext (Q.over_def v.asIdeal).symm have hA : IsPlaceOver (placeOver w) v := by rw [← hw_below] exact w.isPlaceOver_placeOver.isPlaceOver_below -- Every Frobenius `τ` at `placeOver w` restricts to an arithmetic Frobenius at `Q`, hence agrees -- with `gL` on `L` by unramifiedness; so `g⁻¹ * τ ∈ U` and `τ ∈ W`. have h_all (τ : Gal(Ω/K)) (hτ : IsFrob (placeOver w) v.q τ) : τ ∈ W := by have hτL : IsArithFrobAt (𝓞 K) (τ.restrictNormal L) Q := hτ.isArithFrobAt_restrictNormal have h_eq : τ.restrictNormal L = gL := NumberField.isArithFrobAt_eq_of_isUnramifiedAt hτL hgL_frob have h_mem : g⁻¹ * τ ∈ U.toSubgroup := by rw [← fixingSubgroup_fixedFieldOf (Γ := Gal(Ω/K)) (K := K) (H := U.toSubgroup)] change g⁻¹ * τ ∈ L.fixingSubgroup rw [← L.restrictNormalHom_ker, MonoidHom.mem_ker, map_mul, map_inv, inv_mul_eq_one] exact h_eq.symm simpa using hU _ h_mem obtain ⟨σ, hσ⟩ := hA.exists_isFrob Gal(Ω/K) exact ⟨v, hv_notMem, hv_prime, placeOver w, hA, σ, h_all σ hσ, hσ, h_all⟩ /-- Choose distinct finite primes outside `S` whose Frobenius elements lie in prescribed nonempty open subsets of the absolute Galois group, one prime for each index in a finite family. -/ lemma New.chebotarev_family {K ι : Type} [Field K] [NumberField K] [Algebra K Ω] [Finite ι] {W : ι → Set Gal(Ω/K)} (hW : ∀ i, IsOpen (W i)) (hW_ne : ∀ i, (W i).Nonempty) {S : Set (FinPlace K)} (hS : S.Finite) : ∃ (v : ι → FinPlace K) (A : ι → ClosurePlace) (σ : ι → Gal(Ω/K)), Function.Injective v ∧ ∀ i, v i ∉ S ∧ IsPlaceOver (A i) (v i) ∧ σ i ∈ W i ∧ IsFrob (A i) (v i).q (σ i) := by classical -- Make a sequence of choices, each avoiding every prime in the earlier families. have h_choose (T : Set (ι → FinPlace K)) (hT : T.Finite) : ∃ v : ι → FinPlace K, ∀ i, (v i ∉ S ∧ v i ∉ T.seq Set.univ) ∧ ∃ A : ClosurePlace, IsPlaceOver A (v i) ∧ ∃ σ ∈ W i, IsFrob A (v i).q σ := by choose v hv _hprime A hA σ hσ hfrob _hall using fun i ↦ chebotarev (hW i) (hW_ne i) (hS.union (hT.seq Set.finite_univ)) exact ⟨v, fun i ↦ ⟨not_or.mp (hv i), A i, hA i, σ i, hσ i, hfrob i⟩⟩ obtain ⟨u, hu⟩ := Set.seq_of_forall_finite_exists h_choose -- Take each index from a different family in the sequence. obtain ⟨e, he⟩ := exists_injective_nat ι choose hv A hA σ hσ hfrob using fun i : ι ↦ hu (e i) i have h_avoid (i : ι) : ∀ n < e i, ∀ j : ι, u n j ≠ u (e i) i := by simpa [Set.mem_seq_iff] using (hv i).2 exact ⟨fun i ↦ u (e i) i, A, σ, by grind [Function.Injective], fun i ↦ ⟨(hv i).1, hA i, hσ i, hfrob i⟩⟩