solve_by_elim failure
Open
Nobody has claimed this yet.
bug
P-medium
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Prerequisites
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
The solve_by_elim tactic fails on test. It should work.
def injective (f: α → β): Prop := ∀ x y, f x = f y → x = y
def surjective (f: α → β): Prop := ∀ x, ∃ y, f y = x
def bijective (f: α → β): Prop := injective f ∧ surjective f
def prod (f: α → β) (g: γ → σ): α × γ → β × σ := fun (x, y) => (f x, g y)
theorem bijective_id: bijective (id: α → α) := sorry
theorem bijective_compose {f: α → β} {g: β → γ}
(h₁: bijective f) (h₂: bijective g): bijective (g ∘ f) := sorry
theorem bijective_product {f: α → β} {g: γ → σ} (h₁: bijective f) (h₂: bijective g):
bijective (prod f g) := sorry
theorem test {α β γ δ σ: Type}
(f₀: (α → β) → γ)
(f₁: (δ → β) → (α → β) × β)
(f₂: γ × β → σ)
(h₀: bijective f₀)
(h₁: bijective f₁)
(h₂: bijective f₂): bijective (f₂ ∘ prod f₀ id ∘ f₁) := by
solve_by_elim [bijective_compose, bijective_product, bijective_id]
Context
Discussed during office hours with @kim-em.
Versions
4.30.0
4.29.1
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the minimal test theorem with Lean 4 versions 4.30.0 and 4.29.1, focusing on the solve_by_elim invocation and the supplied bijectivity lemmas. Trace why solve_by_elim [bijective_compose, bijective_product, bijective_id] does not close the goal, then confirm that the original theorem succeeds without changing its intended statement.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100