Zulip Chat Archive

Stream: lean4

Topic: Dependent rewrite


James Gallicchio (Aug 15 2022 at 14:44):

Newbie question about rewriting functions with dependencies -- I know I should do an explicit generalization here, but I have no clue what generalization to do:

opaque map' (L : List τ) (f : (x : τ)  x  L  τ') : List τ'

example (L1 L2 : List τ) (hL : L2 = L1) (f : (x : τ)  x  L1  τ')
  : map' L1 f = map' L2 (fun x h => f x (hL.subst h))
  := by
  sorry

James Gallicchio (Aug 15 2022 at 14:45):

help would be sorely appreciated; I keep guessing what to generalize, and failing :joy:

James Gallicchio (Aug 15 2022 at 14:47):

wait a minute, casing on hL is enough

James Gallicchio (Aug 15 2022 at 14:48):

okay, new question: will eliminating on eq always work if it's between two variables? is the goal of doing explicit generalizations to make an equality be between two variables so you can eliminate on it?

James Gallicchio (Aug 15 2022 at 14:49):

this actually makes substantially more sense now. hm.

Reid Barton (Aug 15 2022 at 14:52):

Or even if just one side is a variable


Last updated: Dec 20 2023 at 11:08 UTC