Error Reference › Lean 4
Lean 4

omega could not prove the goal (Lean 4)

The omega decision procedure (linear arithmetic over ℤ and ℕ) found that the goal does not follow from the facts it could understand.

What it looks like

Main.lean:2:2: error: omega could not prove the goal:
a possible counterexample may satisfy the constraints
  b - a ≥ 1
  a ≥ 0
  b ≥ 0
where
 a := x
 b := y

What does "omega could not prove the goal (Lean 4)" mean?

omega is built into Lean. It decides linear arithmetic over Int and Nat — +, -, multiplication by constants, / and % by constants — and splits ℕ subtraction into cases. When it fails it prints a possible counterexample in terms of atoms a, b, … and lists what each atom stands for. If it found no usable facts at all, it says No usable constraints found and suggests unfolding definitions.

What causes "omega could not prove the goal (Lean 4)"?

  • The goal or a hypothesis is non-linear (x * y, x ^ 2) or about real numbers — omega only handles Int and Nat.
  • A needed fact is hidden inside a definition omega does not unfold.
  • The statement is false for some values — often because ℕ subtraction stops at 0.

How do I confirm the cause?

  1. Plug the counterexample into your statement — if the goal really fails there, the theorem needs another hypothesis.
  2. Check the where list: an atom standing for a whole expression (like x * y or f n) means omega treated it as an unknown number.

How do I fix "omega could not prove the goal (Lean 4)"?

  • Read the counterexample in the message: it describes values where your goal fails, given what omega could see.
  • Add the missing fact with have, or unfold definitions first (simp only [f] or unfold f).
  • For non-linear or real-number goals use nlinarith, linarith or positivity (Mathlib).
  • If the counterexample is genuine, fix the statement — e.g. add h : y ≤ x before using x - y.

How do I stop it happening again?

  • Use omega for ℕ and ℤ bookkeeping (indices, lengths, bounds) and linarith or nlinarith for ordered fields.
  • State side conditions such as h : y ≤ x explicitly before subtracting natural numbers.
Got a different error? Paste it into the Explain This Error tool → Identifies the family and the fix — runs locally, nothing uploaded.

Related errors