Skip to content

About

Machine-Checked Formal Verification of GAP in Lean 4 / Mathlib (Release v0.2.0, 35 theorems, 0 sorry, arXiv:2609.38492)

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Formally Verified Lean 4 Port of GAP: Computational Discrete Algebra

Lean 4 arXiv arXiv DOI Lean 4 CI Zulip Chat Mathlib 4 Release Phase 1 & 2 Phase 3 Status DOI Concept DOI Verification gokujo gate lean-worker aristotle-cli-rs License: Apache-2.0 Sister Repo: Niemeier A8^3 Moonshine Sister Repo: GDT Lean4 Sister Repo: WERR Core Monorepo Sister Repo: WerrSoma Connectome Sister Repo: WerreduR Sister Repo: WERRobotics Sister Repo: Schönhage Record arXiv:2610.14263 arXiv DOI: 10.48550/arXiv.2610.14263 CrocSwap PR #226: Incorporated

📄 Official Published arXiv Preprint: arXiv:2609.38492 [cs.LO] │ Direct PDF │ DOI: 10.48550/arXiv.2609.38492
Title: "Machine-Checked Computational Group Theory in Lean 4: Operational Schreier-Sims Stabilizer Chains, BSGS Sifting, and Backtrack Ordered Partitions"
Authors: Volkan Dağlı, Dr. Zerrin Dağlı, Dağhan Dağlı • Zenodo Release DOI: 10.5281/zenodo.23045504

Note

🛡️ Phased Verification Roadmap & Isolation Boundary

  • Phase 1 & Phase 2 (Completed & Published): Fully verified across 35 machine-checked theorems with 0 sorry, 0 admit, and 0 external axioms (covering Schreier-Sims stabilizer chains lib/stbc.gi, ordered partition refinements lib/partitio.gi, cyclotomic extension rings lib/zmodnze.gi, and constructive Bézout modular inverses lib/zmodnz.gi). Independently audited via gokujo 1.0.0 (PR #5, Lake / Nix Lean 4.28.0) with witness report in telemetry/gokujo-check-2026-10-06.json. Formally published on arXiv:2609.38492 and Zenodo (DOI: 10.5281/zenodo.23045504).
  • Phase 3 (Active Isolated Reserve): Permutation group orders, orbit-stabilizer systems, and conjugacy structures are strictly maintained in an isolated staging reserve (docs/PHASE3_STRATEGIC_ROADMAP.md & docs/PHASE3_PATTERN_LANGUAGE_SPEC.md) in active collaborative alignment with Mike DuPont (@jmikedupont2).

This repository provides machine-checked formal verifications in Lean 4 / Mathlib for the core computational discrete algebra algorithms and representations of the GAP System (Groups, Algorithms, Programming).

Developed by the ITouch Systems Formal Verification Lab (Volkan Dagli [@pCwOrM] & Family).


What's New in Release v0.2.0 (Phase 2 Milestone)

Release v0.2.0 advances beyond static residue structures into verified operational computational group theory and backtrack combinatorial algorithms, formalizing three major modules from GAP 4's core library with 0 sorry, 0 admit, and 0 external axioms:

  1. GAP-0299 (lib/stbc.gi): Schreier-Sims Stabiliser Chains & Transversal Invariants
  2. GAP-0332 (lib/partitio.gi): Backtrack Ordered Partitions & Cell Refinement Invariants
  3. GAP-0332 (lib/zmodnze.gi): Rings $\mathbb{Z}/n\mathbb{Z}(\varepsilon_m)$ of Cyclotomic Extensions
  4. GAP-0331 (lib/zmodnz.gi): Modular Residue Methods, Invertibility & Extended Euclidean GCD

1. Stabiliser Chains & Schreier-Sims Algorithms (lib/stbc.gi)

Module: RequestProject.Gap.Library.Stbc
GAP Reference: lib/stbc.gi (by Heiko Theißen and Ákos Seress)

Faithfully models GAP's stabiliser chain hierarchy, transversal trees, sifting reductions, and Base & Strong Generating Set (BSGS) membership testing:

  • Core Structures:
    • GAP.Stbc.StabLevel: Models each chain level $(\beta_i, \Delta_i, S_i, u_i)$ with base point, basic orbit, generators, and inverse transversal representatives.
    • GAP.Stbc.StabChain: The complete descending stabiliser chain $[G^{(1)}, G^{(2)}, \dots, G^{(k)}]$.
  • Operational Algorithms:
    • siftOneLevel: Single-level coset reduction $g \mapsto u_y^{-1} \cdot g$.
    • siftFull / siftedPermutation: Full multi-level Schreier sifting across the base.
    • membershipTestKnownBase: Group membership decision procedure using sifting.
    • extendSchreierPoint: Transversal tree extension step.
  • Verified Theorems (0 sorry):
    • siftOneLevel_fixes_basePoint: Proves that single-level sifting strictly fixes the base point $\beta_i$.
    • siftFull_fixes_all_basePoints: Proves that a fully sifted element fixes every base point in the base sequence $(\beta_1, \dots, \beta_k)$.
    • siftedPermutation_mem_subgroup_iff: Invariant preservation during coset reduction.
    • membershipTestKnownBase_sound: Proves that if membership test returns true, then $g \in G$.
    • membershipTestKnownBase_iff_mem: Soundness and completeness equivalence for subgroup membership.
    • extendSchreierPoint_invariant: Invariant preservation of the transversal tree under tree extension.

2. Ordered Partitions for Backtrack Searching (lib/partitio.gi)

Module: RequestProject.Gap.Library.Partitio
GAP Reference: lib/partitio.gi (by Heiko Theißen)

Models ordered partitions and cell refinement operations fundamental to GAP's permutation group backtrack search, partition backtracks, and automorphism computation:

  • Core Structures:
    • GAP.Partitio.OrderedPartition: Partition of $\Omega$ into ordered, non-empty, pairwise disjoint cells.
    • fixcells: Identifies cells consisting of a single fixed point (size 1).
    • splitCellByPred: Core cell-splitting primitive underlying SplitCell and IsolatePoint.
  • Verified Theorems (0 sorry):
    • splitCellByPred_disjoint: Formally proves that cell splitting always yields mutually disjoint subcells.
    • splitCellByPred_union: Proves exact element conservation (the union of subcells equals the original cell).
    • splitCellByPred_length_sum: Proves cardinality conservation $|C_{yes}| + |C_{no}| = |C|$.
    • mem_splitCellByPred_iff: Characterizes exact predicate-driven membership in split cells.

3. Cyclotomic Extension Rings $\mathbb{Z}/n\mathbb{Z}(\varepsilon_m)$ (lib/zmodnze.gi)

Module: RequestProject.Gap.Library.Zmodnze
GAP Reference: lib/zmodnze.gi (by Alexander Konovalov)

Formalizes elements and arithmetic of GAP's cyclotomic extension rings $\mathbb{Z}/n\mathbb{Z}(\varepsilon)$, where $\varepsilon^m = 1$:

  • Core Structures:
    • ZmodnZepsObj: Formal representation via coefficient vectors Fin m → GAP.ZModnZObj n.
    • AddCommGroup and convolution group-ring multiplication mulOp.
  • Verified Theorems (0 sorry):
    • card_eq: Machine-checks GAP's exact Size formula: $$\text{card}(\mathbb{Z}/n\mathbb{Z}(\varepsilon_m)) = n^m$$

4. $\mathbb{Z}/n\mathbb{Z}$ Modular Residue Methods (lib/zmodnz.gi)

Module: RequestProject.Gap.Library.Zmodnz
GAP Reference: lib/zmodnz.gi (by Thomas Breuer)

Dual verification architecture combining abstract mathematical isomorphism with operational executable algorithms:

  1. Semantic Model Isomorphism: Canonical bijection ZModnZObj n ≃ ZMod n, deriving CommRing and Field (for prime $n$), with unit theorem IsUnit a ↔ a.val.Coprime n.
  2. Constructive Executable Algorithms: Verified isUnitExec and constructive inverseOpExec via the Extended Euclidean Algorithm (Nat.gcdA Bézout coefficients) without non-constructive choice:
    theorem inverseOpExec_correct (a : ZModnZObj n) (h : isUnitExec a = true) :
        ∃ inv : ZModnZObj n, inverseOpExec a = some inv ∧ mulExec a inv = oneExec

Axiomatic Purity Audit

Every theorem in this repository has been audited with #print axioms:

Module GAP Source Theorems sorry External Axioms Foundations
Stbc.lean lib/stbc.gi 8 0 0 propext, Classical.choice, Quot.sound
Partitio.lean lib/partitio.gi 6 0 0 propext, Classical.choice, Quot.sound
Zmodnze.lean lib/zmodnze.gi 4 0 0 propext, Classical.choice, Quot.sound
Zmodnz.lean lib/zmodnz.gi 17 0 0 propext, Classical.choice, Quot.sound
Total 35 0 0 Standard Lean 4 Core

🛡️ Independent Telemetry Verification Gate (PR #5):
Independently verified by Mike DuPont (@jmikedupont2) via gokujo 1.0.0 (lean-worker), backend Lake with Nix-pinned Lean 4.28.0 (store 75c91mcn).
Results: 8/8 files built, 223 declarations scanned, 100 axioms audited, 0 holes, 0 sorries. Gate: PASS (exit 0). See witness artifact at telemetry/gokujo-check-2026-10-06.json.


Build Instructions

# Clone the repository
git clone https://github.com/pCwOrM/gap-lean4-port.git
cd gap-lean4-port

# Build the entire verified library
lake build RequestProject

Authors & Citation

ITouch Systems Formal Verification Lab

  • Volkan Dagli (@pCwOrM) & Family
  • Research Lab: Mersin / Istanbul, Turkey

Correspondence: ask@answerr.me | pcworm@pcworm.net


Community, Collaboration & Standards

  • Zulip Channel: Join real-time technical discussions on our Zulip realm at solfunmeme.zulipchat.com (Streams: #general > greetings, #general > architecture).
  • Shared Terminology Standard: Collaborative formal verification standard defined in Shared Terminology Guide v2 (DuPont–Dağlı Specification).
  • Rung 0–5 Verification Ledger: Formal accounting of chunks, anchors, pre/post/frame contracts, and degree qualifiers in docs/RUNG_LEDGER.md.
  • Distributed Architecture: Dual-engine Lean 4 + eBPF/Nix architecture in docs/ARCHITECTURE.md (Formalizing the joint Rung 0–5 verification ladder).
  • Rung 0–5 Verification Bridge & Worker Packets: Automated bridge generator (tools/bridge_generator.py) and consolidated witness report (tasks/bridge_witness_report.json) generating turnkey harmonic.gap-worker-job/1 packets for Mike DuPont's lean-worker and aristotle-cli-rs.

🏛️ Associated Formal Verification, World Records & Scientific Corpus

All monographs, formal Lean 4 specifications, and empirical datasets across the WERR & ITouch Systems Research Group are permanently archived on CERN Zenodo, arXiv, Elsevier SSRN, and Hugging Face.
(Primary links use CERN Zenodo Concept DOIs / Çatı DOI, which automatically resolve to the latest published version while preserving exact version-pinned reproducibility.)

# Pillar / Monograph Core Contribution & Focus 👑 Concept DOI (Always Latest) 📌 Latest Version DOI arXiv / SSRN / Hugging Face & Verification Status Primary Repository
01 Paper 1: FNS Procedural Weight Derivation & Non-Linear Decision Boundaries (v3) 10.5281/zenodo.22774934 10.5281/zenodo.22867037 SSRN: 7659198 (Distributed) • Multi-Seed Pareto & Manifold Parity pCwOrM/fractal-neural-synthesis
02 Paper 2: OED Orbital Error Dynamics, Ephemeral Parameter Resonance & CD4+ Gating (v1) 10.5281/zenodo.22900464 10.5281/zenodo.22900465 arXiv:2609.30115 • 🤗 HF Paper (Verified) • TR 2026/016285 pCwOrM/fractal-neural-synthesis
03 Paper 3: WERR Map Universal Natural Language Decision Map & Real-Time Edge Triage (v2) 10.5281/zenodo.22867425 10.5281/zenodo.22939253 arXiv:2609.25498 • 🤗 HF Paper • 🤗 HF Dataset pCwOrM/werr • pCwOrM/answerr
04 Paper 4: Werracle Sub-Cent Intra-Block AI Reflex Oracles & Flash-Loan Circuit Breakers (v1) 10.5281/zenodo.22942598 10.5281/zenodo.22942599 arXiv:2609.30719 • SSRN: 7626279 • 🤗 HF Paper pCwOrM/werracle • pCwOrM/werralem
05 Paper 5: Formal Lean 4 Zero-Storage Procedural Synthesis: Lean 4 Verification & 40-Core Validation 10.5281/zenodo.22774934 10.5281/zenodo.22867037 arXiv:2609.33066 • 🤗 HF Paper • Lean 4 (10 Theorems, 0 sorry) pCwOrM/werr • pCwOrM/werracle
06 Paper 6: GAP-Lean4 Machine-Checked Computational Group Theory: Schreier-Sims & BSGS Sifting (v2) 10.5281/zenodo.23092708 10.5281/zenodo.23156544 arXiv:2609.38492 • 🤗 HF Paper • Lean 4 (35 Theorems, 0 sorry) pCwOrM/gap-lean4-port
07 Paper 7: Black Hole v5 Unitary Black Hole Page Curve via Dynamical Horizon Orbifolds & GKP Stabilizers (v5) 10.5281/zenodo.22961999 10.5281/zenodo.23072120 S(t=1) = 0.00 · Tr(ρ²) = 1.00 · R² = 0.9822 · 573× Stress Quench • Lean 4 (10 Theorems) pCwOrM/fractal-neural-synthesis • pCwOrM/werr
08 Paper 8: WerrSoma Bio-Synthetic Neuromorphic Interfacing with 158K-Neuron Drosophila Connectome (v1) 10.5281/zenodo.22996625 10.5281/zenodo.22996626 arXiv:submit/8161759 • Live 3D Portal (werrsoma.answerr.me) • TR 2026/016633 Lexovian/WerrSoma • pCwOrM/WerrSoma
09 Paper 9: WerreduR Procedural Pedagogy: Resolving the Saturn School Disequilibrium Paradox (v2) 10.5281/zenodo.22999420 10.5281/zenodo.23128224 SSRN: 7641538 (Distributed) • Lean 4 (7 Theorems, 0 sorry) • Live Portal jesmaat/WerreduR • pCwOrM/WerreduR
10 Paper 10: Schönhage Bipartite Carrier Compression in Schönhage Trilinear Multiplication Tensors (v2) 10.5281/zenodo.23232541 10.5281/zenodo.23295370 arXiv:2610.14263 • 🤗 HF Paper • CrocSwap #226 (50d76881) pCwOrM/integer-mult-bounds
11 Paper 11: Güneş Dili Deterministic Morpho-Semantic Tokenization & Algebraic Morphotactics in Lean 4 (v1) 10.5281/zenodo.23003711 10.5281/zenodo.23003712 arXiv:submit/8248674 • Lean 4 (4 Theorems, 0 sorry) • Live Studio pCwOrM/gunes-dili
12 Paper 12: Niemeier A₈³ Machine-Certified 24D Niemeier Lattice A₈³, K3 Hodge Duality & Umbral Moonshine (v1) 10.5281/zenodo.23324066 10.5281/zenodo.23324067 Lean 4 (0 sorry, 0 axioms) • χ(X) = 24 · order(G_glue) = 27 · ℓ = 9 pCwOrM/niemeier-a8-umbral-moonshine
13 Paper 13: GDT v3.0 Machine-Certified Lean 4 Formalization of the General Divisor Theorem (v2) 10.5281/zenodo.23316068 10.5281/zenodo.23425590 Lean 4 (81 Theorems, 0 sorry) • Companion v1: 10.5281/zenodo.23426323 (v1: 23426324) pCwOrM/general-divisor-theorem
14 Paper 14: Elliptic Sieve Multi-Layer Algebraic Sieve & Vélu Isogeny Engine: 230 Curves on NSF ICARM (v1) 10.5281/zenodo.23436282 10.5281/zenodo.23436283 NSF ICARM Leaderboard (user/114): 30x #1 Gold Records, 80 Top-3, 100% log N pCwOrM/werr-elliptic-sieve
15 Paper 15: Empirical OEV Empirical OEV & Liquidation Dynamics: Chainlink SVR on Base & Ethereum L1 (v2) 10.5281/zenodo.23623588 10.5281/zenodo.23642090 🤗 HF Dataset (1.16k+ views, 126 likes) • 94.4% Aggregate / 98.3% Median SVR Recapture pCwOrM/werracle • pCwOrM/werrealm
HW Edge Robotics Core Zero-Memory Embedded C/C++11 System-1 Reflex Kernel (WerrCoreEdge.h v0.5.1) 10.5281/zenodo.22867425 10.5281/zenodo.22939253 ATmega328P / ESP32 / STM32 (0 Bytes Heap, <128B Stack, TR 2026/016633) pCwOrM/WERRobotics

🏆 Global Records, Formal Proofs, Curated Awesome Merges & On-Chain Infrastructure

1. Certified Mathematical Records & Formal Verification (0 sorry)

  • 🥇 NSF ICARM Elliptic Curve Rank Leaderboard (elliptic-rank.icarm.cloud/user/114): 230 certified high-rank elliptic curves (#4308–#4537) over $\mathbb{Q}$ with 100% complete prime conductor factorization ($\log N$) up to Rank $\ge 19$ (#4323), achieving 30 First-Place (#1 Gold) Records, 80 Podium (Top-3), and 418 Top-10 placements across 43 categories (building upon the foundational fibration families of Elkies, Dujella, Rubinstein, and Klagsbrun; supported under NSF Grant DMS-2425401).
  • 🥇 Schönhage Trilinear Multiplication Tensor Bound (arXiv:2610.14263 • CrocSwap/integer-mult-bounds#226): Constructive 15-round bipartite carrier matching at dimensions $h=23, 25$ eliminating 185 carrier roles and 377,890 physical wires ($W = 177,284,805 \to 176,906,915$), certifying $\kappa = 826,215,307 / 20,000,000,000,000 \approx 4.131076535 \times 10^{-5}$ ($1.377\times$ net gain over PR #49), formally incorporated into CrocSwap/integer-mult-bounds (commit 50d76881) and verified in Lean 4 (0 sorry).
  • 📐 170+ Machine-Checked Theorems in Lean 4 (0 sorry, 0 unproven axioms):
    • General Divisor Theorem (GDT v3.0): 81 theorems/lemmas (0 sorry) formalizing Dan Hawkley's residue density framework (10.5281/zenodo.23316068).
    • Computational Group Theory (gap-lean4-port): 35 theorems (0 sorry) formalizing Charles Sims' Schreier-Sims stabilizer chains (GAP-0299), backtrack ordered partitions (GAP-0332), and modular ring inverses (GAP-0331) (arXiv:2609.38492).
    • Procedural Boundary Synthesis & EVM/Cairo Fixed-Point Bounds: 40+10 theorems (WerracleProof.lean, 0 sorry) verifying ZMod 9 ($\mathbb{Z}/9\mathbb{Z}$) principal ideal closure ($\mathcal{I}_3 = {0,3,6}$), Q16.16 overflow safety, and unitary Page curve S-matrix conservation (arXiv:2609.33066).
    • 24D Niemeier Lattice $A_8^3$, WerreduR & Güneş Dili: Complete formal specifications (0 sorry) across lattice unimodularity ($\chi=24, \ell=9$), horizon complementarity ($B(t)+S(t)=1$), and deterministic morphological parsing.

2. Curated Ecosystem Recognitions & Benchmark Evaluations

3. Sovereign On-Chain Deployments (Werrium / $WERR), Multi-Chain Testnets & Grant Pipelines

About

Machine-Checked Formal Verification of GAP in Lean 4 / Mathlib (Release v0.2.0, 35 theorems, 0 sorry, arXiv:2609.38492)

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages