Formal Verification of Percolation Theory with AI Assistance: A Practical Workflow
This article examines a recent case in which a draft formal proof of a classic percolation theory problem briefly appeared in a public repository branch. It breaks down why the statement θ(pc)=0 is difficult, how formal verification works in Lean 4, what role AI plays as a verifiable search engine, and how to build a dual-channel audit and a reusable formal engineering pipeline with CI gates.
1. Background: A Formal Proof That Was Briefly Public
A research team recently made a draft formal proof of a classic open problem in percolation theory briefly visible in a branch on a public code hosting platform. The draft claimed to prove that “the probability of an infinite cluster at the critical probability is zero,” and included a complete machine-checkable proof script. A merge request was then opened, renamed, downgraded to a draft, and closed. It never reached the main branch, but the corresponding commit remained accessible.
At roughly the same time, a mathematics researcher wrote on a personal technical blog that AI would likely complete this proof ahead of humans. The researcher also mentioned that a few months earlier, another AI coding tool had helped solve a different open problem in the same field. The twist: that candidate answer may have already been sitting in the repository two days earlier.
Outsiders cannot determine whether this was an accidental disclosure. What can be confirmed is the consistency among the statement, the lattice and measure definitions, the critical probability definition, the infinite-cluster event, the challenge and solution files, and the build and kernel recheck records. This article does not judge who came first; it abstracts a reusable technical method.
2. The Problem: Why θ(pc)=0 Is Hard
Percolation theory studies connectivity on random graphs. Take the d-dimensional integer lattice as an example: each edge is independently “open” with probability p, forming a random subgraph. The core quantities are:
- Critical probability pc: the threshold at which an infinite cluster first appears with positive probability;
- θ(p): the probability that the origin belongs to the infinite cluster;
- Key statement: at p=pc, θ(pc)=0, meaning no “macroscopic connectivity” exists at the critical point.
The difficulty concentrates in three areas:
- Behavior on the two sides of the critical point is heterogeneous, and proof tools for p>pc and p<pc are rarely interchangeable;
- It requires controlling both “local event probabilities” and “limits at infinity,” involving compactness and measure-theoretic details;
- The dimension d enters quantitative estimates, low-dimensional and high-dimensional methods diverge, and a unified treatment for d≥2 requires additional structure.
Formalization here is not translation but forcing every implicit assumption into the open: how the measure is constructed, how events are defined, how limits are exchanged. Any ambiguity is rejected by the machine.
3. The Technical Foundation of Formal Verification
A formal proof typically consists of three parts:
- Definition layer: lattice, edge set, probability space, event families;
- Lemma layer: monotonicity, finite-volume approximation, tail event estimates;
- Main theorem layer: combining lemmas into the final statement.
Using an interactive proof assistant such as Lean 4 as an example, the core checking is done by the kernel, while the external build only handles orchestration. A schematic skeleton:
-- Definition: edge percolation probability spacedef percolationMeasure (p : ℝ) : Measure Ω := ...-- Key lemma: finite-volume approximation + monotonicitylemma theta_eq_sup_finite (p : ℝ) :θ p = ⨆ n, θ_n p := by ...-- Main theorem: probability of an infinite cluster at criticality is zerotheorem theta_pc_eq_zero :θ (pc : ℝ) = 0 := byrw [theta_eq_sup_finite]-- Combine tail estimates with the definition of pc...
The key to acceptance is not “it compiles” but “there are no holes after compiling.” In engineering practice, teams usually check:
- No unproven placeholders in the source;
- No extra axioms introduced;
- Challenge and solution files match verbatim;
- Build and kernel recheck records are reproducible.
4. The Real Role of AI: From Generation to Verifiable Search
In this kind of task, the value of AI is not to replace mathematical judgment but to turn proof search into a verifiable engineering loop:
- Formal scaffolding: decompose a natural-language statement into definitions, lemmas, and the main theorem;
- Candidate proof generation: produce multiple proof attempts for each lemma;
- Machine feedback loop: feed compilation errors directly back to drive the next round of fixes;
- Consistency audit: automatically compare challenge and solution, and scan for placeholders and axioms.
A pseudo-flow:
spec(natural language) -> formal_spec(definitions + statements)-> lemma_decomposition-> candidate_proofs(multiple)-> kernel_check(compile/kernel)-> audit(no placeholder, no extra axiom)-> report
The key point: any error at any step is intercepted by the machine, so the cost of a “hallucination” here is a compilation failure, not a silently wrong result.
5. Independent Recheck: How Dual-Channel Static Auditing Works
In the original event, the author used two different AI tools to independently recheck the same commit and reached the same conclusion. The reusable approach is a “dual-channel audit”:
- Channel A: dynamic build, running the full compilation and kernel check;
- Channel B: static scan, counting files, lines, placeholder locations, and the axiom list;
- Cross-checks: verbatim comparison of challenge and solution, and consistency between the statement and the lattice definition.
A schematic checklist:
[ ] Final statement matches expectations[ ] Lattice/edge set/measure definitions are unambiguous[ ] pc definition matches the standard[ ] Infinite-cluster event is defined correctly[ ] Challenge and Solution match verbatim[ ] No unproven placeholders[ ] No extra axioms[ ] Build and kernel records are reproducible
If either channel finds a discrepancy, the work should be downgraded to “draft” and not merged into the main branch.
6. A Reusable Formal Engineering Pipeline
Consolidate the above practice into an executable team process:
- Specification first: write the formal specification before the proof;
- Layered commits: separate PRs for definitions, lemmas, and the main theorem to ease auditing;
- Automated gates: make placeholder, axiom, and consistency checks part of CI;
- Dual-model recheck: cross-validate with different implementations to reduce single-point errors;
- Traceable builds: pin commits, pin dependencies, and retain kernel logs.
For cloud deployment, general-purpose capabilities can carry the load: a container platform runs the build cluster, object storage holds build artifacts and logs, a message queue distributes proof tasks, monitoring and alerting track failure rates, and a logging service keeps audit trails. This turns formal verification from a “one-off script” into a sustainable quality pipeline.
7. Capability Boundaries and Risks
A clear view is necessary:
- AI-generated proofs must be machine-checked and cannot be accepted directly;
- Formalization only guarantees “correctness under the given definitions”; wrong definitions mean everything is wrong;
- A draft branch in a public repository is not an accepted result;
- Accidental disclosure creates expectation-management risk, so teams need branch and release policies.
8. Conclusion
What is truly worth attention in this event is not “who got there first” but that “verifiable proofs” are becoming the standard interface for AI-assisted mathematical research. For engineering teams, the reusable conclusion is: engineer the specification, proof, audit, and build end to end, constrain the generation process with a machine feedback loop, and guard the quality gate with dual-channel rechecks. This way, regardless of how the underlying models evolve, formal verification can reliably produce trustworthy results.
