Identifier
F:int-multiplicative-order-exists
Proof route
kernel-lean
External status
proved
Axiom footprint
Empty

Recorded description

For every n : Nat with 0 < n and every a : Int coprime to n, there is a k with `Int.IsOrder (ofNat n) a k` -- that is, k is positive, a^k is congruent to 1 mod n, and no smaller positive exponent is. The order is picked out by BOUNDED SEARCH, not defined as a function: `Nat.lnp_bounded_search` at the predicate `Q j := a^(succ j) = 1 (mod n)` with bound `Nat.totient n`. Two things make that search legitimate and both are load-bearing. The search's decidability hypothesis -- the ONLY thing separating it from the excluded middle it would otherwise imply -- is discharged by `Int.eq_em`, because `Int.ModEq n x y` is a Definition unfolding to `Eq Int (emod x n) (emod y n)`, so deciding it is deciding an integer equation and nothing classical enters. The bound is Euler's theorem, `Int.euler_totient_theorem`, together with `Nat.totient_eq_zero` making the totient a successor once 0 < n. The predicate is stated at `succ j` rather than at j deliberately: at j = 0 the condition a^0 = 1 holds for EVERY a, so a search on the unshifted predicate would always answer 0. What this does NOT claim: no computable function is produced, no efficiency claim is made, and both hypotheses are load-bearing (without coprimality Euler's theorem does not apply and the search has no bound). Uniqueness is a separate result, `Int.order_unique`.

Formal statement
theorem Int.order_exists : ((x0 : AxNat) -> ((x1 : Int) -> ((x2 : AxNat.lt AxNat.zero x0) -> ((x3 : Int.Coprime x1 (Int.ofNat x0)) -> Exists.{1} AxNat (fun (x4 : AxNat) => Int.IsOrder (Int.ofNat x0) x1 x4)))))

Dependencies

The graph shows direct ledger edges. Follow a node to open its artifact page.

Direct dependencies appear to the left. The current fact is in the center. Facts that depend directly on it appear to the right. Euler's totient theorem over th Equality of integers is decidab Mathlib v4.30 source propositio Mathlib v4.30 source propositio <= is preserved by successor on < on the naturals is irreflexiv [generated] kernel theorem Nat. Zero is a lower bound for every Current fact
8 direct dependencies 0 direct dependents

Evidence

kernel-Int.order_exists

Kind
kernel-term
Status
checked

Supports: Int.order_exists is admitted by the trusted kernel gate with the type recorded in formal.statement.

Checker command
cargo run -q --release -p axeyum-lean-kernel --example theorem_dependency_inventory -- Int.order_exists 2>/dev/null | grep -cE '^Int\.order_exists[[:space:]]'
Evidence notes

Two independent failure modes, so the exit status depends on the finding rather than on the run completing: theorem_dependency_inventory exits non-zero when a NAMED filter matches nothing, and grep -c exits 1 printing 0 when the anchored line is absent. Anchored with [[:space:]], never \t -- in a scripted (GNU) grep \t is a literal t. grep -c rather than grep -q, which would SIGPIPE the producer under pipefail. --release is MANDATORY: this tool builds creal/complex/cpoint, which overflow the default debug thread stack.

footprint-Int.order_exists

Kind
exhaustive-enumeration
Status
checked

Supports: axiom_footprint: [] -- the integer prelude admits no Axiom, Opaque or Quotient declaration, which bounds Int.order_exists.

Checker command
cargo run -q --release -p axeyum-lean-kernel --example nat_axiom_inventory -- --require-axiom-free integer
Evidence notes

--require-axiom-free exits non-zero when the named prelude's trusted surface (Axiom + Opaque + Quotient) is not empty, and errors rather than silently passing for a prelude the run never built. A declaration cannot depend on a trusted declaration the environment does not contain, so an empty integer surface bounds every declaration in it. The per-declaration figure is the footprint column of kernel_declaration_projection, measured 0 for this row.

concrete-Int.order_exists

Kind
instance-pin
Status
checked

Supports: The definitions this statement is about compute the intended values at concrete small arguments, and the discriminating negative cases FAIL: ord_8(3) = 2 (not phi(8) = 4), ord_7(3) = 6, and 3 is refutably NOT a primitive root mod 8.

Checker command
cargo test --release -p axeyum-lean-kernel --lib int_prelude::mult_order_tests -- --test-threads=4
Evidence notes

The trusted gate cannot tell you a Definition is wrong -- it type-checks either way -- so Int.IsOrder and Int.IsPrimitiveRoot are pinned by reduction at concrete small arguments. Each battery asserts BOTH what must hold and what must fail, so no run can be vacuous: three_mod_eight_is_killed_by_exactly_the_even_exponents requires hits at m in {0,2,4} and misses at {1,3,5} (the misses are the negative control for Int.pow_modeq_one_of_dvd); is_order_unfolds_to_the_intended_conjunction requires the definition to be def_eq to the intended conjunction and NOT def_eq to the variant with the positivity comparison transposed; three_has_multiplicative_order_two_mod_eight builds a witness for IsOrder 8 3 2 and a REFUTATION of IsOrder 8 3 4, which only the minimality conjunct separates. Confirm a NONZERO test count (6).

Provenance

{
  "date": "2026-09-04",
  "curation": "curated",
  "established_by": "axeyum-lean-kernel build_int_prelude (crates/axeyum-lean-kernel/src/int_prelude/mult_order.rs)",
  "source": "formal.statement is Kernel::render_lean of the declared type, taken verbatim from the unfiltered emit of `cargo run -q --release -p axeyum-lean-kernel --example kernel_declaration_projection`; axiom_footprint is that same row's footprint column, measured 0. The prose statement and the \"what this does NOT claim\" clause are hand-written by the `primitive-roots` lane and are NOT generator output. Design record: ADR-1598.",
  "prior_art": "Classical; the multiplicative order of a unit modulo n is Gauss, Disquisitiones Arithmeticae (1801), art. 45-56. The statement here is the constructive existence form over this kernel's own `Int.ModEq` relation and `Nat.totient`, not a transcription of any particular modern formalization."
}