Skip to content

combin · CoreReduction

8 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 finite Poset and its order complex with replayable evidence uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Reduce a finite Poset and its order complex with replayable evidence."""

from noether import Z
from noether.combin import Poset


def main() -> None:
    chain = Poset(4, [(0, 1), (1, 2), (2, 3)])
    core = chain.core()
    core.verify(chain)
    assert core.core.order == 1

    order_complex = chain.order_complex()
    morse = order_complex.morse_reduction(Z)
    morse.verify()
    assert sum(morse.critical_cells) == 1
    assert morse.reduced.homology_invariants(0).free_rank == 1
    print(
        f"Poset order {chain.order} -> core order {core.core.order}; "
        f"Morse cells {morse.original_cells} -> {morse.critical_cells}"
    )


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/32_poset_core_and_morse.py.

combin.CoreReduction

Replayable beat-point reduction to a canonical core.

class CoreReduction

noether::combin::CoreReduction · Direct Rust declaration

pub struct CoreReduction { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/combinatorics/test_poset.py:102 · validation/unit/combinatorics/test_poset.py:9 · validation/unit/infra/test_discovery.py:153

combin.CoreReduction.canonical_labeling

Final permutation from reduced ids to canonical-core ids.

Detailed contract

Final permutation from reduced-poset ids to canonical-core ids.

(self) -> Permutation

noether::combin::CoreReduction::canonical_labeling · Direct Rust declaration

pub fn canonical_labeling(&self) -> &Permutation
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/combinatorics/test_poset.py:106

combin.CoreReduction.core

Canonical representative of the terminal core.

Detailed contract

The canonical representative of the terminal core.

(self) -> Poset

noether::combin::CoreReduction::core · Direct Rust declaration

pub fn core(&self) -> &Poset
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: examples/32_poset_core_and_morse.py:11 · examples/32_poset_core_and_morse.py:12 · examples/32_poset_core_and_morse.py:13 · examples/32_poset_core_and_morse.py:21 · validation/unit/combinatorics/test_poset.py:101 · validation/unit/combinatorics/test_poset.py:104

combin.CoreReduction.deletions

Beat-point deletions in replay order and original ids.

Detailed contract

Beat-point deletions, in replay order and in original vertex ids.

(self) -> list[BeatPoint]

noether::combin::CoreReduction::deletions · Direct Rust declaration

pub fn deletions(&self) -> &[BeatPoint]
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

combin.CoreReduction.graded_homology_invariants

Compute lean integral homology from the canonical core.

Detailed contract

Compute lean integral homology from the canonical core. Beat-point deletion preserves the homotopy type of the order complex, so these groups are also the integral homology of the source poset. The returned vector is indexed by homological degree.

(self) -> list[FinitelyGeneratedAbelianGroup]

noether::combin::CoreReduction::graded_homology_invariants · Direct Rust declaration

pub fn graded_homology_invariants( &self, ) -> Result<Vec<FinitelyGeneratedAbelianGroup>, PosetError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL released

Executable usage: validation/unit/combinatorics/test_poset.py:107 · validation/unit/combinatorics/test_poset.py:108 · validation/unit/homalg/test_chain_complex.py:162 · validation/unit/homalg/test_chain_complex.py:179 · validation/unit/homalg/test_padic_homology_facade.py:106 · validation/unit/homalg/test_padic_homology_facade.py:202

combin.CoreReduction.reduced

Terminal core before its final canonical relabeling.

Detailed contract

The terminal core before its final canonical relabeling.

(self) -> Poset

noether::combin::CoreReduction::reduced · Direct Rust declaration

pub fn reduced(&self) -> &Poset
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: examples/16_rational_functions.py:14 · examples/16_rational_functions.py:15 · examples/16_rational_functions.py:16 · examples/16_rational_functions.py:17 · examples/32_poset_core_and_morse.py:19 · examples/distributed/f2_linear_algebra.py:50

combin.CoreReduction.retained_vertices

Map from reduced ids to retained original ids.

Detailed contract

Map from reduced-poset ids to retained original vertex ids.

(self) -> list[VertexId]

noether::combin::CoreReduction::retained_vertices · Direct Rust declaration

pub fn retained_vertices(&self) -> &[VertexId] ⓘ
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

combin.CoreReduction.verify

Replay and verify the reduction against its source poset.

Detailed contract

Replay every deletion and verify the stored reduced and canonical cores.

(self, original: Poset) -> bool

noether::combin::CoreReduction::verify · Direct Rust declaration

pub fn verify(&self, original: &Poset) -> bool
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

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