Zulip Chat Archive

Stream: new members

Topic: unfold tactic fails


Patrick Johnson (Nov 11 2021 at 05:02):

Hello! This is my first post in Zulip chat. I'm just wondering why does unfold f not work in this example?

def f :     Prop
| 0 0 := true
| (n + 1) (m + 1) := f n m
| _ _ := false

lemma lem1 : ¬f 0 1 := begin
  -- unfold f,
  exact id,
end

Scott Morrison (Nov 11 2021 at 05:33):

You can see what the equation compiler came up with using #print prefix f.

Scott Morrison (Nov 11 2021 at 05:34):

If you add the case | 0 (n+1) := false it does a better job, and unfold f will work.

Scott Morrison (Nov 11 2021 at 05:35):

The equation compiler is very useful, but can't be "perfect".

Kyle Miller (Nov 11 2021 at 05:37):

Curiously rw f does something, splitting it into two goals.


Last updated: Dec 20 2023 at 11:08 UTC