# openai/primegaps186 architecture

> Architecture diagram of the GitHub repository openai/primegaps186, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openai/primegaps186
- Repository: https://github.com/openai/primegaps186

## Overview

This repository combines a conditional Lean proof of a prime-gap bound with a standalone Python numerical certificate. The main workflow is: assume three analytic/numerical inputs, derive DHL[40,2], apply it to the documented diameter-186 tuple, and conclude the liminf bound. Separately, the Python script recomputes a numerical trial and writes a receipt; the README cautions that this does not discharge the Lean axioms. Lean source details and certificate internals are only partially sampled, so the graph avoids unsupported internal call relationships.

Main entry points: [`prime_gap_186_certificate.py`](https://github.com/openai/primegaps186/blob/main/prime_gap_186_certificate.py) (Numerical recomputation), [`PrimeGaps186.lean`](https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean) (DHL theorem)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_formal["Lean formalization"]
  node_dhl["DHL theorem<br/>[PrimeGaps186.lean]"]
  node_tuple["Explicit tuple<br/>[PrimeGaps186.lean]"]
  node_gapbound["Gap bound<br/>[PrimeGaps186.lean]"]
end

subgraph group_numerical["Numerical certificate"]
  node_certificate["Numerical recomputation"]
  node_receipt["JSON receipt"]
end

subgraph group_inputs["Assumed inputs"]
  node_assumptions["Input axioms<br/>[PrimeGaps186.lean]"]
  node_literature["Published estimates"]
end

node_engineer(("Project user"))

node_engineer -->|"runs script"| node_certificate
node_certificate -->|"writes receipt"| node_receipt
node_engineer -->|"checks proof"| node_dhl
node_literature -->|"motivates estimates"| node_assumptions
node_assumptions -->|"assumed inputs"| node_dhl
node_dhl -->|"applies theorem"| node_tuple
node_tuple -->|"yields bound"| node_gapbound
node_certificate -.->|"checks numerical input"| node_assumptions

click node_assumptions "https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean"
click node_dhl "https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean"
click node_tuple "https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean"
click node_gapbound "https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean"
click node_certificate "https://github.com/openai/primegaps186/blob/main/prime_gap_186_certificate.py"

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_dhl,node_tuple,node_gapbound,node_engineer toneBlue
class node_certificate,node_receipt toneAmber
class node_assumptions,node_literature toneMint
```

## Components

### Lean formalization

- [DHL theorem](https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean): `PrimeGaps186.lean`
- [Explicit tuple](https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean): `PrimeGaps186.lean`
- [Gap bound](https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean): `PrimeGaps186.lean`

### Numerical certificate

- [Numerical recomputation](https://github.com/openai/primegaps186/blob/main/prime_gap_186_certificate.py): `prime_gap_186_certificate.py`
- **JSON receipt**

### Assumed inputs

- [Input axioms](https://github.com/openai/primegaps186/blob/main/PrimeGaps186.lean): `PrimeGaps186.lean`
- **Published estimates**

### Other components

- **Project user**

## Connections

- Project user → Numerical recomputation: runs script (evidence: `README.md`)
- Numerical recomputation → JSON receipt: writes receipt (evidence: `README.md`)
- Project user → DHL theorem: checks proof (evidence: `README.md`)
- Published estimates → Input axioms: motivates estimates (evidence: `README.md`)
- Input axioms → DHL theorem: assumed inputs (evidence: `README.md`)
- DHL theorem → Explicit tuple: applies theorem (evidence: `README.md`)
- Explicit tuple → Gap bound: yields bound (evidence: `README.md`)
- Numerical recomputation → Input axioms: checks numerical input
