Zulip Chat Archive
Stream: lean4
Topic: eta expansion in dependent elimination
Matthew Ballard (Jun 03 2025 at 18:38):
This is a bit of a throw-away but for something like
abbrev Foo := ℕ
def SubFoo : Type := { f : Foo // f = 0 }
inductive Bar : ∀ (_ : Foo), Type
| A (f : SubFoo) : Bar f.val
example : (f : Foo) → Bar f → Bar f → True
| _, Bar.A f, Bar.A _ => trivial
/- dependent elimination failed, failed to solve equation
f✝¹.1 = f✝.1
at case Bar.A after processing
_, (Bar.A _), _ -/
would doing some eta expansion and continuing reasonable? Feel free to tell me this is a bad pattern and there is something else I should be doing.
Mario Carneiro (Jun 04 2025 at 14:40):
I think you can pattern match on f as well there to make it work
Kyle Miller (Jun 04 2025 at 14:54):
Yeah, that works:
example : (f : Foo) → Bar f → Bar f → True
| _, Bar.A ⟨f, _⟩, Bar.A _ => trivial
Matthew Ballard (Jun 04 2025 at 17:52):
Thanks. That helps.
Last updated: Dec 20 2025 at 21:32 UTC