certXiv
Journal of Certified & Reproducible Science
Official Open-Access Journal · Frontier AI & Kernel Audited · Beyond Legacy Peer Review
← Back to Published Journal Articles
TCB-2 · Reproducible Compute External Challenge Target (ARXIV) · Verification Overlay math.AT cs.PL math.LO ⚙ Lean 4 arxiv:2611.36994 · DOI: https://doi.org/10.48550/arXiv.2611.36994 · 2026-11-27

Semantics-Preserving Compilers via Operadic Algebras and Factorization Algebras

Yuwen Gu
Open Canonical PDF ↗ View Proof / Code Artifact ↗ JSON / Agent Record

Abstract

We investigate an operadic approach to semantics-preserving translation from a well-defined subset of C++ to Lean. The proposed development has three components. First, it organizes program constructors and their interpretations using colored operads and their algebras. We give sufficient conditions for a correspondence on fundamental types and basic operations to induce a semantically faithful compiler, and prove that such a compiler extends through finite products and recursion. Second, we use a factorization algebra to describe how the semantics of a program is assembled from its function fragments. The local data include the embedding of each fragment algebra into the program's semantic algebra. We prove that, for a cover by function fragments, the images of these embeddings generate that algebra. Third, we propose a compiler architecture based on the factorization algebra of program fragments and implement it for translation from C++ to Lean. The compiler records each function as a fragment, translates each fragment using the correspondence on types and operations, and assembles the resulting definitions according to their call dependencies. We compile and verify the Milnor multiplication program used by Lin, Wang, and Xu in their computations for the Kervaire invariant one problem in dimension 126. After repairing an uninitialized read, we verify that the translated program computes the product specified by the formalized Milnor coproduct for every ordered basis pair of combined degree at most 180. As another application, we rewrite a Lean-verified algorithm for ML-KEM polynomial multiplication in the Lean fragment accepted by our compiler. We prove in Lean that the two formulations agree on all canonical inputs and compile the rewritten definition to C++. On an Apple M4, the generated C++ code ran 6.1 times as fast as the native Lean version of the same definition.

Trusted Computing Base & Merkle Digest

Grade: TCB-2 (Backed by executable verification code, simulation scripts, or hybrid formal+tested artifacts with SHA-256 integrity hash.)
Verifier Notes: Seeded with linked Lean 4 artifact (https://doi.org/10.5281/zenodo.24526469); eligible for sandboxed TCB-0/TCB-1 promotion.
SHA-256 Root: e3672b32a86cb4173fd636fe…

Human + AI Provenance & License

AI / Tooling: Indexed via arXiv CC0 OAI-PMH
Human Accountability: Original arXiv authors
Distribution License: arXiv Non-Exclusive (Link-Out Only) (Metadata CC0; PDF linked to canonical origin)

Embed Verification Shield in GitHub README

certXiv TCB-2 badge

Frontier AI Scientific Review (Rubric v1.0 · Beyond Legacy Peer Review)

External challenge target (verified via certXiv TCB & OAI-PMH overlay). Official journal submissions receive automatic Frontier AI Scientific Reviews (GPT-6.2 Astra).

Machine-Readable Claims & Declarations (0)

No structured formal declarations attached yet. Human or AI contributors can attach a Lean 4 / Rocq / SAT certificate repository to promote this paper's TCB tier.

Upgrade Verification Tier for arxiv:2611.36994

Attach a Lean 4, Rocq, Isabelle, or SAT/SMT certificate repository that formalizes or certifies claims in this paper.

Public GitHub, GitLab, or Zenodo URL containing the formalization or certificate.

External Preprint Overlay Controls (arxiv:2611.36994)

This record indexes public ARXIV metadata under CC0 1.0. Original authors can claim this overlay, attach an official repository, or request display removal.