Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Arb4 Q certificate definitions

Definition
ArdaRH65K_Turing121_Arb4_Q

by Johan Mercedes · Oct 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

arda-rh65k-transfernumber-theoryriemann-zeta

This bundle represents exact signed rational numbers and defines their arithmetic and comparisons. Let D\mathcal DD be the set of declarations it provides. Among its named definitions are

D⊇{Arb4.Q.dm,  Arb4.Q.mk,  Arb4.Q.n,  Arb4.Q}.\mathcal D\supseteq\{\mathtt{Arb4.Q.dm},\;\mathtt{Arb4.Q.mk},\;\mathtt{Arb4.Q.n},\;\mathtt{Arb4.Q}\}.D⊇{Arb4.Q.dm,Arb4.Q.mk,Arb4.Q.n,Arb4.Q}.

The accompanying theorems establish the mathematical properties of these definitions.

Definition code
import Mathlib
/-  Arb4_Q.lean -- lane Arb4 (h1000 compaction): exact rational arithmetic for Boolean kernel
    checkers.

    A certificate side condition such as the error budget of an octant piece is a polynomial
    inequality between explicit rationals.  Closing it by `norm_num` stores the whole normalisation
    trace in the olean (about 300 KB per budget at height 1000).  Here the same inequality is
    computed by `decide +kernel` over plain `Int`/`Nat` arithmetic (GMP-accelerated literals) and
    transported to `ℝ` by ONE soundness theorem per operation, proved once:

      * `Q`             -- an UNNORMALISED rational `n / (dm + 1)` (`n : ℤ`, `dm : ℕ`): the
                           denominator is positive by construction, so no positivity bookkeeping;
                           `val` is its real value, `frac n d` the rational `n / d` (`d ≥ 1`);
      * `add sub mul neg qabs npow div sumQ` -- the operations, `val_*` their homomorphism laws;
      * `le lt`         -- the Boolean comparisons, `le_sound`, `lt_sound`.

    Trust: every theorem is proved from its stated hypotheses; axioms [propext, Classical.choice,
    Quot.sound] (Arb4_AxiomGuard).  No `sorry`.  conjecture1_proved = False.
-/


namespace Arb4

/-- A rational `n / (dm + 1)`, NOT normalised (numerator in `ℤ`, denominator minus one in `ℕ`). -/
structure Q where
  n : ℤ
  dm : ℕ

namespace Q

/-- The real value `n / (dm + 1)`. -/
noncomputable def val (a : Q) : ℝ := (a.n : ℝ) / ((a.dm : ℝ) + 1)

/-- The rational `n / d` (for `d ≥ 1`). -/
def frac (n : ℤ) (d : ℕ) : Q := ⟨n, d - 1⟩

/-- `m / 1`. -/
def ofNat (m : ℕ) : Q := ⟨(m : ℤ), 0⟩

/-- `m / 1`. -/
def ofInt (m : ℤ) : Q := ⟨m, 0⟩

def add (a b : Q) : Q := ⟨a.n * ((b.dm : ℤ) + 1) + b.n * ((a.dm : ℤ) + 1), a.dm * b.dm + a.dm + b.dm⟩

def sub (a b : Q) : Q := ⟨a.n * ((b.dm : ℤ) + 1) - b.n * ((a.dm : ℤ) + 1), a.dm * b.dm + a.dm + b.dm⟩

def mul (a b : Q) : Q := ⟨a.n * b.n, a.dm * b.dm + a.dm + b.dm⟩

def neg (a : Q) : Q := ⟨-a.n, a.dm⟩

/-- `|a|`. -/
def qabs (a : Q) : Q := ⟨(a.n.natAbs : ℤ), a.dm⟩

/-- `a ^ k`. -/
def npow (a : Q) : ℕ → Q
  | 0 => ⟨1, 0⟩
  | k + 1 => mul (npow a k) a

/-- `a / b` for a POSITIVE numerator of `b` (read through `Int.toNat`). -/
def div (a b : Q) : Q := ⟨a.n * ((b.dm : ℤ) + 1), (a.dm + 1) * b.n.toNat - 1⟩

/-- `Σ_{i < k} f i`. -/
def sumQ (f : ℕ → Q) : ℕ → Q
  | 0 => ⟨0, 0⟩
  | k + 1 => add (sumQ f k) (f k)

/-- `a ≤ b`, cross-multiplied. -/
def le (a b : Q) : Bool := decide (a.n * ((b.dm : ℤ) + 1) ≤ b.n * ((a.dm : ℤ) + 1))

/-- `a < b`, cross-multiplied. -/
def lt (a b : Q) : Bool := decide (a.n * ((b.dm : ℤ) + 1) < b.n * ((a.dm : ℤ) + 1))

/-! ## The value homomorphism -/





























/-! ## The comparisons -/











/-! ## Literal conversions (small proof terms for the generated certificates) -/











end Q

end Arb4


def ArdaRH65K_Turing121_Arb4_Q : Nat := 0
Source
https://github.com/DrMurphyIsIn/Arda/blob/af4fde8972eb6d4e78c7d9a95933b18b81adf52d/telperion/examples/zeta_reflection/lean/Arb4_Q.lean

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