Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Binding variables within nested matches

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Binding variables within nested matches


chronological Thread 
  • From: Ben Moseley <ben_moseley AT mac.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: [Coq-Club] Binding variables within nested matches
  • Date: Thu, 25 Nov 2010 19:36:31 +0000

Hi,

I am somewhat puzzled by some behaviour with binding variables within nested 
matches.

I am working with: Coq 8.2pl1 (November 2010)

If I define a basic type and term...

Unset Printing Matching.
Inductive MyType : Set := | Left | Right.
Definition term (t : option MyType) : bool :=
  match t with
    | Some x => (match x with
                   | Left  => true
                   | Right => true
                 end)
    | None => true
  end.

...and then try to prove the following...

Theorem termTrue : forall t, term t = true.
  intro t; unfold term;
  match goal with | [ |- context [match ?d with
                                    | Some _ => (match ?y with
                                                   | Left  => true
                                                   | Right => true
                                                 end)
                                    | None => true
                                  end] ] => destruct d; [|reflexivity]
  end.
  destruct m; reflexivity.
Qed.

... then the match fails.

If instead I replace the '?y' with '_', then it succeeds.

Is there some reason why I can't bind both '?d' and '?y' ?

--Ben



Archive powered by MhonArc 2.6.16.

Top of Page