Zulip Chat Archive

Stream: new members

Topic: unfold definition in goal?


Chris M (Jul 22 2020 at 04:06):

I have the following goal state:

1 goal
fg:   
ab: 
hfa: fn_lb f a
hgb: fn_lb g b
 fn_lb (λ (x : ), f x + g x) (a + b)

Is there a tactic for unfolding the definition offn_lb in this goal state?

Chris M (Jul 22 2020 at 04:08):

Neither simp nor dsimp work.

Jalex Stark (Jul 22 2020 at 04:11):

unfold or dunfold or delta?

Chris M (Jul 22 2020 at 04:12):

None of those do anything

Jalex Stark (Jul 22 2020 at 04:15):

can you post a #mwe?

Chris M (Jul 22 2020 at 04:16):

import data.real.basic
import tactic

example (hfa : fn_lb f a) (hgb : fn_lb g b) :
  fn_lb (λ x, f x + g x) (a + b) :=
begin
  dunfold,
end

Jalex Stark (Jul 22 2020 at 04:16):

dunfold fn_lb

Jalex Stark (Jul 22 2020 at 04:17):

you wouldn't want a tactic that says "unfold every definition you see and then show me the result"

Chris M (Jul 22 2020 at 04:17):

right

Chris M (Jul 22 2020 at 04:17):

So this unfolds the definition in the conclusion, but not in the assumptions. how do I unfold the assumptinos?

Jalex Stark (Jul 22 2020 at 04:18):

dunfold fn_lb at hfa or dunfold fn_lb at *

Chris M (Jul 22 2020 at 04:18):

great :)

Jalex Stark (Jul 22 2020 at 04:18):

all of this should be in the docs, see e.g. tactic#unfold

Chris M (Jul 22 2020 at 04:19):

Ok thanks, I'll look there next time


Last updated: Dec 20 2023 at 11:08 UTC