Skip to content

Reconstruct ARITH_SUM_UB when every premise is an equality - #1

Open
tannerduve wants to merge 1 commit into
verse-lab:mainfrom
tannerduve:fix-sum-ub-equalities
Open

tannerduve wants to merge 1 commit into
verse-lab:mainfrom
tannerduve:fix-sum-ub-equalities

Conversation

@tannerduve

Copy link
Copy Markdown

reconstructSumUB folds the premises of cvc5's ARITH_SUM_UB with sum_ub₁…sum_ub₉. When every premise is an equality, the fold ends with a proof of ls = rs (sum_ub₉), but cvc5's conclusion is ls ≤ rs, and the proof is registered under the ≤ type with addThm. The elaborator accepts this, and the kernel rejects the step that uses it:

(kernel) application type mismatch
  Smt.Reconstruct.Prop.eqResolve (Smt.Reconstruct.Int.sum_ub₉ …)
argument has type  … = …
but function has type  … ≤ … → (… ≤ …) = False → False

Minimal reproduction (Test/Int/SumUbEq.lean):

example (x y : Int) (h₁ : x + -1 * y = 0) (h₂ : -1 * x + y = -1) : False := by
  smt [h₁, h₂]

Fix: when the fold ends with ks == .EQUAL, convert with a new lemma sum_ub_le_of_eq : a = b → a ≤ b, in each of Int, Rat and Real, beside sum_ub₉. It's a separate lemma because Rat's lemmas have no generic le_of_eq in scope, and the name keeps clear of core and Mathlib.

@tannerduve tannerduve closed this Sep 24, 2026
@tannerduve tannerduve reopened this Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant