Skip to content

Commit 1a77dce

Browse files
committed
feat(number-theory): add bounded finite abelian factorizations
Rebuild the finite-abelian-group port as one domain-owned commit on the corrected declaration-runtime base. Keep exhaustive native semantics, one thin operation binding, a lazy dedicated checker runtime, independent stdlib replay, and focused positive and negative factorization coverage.
1 parent 7a5c0f4 commit 1a77dce

7 files changed

Lines changed: 772 additions & 2 deletions

File tree

src/jacobian/domains/number_theory/bundle.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from jacobian.domains.number_theory.checkers import NUMBER_THEORY_EXACT_REPLAY_CHECKERS
1010
from jacobian.domains.number_theory.derived import DERIVED_NUMBER_THEORY_CAPABILITIES
1111
from jacobian.domains.number_theory.divisibility import DIVISIBILITY_CAPABILITIES
12+
from jacobian.domains.number_theory.finite_abelian_groups import (
13+
FINITE_ABELIAN_GROUP_FACTORIZATION_CAPABILITY,
14+
)
1215
from jacobian.domains.number_theory.modular import MODULAR_CAPABILITIES
1316
from jacobian.domains.number_theory.primes import PRIME_CAPABILITIES
1417
from jacobian.operations import (
@@ -25,11 +28,12 @@ def build_number_theory_bundle() -> DomainBundle:
2528
schema_namespace="jacobian.number-theory",
2629
semantics=DomainSemantics(
2730
name="jacobian.exact-integer-number-theory",
28-
version="1",
31+
version="2",
2932
definition={
3033
"description": (
3134
"Exact integer divisibility, primes, arithmetic functions, "
32-
"and modular arithmetic over bounded inputs"
35+
"modular arithmetic, and bounded finite abelian group "
36+
"factorization"
3337
),
3438
"integer_encoding": "canonical decimal string",
3539
},
@@ -44,6 +48,7 @@ def build_number_theory_bundle() -> DomainBundle:
4448
*PRIME_CAPABILITIES,
4549
*MODULAR_CAPABILITIES,
4650
*DERIVED_NUMBER_THEORY_CAPABILITIES,
51+
FINITE_ABELIAN_GROUP_FACTORIZATION_CAPABILITY,
4752
),
4853
diagnostics=DomainDiagnostics(
4954
invalid_request=CapabilityDiagnostic(

src/jacobian/domains/number_theory/checkers.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,65 @@
11
"""Independent checker declarations owned by the number-theory domain."""
22

33
from jacobian.checker_operations import ExactReplayCheckerDeclaration
4+
from jacobian.contracts.capabilities import CapabilityInstallTier
45
from jacobian.contracts.number_theory import (
56
FactorizationRequest,
67
ModularPolynomialResidueImageRequest,
78
PowerfulNumberRequest,
89
)
10+
from jacobian.math.finite_abelian_groups import (
11+
FiniteAbelianGroupFactorizationRequest,
12+
)
13+
from jacobian.provider_runtime import source_provider_runtime
914

1015
_EXACT_DOMAIN_ENTRYPOINT = "jacobian_checkers.exact_domain_operations"
1116

17+
18+
def _finite_abelian_group_checker_runtime():
19+
"""Measure the exhaustive group checker only when installation requests it."""
20+
21+
return source_provider_runtime(
22+
"jacobian.finite-abelian-group-checker",
23+
version="1",
24+
entrypoint=(
25+
"jacobian_checkers.finite_abelian_groups:"
26+
"check_finite_abelian_group_exact_factorization"
27+
),
28+
install_tier=CapabilityInstallTier.T1,
29+
license_id="MIT",
30+
features=("exhaustive-finite-group-replay", "clean-process-checker"),
31+
)
32+
33+
1234
NUMBER_THEORY_EXACT_REPLAY_CHECKERS = (
35+
ExactReplayCheckerDeclaration(
36+
"finite_abelian_group.exact_factorization.compute",
37+
FiniteAbelianGroupFactorizationRequest,
38+
"check_finite_abelian_group_exact_factorization",
39+
"finite-abelian-group.exact-factorization.stdlib-replay",
40+
entrypoint_module="jacobian_checkers.finite_abelian_groups",
41+
replay_method="standard-library exhaustive finite-group replay",
42+
reason=(
43+
"operator-authorized standard-library checker independently "
44+
"normalizes both factors and replays every group sum"
45+
),
46+
provider_runtime_factory=_finite_abelian_group_checker_runtime,
47+
verification_capability_id="finite_abelian_group.exact_factorization.verify",
48+
verification_title="Verify a finite abelian group factorization",
49+
verification_description=(
50+
"Independently normalize both bounded factors, enumerate every sum "
51+
"in the declared product of cyclic groups, and verify the complete "
52+
"representation histogram, decision, and first failure witnesses."
53+
),
54+
verification_tags=(
55+
"verification",
56+
"exact",
57+
"number-theory",
58+
"finite-abelian-group",
59+
"factorization",
60+
"unique-representation",
61+
),
62+
),
1363
ExactReplayCheckerDeclaration(
1464
"integer.compute.prime_factorization",
1565
FactorizationRequest,
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
"""Thin operation binding for finite abelian group factorization."""
2+
3+
from __future__ import annotations
4+
5+
from jacobian.contracts.capabilities import CapabilityDiagnostic
6+
from jacobian.domains._examples import example
7+
from jacobian.math.finite_abelian_groups import (
8+
FiniteAbelianGroupFactorizationRequest,
9+
FiniteAbelianGroupFactorizationResult,
10+
finite_abelian_group_factorization,
11+
)
12+
from jacobian.operation_bindings import inline_operation
13+
from jacobian.operations import OperationSpec
14+
15+
FINITE_ABELIAN_GROUP_FACTORIZATION_CAPABILITY = inline_operation(
16+
OperationSpec(
17+
operation_id="finite_abelian_group.exact_factorization.compute",
18+
version="1",
19+
title="Exact finite abelian group factorization",
20+
description=(
21+
"Normalize two bounded integer-vector factors in a declared product "
22+
"of cyclic groups, exhaustively count every sum representation, and "
23+
"decide whether every group element has exactly one representation."
24+
),
25+
request_type=FiniteAbelianGroupFactorizationRequest,
26+
result_type=FiniteAbelianGroupFactorizationResult,
27+
execute=finite_abelian_group_factorization,
28+
tags=(
29+
"number-theory",
30+
"finite-abelian-group",
31+
"cyclic-product",
32+
"factorization",
33+
"unique-representation",
34+
"coset-transversal",
35+
"exact",
36+
),
37+
invalid_request=CapabilityDiagnostic(
38+
code="INVALID_FINITE_ABELIAN_FACTORIZATION_REQUEST",
39+
stage="finite_abelian_group_input_validation",
40+
message=(
41+
"Input does not satisfy the bounded product-of-cyclic-groups "
42+
"factorization contract."
43+
),
44+
hint=(
45+
"Supply rank at most 6, group order and factor product at most "
46+
"4,096, and distinct bounded factor elements after normalization."
47+
),
48+
),
49+
invocation_examples=(
50+
example(
51+
"z2_times_z4_transversal",
52+
"Verify eight representatives form a complete transversal.",
53+
{
54+
"moduli": [2, 4],
55+
"left": [
56+
[0, 0],
57+
[0, 1],
58+
[0, 2],
59+
[0, 3],
60+
[1, 0],
61+
[1, 1],
62+
[1, 2],
63+
[1, 3],
64+
],
65+
"right": [[0, 0]],
66+
},
67+
),
68+
),
69+
)
70+
)
71+
72+
__all__ = ["FINITE_ABELIAN_GROUP_FACTORIZATION_CAPABILITY"]

src/jacobian/math/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from jacobian.math import (
44
arithmetic,
5+
finite_abelian_groups,
56
finite_fields,
67
graphs,
78
matrices,
@@ -11,6 +12,7 @@
1112

1213
__all__ = [
1314
"arithmetic",
15+
"finite_abelian_groups",
1416
"finite_fields",
1517
"graphs",
1618
"matrices",

0 commit comments

Comments
 (0)