AI and Formal Verification: How AI Is Tackling Math and Cryptography Problems

    AI is now delivering results on two fronts at once: large-scale machine verification of proofs related to the Riemann Hypothesis, and previously unknown structural weaknesses in public cryptography competition candidates. This article breaks down what happened, why large models are effective on these tasks, how to build a "model plus verifier" research workflow in four steps, and where the limits and risks lie. Developers will find a reusable pattern for picking auto-verifiable tasks, building the verification layer first, injecting domain knowledge, and handling the engineering load.

    Over the past few days, AI has produced staged results on two very different technical tracks: one leading to a century-old problem in pure mathematics, the other to the security boundary of cryptographic algorithms. The first involved large-scale machine verification of proofs related to the Riemann Hypothesis using intelligent coding and formal proof tools, extended further to the generalized form of Dirichlet L-functions. The second came from an internal model that identified previously unknown mathematical structural flaws in several candidate algorithms from public cryptographic standardization competitions, compressing the runtime of some theoretical attacks to seconds and setting new records in public challenges.

    Looked at together, the significance of these two events is not that “AI has replaced mathematicians,” but that the way research work is divided is changing: humans propose conjectures, construct proof strategies, and define problem boundaries, while models handle exhaustive search, pattern recognition, and formalization across enormous search spaces. This article follows the order of “what happened — why it works — how to build it in engineering — where the boundaries are.”

    1. The Technical Core of the Two Advances

    Formal proofs: turning “I am confident” into “machine-verifiable”

    The Riemann Hypothesis was proposed by Riemann in 1859 and describes the distribution of prime numbers. In 2000 it was listed as one of the seven Millennium Prize Problems, with a one-million-dollar award. The difficulty of such problems lies not in the amount of computation but in the rigor of the proof chain — any implicit assumption can bring the whole thing down.

    A key feature of the recently announced approach is that the proof was not delivered only as a natural-language paper: it also came with roughly 17 million lines of formal proof code, after which the relevant formal proof community issued a joint statement confirming that verification had passed. Here “verification” does not mean peer reading; it means a proof assistant checks each inference rule against a very small trusted kernel, and any illegitimate step cannot pass.

    The basic operation of a formal proof can be illustrated schematically as follows:

    1. theorem riemann_hypothesis_generalized :
    2. ∀ (χ : DirichletChar), NontrivialZero χ → Re (s) = 1/2 := by
    3. -- Derived step by step from several formalized lemmas
    4. exact proof_of_generalized_case χ

    The scale in real projects far exceeds this example. The main costs concentrate on three things: formalizing existing conclusions from the mathematical literature into a public library, filling in intermediate lemmas, and aligning types and structures. A volume of 17 million lines shows that the vast majority of the work is actually “infrastructure” rather than “inspiration.”

    Cryptanalysis: finding executable weaknesses in mathematical structures

    The reliability of a cryptographic algorithm depends on computational hardness assumptions. The goal of cryptanalysis is not to “guess the key” but to study the algorithm’s algebraic structure, differential and linear propagation properties, and the invertibility of round functions, looking for a path faster than brute-force enumeration.

    The recently announced results covered candidate algorithms from several rounds of a standardization body’s competitions, as well as schemes from recent international conferences and journals. Two conclusions are worth noting:

    • Collision attacks were constructed against two hash candidate algorithms, with runtimes of 0.045 seconds and on the order of 0.36 to 2.3 seconds in a single-core environment;
    • In several algorithms that previously had no known practical attack, design flaws were identified, advancing attacks that had remained theoretical to an executable state.

    A collision attack means finding two different inputs that produce the same hash value. Its engineering implication is direct: any scenario that relies on hash uniqueness (digital signatures, content addressing, commitment schemes, version verification) loses reliability.

    2. Why Large Models Are Effective on These Two Task Types

    The two task types appear unrelated, but their underlying capability requirements overlap heavily:

    1. Long-chain symbolic reasoning. Both proof construction and attack construction require maintaining consistency over dozens to thousands of steps, and the model’s value lies in reducing the cost of writing and trial-and-error for intermediate steps.
    2. Large-scale pattern search. Finding differential paths or usable lemma combinations is essentially heuristic search in a combinatorial space, and the model provides a smarter prior than random enumeration.
    3. Verifiability. This is the most critical point. Formal proofs have proof assistants as a backstop, and cryptanalysis has public challenges and reproducible code as a backstop. Whether a result is right or wrong does not depend on the model’s own account but on an external judge.

    In other words, the areas where AI4S has genuinely gotten through almost all share the feature that “the answer can be automatically judged by a machine.” This determines the priority for adoption: invest first in scenarios with an objective verifier, rather than starting from subjective-evaluation tasks.

    3. How Enterprises Can Build Usable Research Assistance Capabilities

    For most teams, the goal is not to reproduce a century-old problem but to plug the “model + verifier” paradigm into their own R&D process. This can be advanced in four steps.

    Step one, choose the scenario. Prioritize tasks whose results can be judged automatically: configuration consistency checks, protocol state machine verification, scheduling policy optimization, defect sample clustering, and test case generation.

    Step two, build the verification layer. The verifier must exist before the model, otherwise it is impossible to distinguish correct output from output that merely looks reasonable.

    1. def verify(candidate, spec) -> bool:
    2. # 1) Structural check: whether fields, types, and dependencies are closed
    3. if not schema_ok(candidate, spec):
    4. return False
    5. # 2) Semantic check: invoke a formal engine or a specialized solver
    6. return solver.check(candidate, spec)

    Step three, add retrieval and knowledge injection. Turn internal specifications, historical defect libraries, and domain documents into a searchable knowledge layer so that the model cites real clauses during generation instead of filling gaps from memory.

    Step four, handle engineering. These tasks are typically batch, long-running, and bursty, requiring elastic compute and queue decoupling; intermediate artifacts and proof or attack code are large in volume and suit object storage; the whole process needs logging services and monitoring alerts to track the input, runtime, and verdict of each attempt. When using public cloud resources, a container platform handles elastic scaling and a message queue handles peak shaving, which is a fairly general combination.

    4. Boundaries and Risks That Must Be Faced

    First, verifiable does not mean understandable. Machine confirmation does not mean humans have grasped the proof intuition, and subsequent maintenance and generalization still depend on experts.

    Second, cryptographic conclusions are time-sensitive. Algorithms identified as having structural flaws should be removed from new system selections immediately; deployed systems need to assess migration costs and retain a switchable algorithm abstraction layer to avoid hard-coding a specific algorithm into the business.

    1. # Pseudocode: pluggable algorithm
    2. hash = registry.get(cfg.hash_id) # Switch via configuration, not hard-coded
    3. digest = hash(data)

    Third, supply chain and compliance risks. When introducing external models and automatically generated code, provenance, versions, and review records need to be retained, with human review kept on critical paths.

    Fourth, expectation management. These results are currently highly concentrated in mathematical and cryptographic subfields with strong verifiers and cannot be directly extrapolated to open-ended research.

    5. Conclusion

    The substantive change from AI participating in frontier research is that the cost between “proposing an idea” and “verifying an idea” has been greatly reduced. For developers, the reusable methodology is a single sentence: build the verifier first, then connect the model, and finally handle engineering. Whoever can set up a closed loop with automatic judgment can achieve a similar magnitude of efficiency gain in their own field.