Zulip Chat Archive

Stream: new members

Topic: Unfolding definitions with match


Ken Roe (Jul 24 2018 at 23:18):

I'm trying to prove the following:

def evv (x :  ) (y: ):=
    match x y with
    | 0 := tt
    | 1 := ff
    | _ := tt
    end

theorem test:  x (f:   ), f x=1  evv f x :=
begin
    intros, unfold evv, ...
end

At the point of the "...", I have the following state:

x : ,
f :   ,
a : f x = 1
 (evv._match_1 (f x))

How do I complete the theorem?

Ken Roe (Jul 24 2018 at 23:23):

I was using quotation, however, I would like to find a way to construct the expression without the quotation.

Kevin Buzzard (Jul 24 2018 at 23:25):

Your theorem is false so it's hard to complete.

Kevin Buzzard (Jul 24 2018 at 23:26):

theorem test:  x (f:   ), f x=1  evv f x :=
begin
    intros,
    unfold evv,
    rw a,
    simp only [evv._match_1],
    -- suffices to prove ff
    sorry
end

Kevin Buzzard (Jul 24 2018 at 23:27):

The arrow business is because you are talking about booleans as if they're propositions, so a coercion is happening.

Chris Hughes (Jul 24 2018 at 23:30):

It wasn't true so I changed it.

theorem test:  x (f:   ), f x=0  evv f x :=
begin
  intros,
  unfold evv,
  rw a,
  exact rfl,
end

Last updated: Dec 20 2023 at 11:08 UTC