Fractional ideals away from finitely many primes
DefinitionTauCeti_NumberTheory_NumberField_Ideal_Awaynumber-theorytauceti-chebotarev
For a set of nonzero primes of a Dedekind domain, let
The nonzero integral ideals divisible by no prime of form a monoid mapping into . These groups and monoids are the domains of ideal-theoretic Artin maps.
Formalization Note. These foundational declarations are transplanted from the Tau Ceti contributors' original source (Apache-2.0, commit 948fe4751b1fe528b6d580c522ca5d743d47f185), with compatibility adaptations for Lean 4.33.1. Mathematical proofs requiring separate theorem nodes are published separately.
Definition code
/- Transplanted from https://github.com/TauCetiProject/TauCeti at 948fe4751b1fe528b6d580c522ca5d743d47f185.
Original source copyright/license notices are retained below.
Generated exclusively from compiler declaration, command, and reference facts. -/
import Definitions.Def_TauCeti_RingTheory_DedekindDomain_Ideal
import Mathlib.NumberTheory.NumberField.Basic
import Mathlib.RingTheory.ClassGroup.Basic
import Mathlib.RingTheory.DedekindDomain.AdicValuation
import Mathlib.RingTheory.DedekindDomain.Factorization
import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas
import Mathlib.RingTheory.Valuation.Discrete.IsDiscreteValuationRing
section
set_option autoImplicit true
/-
Copyright (c) 2026 The Tau Ceti contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: The Tau Ceti contributors
-/
/-!
# Fractional ideals away from finitely many primes
For a number field `K` and a finite set `S` of its finite places, this file defines the subgroup
`idealsAway S` of invertible fractional ideals whose multiplicity vanishes at every member of
`S`. It proves that this subgroup is generated by the prime ideals outside `S` and supplies the
inclusion induced by enlarging `S`.
The integral counterpart `integralIdealsAway S` consists of the nonzero integral ideals divisible
by no prime in `S`. Its map to `idealsAway S` is the restriction of Mathlib's
`FractionalIdeal.mk0`.
The generation proof transports Mathlib's unique factorization of a nonzero fractional ideal,
`FractionalIdeal.finprod_heightOneSpectrum_factorization'`, to fractional-ideal units.
## Main definitions
* `NumberFieldArithmetic.idealsAway`: unit fractional ideals trivial at the primes in `S`.
* `NumberFieldArithmetic.idealsAwayEmptyEquiv`: ideals away from no primes are all invertible
fractional ideals.
* `NumberFieldArithmetic.idealsAwayInclusion`: inclusion obtained from `S ⊆ S'`.
* `NumberFieldArithmetic.integralIdealsAway`: nonzero integral ideals prime to `S`.
* `NumberFieldArithmetic.integralIdealsAwayHom`: the map from integral to fractional ideals.
## Main results
* `NumberFieldArithmetic.integralIdealsAway_hom_ext`: a monoid homomorphism out of
`integralIdealsAway S` is determined by its values on the primes outside `S`.
## References
The shared lift of fractional-ideal factorization to units,
`FractionalIdeal.finprod_unitOfPrime_zpow_count`, is also used by
`TauCeti.RingTheory.ClassGroup.HeightOneSpectrum`. It is adapted from Michael Stoll's
`EllipticCurves/Mathlib/FractionalIdeal.lean` at commit `66889eada51a` of the
`MichaelStollBayreuth/EllipticCurves` repository (Apache 2.0).
-/
section
open IsDedekindDomain IsDedekindDomain.HeightOneSpectrum NumberField
open scoped nonZeroDivisors NumberField
namespace TauCeti.NumberFieldArithmetic
variable {K : Type*} [Field K] [NumberField K]
/-- The subgroup of invertible fractional ideals whose multiplicity vanishes at every prime in
`S`. -/
def idealsAway (S : Finset (HeightOneSpectrum (𝓞 K))) :
Subgroup (FractionalIdeal (𝓞 K)⁰ K)ˣ where
carrier := {I | ∀ v ∈ S, FractionalIdeal.count K v (I : FractionalIdeal (𝓞 K)⁰ K) = 0}
one_mem' := fun v _ ↦ FractionalIdeal.count_one K v
mul_mem' := by
intro I J hI hJ v hv
rw [Units.val_mul, FractionalIdeal.count_mul K v (Units.ne_zero I) (Units.ne_zero J),
hI v hv, hJ v hv, add_zero]
inv_mem' := by
intro I hI v hv
rw [Units.val_inv_eq_inv_val, FractionalIdeal.count_inv, hI v hv, neg_zero]
/-- Membership in `idealsAway S` means vanishing multiplicity at every prime in `S`. -/
@[simp]
theorem mem_idealsAway_iff {S : Finset (HeightOneSpectrum (𝓞 K))}
{I : (FractionalIdeal (𝓞 K)⁰ K)ˣ} :
I ∈ idealsAway S ↔
∀ v ∈ S, FractionalIdeal.count K v (I : FractionalIdeal (𝓞 K)⁰ K) = 0 :=
Iff.rfl
/-- Enlarging the excluded set of primes shrinks the group of fractional ideals away from it. -/
theorem idealsAway_antitone {S S' : Finset (HeightOneSpectrum (𝓞 K))} (h : S ⊆ S') :
idealsAway (K := K) S' ≤ idealsAway (K := K) S := by
intro I hI v hv
exact hI v (h hv)
/-- The inclusion of fractional ideals away from `S'` into those away from `S`, for `S ⊆ S'`. -/
noncomputable def idealsAwayInclusion {S S' : Finset (HeightOneSpectrum (𝓞 K))} (h : S ⊆ S') :
idealsAway (K := K) S' →* idealsAway (K := K) S :=
Subgroup.inclusion (idealsAway_antitone h)
/-- The inclusion between groups of ideals away from finite sets does not change the underlying
fractional ideal. -/
@[simp]
theorem coe_idealsAwayInclusion {S S' : Finset (HeightOneSpectrum (𝓞 K))} (h : S ⊆ S')
(I : idealsAway (K := K) S') :
((idealsAwayInclusion h I : idealsAway (K := K) S) :
(FractionalIdeal (𝓞 K)⁰ K)ˣ) = I := by
simpa only [idealsAwayInclusion] using
Subgroup.coe_inclusion (idealsAway_antitone h) I
/-- The monoid of nonzero integral ideals divisible by no prime in `S`. -/
def integralIdealsAway (S : Finset (HeightOneSpectrum (𝓞 K))) : Submonoid (Ideal (𝓞 K)) where
carrier := {I | Ideal.IsPrimeTo I (S : Set (HeightOneSpectrum (𝓞 K)))}
one_mem' := by
-- Submonoid membership here reduces to the set-builder carrier in the definition above.
change Ideal.IsPrimeTo (1 : Ideal (𝓞 K)) (S : Set _)
simpa only [Ideal.one_eq_top] using
(Ideal.isPrimeTo_top : Ideal.IsPrimeTo (⊤ : Ideal (𝓞 K)) (S : Set _))
mul_mem' := fun hI hJ ↦ Ideal.isPrimeTo_mul_iff.mpr ⟨hI, hJ⟩
/-- Membership in `integralIdealsAway S` is nonvanishing together with divisibility by no prime
in `S`. -/
@[simp]
theorem mem_integralIdealsAway_iff {S : Finset (HeightOneSpectrum (𝓞 K))}
{I : Ideal (𝓞 K)} :
I ∈ integralIdealsAway S ↔ I ≠ ⊥ ∧ ∀ v ∈ S, ¬ v.asIdeal ∣ I := by
-- Expose the set-builder carrier so the shared characterization applies directly.
change Ideal.IsPrimeTo I (S : Set (HeightOneSpectrum (𝓞 K))) ↔ _
exact Ideal.isPrimeTo_iff
/-- Members of `integralIdealsAway S` are nonzero ideals of a Dedekind domain, so they cancel. -/
instance (S : Finset (HeightOneSpectrum (𝓞 K))) : CancelCommMonoid (integralIdealsAway S) where
mul_left_cancel a _ _ h :=
Subtype.ext <| mul_left_cancel₀ (mem_integralIdealsAway_iff.mp a.2).1 (congrArg Subtype.val h)
/-- **Homomorphisms out of `integralIdealsAway S` are determined on the primes.** Two monoid
homomorphisms from the integral ideals prime to `S` agree as soon as they agree on every prime
outside `S`. -/
theorem integralIdealsAway_hom_ext {M : Type*} [MulOneClass M]
{S : Finset (HeightOneSpectrum (𝓞 K))} {f g : integralIdealsAway (K := K) S →* M}
(h : ∀ (v : HeightOneSpectrum (𝓞 K)) (hv : v.asIdeal ∈ integralIdealsAway (K := K) S),
f ⟨v.asIdeal, hv⟩ = g ⟨v.asIdeal, hv⟩) : f = g := by
refine MonoidHom.ext fun ⟨I, hI⟩ ↦ ?_
-- The carrier of `integralIdealsAway S` is `Ideal.IsPrimeTo`, whose induction principle applies.
refine Ideal.IsPrimeTo.induction_on (motive := fun J ↦ ∀ hJ : J ∈ integralIdealsAway (K := K) S,
f ⟨J, hJ⟩ = g ⟨J, hJ⟩) hI (fun htop ↦ ?_) (fun v J hv hJ ih _ ↦ ?_) hI
· have hone : (⟨⊤, htop⟩ : integralIdealsAway (K := K) S) = 1 :=
Subtype.ext Ideal.one_eq_top.symm
rw [hone, map_one, map_one]
· have hvS : v.asIdeal ∈ integralIdealsAway (K := K) S := Ideal.isPrimeTo_asIdeal_iff.mpr hv
rw [← Submonoid.mk_mul_mk _ _ _ hvS hJ, map_mul, map_mul, ih hJ, h v hvS]
/-- Divisibility in `integralIdealsAway S` is divisibility of the underlying ideals: a cofactor
of two ideals prime to `S` is itself prime to `S`. -/
theorem integralIdealsAway_dvd_iff_dvd_coe {S : Finset (HeightOneSpectrum (𝓞 K))}
{I J : integralIdealsAway S} : I ∣ J ↔ (I : Ideal (𝓞 K)) ∣ (J : Ideal (𝓞 K)) := by
refine ⟨fun ⟨c, hc⟩ ↦ ⟨c, by rw [hc, Submonoid.coe_mul]⟩, fun ⟨c, hc⟩ ↦ ?_⟩
have hJ := mem_integralIdealsAway_iff.mp J.prop
refine ⟨⟨c, mem_integralIdealsAway_iff.mpr
⟨fun h ↦ hJ.1 ?_, fun v hv hvc ↦ hJ.2 v hv ?_⟩⟩, Subtype.ext hc⟩
· rw [hc, h, Ideal.mul_bot]
· rw [hc]
exact dvd_mul_of_dvd_right hvc _
/-- Membership in `integralIdealsAway S` is equivalently nonvanishing and vanishing fractional
ideal multiplicity at every prime in `S`. -/
theorem mem_integralIdealsAway_iff_count_eq_zero {S : Finset (HeightOneSpectrum (𝓞 K))}
{I : Ideal (𝓞 K)} :
I ∈ integralIdealsAway S ↔ I ≠ ⊥ ∧
∀ v ∈ S, FractionalIdeal.count K v (I : FractionalIdeal (𝓞 K)⁰ K) = 0 := by
rw [mem_integralIdealsAway_iff]
refine and_congr_right fun hI ↦ forall_congr' fun v ↦ forall_congr' fun _ ↦ ?_
rw [FractionalIdeal.count_coe K v hI]
simp only [Int.natCast_eq_zero]
simpa only [not_ne_iff] using
(not_congr (Associates.count_ne_zero_iff_dvd hI v.irreducible)).symm
/-- Map a nonzero integral ideal away from `S` to its invertible fractional ideal. -/
noncomputable def integralIdealsAwayHom (S : Finset (HeightOneSpectrum (𝓞 K))) :
integralIdealsAway (K := K) S →* idealsAway (K := K) S where
toFun I := ⟨FractionalIdeal.mk0 K
⟨I, mem_nonZeroDivisors_iff_ne_zero.mpr I.2.ne_bot⟩,
(mem_integralIdealsAway_iff_count_eq_zero.mp I.2).2⟩
map_one' := by
apply Subtype.ext
exact (FractionalIdeal.mk0 (R := 𝓞 K) K).map_one
map_mul' I J := by
apply Subtype.ext
exact (FractionalIdeal.mk0 (R := 𝓞 K) K).map_mul
⟨I, mem_nonZeroDivisors_iff_ne_zero.mpr I.2.ne_bot⟩
⟨J, mem_nonZeroDivisors_iff_ne_zero.mpr J.2.ne_bot⟩
/-- The integral-to-fractional map does not change the underlying ideal. -/
@[simp]
theorem coe_integralIdealsAwayHom (S : Finset (HeightOneSpectrum (𝓞 K)))
(I : integralIdealsAway (K := K) S) :
(((integralIdealsAwayHom S I : idealsAway (K := K) S) :
(FractionalIdeal (𝓞 K)⁰ K)ˣ) : FractionalIdeal (𝓞 K)⁰ K) = I := by
-- Both codomain subtypes coerce away; expose the resulting `mk0` expression explicitly.
change ((FractionalIdeal.mk0 (R := 𝓞 K) K _ :
(FractionalIdeal (𝓞 K)⁰ K)ˣ) : FractionalIdeal (𝓞 K)⁰ K) = I
exact FractionalIdeal.coe_mk0 (R := 𝓞 K) K _
end TauCeti.NumberFieldArithmetic
end
end
Source