Lean sources / Tests / Ramified.lean

Non-vacuity over a ramified base: `ℚ_p(√p)`

105 lines · 9 public declarations · raw file · declaration index

1/-2Copyright (c) 2026 Asvin G, Claude (Anthropic), GPT-6-Astra (OpenAI). All rights reserved.3Released under Apache 2.0 license as described in the file LICENSE.4Authors: Asvin G, Claude (Anthropic), GPT-6-Astra (OpenAI)5-/6import SurfaceBlowup.Corollaries.AdicCompact7import Mathlib.NumberTheory.Padics.PadicVal.Basic8import Mathlib.Algebra.Polynomial.SpecificDegree9 10/-!11# Non-vacuity over a ramified base: `ℚ_p(√p)`12 13`Tests/PadicInt.lean` applies the main theorem to `ℤ_p`. This file applies it to the ring of14integers of the ramified quadratic extension `K = ℚ_p(√p) = ℚ_p[X]/(X² - p)`, for every prime `p`15including `p = 2`.16 17## Main results18 19* `irreducible_sqrtPoly`: `X² - p` is irreducible over `ℚ_p` (it has no root, by valuations).20* `not_padicUnramified`: `K/ℚ_p` is ramified: `p = √p · √p` in `𝒪_K`, so `p` is not irreducible.21* `main_field_form_sqrtP`: the monic and projective type densities over `𝒪_K`, with its `𝔪`-adic22  topology and Borel σ-algebra, are the values of the universal rational functions at the residue23  cardinality of `𝒪_K`. No topological hypothesis is assumed.24-/25 26open Polynomial IsLocalRing27 28namespace SurfaceBlowup.Tests29 30section Ramified31 32variable (p : ℕ) [hp : Fact p.Prime]33 34/-- The polynomial `X² - p` over `ℚ_p`. -/35noncomputable abbrev sqrtPoly : ℚ_[p][X] := X ^ 2 - C (p : ℚ_[p])36 37/-- `p` is not a square in `ℚ_p`: its valuation is odd. -/38theorem not_isSquare_p (x : ℚ_[p]) : x ^ 2 ≠ (p : ℚ_[p]) := by39  intro h40  have hx : x ≠ 0 := by41    rintro rfl42    simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow] at h43    exact hp.out.ne_zero (by exact_mod_cast h.symm)44  have hv := congrArg Padic.valuation h45  rw [Padic.valuation_pow, Padic.valuation_p] at hv46  omega47 48theorem irreducible_sqrtPoly : Irreducible (sqrtPoly p) := by49  refine irreducible_of_degree_le_three_of_not_isRoot ?_ fun x hx => not_isSquare_p p x ?_50  · rw [sqrtPoly, natDegree_X_pow_sub_C]; decide51  · simpa [sqrtPoly, IsRoot, sub_eq_zero] using hx52 53instance : Fact (Irreducible (sqrtPoly p)) := ⟨irreducible_sqrtPoly p⟩54 55/-- The field `ℚ_p(√p)`. -/56noncomputable abbrev QpSqrtP : Type := AdjoinRoot (sqrtPoly p)57 58instance : FiniteDimensional ℚ_[p] (QpSqrtP p) :=59  (AdjoinRoot.powerBasis (irreducible_sqrtPoly p).ne_zero).finite60 61/-- `√p` is integral over `ℤ_p`. -/62theorem isIntegral_root : IsIntegral ℤ_[p] (AdjoinRoot.root (sqrtPoly p)) := by63  refine ⟨X ^ 2 - C (p : ℤ_[p]), ?_, ?_⟩64  · exact monic_X_pow_sub_C _ two_ne_zero65  · have h := AdjoinRoot.eval₂_root (sqrtPoly p)66    simp only [sqrtPoly, eval₂_sub, eval₂_X_pow, eval₂_C] at h ⊢67    simpa [map_natCast] using h68 69/-- `ℚ_p(√p)` is ramified over `ℚ_p`: `p` is the square of `√p` in the ring of integers. -/70theorem not_padicUnramified : ¬ PadicUnramified p (QpSqrtP p) := by71  intro hirr72  let s : padicIntegers p (QpSqrtP p) := ⟨_, isIntegral_root p⟩73  have hs : s * s = (p : padicIntegers p (QpSqrtP p)) := by74    apply Subtype.ext75    have h := AdjoinRoot.eval₂_root (sqrtPoly p)76    simp only [sqrtPoly, eval₂_sub, eval₂_X_pow, eval₂_C, sub_eq_zero] at h77    simpa [s, pow_two, map_natCast] using h78  rcases hirr.isUnit_or_isUnit hs.symm with hu | hu <;>79    exact hirr.not_isUnit (hs ▸ hu.mul hu)80 81/-- **Main theorem over `ℤ_p[√p]`.** With the `𝔪`-adic topology and Borel σ-algebra on the ring of82integers of the ramified field `ℚ_p(√p)`, the type densities are the values of the universal83rational functions at the residue cardinality. -/84theorem main_field_form_sqrtP (n : ℕ) (σ : FactorType) :Theorem 1.185    letI := padicIntegers_isDVR p (QpSqrtP p)86    haveI := padicIntegers_maximal_adic_complete p (QpSqrtP p) this87    haveI := padicIntegers_residueField_finite p (QpSqrtP p) (padicIntegers_isDVR p (QpSqrtP p))88    letI := (maximalIdeal (padicIntegers p (QpSqrtP p))).adicTopology89    letI : MeasurableSpace (padicIntegers p (QpSqrtP p)) := borel _90    haveI : BorelSpace (padicIntegers p (QpSqrtP p)) := ⟨rfl⟩91    haveI := isTopologicalRing_of_isAdic (I := maximalIdeal (padicIntegers p (QpSqrtP p))) rfl92    haveI := compactSpace_of_isAdic (O := padicIntegers p (QpSqrtP p)) rfl93    haveI := t2Space_of_isAdic (O := padicIntegers p (QpSqrtP p)) rfl94    haveI := secondCountableTopology_of_isAdic (O := padicIntegers p (QpSqrtP p)) rfl95    monicDensity (padicIntegers p (QpSqrtP p)) n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ)96        (Nat.card (ResidueField (padicIntegers p (QpSqrtP p))) : ℚ) (monicExpr n σ).rational :97          ℚ) : ℝ) ∧98      projectiveDensity (padicIntegers p (QpSqrtP p)) n σ = ENNReal.ofReal ((RatFunc.eval99        (RingHom.id ℚ) (Nat.card (ResidueField (padicIntegers p (QpSqrtP p))) : ℚ)100          (projectiveExpr n σ).rational : ℚ) : ℝ) :=101  main_field_form_ramified_adic n σ p (QpSqrtP p)102 103end Ramified104 105end SurfaceBlowup.Tests