Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Totally positive representatives of integral residue classes

Proved
NumberField.exists_isTotallyPositive_sub_mem

by riccardo.brasca · Sep 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

number-theorytauceti-chebotarev

Let KKK be a number field, let H⊆OKH\subseteq\mathcal O_KH⊆OK​ be a nonzero ideal, and let a∈OKa\in\mathcal O_Ka∈OK​. There exists b∈OKb\in\mathcal O_Kb∈OK​ such that

b≠0,b≡a(modH),w(b)>0for every real embedding w:K↪R.b\ne0,\qquad b\equiv a\pmod H,\qquad w(b)>0\quad\text{for every real embedding }w:K\hookrightarrow\mathbb R.b=0,b≡a(modH),w(b)>0for every real embedding w:K↪R.

This reconciles an arbitrary ideal congruence with total positivity at the real places.

Source: the Tau Ceti contributors (Apache-2.0, commit 948fe4751b1fe528b6d580c522ca5d743d47f185).

Preamble
/- 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_NumberTheory_NumberField_TotallyPositive
import Mathlib.Algebra.Group.Subgroup.Ker
import Mathlib.Algebra.Order.Ring.Units
import Mathlib.Algebra.Ring.Int.Units
import Mathlib.Data.Nat.Prime.Basic
import Mathlib.Data.Nat.Prime.Defs
import Mathlib.GroupTheory.Index
import Mathlib.GroupTheory.IndexNormal
import Mathlib.GroupTheory.Solvable
import Mathlib.GroupTheory.Subgroup.Center
import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic
import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex
import Mathlib.Tactic.Group

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
-/
/-!
# Totally positive elements of a number field

An element `x` of a number field `K` is **totally positive** when it is strictly positive under
every real embedding `K →+* ℝ` — equivalently, at every real infinite place. This is the archimedean
positivity condition underlying the *narrow* class group of the multiquadratic roadmap (Layer 3):
the narrow class group `Cl⁺(K)` is the quotient of the fractional ideals by the principal ideals
admitting a totally positive generator. It surjects onto the ordinary class group `Cl(K)`
(forgetting the positivity condition), and the `2`-rank of `Cl⁺(K)` is what the genus-theory
`t - 1` formula (with `t` the number of ramified primes) computes for a **real quadratic** field
in the multiquadratic roadmap.

This file introduces the predicate and its multiplicative structure. The totally positive elements
are closed under multiplication and inversion and contain every nonzero square, so the totally
positive units form a subgroup of `Kˣ`. That subgroup is the kernel of the sign (signature) map on
units; the signs *not* realized by units measure the difference between `Cl⁺(K)` and `Cl(K)`.

The file also records that `totallyPositiveUnits` has **finite index** — a finite intersection, over
the real places, of the finite-index preimages of the positive units of `ℝ` — which is what makes
the narrow class group finite (see `NarrowClassGroup.Finite`).

## Main definitions and results

* `NumberField.IsTotallyPositive`: strict positivity at every real place, with
  `isTotallyPositive_iff` its introduction/elimination form.
* `NumberField.isTotallyPositive_one`, `IsTotallyPositive.mul`, `IsTotallyPositive.inv`,
  `isTotallyPositive_sq`: the multiplicative structure, including that nonzero squares are totally
  positive.
* `NumberField.isTotallyPositive_ratCast`: a positive rational number is totally positive, with
  `NumberField.isTotallyPositive_intCast` its integer special case.
* `NumberField.totallyPositiveUnits`: the subgroup of totally positive units of `Kˣ` (the
  kernel of the unit signature map), with `sq_mem_totallyPositiveUnits`. For a totally complex field
  it is everything (`totallyPositiveUnits_eq_top`), since total positivity is then vacuous
  (`not_isReal_of_isTotallyComplex` makes `IsTotallyPositive` `simp` to `True`).
* `NumberField.totallyPositiveIntegerUnits`: the corresponding subgroup of the arithmetic
  units `(𝓞 K)ˣ`, the preimage of `totallyPositiveUnits` under `(𝓞 K)ˣ → Kˣ`, with
  `mem_totallyPositiveIntegerUnits` and `sq_mem_totallyPositiveIntegerUnits`.
* `NumberField.exists_isTotallyPositive_sub_mem`: every residue class modulo a nonzero ideal of
  `𝓞 K` contains a nonzero totally positive integer.
* `NumberField.norm_nonneg_of_isTotallyPositive`: the field norm of a totally positive element is
  nonnegative, and `NumberField.norm_pos_of_isTotallyPositive`: for a nonzero such element it is
  strictly positive.
* `NumberField.finiteIndex_totallyPositiveUnits`: `totallyPositiveUnits` has finite index
  (via `Units.instFiniteIndexPosSubgroup` and the general `Subgroup.instFiniteIndexComap`).
-/

 section

open NumberField InfinitePlace

namespace NumberField
end NumberField
section NumberField
open NumberField

variable {K : Type*} [Field K]



























variable [NumberField K]










Formal statement
theorem NumberField.exists_isTotallyPositive_sub_mem {H : _root_.Ideal (𝓞 K)} (hH : H ≠ ⊥) (a : 𝓞 K) :
    ∃ b : 𝓞 K, b ≠ 0 ∧ b - a ∈ H ∧ _root_.NumberField.IsTotallyPositive (b : K) := by sorry
Source
https://github.com/TauCetiProject/TauCeti/blob/948fe4751b1fe528b6d580c522ca5d743d47f185/TauCeti/NumberTheory/NumberField/TotallyPositive.lean#L181-L237

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me