Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PANIC at Lean.Meta.whnfEasyCases Lean.Meta.WHNF:305:22: unreachable code has been reached #1842

Closed
1 task done
semorrison opened this issue Nov 16, 2022 · 0 comments
Closed
1 task done

Comments

@semorrison
Copy link
Collaborator

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Checked that your issue isn't already filed.
    • Reduced the issue to a self-contained, reproducible test case.

Description

PANIC at Lean.Meta.whnfEasyCases Lean.Meta.WHNF:305:22: unreachable code has been reached

Steps to Reproduce

variable (R : α → α → Prop)

inductive List.Pairwise : List α → Prop
  | nil : Pairwise []
  | cons : ∀ {a : α} {l : List α}, (∀ {a} (_ : a' ∈ l), R a a') → Pairwise l → Pairwise (a :: l)

theorem and_assoc : (a ∧ b) ∧ c ↔ a ∧ (b ∧ c) :=
  ⟨fun ⟨⟨ha, hb⟩, hc⟩ => ⟨ha, hb, hc⟩, fun ⟨ha, hb, hc⟩ => ⟨⟨ha, hb⟩, hc⟩⟩

theorem and_left_comm : a ∧ (b ∧ c) ↔ b ∧ (a ∧ c) := by
  rw [← and_assoc, ← and_assoc, @And.comm a b]
  exact Iff.rfl

theorem pairwise_append {l₁ l₂ : List α} :
    (l₁ ++ l₂).Pairwise R ↔ l₁.Pairwise R ∧ l₂.Pairwise R ∧ ∀ {a} (_ : a ∈ l₁), ∀ {b} (_ : b ∈ l₂), R a b := by
  induction l₁ <;> simp [*, and_left_comm]

Expected behavior: [What you expect to happen]

Failure with unsolved goals. (I can restore a proper proof if that is better for a test case.)

Actual behavior: [What actually happens]

PANIC at Lean.Meta.whnfEasyCases Lean.Meta.WHNF:305:22: unreachable code has been reached

Versions

Lean (version 4.0.0-nightly-2022-11-16, commit 98922b8, Release)

Additional Information

This is getting in the way of bumping Std4 (and then mathlib4).

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

No branches or pull requests

1 participant