Skip to main content

symlib — Global Structure in Highly Symmetric Systems

v2.0.0 · March 2026

Finding global structure in combinatorial problems via the short exact sequence 0 → H → G → G/H → 0.


The core idea

Every highly symmetric combinatorial problem has a group G with a normal subgroup H. The quotient G/H is the fiber — a single modulus m that governs solvability, construction strategy, and solution space size. The library extracts 8 algebraic weights from this structure and uses them to:

  • Prove impossibility in O(1) — before any search, before any construction attempt
  • Construct solutions algebraically — not by search, wherever the algebra supports it
  • Measure the solution space exactly — |M_k(G_m)| = φ(m) × coprime_b(m)^(k−1), exact for m=3
  • Auto-detect the best decomposition for any arbitrary finite group

Quick start

from symlib.engine import DecisionEngine
from symlib.domain import Problem

engine = DecisionEngine()

# Classify and construct
result = engine.run(Problem.from_cycles(m=5, k=3))
print(result.one_line())
# (5,3) PROVED POSSIBLE   W4=φ=4  W6=0.1328  0.1ms

# Auto-detect: no prior knowledge of group structure needed
from symlib.autodetect import detect
r = detect("symmetric", n=3, k=3)
print(r.is_impossible)   # True — S_3 k=3 is H²-blocked
r = detect("dihedral",  n=5, k=2)
print(r.is_constructible)  # True

Standalone theorem utilities

from symlib.theorems import ParityObstruction, CoprimeCoverage, QuotientCounter

# O(1) impossibility — applies to any symmetric system
ParityObstruction.check(m=8, k=3).blocked    # True — 3 odd tasks can't fill 8 slots

# Step-and-wrap coverage (hash tables, buffers, schedulers)
CoprimeCoverage.check(step=4, space=12).covers_all   # False — gcd(4,12)=4

# Count distinct states in symmetric system
QuotientCounter.distinct_states(12)   # 4 = φ(12)

Benchmark

Solver Correct Proves ⊘ Avg ms Timeouts
symlib v2.0 8/8 5 <1 0
Pure SA 3/8 0 6,900 5
Brute random 0/8 0 — 8

Impossible cases proved in <0.03ms. Random search times out on all of them.

Repository layout

symlib/
  kernel/          Frozen mathematical kernel — theorems, no randomness
    weights.py     The 8 weights: W1-W8, all exact or O(1)
    obstruction.py H² and H³ obstruction checkers
    construction.py Algebraic construction: precomputed → formula → search
    verify.py      Hamiltonian cycle verifier, O(m³)
    torsor.py      Moduli theorem, H¹ classes, solution space geometry
    group_algebra.py Finite group representation, subgroup detection
    ses_analyzer.py SES candidate scoring and ranking
  autodetect.py    Auto-detect best SES for any group
  domain.py        Problem representation and registry
  engine.py        Decision engine: classify → construct → prove
  theorems.py      Standalone theorem utilities
  search/
    equivariant.py Group-equivariant SA with orbit moves
  proof/
    builder.py     Formal proof objects, versioned
    lean4.py       Lean 4 export (machine-verifiable)
tests/
  test_kernel.py   64 kernel tests
  test_autodetect.py  77 auto-detection tests
docs/
  DOCUMENTATION.md Full API reference (1,600+ lines)
showcase.py        85-check live implementation study

Tests

python -m pytest tests/           # 141 tests
python showcase.py                # 85 live checks with real data

Open problems

Problem Status Best known
P1: k=4, m=4 OPEN Score 337→230
P2: m=6, k=3 OPEN Score 9 (depth-3 barrier confirmed)
P3: m=8, k=3 OPEN Not yet attempted at scale
Closure Lemma (general m) PARTIAL Proved for m=3

Cross-domain applications

The framework governs: Cayley digraphs, Latin squares, Hamming codes, magic squares, difference sets, non-abelian groups (S_3), product groups (ℤ_m×ℤ_n), hash functions, circular buffers, symmetric schedulers, and configuration spaces.

See docs/DOCUMENTATION.md for full API reference.

Metadata

Release files for symlib-core 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for symlib-core 2.0.0
File Size Uploaded Provenance Actions
symlib_core-2.0.0.tar.gz 53.6 kB Without provenance Details for symlib_core-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for symlib-core 2.0.0
File Interpreter ABI Platform Actions
symlib_core-2.0.0-py3-none-any.whl Python 3 none any Details for symlib_core-2.0.0-py3-none-any.whl

Total release size: 107.8 kB

Release files / symlib_core-2.0.0.tar.gz

Download URL symlib_core-2.0.0.tar.gz
Size 53.6 kB
Tags Source
SHA-256 checksum
How to use checksums
28b81aa74405752ba1d2629e0f1334950c479ca9ae038f8e413a62798742e875
BLAKE2b-256 checksum
How to use checksums
cf7bb8d997349ea4d5c886a67806946dc79cd6fa292c758a8df1734c679a7288
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / symlib_core-2.0.0-py3-none-any.whl

Download URL symlib_core-2.0.0-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd9d5bf811ba2f04fb41aac1828059d9d89da046889ed3501476ec74606b4df2
BLAKE2b-256 checksum
How to use checksums
83b7894c9a51be90a24506e7a1b37c73a0b2202b1995f199ba1c4ad99c36cbfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for symlib-core 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page