News

日本語 · English · 中文

blueqat poqet enables formal verification of QUBO correctness in Lean 4, proving answer optimality and penalty weights

With blueqat poqet, you can now formally verify QUBOs that represent optimization problems using Lean 4 (Mathlib). By simply asking in a conversation, it checks the answer's energy, confirms it is the global minimum, verifies penalty weights and constraints, and ensures consistency between the formulation expressions and coefficients—all within the Lean kernel—and returns checkmarks/crosses along with .lean files.

With blueqat poqet, you can now use the theorem prover Lean 4 (Mathlib) to formally verify the correctness of QUBOs (quadratic expressions of binary variables) that represent optimization problems. When you ask in conversation, “Verify this QUBO with Lean,” poqet constructs a Lean proof from the QUBO, and Lean verifies it.

Four things to formally verify and confirm QUBOs with Lean 4
Four things to formally verify and confirm QUBOs with Lean 4

Why prove QUBOs?

QUBOs are the common form for solving combinatorial optimization problems using quantum algorithms such as quantum annealing and QAOA. Constraints are added to the equation as penalties for violation; however, if the penalty weights are too small, solutions violating constraints become more favorable, and if they are too large, the original objective gets obscured. Errors in transcription or weight selection are hard to detect just by looking at the answer, and may only be discovered after solving with a quantum computer or classical solver.

Therefore, separate from finding the answer, we enabled verification of whether “this answer is truly the minimum of this expression” and “constraints are always satisfied with these weights” as mathematical proofs. We use Lean 4 to check mathematical theorems on computers, along with its mathematics library Mathlib. Proofs accepted by Lean have been verified step-by-step by Lean’s type checker.

What is being verified?

We verify the following four items:

  1. The energy value of the answer (strictly as fractions, without rounding to decimals)
  2. That the answer is the global minimum (for small problems, Lean enumerates and checks all combinations)
  3. Correctness of constraint penalties. If penalty weights are sufficient, the minimum answer must satisfy the constraints
  4. Consistency between the formulation equation and the QUBO coefficients

For example, in a problem assigning three jobs to three people, Lean proved six assertions—including optimality and consistency—in 6.4 seconds.

Example: 3-variable QUBO

In the QUBO $Q = [[-1, 0.5, 0], [0, -0.75, 2], [0, 0, 1]]$, the energy for $x = 110$ ($x_1 = 1, x_2 = 1, x_3 = 0$) is $-1 - 0.75 + 0.5 = -5/4$. Since there are only eight possible combinations for three variables, Lean verifies that the energy is $\ge -5/4$ for all eight cases, proving that $x = 110$ is the global minimum.

In an assignment example (costs $[[4,1,3],[2,0,5],[3,2,2]]$), the minimum cost is 5 when job 2 is assigned to person 1, job 1 to person 2, and job 3 to person 3. In the QUBO, penalties are added for the constraints “one job per person” and “one person per job.” If penalty weights are sufficient, Lean also proves that the minimum answer must satisfy these constraints.

Returning errors and failures as-is

If an assertion is incorrect, Lean proves the error and returns ✗ along with the reason. For properties that could not be proven due to problem size, we return “—” with the reason, rather than claiming they were proven.

All proofs are verified using Lean’s type checker (kernel); we do not use shortcuts like native_decide, which compiles and executes calculations and trusts the results. Outputs include formal verification marks ✓/✗ and the proof’s .lean file. You can re-verify the same proof locally using Lean.

Benefits

  • Detection of formulation errors: More issues arise in formulation than in the solving tools themselves. These include penalties being too weak, coefficient transcription errors, or inverted signs. Even with incorrect equations, solvers often return plausible-looking “optimal solutions,” making errors hard to spot. Lean shows that the equation matches the QUBO for all 0/1 combinations and that penalty weights are sufficient, catching these errors.
  • Verification without trusting the solver: You can mathematically verify answers and claims returned by quantum services or external optimization solvers on your own end.
  • Persistent evidence: .lean files produce identical results regardless of who re-verifies them or when. They can be attached to records as justification for decisions.
  • Guardian over formulated definitions: When constructing formulations via conversation, you can verify their correctness through proofs.

Enterprise use case examples

  • Shift/Scheduling: Prove that constraints like “one slot per person per day” are satisfied in the answer, and use this for explanations.
  • Delivery/Assignment/Portfolio (selecting K stocks): Verify that conditions and penalty weights are correct, show optimality for small problems, and attach these to operational decision records.
  • Acceptance of quantum proof-of-concept experiments: Verify received results internally before acceptance.
  • Testing internal QUBO generation programs: Check consistency between equations and QUBOs each time the program is updated.

Research use case examples

  • Provide proofs of optimal values for benchmark problems to prevent errors in ground truth.
  • Attach .lean files demonstrating formulation and optimal value correctness to papers to enhance reproducibility.
  • Demonstrate validity of penalty weight conditions and transformations such as Max-Cut to Ising models.
  • In education, allow hands-on verification that “objective + penalty = QUBO” holds.

Limitations

  • Solving speed remains unchanged: This feature verifies answers and formulations; it does not make solvers faster.
  • Enumerating all combinations to prove optimality is limited to small problems (dozens of variables): Combinations double with each additional variable. For large problems, this property is marked as “—” with the reason. Another method for proving optimality in large problems (using certificates) has become available for assignment-type problems (follow-up report).
  • Does not verify what happens inside the quantum computer: It verifies whether the returned answer and formulation are correct. It applies equally to answers from quantum computers and classical solvers.
  • Human judgment remains for real-world alignment: The proof covers “claims about the provided QUBO equation.” Whether replacing a real-world problem with a QUBO aligns with the actual objective requires human judgment alongside equation consistency checks.

This feature is available on any plan when logged in.

Examples of how to request

  • “Prove with Lean whether x = 110 is optimal for the QUBO Q = [[-1, 0.5, 0], [0, -0.75, 2], [0, 0, 1]]”
  • “Solve the problem of assigning three jobs to three people (costs [[4,1,3],[2,0,5],[3,2,2]]) and verify with Lean whether the answer is optimal”
  • “Verify with Lean whether the minimum always involves exactly two stocks for this portfolio’s QUBO (penalty weight A = 0.05)”

blueqat poqet is available from blueqat.app.

This article was translated from the Japanese original. 日本語で読む

← Latest articles