AI-Assisted Formal Proofs: Engineering Practices and Limits

    This article examines three recent signals in the tech community—AI tools attempting formal proofs of mathematical conjectures, models running long-horizon interactive tasks, and tightening free-tier quotas—and argues they point to one engineering problem: stability depends on quota governance, state consistency, and result verifiability rather than impressive single outputs. It provides actionable practices, including layered verification with dependency audits, explicit state machines with checkpoints and rollback, and token-bucket rate limiting with fallback paths.

    Three recent items in the tech community look unrelated at first glance: an AI coding tool took part in the formalization of a mathematical conjecture and was then questioned; a similar tool was used to carry out interactive tasks in a game world for more than ten hours straight; and a platform began tightening its free usage quotas. Put together, they point to the same engineering proposition: when model capabilities are embedded in long-running processes with strong verification requirements, system stability no longer depends on how impressive a single output is, but on quota governance, state consistency, and result verifiability. This article breaks down these three types of problems from a neutral perspective and offers engineering practices you can apply directly.

    1. Abstracting the Signals: Three Symptoms, One Common Thread

    The first signal is formal proof. Having a model help decompose a mathematical conjecture into propositions that a machine can check one by one is consistent with current mainstream practice: natural-language proofs require peer review, while formal proofs are verified statement by statement by a kernel, which makes them more trustworthy. The controversy does not come from “whether a model can write a formal script,” but from “whether that script actually covers the original proposition, whether it cites lemmas that have not been proven, and whether it swaps definitions.” This tells us that the fluency of generation and the strictness of verification are two independent curves, and neither can vouch for the other.

    The second signal is long-horizon interaction. Running a model continuously for more than ten hours in an open environment is essentially a control problem with no stable termination condition: the environment is partially observable, the state space is huge, rewards are sparse, and errors accumulate over time. Evaluating it as a “one-off question answering” task will inevitably overestimate its reliability.

    The third signal is the tightening of free quotas. This is not a technical regression but a return of resource pricing to normal. The real implication for users is that call volume is no longer an exogenous variable and must be incorporated into the cost model and capacity planning.

    2. Formal Verification: Turning “Looks Right” into “Verifiable”

    The practical approach is layered validation, where failing any layer stops the process from moving to the next:

    1. L0 proposition alignment: natural-language statement -> formal goal, with definitions and quantifiers confirmed manually
    2. L1 dependency audit: list all cited lemmas, flag unproven items and assumptions
    3. L2 kernel check: verified statement by statement by the proof kernel; "roughly correct" is not accepted
    4. L3 coverage assessment: check whether only special cases, weakened conditions, or subsets were proven
    5. L4 regression hardening: integrate into continuous integration; any change triggers re-verification

    There are three key engineering constraints. First, definitions come first: quantifier order, boundaries, and degenerate cases must be locked before formalization; otherwise every later check rests on drifting semantics. Second, assumptions must be made explicit: any lemma that is “obviously true” must either be proven or recorded as an external assumption, with the confidence level of the overall conclusion lowered accordingly. Third, environment and artifacts must be separated: proof scripts, dependency lists, and verification logs should be kept as traceable artifacts, written to object storage and bound to version numbers, so they are easy to reproduce and audit. This way, even if the generated content is questioned, you can quickly determine whether the issue is semantic drift, a dependency gap, or a verification omission.

    3. Long-Horizon Tasks: Replace “Keep Running” with a State Machine

    More than ten hours of continuous execution exposes one core problem: a lack of recoverability. The recommended structure is to model the task as an explicit state machine and define entry and exit conditions for each state:

    1. # Skeleton of a long-horizon task with budget and rollback
    2. def run_task(env, policy, budget):
    3. state = env.reset()
    4. checkpoints = []
    5. for step in range(budget.max_steps):
    6. if budget.exhausted(step):
    7. return rollback(checkpoints, reason="budget")
    8. action = policy(state)
    9. nxt, done, info = env.step(action)
    10. if not info.get("valid", True): # invalid/out-of-bounds action
    11. state = rollback(checkpoints, reason="invalid")
    12. continue
    13. checkpoints.append(snapshot(state, action, nxt))
    14. state = nxt
    15. if done and info.get("goal_reached"):
    16. return state
    17. return rollback(checkpoints, reason="timeout")

    Three types of observability are needed alongside this: process metrics (number of steps, ratio of valid actions, number of rollbacks), outcome metrics (goal achievement rate, manual takeover rate), and resource metrics (cumulative call volume, cost per task). Wiring these three curves into a logging service and monitoring alerts is what lets you make grounded trade-offs such as “reduce frequency, degrade, or queue” when quotas tighten, rather than being interrupted passively. In addition, long-horizon tasks should support manual takeover points and idempotent replay by default, so that a single failure does not invalidate all progress.

    4. Quotas and Cost: Design as If Free Quotas Were a Finite Resource

    Once quotas tighten, system design should shift from “call as much as possible” to “allocate calls by value.” Reusable strategies include request tiering (separate pools for online interaction, offline batch processing, and deferrable tasks), result caching and semantic deduplication, failing fast instead of retrying indefinitely, and client-side token-bucket rate limiting to match server-side quotas.

    1. class TokenBucket:
    2. def __init__(self, rate, capacity):
    3. self.rate, self.capacity = rate, capacity
    4. self.tokens, self.last = capacity, now()
    5. def allow(self, need=1):
    6. self.refill()
    7. if self.tokens >= need:
    8. self.tokens -= need
    9. return True
    10. return False

    A fallback chain should also be established: prioritize predictable, lightweight capabilities and reserve high-cost capabilities for critical steps; when quota approaches a threshold, automatically switch to cached results or rule-based fallbacks to keep the main flow from breaking. Cost observability matters just as much—only by aggregating call volume by task and by stage can you identify where waste actually occurs.

    5. Conclusion

    Combining the three signals yields one conclusion: the stronger the capability, the more you need to confine uncertainty within engineering constraints. Formal proof scenarios call for layered verification and dependency audits; long-horizon scenarios call for state machines, checkpoints, and rollback; quota-fluctuation scenarios call for quota governance and fallback design. On platforms such as Baidu AI Cloud, these capabilities are typically assembled from general-purpose categories such as object storage, message queues, container platforms, logging services, and monitoring alerts, without relying on any single proprietary interface. Only when verification, recoverability, and cost are handled solidly can model output be reliably reused in production systems.