Lean 4 formalization of SNARK-related theory, interactive oracle reductions, and proof systems.
Start with README.md for project overview.
AGENTS.md is the canonical root guide. CLAUDE.md is a symlink to this file.
- For a convenient routine check, start with
./scripts/validate.sh. Before committing or pushing, run it in full; it enforces repository-wide non-sorrywarnings and the Lean-native source-policy gate acrossArkLib/andArkLibTest/. It also runslake testand rejects all test warnings. - On a cold clone, run
lake exe cache getfirst. - If you add, rename, or delete files under
ArkLib/,git addnew paths before validation. - For docstring or docs work,
./scripts/validate.sh --docsis a convenient add-on check. - Only build site or blueprint output when touching
blueprint/orhome_page/:./scripts/validate.sh --site. - When filling or adding a
sorry(or anything that must stay axiom-clean), run./scripts/validate.sh --axioms; it first certifies the sweep tool against its fixture matrix (./scripts/test-axiomsweep.sh), then runs the regression gate. Refreshscripts/axiom_baseline.jsonwithlake exe axiomsweep --update-baselineand commit the diff if the change is intentional. The baseline coverssorryAxdebt only — native-compiler trust is never allowlistable.
ArkLib/Data/- reusable math, coding theory, polynomials, and supporting definitions.ArkLibTest/- compile-time acceptance examples and regression tests; runlake test.ArkLib/Interaction/- typed interactions and dependent reduction foundations.ArkLib/OracleReduction/- legacy IOR abstractions and security theory.ArkLib/ProofSystem/- protocol formalizations built on the core.ArkLib/Commitments/- commitments and opening arguments.ArkLib/ToMathlib/- local extensions intended for upstreaming.blueprint/src/- deep design docs and bibliography.scripts/- repo utilities.
- Lean defaults:
autoImplicit = false; source files must remain at or below 1500 lines. - Source-policy exceptions and linter suppressions are not supported. Fix the source or improve the linter with a repository-wide, tested policy change.
ArkLib.leanis generated; do not hand-edit it.- Every file under
ArkLib/uses Lean's module system (issue #795):module,public import,@[expose] public section. A new file must follow the same shape —lake buildrejects a classic file, since the generated root imports all of them as a module.ArkLibTest/stays classic on purpose. The conventions and an error-to-fix table are indocs/wiki/module-system.md. - Edit source, not derived output such as
.lake/,blueprint/web/,blueprint/print/,dependency_graphs/, orhome_page/docs/. - Pre-existing
sorryblocks exist in active formalizations; distinguish existing gaps from new regressions. - Prefer proof scripts that expose the key mathematical steps and compose predictably. Broad
automation is welcome when it closes a well-scoped goal quickly and clearly; for a slow proof,
profile first, then narrow imports, local hypotheses, simp sets, or automation rules, or move a
recurring argument into its owner layer. Do not mechanically expand a short, stable terminal
simpinto a brittlesimp onlylist. - If a PR changes commands, repo structure, generated outputs, or the blueprint/citation
workflow, update the matching page in
docs/wiki/in the same PR. - Promote recurring agent learnings into
docs/wiki/; do not let stable guidance live only in ephemeral notes.
docs/wiki/README.md- hub and maintenance rules.docs/skills/README.md- reusable cross-cutting workflows.docs/wiki/quickstart.md- commands and validation.docs/wiki/repo-map.md- structure and module routing.docs/wiki/generated-files.md- source-of-truth rules for derived outputs.docs/wiki/blueprint-and-citations.md- blueprint, references, and citations.
README.md- project overview.CONTRIBUTING.md- style, naming, docstrings, citations, and large contributions.ROADMAP.md- planned directions.BACKGROUND.md- background references.