A residue accumulated from coprime moduli. value is the symmetric
representative of their common solution modulo modulus.
- modulus : Nat
Product of the moduli already folded into the state.
- value : Int
Symmetric representative of the accumulated residue.
The accumulated modulus is positive.
The representative lies in the symmetric interval.
Instances For
The empty scalar CRT accumulation, modulo one.
Equations
- Hex.Modular.Crt.init = { modulus := 1, value := 0, pos := Hex.Modular.Crt.init._proof_1, le := Hex.Modular.Crt.init._proof_2 }
Instances For
Fold the residue r modulo m into a scalar CRT accumulation using one
Garner mixed-radix step. Moduli zero and one and moduli not coprime to the
accumulated modulus are rejected.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The compiled CRT step agrees with its kernel-reducible reference.
Several accumulated residues sharing one positive product modulus.
- modulus : Nat
Product of the moduli already folded into the state.
Symmetric representatives of the accumulated residues.
The accumulated modulus is positive.
Every representative lies in the symmetric interval.
Instances For
The empty vector CRT accumulation, modulo one.
Equations
- Hex.Modular.CrtVec.init k = { modulus := 1, value := Vector.replicate k 0, pos := Hex.Modular.Crt.init._proof_1, le := ⋯ }
Instances For
Fold k residues sharing modulus m into a vector CRT accumulation. The
extended GCD and modular inverse are computed once and reused for every
coordinate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
GMP-backed compiled implementation of CrtVec.push.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The compiled vector CRT step agrees with its kernel-reducible reference.
Congruence with both the old state and the new image gives congruence modulo the entire accumulated product after a successful push.
A strictly half-bounded integer congruent to a state's coordinate equals that coordinate; the stored coordinate only needs its non-strict bound.