Elamur Groupants⌕
☰

math-nt-factor

The groupant beside math/src/nt.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

Facts

Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

Components

componentlabelwhere
approximantpartialapproximant
astpartial../syntax.json
descriptantpresentdescriptant
invariantpartialinvariant
testsexecuted bounded checkstests

Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
primality_classesprimality_classespartial source derived modelprimality_classes
pocklington_conditionpocklington_conditionpartial source derived modelpocklington_condition
budget_effectbudget_effectpartial source derived modelbudget_effect
factor_certificatefactor_certificatepartial source derived modelfactor_certificate

Model text

descriptant

math-nt-factor

Fixed-base MR, recursive Pocklington and Pollard split magnitudes. Probable factors count complete. Sorted factors preserve product under producer domain, except zero's empty convention. Budget/deadline checks do not bound all work. No randomized-error claim follows from fixed bases.

Epoch 2026-10-31: complete source read, parent AST reused; partial finite evidence only.

approximant

Scoped forward and cost

Fixed-base MR, recursive Pocklington and Pollard split magnitudes. Probable factors count complete. Sorted factors preserve product under producer domain, except zero's empty convention. Budget/deadline checks do not bound all work. No randomized-error claim follows from fixed bases.

No executable percent surrogate claimed.

invariant

Scoped invariant

Fixed-base MR, recursive Pocklington and Pollard split magnitudes. Probable factors count complete. Sorted factors preserve product under producer domain, except zero's empty convention. Budget/deadline checks do not bound all work. No randomized-error claim follows from fixed bases.

Source range[5396,17881) bound by manifest digest. Parent domain applies, not arbitrary public states.

models

Source-scoped typed relations

behavior_complement

A composite unresolved by Pollard excludes complete=true, but Probable factor does not. Negative n excludes negative factor entries because magnitude is factored.

reverse_reconstruction

Nonempty factors reconstruct |n| as product p^e, losing sign. Empty producer factors admit n=0,1,-1. Sorted merged factors lose split/trial traversal history and time/budget usage.

primality_classes

u64 uses12 fixed prime bases. Larger inputs try small primes,30 fixed bases, depth-limited Pocklington, then Probable. Fixed bases do not justify a randomized4^-30 error statement.

pocklington_condition

Accumulate only proven prime factors of n-1 into F; require F²>n and for each q a<200 with a^(n-1)=1 and gcd(a^((n-1)/q)-1,n)=1. Failure to find witnesses returns no certificate.

budget_effect

Pollard decrements budget in blocks; trial/primality, initial doubling and recovery omit the check. u64 ignores deadline; big checks deadline only within blocks. A budget is not total arithmetic work.

factor_certificate

check_factor multiplies powers and requires complete plus prime-like factors; zero with empty list is specially accepted. It repeats probable acceptance and cannot convert that status to proven prime.

tests

Evidence

See ../tests.md for actual checks and source mutant; this fragment adds no runtime test.

Fixed-base MR, recursive Pocklington and Pollard split magnitudes. Probable factors count complete. Sorted factors preserve product under producer domain, except zero's empty convention. Budget/deadline checks do not bound all work. No randomized-error claim follows from fixed bases.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/math/src/nt.rs.groupant/factor.groupant/