# open-goat/pequalnp-proofs architecture

> Architecture diagram of the GitHub repository open-goat/pequalnp-proofs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-goat/pequalnp-proofs
- Repository: https://github.com/open-goat/pequalnp-proofs

## Overview

PEqualNP is a Lean 4, machine-checked proof repository, not a claim that P versus NP is settled. The documented workflow is: an outside contributor obtains a gap and its permitted imports, writes a proof, submits it, and runs the checker; the checker builds the file and verifies the result against the pinned Lean and Mathlib environment. The repository also contains substantial formal domains for circuit lower bounds, geometric complexity theory, proof complexity, search, and meta-complexity. The graph follows README-described relationships; most Lean modules were not sampled, so their internal dependency links are omitted.

Main entry points: [`lean/PEqualNP/Defs`](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Defs) (Shared definitions), [`tools/check-lean.mjs`](https://github.com/open-goat/pequalnp-proofs/blob/main/tools/check-lean.mjs) (Lean checker), [`lean/PEqualNP/Outside`](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Outside) (Submitted proof), [`tools/check-lean-memory.mjs`](https://github.com/open-goat/pequalnp-proofs/blob/main/tools/check-lean-memory.mjs) (Memory detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_contribution["Gap contribution"]
  node_gap["Assigned gap"]
  node_outsideproof["Submitted proof"]
end

subgraph group_checking["Proof checking"]
  node_checker["Lean checker<br/>[check-lean.mjs]"]
  node_memory["Memory detection"]
  node_kernel["Proof verifier<br/>[CheckLemma.lean]"]
end

subgraph group_formal["Formal foundations"]
  node_leanproject["Pinned Lean project"]
  node_definitions["Shared definitions"]
end

subgraph group_results["Proof domains"]
  node_circuit["Circuit lower bounds"]
  node_gct["Geometric complexity"]
  node_proofcomplexity["Proof complexity"]
  node_search["Search complexity"]
  node_library["Complexity library"]
  node_metacomplexity["Meta-complexity"]
end

node_contributor(("Outside contributor"))
node_desk(("Gap desk"))

node_contributor -->|"requests gap"| node_desk
node_desk -->|"assigns statement"| node_gap
node_contributor -->|"writes proof"| node_outsideproof
node_gap -->|"constrains proof"| node_outsideproof
node_contributor -->|"runs check"| node_checker
node_checker -->|"builds file"| node_outsideproof
node_checker -->|"checks memory"| node_memory
node_checker -->|"invokes verifier"| node_kernel
node_checker -->|"uses pinned environment"| node_leanproject
node_checker -->|"checks definitions"| node_definitions
node_definitions -.->|"defines statements for"| node_circuit
node_definitions -.->|"defines statements for"| node_gct
node_definitions -.->|"defines statements for"| node_proofcomplexity
node_definitions -.->|"defines statements for"| node_search
node_definitions -.->|"defines statements for"| node_library
node_definitions -.->|"defines statements for"| node_metacomplexity

click node_gap "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Outside"
click node_outsideproof "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Outside"
click node_checker "https://github.com/open-goat/pequalnp-proofs/blob/main/tools/check-lean.mjs"
click node_memory "https://github.com/open-goat/pequalnp-proofs/blob/main/tools/check-lean-memory.mjs"
click node_kernel "https://github.com/open-goat/pequalnp-proofs/blob/main/lean/CheckLemma.lean"
click node_leanproject "https://github.com/open-goat/pequalnp-proofs/tree/main/lean"
click node_definitions "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Defs"
click node_circuit "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/CircuitLowerBounds"
click node_gct "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Gct"
click node_proofcomplexity "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/ProofComplexity"
click node_search "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Search"
click node_library "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Library"
click node_metacomplexity "https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/MetaComplexity"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gap,node_outsideproof toneBlue
class node_checker,node_memory,node_kernel toneAmber
class node_leanproject,node_definitions toneMint
class node_circuit,node_gct,node_proofcomplexity,node_search,node_library,node_metacomplexity toneRose
class node_contributor,node_desk toneIndigo
```

## Components

### Gap contribution

- [Assigned gap](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Outside): `lean/PEqualNP/Outside`
- [Submitted proof](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Outside): `lean/PEqualNP/Outside`

### Proof checking

- [Lean checker](https://github.com/open-goat/pequalnp-proofs/blob/main/tools/check-lean.mjs): `tools/check-lean.mjs`
- [Memory detection](https://github.com/open-goat/pequalnp-proofs/blob/main/tools/check-lean-memory.mjs): `tools/check-lean-memory.mjs`
- [Proof verifier](https://github.com/open-goat/pequalnp-proofs/blob/main/lean/CheckLemma.lean): `lean/CheckLemma.lean`

### Formal foundations

- [Pinned Lean project](https://github.com/open-goat/pequalnp-proofs/tree/main/lean): `lean`
- [Shared definitions](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Defs): `lean/PEqualNP/Defs`

### Proof domains

- [Circuit lower bounds](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/CircuitLowerBounds): `lean/PEqualNP/CircuitLowerBounds`
- [Geometric complexity](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Gct): `lean/PEqualNP/Gct`
- [Proof complexity](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/ProofComplexity): `lean/PEqualNP/ProofComplexity`
- [Search complexity](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Search): `lean/PEqualNP/Search`
- [Complexity library](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/Library): `lean/PEqualNP/Library`
- [Meta-complexity](https://github.com/open-goat/pequalnp-proofs/tree/main/lean/PEqualNP/MetaComplexity): `lean/PEqualNP/MetaComplexity`

### Other components

- **Outside contributor**
- **Gap desk**

## Connections

- Outside contributor → Gap desk: requests gap (evidence: `README.md`)
- Gap desk → Assigned gap: assigns statement (evidence: `README.md`)
- Outside contributor → Submitted proof: writes proof (evidence: `README.md`)
- Assigned gap → Submitted proof: constrains proof (evidence: `README.md`)
- Outside contributor → Lean checker: runs check (evidence: `README.md`)
- Lean checker → Submitted proof: builds file (evidence: `tools/check-lean.mjs`)
- Lean checker → Memory detection: checks memory (evidence: `tools/check-lean.mjs`)
- Lean checker → Proof verifier: invokes verifier (evidence: `tools/check-lean.mjs`)
- Lean checker → Pinned Lean project: uses pinned environment (evidence: `README.md`)
- Lean checker → Shared definitions: checks definitions (evidence: `README.md`)
- Shared definitions → Circuit lower bounds: defines statements for
- Shared definitions → Geometric complexity: defines statements for
- Shared definitions → Proof complexity: defines statements for
- Shared definitions → Search complexity: defines statements for
- Shared definitions → Complexity library: defines statements for
- Shared definitions → Meta-complexity: defines statements for
