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
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | ../syntax.json |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| tests | executed bounded checks | tests |
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.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
primality_classes | primality_classes | partial source derived model | primality_classes |
pocklington_condition | pocklington_condition | partial source derived model | pocklington_condition |
budget_effect | budget_effect | partial source derived model | budget_effect |
factor_certificate | factor_certificate | partial source derived model | factor_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/