Skip to content

homalg · ModulePrimaryComponent

10 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.

Worked example

The complete checked program Project and reconstruct a residue class by the Chinese remainder theorem uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Project and reconstruct a residue class by the Chinese remainder theorem."""

from noether.commalg import ResidueRing


def main() -> None:
    ring = ResidueRing(360)
    decomposition = ring.crt()
    decomposition.verify()
    value = ring(347)
    components = decomposition.project(value)
    assert decomposition.reconstruct(components) == value
    print(f"347 mod 360 -> {[int(component) for component in components]}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/13_chinese_remainder_theorem.py.

homalg.ModulePrimaryComponent

One verified primary submodule of a retained presented module.

class ModulePrimaryComponent

noether::homalg::ModulePrimaryComponent · Direct Rust declaration

pub struct ModulePrimaryComponent<R: Field> { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/unit/homalg/test_module_facade.py:165 · validation/unit/homalg/test_module_facade.py:179 · validation/unit/homalg/test_module_facade.py:34

homalg.ModulePrimaryComponent.associated_prime

Return the associated prime recorded by this ModulePrimaryComponent.

Detailed contract

The unique associated prime of the quotient, proving primaryness.

(self) -> PolynomialPrimeCertificate[_AssociatedPrimeField]

noether::homalg::ModulePrimaryComponent::associated_prime · Direct Rust declaration

pub fn associated_prime(&self) -> &PolynomialPrimeCertificate<R>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/unit/commalg/test_polynomial_ideal_facade.py:1090 · validation/unit/commalg/test_polynomial_ideal_facade.py:1292 · validation/unit/commalg/test_polynomial_ideal_facade.py:733 · validation/unit/commalg/test_polynomial_ideal_facade.py:859 · validation/unit/commalg/test_polynomial_ideal_facade.py:903 · validation/unit/commalg/test_polynomial_ideal_facade.py:907

homalg.ModulePrimaryComponent.from_json

Deserialize and revalidate a ModulePrimaryComponent from typed JSON.

Detailed contract

Deserialize and exactly reverify a primary-submodule certificate.

(cls, value: str) -> ModulePrimaryComponent[RationalField | FiniteField]

noether::homalg::ModulePrimaryComponent::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, NoetherError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106 · validation/unit/combin/test_graph_facade.py:25 · validation/unit/combinatorics/test_kashiwara_crystal.py:32

homalg.ModulePrimaryComponent.inclusion

Return the inclusion recorded by this ModulePrimaryComponent.

Detailed contract

Exact inclusion of the primary submodule C/N into the source module.

(self) -> PresentedModuleHomomorphism[PolynomialRing[_AssociatedPrimeField]]

noether::homalg::ModulePrimaryComponent::inclusion · Direct Rust declaration

pub fn inclusion(&self) -> &PresentedModuleHomomorphism<PolynomialRing<R>>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/unit/homalg/test_module_facade.py:171

homalg.ModulePrimaryComponent.preimage

Return the preimage recorded by this ModulePrimaryComponent.

Detailed contract

Preimage C in the retained generator free module F of M = F/N.

(self) -> Submodule[PolynomialRing[_AssociatedPrimeField]]

noether::homalg::ModulePrimaryComponent::preimage · Direct Rust declaration

pub fn preimage(&self) -> &Submodule<PolynomialRing<R>>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/bench/macaulay2_affine_normalization.py:8 · validation/bench/macaulay2_derived.py:482

homalg.ModulePrimaryComponent.quotient_associated_primes

Return the quotient associated primes recorded by this ModulePrimaryComponent.

Detailed contract

Complete singleton associated-prime evidence for the quotient F/C.

(self) -> ModuleAssociatedPrimeSet[_AssociatedPrimeField]

noether::homalg::ModulePrimaryComponent::quotient_associated_primes · Direct Rust declaration

pub fn quotient_associated_primes(&self) -> &ModuleAssociatedPrimeSet<R>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/unit/homalg/test_module_facade.py:173 · validation/unit/homalg/test_module_facade.py:175 · validation/unit/homalg/test_module_facade.py:177

homalg.ModulePrimaryComponent.quotient_projection

Return the quotient projection recorded by this ModulePrimaryComponent.

Detailed contract

Exact quotient projection M -> M/(C/N) = F/C.

(self) -> PresentedModuleHomomorphism[PolynomialRing[_AssociatedPrimeField]]

noether::homalg::ModulePrimaryComponent::quotient_projection · Direct Rust declaration

pub fn quotient_projection( &self, ) -> &PresentedModuleHomomorphism<PolynomialRing<R>>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/unit/homalg/test_module_facade.py:172 · validation/unit/homalg/test_module_facade.py:173 · validation/unit/homalg/test_module_facade.py:389 · validation/unit/homalg/test_module_facade.py:392

homalg.ModulePrimaryComponent.theorem

Return the theorem recorded by this ModulePrimaryComponent.

Detailed contract

Exact definition of primaryness used by this certificate.

(self) -> str

noether::homalg::ModulePrimaryComponent::theorem · Direct Rust declaration

pub const fn theorem(&self) -> &'static str
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: examples/13_chinese_remainder_theorem.py:3 · validation/unit/commalg/test_polynomial_ideal_facade.py:1150 · validation/unit/commalg/test_polynomial_ideal_facade.py:507 · validation/unit/commalg/test_polynomial_ideal_facade.py:583 · validation/unit/commalg/test_polynomial_ideal_facade.py:659 · validation/unit/homalg/test_module_facade.py:509

homalg.ModulePrimaryComponent.to_json

Serialize this ModulePrimaryComponent to its canonical typed JSON representation.

Detailed contract

Serialize the complete exact evidence as typed JSON.

(self) -> str

noether::homalg::ModulePrimaryComponent::to_json · Direct Rust declaration

pub fn to_json(&self) -> Result<String, NoetherError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/category/test_category.py:15 · validation/unit/combin/test_acceptance_workload.py:30 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106

homalg.ModulePrimaryComponent.verify

Replay and verify the mathematical evidence carried by this ModulePrimaryComponent.

Detailed contract

Independently replay the primary-submodule evidence.

(self) -> None

noether::homalg::ModulePrimaryComponent::verify · Direct Rust declaration

pub fn verify(&self) -> Result<(), ModulePrimaryDecompositionError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ModulePrimaryComponent@1

Executable usage: examples/01_bezout_certificates.py:10 · examples/01_bezout_certificates.py:3 · examples/03_exact_linear_systems.py:13 · examples/03_exact_linear_systems.py:3 · examples/04_smith_normal_form.py:12 · examples/06_shortest_lattice_vectors.py:12