Zulip Chat Archive

Stream: new members

Topic: Rewrite only one part of expression


Winston Yin (Jun 07 2021 at 14:05):

If I start with the hypotheses h1 : f x = g x and h2 : x = y, what can I do to rewrite this hypothesis into f x = g y, where h2 is applied to only one side of the equation?

Winston Yin (Jun 07 2021 at 14:06):

Would I have to prove a new hypothesis g x = g y and use this to prove f x = g y?

Eric Rodriguez (Jun 07 2021 at 14:11):

tactic#nth_rewrite

Adam Topaz (Jun 07 2021 at 14:12):

Or you can use conv_rhs

Adam Topaz (Jun 07 2021 at 14:13):

Or equivalently conv { to_rhs, ... }

Adam Topaz (Jun 07 2021 at 14:13):

It's good to know multiple ways to do something, in case you need more flexibility in the future. In this case I would indeed use nth_rewrite

Winston Yin (Jun 07 2021 at 14:14):

Exactly what I need. Thanks!

Ruben Van de Velde (Jun 07 2021 at 14:20):

Or

have h3 : f x = g y,
{ rw [h1, h2] },

Last updated: Dec 20 2023 at 11:08 UTC