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
classFoo (α : Type)
instance : Foo Nat where
@[elab_as_elim]defFoo.induction_no (P : ∀ (α : Type) [Foo α], Prop) (nat : P Nat) (α : Type) [ohno : Foo α] : P α := sorry@[elab_as_elim]defFoo.induction_ok (P : ∀ (α : Type) [Foo α], Prop) (nat : P Nat) (α : Type) (ohok : Foo α) : P α := sorryexample (α : Type) [Foo α] : α = Nat := by
induction α using Foo.induction_no with
| nat => rfl
example (α : Type) [Foo α] : α = Nat := by
induction α, ‹Foo α› using Foo.induction_ok with
| nat => rfl
Expected behavior: Both inductions should succeed
Actual behavior: The first one fails with "failed to infer implicit target ohno". It should be synthesizing the target via typeclass search, since it is in square brackets.
Versions
4.8.0-rc1
4.9.0-nightly-2024-05-21
Additional Information
[Additional information, configuration or data that might be necessary to reproduce the issue]
@eric-wieser or others: could you say more about the (positive) impact of fixing this bug? Has it come up more often than with the single theorem mentioned on Zulip?
I think probably it does only come up with the handful of theorems mentioned on Zulip, but only because it is rare to have an induction principle that inducts on a typeclass argument. Finiteness is precisely the case where this is most likely to happen.
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
induction
tactic does not handle instance-implicit arguments, as it treats them as regular implicits.Context
Zulip thread
Steps to Reproduce
Expected behavior: Both inductions should succeed
Actual behavior: The first one fails with "failed to infer implicit target ohno". It should be synthesizing the target via typeclass search, since it is in square brackets.
Versions
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.
The text was updated successfully, but these errors were encountered: