/-java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
Copyright (c) 2025 Andrew Yang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Andrew Yang
-/
module
public import Mathlib.NumberTheory.RamificationInertia.Galois
import Mathlib.NumberTheory.NumberField.Discriminant.Basic
import Mathlib.NumberTheory.NumberField.Discriminant.Different
import Mathlib.RingTheory.Unramified.Dedekind
/-!
# Every number field has a ramified prime over `ℚ`
...except `ℚ` itself.
This is a trivial corollary of `NumberField.not_dvd_discr_iff_forall_mem` and
`NumberField.abs_discr_gt_two` but is placed in a separate file to avoid large imports.
-/
public section
open scoped NumberField nonZeroDivisors
variable {K : Type*} [Field K] [NumberField K] [CommRing ] [Algebra K]
variable [IsIntegralClosure ℤ K]
/-- If `K` is a number field with positive rank, then some prime is ramified in `K`. -/
lemma NumberField.exists_not_isUnramifiedIn (H : Module.finrank ℚ K ≠ 1) :
∃ p : ℕ, p.Prime ∧ ¬ Algebra.IsUnramifiedIn (Ideal.span {(p : ℤ)}) := by
have : 0 < Module.finrank ℚ K := Module.finrank_pos
have : 2 < |discr K| := abs_discr_gt_two (by lia)
obtain ⟨p, hp1, hp2⟩ := (discr K).exists_prime_and_dvd (by linarith)
use p.natAbs, p.prime_iff_natAbs_prime.mp hp1
simpa [← not_dvd_discr_iff_isUnramifiedIn K hp1]
/-- If `K` is a number field with positive rank, then there exists some maximal ideal of ` K`
that is ramified over `ℤ`. -/
lemma NumberField.exists_not_isUnramifiedAt_int (H : Module.finrank ℚ K ≠ 1) :
∃ (P : Ideal ) (_ : P.IsMaximal), ¬ Algebra.IsUnramifiedAt ℤ P := by
obtain ⟨p, hp1, hp2⟩ := NumberField.exists_not_isUnramifiedIn ( := ) H
have := (IsIntegralClosure.algebraMap_injective ℤ K).isDomain
have := IsIntegralClosure.isDedekindDomain ℤ ℚ K
have := IsIntegralClosure.isTorsionFree ℤ (A := ) K
have := IsIntegralClosure.isIntegral_algebra ℤ (A := ) K
grind [Algebra.isUnramifiedIn_iff_forall_of_isDedekindDomain]
/-- Any number field that is unramified over `ℚ` has rank `1`. -/
lemma NumberField.finrank_eq_one_of_unramified [Algebra.Unramified ℤ ] :
Module.finrank ℚ K = 1 := by
by_contra H
obtain ⟨P, _, H⟩ := NumberField.exists_not_isUnramifiedAt_int ( := ) H
exact H inferInstance
/-- If `` is a domain that is a finite and unramified extension of `ℤ`, then ` = ℤ`. -/
lemma bijective_algebraMap_int_of_finite_of_unramified
[Module.Finite ℤ ] [Algebra.Unramified ℤ ] [IsDomain ] [FaithfulSMul ℤ ] :
Function.Bijective (algebraMap ℤ ) := by
have := IsDedekindDomain.of_formallyUnramified ℤ
let K := FractionRing
let : Algebra ℤ K := Ring.toIntAlgebra K
have : CharZero := Algebra.charZero_of_charZero ℤ _
have : NumberField K := { to_finiteDimensional := Module.Finite.of_isLocalization ℤ ℤ⁰ }
have := NumberField.finrank_eq_one_of_unramified (K := K) ( := )
have : IsIntegralClosure ℤ ℤ K := .of_algEquiv _ (.ofBijective (IsScalarTower.toAlgHom _ _ _)
(Algebra.finrank_eq_one_iff_bijective_algebraMap.mp this)) (by simp)
exact bijective_algebraMap_of_linearEquiv (IsIntegralClosure.equiv ℤ ℤ K ).toLinearEquiv
/-- If `K` is a number field with positive rank such that `K/ℚ` is galois, then there exists
some rational prime `p : ℕ` such that every prime of `K` over `p` is ramified. -/
lemma NumberField.exists_not_isUnramifiedAt_int_of_isGalois [IsGalois ℚ K]
(H : 1 < Module.finrank ℚ K) :
∃ p : ℕ, p.Prime ∧ ∀ (P : Ideal ) (_ : P.IsPrime), ↑p ∈ P → ¬ Algebra.IsUnramifiedAt ℤ P := by
have := (IsIntegralClosure.algebraMap_injective ℤ K).isDomain
have := IsIntegralClosure.isDedekindDomain ℤ ℚ K
have := IsIntegralClosure.isFractionRing_of_finite_extension ℤ ℚ K
have := IsIntegralClosure.finite ℤ ℚ K
have := CharZero.of_module (R := ) K
let : MulSemiringAction Gal(K/ℚ) := IsIntegralClosure.MulSemiringAction ℤ ℚ K
have := IsGaloisGroup.of_isFractionRing Gal(K/ℚ) ℤ ℚ K
obtain ⟨P, _, hP'⟩ := NumberField.exists_not_isUnramifiedAt_int ( := ) H.ne'
obtain ⟨p, hp : _ = Ideal.span _⟩ := IsPrincipalIdealRing.principal (P.under ℤ)
have hp0 : p ≠ 0 := fun hp0 ↦ Ideal.IsMaximal.ne_bot_of_isIntegral_int _
(Ideal.eq_bot_of_under_eq_bot (hp.trans (by aesop)))
have : Prime p := by rw [← Ideal.span_singleton_prime hp0, ← hp]; infer_instance
refine ⟨p.natAbs, Int.prime_iff_natAbs_prime.mp this, fun Q _ hQ ↦ ?_⟩
replace hQ : (p : ) ∈ Q := Q.mem_of_dvd
(map_dvd (algebraMap _ _) p.associated_natAbs.symm.dvd) (by simpa using hQ)
have : .span {p} = Ideal.under ℤ Q :=
((Ideal.liesOver_span_iff Ideal.IsPrime.ne_top' this).mpr hQ).1
rwa [← Ideal.ramificationIdx_eq_one_iff,
← Ideal.ramificationIdxIn_eq_ramificationIdx (Q.under ℤ) _ Gal(K/ℚ), ← this, ← hp,
Ideal.ramificationIdxIn_eq_ramificationIdx _ P Gal(K/ℚ), Ideal.ramificationIdx_eq_one_iff]
[zur Elbe Produktseite wechseln0.20QuellennavigatorsAnalyse erneut starten2026-11-24]