All plugins

verifiable-math-kernel

Deterministic symbolic computation, integer factorization with Baillie-PSW probable-prime testing, elliptic curve invariants, and formal Lean 4 proof auditing for Hermes Agent. When Lean 4 is installed on PATH and enable_lean_cli is enabled, lean4_proof_audit can verify proofs via isolated execution. Disclosure β€” With enable_lean_cli on (default off), lean4_proof_audit runs the user's local lean --stdin on model-written Lean code after a Hermes approval prompt. Lean can execute code while it elaborates, with the user's privileges, a minimal environment (PATH, HOME, LANG, LEAN_PATH) and a scratch working directory under the plugin's data dir. No network calls.

pCwOrM2Toolsv1.0.6Updated 2 days ago

About

Deterministic symbolic computation, integer factorization with Baillie-PSW probable-prime testing, elliptic curve invariants, and formal Lean 4 proof auditing for Hermes Agent. When Lean 4 is installed on PATH and enable_lean_cli is enabled, lean4_proof_audit can verify proofs via isolated execution. Disclosure β€” With enable_lean_cli on (default off), lean4_proof_audit runs the user's local lean --stdin on model-written Lean code after a Hermes approval prompt. Lean can execute code while it elaborates, with the user's privileges, a minimal environment (PATH, HOME, LANG, LEAN_PATH) and a scratch working directory under the plugin's data dir. No network calls.

πŸ”¬ Hermes Verifiable Math Kernel

Deterministic Symbolic Computation, Certified Factorization, Elliptic Curve Arithmetic, and Formal Lean 4 Proof Verification for Hermes Agent (Nous Research).

Hermes Community Plugin
License: MIT
Tests: 25/25 Passed
Category: Tools
arXiv:2611.11641
NSF ICARM Verified


🎯 Overview

Large Language Models (LLMs) and autonomous agents are notorious for mathematical hallucinations:

  1. False Algebraic Claims: Silent sign errors, invalid cancellations, and hallucinated identities.
  2. Factorization Failures: Blindly guessing primes or asserting incorrect prime factorizations for integers beyond $10^{12}$.
  3. Floating-Point Precision Traps: Incurring IEEE-754 precision loss (0.1 + 0.2 != 0.3) in financial and quantitative reasoning.
  4. Unverified Proofs: Claiming theorems are proven while relying on hidden assumptions or unproven axioms.

The Hermes Verifiable Math Kernel (verifiable-math-kernel) transforms Hermes Agent into a machine-verified computational reasoning engine. By uniting computer algebra systems (SymPy), the Werr Multi-Layer Algebraic Sieve & Baillie-PSW engine, arithmetic geometry algorithms (Tate reduction, Mazur torsion bounds), and Lean 4 formal proof auditing, Hermes can now verify mathematical claims with 100% deterministic certainty.


πŸ—οΈ Architecture

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚            Hermes Agent Core                  β”‚
                    β”‚   (User Prompt / Tool Call / Planning Loop)   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                            β”‚
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚                                                         β”‚
   [pre_tool_call Hook]                                       [Interactive Tools]
   β€’ Intercepts IEEE-754 traps                                β€’ verify_math_claim
   β€’ Flags precision loss                                     β€’ certified_factorization
   β€’ Auto-suggests exact fractions                            β€’ elliptic_curve_analyzer
               β”‚                                              β€’ lean4_proof_audit
               β–Ό                                                         β”‚
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β–Ό
 β”‚           Hermes Verifiable Math Plugin Core           β”‚ β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
 β”‚ 1. Symbolic CAS (Exact Rational & Identity Reducer)   β”‚
 β”‚ 2. Werr Sieve & Baillie-PSW Deterministic Primality   β”‚
 β”‚ 3. Elliptic Curve Tate & Mazur Torsion Classifier      β”‚
 β”‚ 4. Lean 4 Formal Proof Auditor & Hole (sorry) Linter   β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                    [post_tool_call Hook]
                    β€’ Emits SHA-256 Proof Stamp:
                      [VERIFIED-MATH-PROOF-v1:<hash>]

πŸ› οΈ Provided Tools

1. verify_math_claim

Verifies algebraic identities, equations, and simplifies expressions with exact symbolic reduction steps.

  • Input: statement: "sin(x)**2 + cos(x)**2 == 1"
  • Output:
{
  "statement": "sin(x)**2 + cos(x)**2 == 1",
  "verified": true,
  "lhs_canonical": "sin(x)**2 + cos(x)**2",
  "rhs_canonical": "1",
  "difference_canonical": "0",
  "proof_trace": "LHS - RHS evaluated to 0 identically.",
  "latex": "\\sin^{2}{\\left(x \\right)} + \\cos^{2}{\\left(x \\right)} = 1",
  "verification_hash": "a1b2c3d4..."
}

2. certified_factorization

Factors composite integers and tests prime factors using the Baillie-PSW probable-prime test (Miller-Rabin base 2 + strong Lucas-Selfridge). Also computes Euler's totient $\phi(N)$, divisor count $d(N)$, and sum of divisors $\sigma(N)$.

  • Input: n: 2026
  • Output:
{
  "n": 2026,
  "bit_length": 11,
  "factors": [[2, 1], [1013, 1]],
  "factor_string": "2 * 1013",
  "certified": true,
  "probable_prime_tests": [
    {"prime": 2, "exponent": 1, "is_prime": true, "test": "small_prime"},
    {"prime": 1013, "exponent": 1, "is_prime": true, "test": "Baillie-PSW_Probable_Prime"}
  ],
  "invariants": {
    "euler_totient": 1012,
    "divisor_count": 4,
    "sum_of_divisors": 3042
  }
}

3. elliptic_curve_analyzer

Computes exact arithmetic geometry invariants for elliptic curves over $\mathbb{Q}$ in generalized Weierstrass form $[a_1, a_2, a_3, a_4, a_6]$ or short model $[a, b]$:

  • Minimal discriminant $\Delta$ and Tate invariants $b_2, b_4, b_6, b_8, c_4, c_6$.
  • $j$-invariant $j(E)$.
  • Bad prime conductor reduction factors.
  • Rational torsion subgroup classification via Mazur's Torsion Theorem and Lutz-Nagell root bracketing.
  • Input: weierstrass: [-1, 0] ($y^2 = x^3 - x$)
  • Output:
{
  "weierstrass_coeffs": [0, 0, 0, -1, 0],
  "discriminant": 64,
  "bad_primes": [2],
  "j_invariant": "1728",
  "torsion_order": 4,
  "torsion_group": "Z/2Z x Z/2Z",
  "nsf_icarm_conformant": true
}

4. lean4_proof_audit

Audits Lean 4 formal code snippets, extracts theorem declarations, checks for classical axioms, and detects unproven holes (sorry / admit). By default (enable_lean_cli: false), runs static analysis without executing code. When enable_lean_cli: true is configured, checks go through Hermes's per-call approval gate with an explicit minimal environment (PATH, HOME, LANG, LEAN_PATH) and an isolated scratch working directory. certified: true is only returned when the local Lean 4 kernel actually verifies the snippet.

  • Input:
theorem ferma_last (n : Nat) (hn : n > 2) : 
  βˆ€ x y z : Nat, x^n + y^n = z^n β†’ x * y * z = 0 := by
  sorry
  • Output:
{
  "status": "REJECTED_UNPROVEN_HOLES",
  "certified": false,
  "unproven_holes_count": 1,
  "holes": [{"line": 3, "keyword": "sorry", "context": "sorry"}],
  "compiler_message": "Contains incomplete proof markers."
}

⚑ Lifecycle Hooks & Safety Guardrails

  • pre_tool_call (Precision Guard): Intercepts floating-point expressions (like 0.1 + 0.2) across tool calls, warning Hermes against IEEE 754 precision loss and advising exact rational arithmetic.
  • post_tool_call (Proof Telemetry): Stamps verified calculations with a cryptographic SHA-256 certificate proof tag:
    [VERIFIED-MATH-PROOF-v1:<hash>]

πŸš€ Installation & Usage

1. Install via Hermes Marketplace CLI

hermes plugins install verifiable-math-kernel
hermes plugins enable verifiable-math-kernel

2. Manual / Developer Installation

Link your local checkout to your Hermes installation (avoid editable pip installs so root helper modules like tools.py stay isolated per plugin rather than global):

hermes plugins link /path/to/hermes-verifiable-math

Validate with Hermes Plugin Doctor:

hermes plugins validate . --install-deps

3. Quick Slash Commands

In Hermes CLI or Desktop:

/verify sin(x)**2 + cos(x)**2 == 1
/verify (x^2 - 1)/(x - 1)

πŸ§ͺ Testing

Run the full automated test suite:

python -m pytest tests/ -v

Output:

tests/test_doctor.py::test_manifest_structure PASSED
tests/test_doctor.py::test_register_context_wiring PASSED
tests/test_hooks.py::test_pre_hook_precision_trap_detection PASSED
tests/test_hooks.py::test_pre_hook_auto_rational_upgrade_on_verify_math_claim PASSED
tests/test_hooks.py::test_pre_hook_clean_call PASSED
tests/test_hooks.py::test_pre_hook_lean_approval PASSED
tests/test_hooks.py::test_post_hook_proof_stamp PASSED
tests/test_tools.py::test_verify_trig_identity PASSED
tests/test_tools.py::test_verify_algebraic_identity PASSED
tests/test_tools.py::test_verify_rational_domain_exact_decimal PASSED
tests/test_tools.py::test_verify_domain_and_variables_wiring PASSED
tests/test_tools.py::test_verify_false_statement PASSED
tests/test_tools.py::test_expression_simplification PASSED
tests/test_tools.py::test_power_tower_resource_bounding PASSED
tests/test_tools.py::test_large_exponent_bounding PASSED
tests/test_tools.py::test_certified_factorization PASSED
tests/test_tools.py::test_certified_factorization_without_certificates PASSED
tests/test_tools.py::test_certified_factorization_prime PASSED
tests/test_tools.py::test_elliptic_curve_analyzer PASSED
tests/test_tools.py::test_elliptic_curve_analyzer_skip_torsion PASSED
tests/test_tools.py::test_lean4_audit_with_sorry PASSED
tests/test_tools.py::test_lean4_audit_unchecked_no_holes_by_default PASSED
tests/test_tools.py::test_safe_parse_blocks_injection PASSED
tests/test_tools.py::test_oversized_integer_literal_bounding PASSED
tests/test_tools.py::test_evaluation_process_timeout PASSED
============================= 25 passed in 14.01s =============================

Release Notes & Kaggle Gemma 4 Paper Track Alignment (v1.0.4 β†’ v1.0.6)

The Kaggle Paper Track writeup "Dual-Process SWE Agent: Gemma 4 with Zero-Tensor Reflex & Formal Verification" (DOI: 10.34740/kaggle/w/125932) cites the isolated child-process execution and AST bounding architecture introduced in v1.0.4. Release v1.0.6 preserves all v1.0.4–v1.0.5 safety guarantees (15.0s OS subprocess timeout guard, OpenAI parameters/description schema compliance, syntactic AST bounds, rational upgrades, and Lean 4 approval gating) while adding positional register_hook compatibility, lean_code payload inspection, plugin-data path alignment (plugins.plugin_storage.plugin_data_dir), and sanitized subprocess environment handling.

Disclosure

  • The lean4_proof_audit tool runs regex-based static inspection by default (enable_lean_cli: false). Only when enable_lean_cli is explicitly enabled and lean is available on PATH does it invoke a local lean --stdin subprocess in an isolated scratch directory under HERMES_HOME/plugin-data/verifiable-math-kernel/scratch.

πŸ“œ Intellectual Attribution & Background

This plugin is part of the Werr Open Science Ecosystem and builds directly upon methodologies verified on the NSF Institute for Computer-Aided Reasoning in Mathematics (ICARM) Elliptic Curve Rank Leaderboard under U.S. National Science Foundation Grant DMS-2425401 and CERN Zenodo permanent research archives (DOI: 10.5281/zenodo.23436282).

  • Author: Volkan Dagli (@pCwOrM)
  • Organization: ITouch Systems Research & Development
  • License: MIT License

πŸ›οΈ 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 / MonographCore Contribution & FocusπŸ‘‘ Concept DOI (Always Latest)πŸ“Œ Latest Version DOIarXiv / SSRN / Hugging Face & Verification StatusPrimary Repository
01Paper 1: FNSProcedural Weight Derivation & Non-Linear Decision Boundaries (v3)10.5281/zenodo.2277493410.5281/zenodo.22867037SSRN: 7659198 (Distributed) β€’ Multi-Seed Pareto & Manifold ParitypCwOrM/fractal-neural-synthesis
02Paper 2: OEDOrbital Error Dynamics, Ephemeral Parameter Resonance & CD4+ Gating (v1)10.5281/zenodo.2290046410.5281/zenodo.22900465arXiv:2609.30115 β€’ πŸ€— HF Paper (Verified) β€’ TR 2026/016285pCwOrM/fractal-neural-synthesis
03Paper 3: WERR MapUniversal Natural Language Decision Map & Real-Time Edge Triage (v2)10.5281/zenodo.2286742510.5281/zenodo.22939253arXiv:2609.25498 β€’ πŸ€— HF Paper β€’ πŸ€— HF DatasetpCwOrM/werr β€’ pCwOrM/answerr
04Paper 4: WerracleSub-Cent Intra-Block AI Reflex Oracles & Flash-Loan Circuit Breakers (v1)10.5281/zenodo.2294259810.5281/zenodo.22942599arXiv:2609.30719 β€’ SSRN: 7626279 β€’ πŸ€— HF PaperpCwOrM/werracle β€’ pCwOrM/werralem
05Paper 5: Formal Lean 4Zero-Storage Procedural Synthesis: Lean 4 Verification & 40-Core Validation10.5281/zenodo.2277493410.5281/zenodo.22867037arXiv:2609.33066 β€’ πŸ€— HF Paper β€’ Lean 4 (10 Theorems, 0 sorry)pCwOrM/werr β€’ pCwOrM/werracle
06Paper 6: GAP-Lean4Machine-Checked Computational Group Theory: Schreier-Sims & BSGS Sifting (v2)10.5281/zenodo.2309270810.5281/zenodo.23156544arXiv:2609.38492 β€’ πŸ€— HF Paper β€’ Lean 4 (35 Theorems, 0 sorry)pCwOrM/gap-lean4-port
07Paper 7: Black Hole v5Unitary Black Hole Page Curve via Dynamical Horizon Orbifolds & GKP Stabilizers (v5)10.5281/zenodo.2296199910.5281/zenodo.23072120S(t=1) = 0.00 Β· Tr(ρ²) = 1.00 Β· RΒ² = 0.9822 Β· 573Γ— Stress Quench β€’ Lean 4 (10 Theorems)pCwOrM/fractal-neural-synthesis β€’ pCwOrM/werr
08Paper 8: WerrSomaBio-Synthetic Neuromorphic Interfacing with 158K-Neuron Drosophila Connectome (v1)10.5281/zenodo.2299662510.5281/zenodo.22996626arXiv:submit/8161759 β€’ Live 3D Portal (werrsoma.answerr.me) β€’ TR 2026/016633Lexovian/WerrSoma β€’ pCwOrM/WerrSoma
09Paper 9: WerreduRProcedural Pedagogy: Resolving the Saturn School Disequilibrium Paradox (v2)10.5281/zenodo.2299942010.5281/zenodo.23128224SSRN: 7641538 (Distributed) β€’ Lean 4 (7 Theorems, 0 sorry) β€’ Live Portaljesmaat/WerreduR β€’ pCwOrM/WerreduR
10Paper 10: SchΓΆnhageBipartite Carrier Compression in SchΓΆnhage Trilinear Multiplication Tensors (v2)10.5281/zenodo.2323254110.5281/zenodo.23295370arXiv:2610.14263 β€’ πŸ€— HF Paper β€’ CrocSwap #226 (50d76881)pCwOrM/integer-mult-bounds
11Paper 11: GΓΌneş DiliDeterministic Morpho-Semantic Tokenization & Algebraic Morphotactics in Lean 4 (v1)10.5281/zenodo.2300371110.5281/zenodo.23003712arXiv:submit/8248674 β€’ Lean 4 (4 Theorems, 0 sorry) β€’ Live StudiopCwOrM/gunes-dili
12Paper 12: Niemeier Aβ‚ˆΒ³Machine-Certified 24D Niemeier Lattice Aβ‚ˆΒ³, K3 Hodge Duality & Umbral Moonshine (v1)10.5281/zenodo.2332406610.5281/zenodo.23324067Lean 4 (0 sorry, 0 axioms) β€’ Ο‡(X) = 24 Β· order(G_glue) = 27 Β· β„“ = 9pCwOrM/niemeier-a8-umbral-moonshine
13Paper 13: GDT v3.0Machine-Certified Lean 4 Formalization of the General Divisor Theorem (v2)10.5281/zenodo.2331606810.5281/zenodo.23425590Lean 4 (81 Theorems, 0 sorry) β€’ Companion v1: 10.5281/zenodo.23426323 (v1: 23426324)pCwOrM/general-divisor-theorem
14Paper 14: Elliptic SieveMulti-Layer Algebraic Sieve & VΓ©lu Isogeny Engine: 230 Curves on NSF ICARM (v1)10.5281/zenodo.2343628210.5281/zenodo.23436283NSF ICARM Leaderboard (user/114): 30x #1 Gold Records, 80 Top-3, 100% log NpCwOrM/werr-elliptic-sieve
15Paper 15: Empirical OEVEmpirical OEV & Liquidation Dynamics: Chainlink SVR on Base & Ethereum L1 (v2)10.5281/zenodo.2362358810.5281/zenodo.23642090πŸ€— HF Dataset (1.16k+ views, 126 likes) β€’ 94.4% Aggregate / 98.3% Median SVR RecapturepCwOrM/werracle β€’ pCwOrM/werrealm
16Paper 16: Holomorphic CollatzSpectral Stability, Fatou Basin Contraction & Machine-Checked Multipliers in Holomorphic Collatz Dynamics (v1)10.5281/zenodo.2406039310.5281/zenodo.24060394arXiv:2611.11641 [cs.LO] β€’ Lean 4 (20 Theorems, 0 sorry, 0 axioms) β€’ $\mu_f(\mathcal{O}_{1,2}) = 3/4$pCwOrM/werr β€’ pCwOrM/hermes-verifiable-math
HWEdge Robotics CoreZero-Memory Embedded C/C++11 System-1 Reflex Kernel (WerrCoreEdge.h v0.5.1)10.5281/zenodo.2286742510.5281/zenodo.22939253ATmega328P / ESP32 / STM32 (0 Bytes Heap, <128B Stack, TR 2026/016633)pCwOrM/WERRobotics

πŸ† Global Records, Formal Proofs & Curated Ecosystem Recognitions

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

README from the reviewed commit b42f09a; it updates when the author re-pins.

More by pCwOrM

3 plugins by pCwOrM in the catalog.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section