Skip to content

homalg · LocalModuleReduction

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

Worked example

The complete checked program Reduce a module element and certify a minimal free resolution uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Reduce a module element and certify a minimal free resolution."""

from noether import Q
from noether.commalg import Degree, MonomialOrder, PolynomialRing
from noether.homalg import (
    FreeModule,
    ModuleElement,
    ModuleHomomorphism,
    ModuleMonomialOrder,
    PresentedModule,
    Submodule,
)
from noether.linalg import Matrix, Vector


def main() -> None:
    ring = PolynomialRing(Q, ["x", "y", "z", "w"])
    x, y, z, w = ring.generators()
    order = ModuleMonomialOrder.term_over_position(MonomialOrder.GREVLEX)

    ambient = FreeModule(ring, 2)
    first = ModuleElement(ambient, Vector.from_values(ring, [x, y]))
    second = ModuleElement(ambient, Vector.from_values(ring, [y, 1]))
    submodule = Submodule.from_generators(ambient, [first, second])
    basis = submodule.groebner_basis(order)
    reduction = basis.reduce(first + second * x)
    basis.verify()
    reduction.verify()
    assert reduction.is_member()

    target = FreeModule(ring, 1, grading_rank=1, degree_shifts=[Degree([0])])
    source = FreeModule(ring, 3, grading_rank=1, degree_shifts=[Degree([-2])] * 3)
    twisted_cubic = PresentedModule(
        ModuleHomomorphism(
            source,
            target,
            Matrix.from_rows(ring, [[x * z - y**2, x * w - y * z, y * w - z**2]]),
        )
    )
    resolution = twisted_cubic.minimal_free_resolution(order)
    resolution.verify()
    betti = resolution.graded_betti_table()
    betti.verify()
    assert betti.entries == [
        (0, Degree([0]), 1),
        (1, Degree([2]), 3),
        (2, Degree([3]), 2),
    ]
    print(f"module member certified; minimal Betti entries={betti.entries}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/30_modules_and_resolutions.py.

homalg.LocalModuleReduction

Replayable weak-normal-form evidence for one local module reduction.

class LocalModuleReduction

noether::homalg::LocalModuleReduction · Direct Rust declaration

pub struct LocalModuleReduction<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/LocalModuleReduction@1

Executable usage: validation/unit/homalg/test_local_module.py:40 · validation/unit/homalg/test_local_module.py:8

homalg.LocalModuleReduction.from_json

Deserialize and revalidate a LocalModuleReduction from typed JSON.

Detailed contract

Deserialize and exactly replay weak-normal-form evidence.

(cls, value: str) -> LocalModuleReduction[_LocalModuleField]

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

pub fn from_json(value: &str) -> Result<Self, NoetherError>where R: for<'de> Deserialize<'de>, R::Element: for<'de> Deserialize<'de>,
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/LocalModuleReduction@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.LocalModuleReduction.is_member

Test whether this LocalModuleReduction is member.

Detailed contract

Whether the retained remainder is zero.

(self) -> bool

noether::homalg::LocalModuleReduction::is_member · Direct Rust declaration

pub fn is_member(&self) -> bool
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/LocalModuleReduction@1

Executable usage: examples/30_modules_and_resolutions.py:31 · validation/unit/commalg/test_local_algebra.py:58 · validation/unit/commalg/test_polynomial_ideal_facade.py:274 · validation/unit/commalg/test_polynomial_ideal_facade.py:305 · validation/unit/commalg/test_prime_localization.py:45 · validation/unit/commalg/test_prime_localization.py:51

homalg.LocalModuleReduction.multiplier

Return the multiplier recorded by this LocalModuleReduction.

Detailed contract

Unit multiplier in the weak-normal-form identity.

(self) -> LocalPolynomial[_LocalModuleField]

noether::homalg::LocalModuleReduction::multiplier · Direct Rust declaration

pub fn multiplier(&self) -> Result<LocalPolynomial<R>, LocalModuleError>
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/LocalModuleReduction@1

Executable usage: validation/unit/commalg/test_local_algebra.py:59 · validation/unit/commalg/test_polynomial_ideal_facade.py:328 · validation/unit/commalg/test_prime_localization.py:46 · validation/unit/commalg/test_prime_localization.py:47 · validation/unit/commalg/test_prime_localization.py:52 · validation/unit/homalg/test_local_module.py:34

homalg.LocalModuleReduction.quotients

Return the quotients recorded by this LocalModuleReduction.

Detailed contract

Coefficients of the ordered standard-basis vectors.

(self) -> list[LocalPolynomial[_LocalModuleField]]

noether::homalg::LocalModuleReduction::quotients · Direct Rust declaration

pub fn quotients(&self) -> Result<Vec<LocalPolynomial<R>>, LocalModuleError>
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/LocalModuleReduction@1

Executable usage: validation/unit/commalg/test_local_algebra.py:60 · validation/unit/commalg/test_prime_localization.py:48 · validation/unit/commalg/test_prime_localization.py:53 · validation/unit/commalg/test_quotient_facade.py:3 · validation/unit/homalg/test_local_module.py:36

homalg.LocalModuleReduction.remainder

Return the remainder recorded by this LocalModuleReduction.

Detailed contract

Weak normal-form remainder.

(self) -> list[LocalPolynomial[_LocalModuleField]]

noether::homalg::LocalModuleReduction::remainder · Direct Rust declaration

pub fn remainder( &self, ) -> Result<ModuleElement<LocalPolynomialRing<R>>, LocalModuleError>
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/LocalModuleReduction@1

Executable usage: examples/13_chinese_remainder_theorem.py:3 · validation/unit/commalg/test_polynomial_facade.py:463 · validation/unit/commalg/test_polynomial_facade.py:484 · validation/unit/commalg/test_polynomial_facade.py:501 · validation/unit/commalg/test_polynomial_ideal_facade.py:275 · validation/unit/homalg/test_local_module.py:35

homalg.LocalModuleReduction.standard_basis

Return the standard basis recorded by this LocalModuleReduction.

Detailed contract

Standard basis used by the reduction.

(self) -> LocalModuleStandardBasis[_LocalModuleField]

noether::homalg::LocalModuleReduction::standard_basis · Direct Rust declaration

pub fn standard_basis(&self) -> &LocalModuleStandardBasis<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/LocalModuleReduction@1

Executable usage: validation/unit/commalg/test_local_algebra.py:55 · validation/unit/commalg/test_local_algebra.py:79

homalg.LocalModuleReduction.to_json

Serialize this LocalModuleReduction to its canonical typed JSON representation.

Detailed contract

Serialize exact weak-normal-form evidence.

(self) -> str

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

pub fn to_json(&self) -> Result<String, NoetherError>where R: Serialize, R::Element: Serialize,
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/LocalModuleReduction@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.LocalModuleReduction.value

Return the value recorded by this LocalModuleReduction.

Detailed contract

Ambient local module element that was reduced.

(self) -> list[LocalPolynomial[_LocalModuleField]]

noether::homalg::LocalModuleReduction::value · Direct Rust declaration

pub fn value(&self) -> &ModuleElement<LocalPolynomialRing<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/LocalModuleReduction@1

Executable usage: examples/09_finite_field_isomorphisms.py:13 · examples/09_finite_field_isomorphisms.py:14 · examples/13_chinese_remainder_theorem.py:12 · examples/13_chinese_remainder_theorem.py:13 · examples/13_chinese_remainder_theorem.py:14 · examples/17_weighted_power_series.py:18

homalg.LocalModuleReduction.verify

Replay and verify the mathematical evidence carried by this LocalModuleReduction.

Detailed contract

Replay the exact identity and deterministic Mora reduction.

(self) -> None

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

pub fn verify(&self) -> Result<(), LocalModuleError>
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/LocalModuleReduction@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