You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The equation compiler gives error "dependent match elimination failed" when I expect the match to succeed
Context
inductive MyOrder : Nat × Nat × Nat → Nat × Nat × Nat → Prop
| twice {x y n u v m : Nat} : m + 2 ≤ n → MyOrder (x, y, n) (u, v, m)
| within {x y u v m : Nat} : x ≤ u → y ≤ v → MyOrder (x, y, m) (u, v, m)
| next_min {x y u v m : Nat} : min x y + 1 ≤ min u v → MyOrder (x, y, m + 1) (u, v, m)
theorem antisymmetric : ∀ {x y : Nat × Nat × Nat}, MyOrder x y → MyOrder y x → x = y
| _, _, .twice _, .twice _ => _
| _, _, .twice _, .within _ _ => _
| _, _, .twice _, .next_min _ => _
| _, _, .within _ _, .twice _ => _
| _, _, .within _ _, .within _ _ => _
| _, _, .next_min _, .twice _ => _
Steps to Reproduce
Code as above
Expected behavior: Code gives errors on the six right-hand-sides to fill in the six proofs.
Actual behavior: The line | _, _, .twice _, .within _ _ => _ gives confusing error
dependent match elimination failed, inaccessible pattern found
.(n✝)
constructor expected
This was by trial-and-error. (I also tried to write the complete patterns with all the necessary inaccessible patterns manually, but I didn't succeed.)
inductive Pred : Nat → Nat → Type
| here : Pred n.succ n
| there : Pred n m → Pred n.succ m.succ
inductive HasPred n
| mk (p : Pred n m)
def fails : HasPred (.succ n) → Unit
| .mk .here => ()
| .mk (.there _) => ()
def works : HasPred (.succ n) → Unit
| .mk .here => ()
| .mk (m := _) (.there _) => ()
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
The equation compiler gives error "dependent match elimination failed" when I expect the match to succeed
Context
Steps to Reproduce
Expected behavior: Code gives errors on the six right-hand-sides to fill in the six proofs.
Actual behavior: The line
| _, _, .twice _, .within _ _ => _
gives confusing errorVersions
Lean 4.15.0-rc1
Target: x86_64-unknown-linux-gnu
Using live.lean-lang.org on Lean nightly.
Additional Information
Discussion here: https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/dependent.20match.20elimination.20failed
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: