Definitions of TypeDensity.Surfaces.TruncatedSeries
DefinitionTypeDensity_Surfaces_TruncatedSeriesTruncations of k⟦T, X⟧ and contacts on the special fibre
Elementary facts about the two-variable power series ring k⟦T, X⟧ over a field, shared by the
residue-ideal counts of the crossing state k⟦T, X⟧ ⧸ (T^a X^b) and the single state
k⟦T, X⟧ ⧸ (T^a): the maximal ideal (T, X) and residue field; the length
ℓ(k⟦T, X⟧ ⧸ (F, X_s)) as the order of F along the other axis, and its identification with
the contact of F with an axis of the special fibre; the truncation
k⟦T, X⟧ ⧸ ((T^a X^b) + (T, X)^L) ≃ k^(truncIndex a b L) by coefficients; and the common
counting argument for principal ideals of the special fibre whose generators are described by
vanishing and non-vanishing of truncated coefficients.
Main results
maximalIdeal_twoSeries,twoSeriesResidueEquiv: the maximal ideal and the residue field.axisQuotientLength_eq_iff,contact_fiberT_eq_axisQuotientLength,contact_fiberX_eq_axisQuotientLength: contacts as orders along an axis.isUnit_mk_truncIdeal_iff: units of the truncated quotient (which is identified with its coefficient vectors by the linear equivalencetruncEval).card_mul_eq_zero_eq_card_quotient: annihilator and quotient of a finite ring have equal size.principal_residue_ideal_count: the shared core of the crossing and single residue-ideal counts.
Provenance: the shared helpers of crossing_residue_ideal_count and single_residue_ideal_count
(formerly duplicated as crc_* in Measure/Normalizer.lean and sric_* in
Measure/StateVolumes.lean).
-- Generated by the TypeDensity exporter from TypeDensity/Surfaces/TruncatedSeries.lean (namespace TypeDensity); do not edit.
import Definitions.Def_TypeDensity_Basic
import Definitions.Def_TypeDensity_Formula_LawAlgebra
import Definitions.Def_TypeDensity_Measure_AdicCylinders
import Definitions.Def_TypeDensity_Measure_HenselProducts
import Definitions.Def_TypeDensity_Surfaces_Lengths
import Definitions.Def_TypeDensity_Surfaces_PowerSeries
import Mathlib.FieldTheory.RatFunc.Basic
import Mathlib.MeasureTheory.Measure.Haar.Unique
import Mathlib.NumberTheory.ArithmeticFunction.Moebius
import Mathlib.NumberTheory.Padics.PadicIntegers
import Mathlib.RingTheory.IntegralClosure.IntegralRestrict
import Mathlib.RingTheory.MvPowerSeries.Basic
import Mathlib.RingTheory.RamificationInertia.Basic
import Mathlib.Topology.Algebra.Nonarchimedean.AdicTopology
import Mathlib.FieldTheory.Finite.GaloisField
import Mathlib.RingTheory.AdicCompletion.Algebra
import Mathlib.RingTheory.RegularLocalRing.Defs
import Mathlib.Topology.Algebra.MvPolynomial
import Mathlib.Algebra.Group.Pi.Units
import Mathlib.Order.CompletePartialOrder
import Mathlib.RingTheory.Henselian
import Mathlib.RingTheory.Polynomial.Resultant.Basic
import Mathlib.RingTheory.SimpleRing.Principal
import Mathlib.FieldTheory.Finite.Extension
import Mathlib.RingTheory.AdicCompletion.Noetherian
import Mathlib.RingTheory.MvPowerSeries.Equiv
import Mathlib.RingTheory.PicardGroup
set_option autoImplicit false
namespace TypeDensity
/-- A series lies in the ideal `(T, X)` of `k⟦T, X⟧` iff its constant coefficient vanishes. -/
theorem mem_axisIdeal_iff (k : Type) [Field k] (φ : TwoSeries k) :
φ ∈ Ideal.span {axisT k, axisX k} ↔ MvPowerSeries.constantCoeff φ = 0 :=
mvPowerSeries_fin_two_mem_variableIdeal_iff k φ
/-- The ideal `(T, X)` of `k⟦T, X⟧` is maximal. -/
theorem axisIdeal_isMaximal (k : Type) [Field k] :
(Ideal.span {axisT k, axisX k}).IsMaximal := by
have : Ideal.span {axisT k, axisX k} =
RingHom.ker (MvPowerSeries.constantCoeff (σ := Fin 2) (R := k)) := by
ext φ; rw [mem_axisIdeal_iff, RingHom.mem_ker]
rw [this]
exact RingHom.ker_isMaximal_of_surjective _ (fun x => ⟨MvPowerSeries.C x, by simp⟩)
/-- The maximal ideal of `k⟦T, X⟧` is `(T, X)`. -/
theorem maximalIdeal_twoSeries (k : Type) [Field k] :
IsLocalRing.maximalIdeal (TwoSeries k) = Ideal.span {axisT k, axisX k} :=
(IsLocalRing.eq_maximalIdeal (axisIdeal_isMaximal k)).symm
/-- The length of `k⟦T, X⟧ ⧸ (F, X_s)`, where `X_0 = T` and `X_1 = X`. -/
noncomputable def axisQuotientLength (k : Type) [Field k] (s : Fin 2) (F : TwoSeries k) : ℕ∞ :=
Module.length (TwoSeries k) (TwoSeries k ⧸ (Ideal.span {F} ⊔ Ideal.span {MvPowerSeries.X s}))
/-- The exponents `(i, j)` with `i + j < L` outside the quadrant `i ≥ a, j ≥ b`: the monomials
surviving in `k⟦T, X⟧ ⧸ ((T^a X^b) + (T, X)^L)`. -/
def truncIndex (a b L : ℕ) : Finset (ℕ × ℕ) :=
(Finset.range L ×ˢ Finset.range L).filter fun ij => ij.1+ij.2<L ∧ ¬(a ≤ ij.1 ∧ b ≤ ij.2)
/-- The ideal `(T^a X^b) + (T, X)^L` of `k⟦T, X⟧`. -/
noncomputable def truncIdeal (k : Type) [Field k] (a b L : ℕ) : Ideal (TwoSeries k) :=
monomialIdeal k a b ⊔ (Ideal.span {axisT k, axisX k})^L
/-- The exponent vector `T^i X^j` of a pair `(i, j)`. -/
noncomputable def truncExponent (ij : ℕ × ℕ) : Fin 2 →₀ ℕ :=
Finsupp.single 0 ij.1 + Finsupp.single 1 ij.2
/-- The coefficients of a series at the exponents of `truncIndex a b L`. -/
noncomputable def truncCoeffs (k : Type) [Field k] (a b L : ℕ) : TwoSeries k →ₗ[k]
(truncIndex a b L → k) :=
LinearMap.pi (fun s => MvPowerSeries.coeff (truncExponent s.1))
theorem truncCoeffs_surjective_and_ker (k : Type) [Field k] (a b L : ℕ) :
Function.Surjective (truncCoeffs k a b L) ∧
∀ φ, truncCoeffs k a b L φ = 0 ↔ φ ∈ truncIdeal k a b L := by
let e : ℕ × ℕ → (Fin 2 →₀ ℕ) := truncExponent
have e0 : ∀ ij, e ij 0 = ij.1 := fun ij => by simp [e, truncExponent]
have e1 : ∀ ij, e ij 1 = ij.2 := fun ij => by simp [e, truncExponent]
have eeq : ∀ m : Fin 2 →₀ ℕ, e (m 0, m 1) = m := fun m => by
ext i; fin_cases i <;> simp [e0, e1]
have einj : Function.Injective e := fun p q h => by
have h0 := congrArg (fun m => m 0) h
have h1 := congrArg (fun m => m 1) h
simp only [e0, e1] at h0 h1
exact Prod.ext h0 h1
refine ⟨?_, ?_⟩
· intro v
refine ⟨∑ s, MvPowerSeries.monomial (e s.1) (v s), ?_⟩
funext s₀
simp only [truncCoeffs, LinearMap.pi_apply, map_sum, MvPowerSeries.coeff_monomial]
rw [Finset.sum_eq_single s₀]
· simp [e]
· intro s _ hs
rw [if_neg]
intro h
exact hs (Subtype.ext (einj h.symm))
· simp
· intro φ
constructor
· intro hφ
have hz : ∀ s : truncIndex a b L, MvPowerSeries.coeff (e s.1) φ = 0 :=
fun s => congrFun hφ s
let x : TwoSeries k := fun m => if a ≤ m 0 ∧ b ≤ m 1 then MvPowerSeries.coeff m φ else 0
have hx : ∀ m, MvPowerSeries.coeff m x =
if a ≤ m 0 ∧ b ≤ m 1 then MvPowerSeries.coeff m φ else 0 :=
fun m => rfl
rw [show φ = x + (φ - x) by ring]
refine Submodule.add_mem_sup ?_ ?_
· rw [monomialIdeal_mem_iff]
intro m hm
rw [hx, if_neg hm]
· rw [axis_ideal_pow_mem_iff]
intro m hm
rw [map_sub, hx]
split_ifs with h
· simp
· have := hz ⟨(m 0, m 1), by
simp only [truncIndex, Finset.mem_filter, Finset.mem_product, Finset.mem_range]
exact ⟨⟨by omega, by omega⟩, hm, h⟩⟩
simp only [eeq] at this
simp [this]
· intro hφ
obtain ⟨x, hx, y, hy, rfl⟩ := Submodule.mem_sup.mp hφ
rw [monomialIdeal_mem_iff] at hx
rw [axis_ideal_pow_mem_iff] at hy
funext s
obtain ⟨ij, hij⟩ := s
simp only [truncIndex, Finset.mem_filter, Finset.mem_product, Finset.mem_range] at hij
simp only [truncCoeffs, LinearMap.pi_apply, map_add, Pi.zero_apply]
rw [hx _ (by rw [e0, e1]; exact hij.2.2), hy _ (by rw [e0, e1]; exact hij.2.1), add_zero]
/-- The coefficient vector of a class in `k⟦T, X⟧ ⧸ truncIdeal k a b L`, as a linear
equivalence (first isomorphism theorem for `truncCoeffs`). -/
noncomputable def truncEval (k : Type) [Field k] (a b L : ℕ) :
(TwoSeries k ⧸ truncIdeal k a b L) ≃ₗ[k] (truncIndex a b L → k) :=
(Submodule.Quotient.restrictScalarsEquiv k (truncIdeal k a b L)).symm ≪≫ₗ
Submodule.quotEquivOfEq _ (LinearMap.ker _) (Submodule.ext fun φ ↦
((truncCoeffs_surjective_and_ker k a b L).2 φ).symm) ≪≫ₗ
(truncCoeffs k a b L).quotKerEquivOfSurjective (truncCoeffs_surjective_and_ker k a b L).1
/-- The residue field of `k⟦T, X⟧` is `k`, via the constant coefficient. -/
noncomputable def twoSeriesResidueEquiv (k : Type) [Field k] :
IsLocalRing.ResidueField (TwoSeries k) ≃+* k :=
(Ideal.quotEquivOfEq (by
rw [maximalIdeal_twoSeries]; ext φ; rw [mem_axisIdeal_iff, RingHom.mem_ker])).trans
(RingHom.quotientKerEquivOfSurjective (f := (MvPowerSeries.constantCoeff (σ := Fin 2) (R := k)))
(fun x => ⟨MvPowerSeries.C x, by simp⟩))
end TypeDensity