Elamur GroupantsโŒ•
โ˜ฐ

math-nt-arithmetic

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
multiplicative_formulamultiplicative_formulapartial source derived modelmultiplicative_formula
divisor_materializationdivisor_materializationpartial source derived modeldivisor_materialization
prime_searchprime_searchpartial source derived modelprime_search
zero_digitszero_digitspartial source derived modelzero_digits
wave39-canonical_sign_fibercanonical_digit_sign_preimagepartial source derived model../model.md
wave39-positional_carry_kernelfixed_length_integer_kernelpartial source derived model../model.md
wave39-base_admission_partitiontyped_base_admission_partitionpartial source derived model../model.md
wave39-magnitude_normalizeridempotent_magnitude_retractionpartial source derived model../model.md

Model text

descriptant

math-nt-arithmetic

phi/tau/sigma/mobius require positive complete-factor inputs; divisors accepts signs, rejects zero and checks count before sorted materialization. Prime count/rank sieve is capped, next_prime unbounded. digits strips sign; from_digits accepts arbitrary Horner coefficients. Canonical restrictions are needed for inversion.

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

Wave39 reviews integer digit/Horner transport and its own typed model sections. Finite checks, dependent formula derivations and algebraic claims retain separate scopes; no production speed or universal source proof is inferred.

approximant

Scoped forward and cost

phi/tau/sigma/mobius require positive complete-factor inputs; divisors accepts signs, rejects zero and checks count before sorted materialization. Prime count/rank sieve is capped, next_prime unbounded. digits strips sign; from_digits accepts arbitrary Horner coefficients. Canonical restrictions are needed for inversion.

No executable percent surrogate claimed.

invariant

Scoped invariant

phi/tau/sigma/mobius require positive complete-factor inputs; divisors accepts signs, rejects zero and checks count before sorted materialization. Prime count/rank sieve is capped, next_prime unbounded. digits strips sign; from_digits accepts arbitrary Horner coefficients. Canonical restrictions are needed for inversion.

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

models

Source-scoped typed relations

behavior_complement

phi/tau/sigma/mobius reject nonpositive n; divisors first takes magnitude and rejects zero but accepts negative values. digits base<2 rejects, from_digits imposes no such gate.

reverse_reconstruction

digits(n,b) loses sign: n and -n share output. Canonical digits and known base recover abs(n); from_digits with arbitrary coefficients admits carrying transformations and leading zeros.

multiplicative_formula

Given complete factors, phi=product p^(e-1)(p-1), tau=product(e+1), sigma_k=product sum(j=0..e)p^(kj), mobius=0 if repeated factor else(-1)^count.

divisor_materialization

Count product(e+1) in u128 is checked against max before allocation, then products are enumerated and sorted. Count arithmetic itself is unchecked; complete probable factors remain accepted.

prime_pi caps n at2e8; nth_prime k in1..1e7 chooses analytic sieve bound and indexes k-1. next_prime/prev_prime step one integer at a time and accept prime-like values, with no iteration cap.

zero_digits

digits0=[0], including nondecimal base; from_digits([],b)=0 for any b. Decimal path converts magnitude text, others repeatedly divide and reverse remainders.

tests

Evidence

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

phi/tau/sigma/mobius require positive complete-factor inputs; divisors accepts signs, rejects zero and checks count before sorted materialization. Prime count/rank sieve is capped, next_prime unbounded. digits strips sign; from_digits accepts arbitrary Horner coefficients. Canonical restrictions are needed for inversion.

This page in Markdown โ†’ https://md.groupants.elamur.ai/free/en/mova/math/src/nt.rs.groupant/arithmetic.groupant/