leanprover / lean4

Lean 4 programming language and theorem prover

Home Page:https://lean-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Omega builds illegal proof term containing pos_pow_of_pos

bollu opened this issue · comments

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Consider the MWE (lean playground link here):

/-
application type mismatch
  Int.pos_pow_of_pos
argument has type
  Int
but function has type
  ∀ {n : Nat} (m : Nat), 0 < n → 0 < n ^ m
-/
theorem omega_fail
  (n : Nat)
  (i : Int)
  (h2n : (2 : Int) ^ n = ↑((2 : Nat) ^ (n : Nat)))
  (hlt : i % 2 ^ n < 2 ^ n) :  2 ^ n ≠ 0 :=
  by omega /- No goals -/

Omega builds an incorrect proof term for this goal state.

Context

Occurred when proving bitblasting theorems.

Steps to Reproduce

Expected behavior: Omega should succeed without an illegal proof.

Actual behavior: Omega builds an illegal proof term.

Versions

Live lean version: "4.9.0-nightly-2024-05-11"

Additional Information

[Additional information, configuration or data that might be necessary to reproduce the issue]

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Thanks! Fixed in #4141.