coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Kevin Sullivan <sullivan.kevinj AT gmail.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: [Coq-Club] Easy question re: pattern matching
- Date: Tue, 12 Sep 2017 16:16:09 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=sullivan.kevinj AT gmail.com; spf=Pass smtp.mailfrom=sullivan.kevinj AT gmail.com; spf=None smtp.helo=postmaster AT mail-wr0-f175.google.com
- Ironport-phdr: 9a23:VQ4f7BSjCIGTNNZTZ5abqvVmqtpsv+yvbD5Q0YIujvd0So/mwa67bBGN2/xhgRfzUJnB7Loc0qyN7PCmBDRIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnZBUin4YEB+If2wEYrPhey20fqz8tvdeU8A0DG6ePZ5KAi8hQTXrMgfx4V4fPUf0BzM91hFZeVQjVh1IVaSgR/6rpOr4Zpn8jpZvbQi+tBBV6fScKExTLgeBzMjZTNmrPb3vAXOGFPcrkAXVX8bx0JF
In the following code, valid_bp is a dependent pair whose first element is a non-dependent pair and whose second element is a proof that that (non-dependent) pair has a certain property. I want to write swap, taking such a dependent pair and returning a dependent but in which the given non-dependent pair is swapped. I'm trying to use refine. I match on the structure of the given dependent pair, extracting the non-dependent pair, (x, y), and the proof, pfxy, that it has the given property. The problem I'm having is that in the resulting context, pfxy asserts that the given property pertains to some arbitrarily introduced pair, d, not to the specific pair, x, y; and without the assumption that (x,y) itself satisfies the property, I can't make the proof go through. What am I missing?
Definition swap_basepair (p: valid_bp): valid_bp.
Proof.
refine (
match p return valid_bp with
| exist _ (x,y) pfxy => exist _ (y,x) _
end).
- [Coq-Club] Easy question re: pattern matching, Kevin Sullivan, 09/12/2017
- Re: [Coq-Club] Easy question re: pattern matching, Gaëtan Gilbert, 09/12/2017
- Re: [Coq-Club] Easy question re: pattern matching, Valentin Robert, 09/12/2017
- Re: [Coq-Club] Easy question re: pattern matching, Gaëtan Gilbert, 09/12/2017
Archive powered by MHonArc 2.6.18.