coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Vincent Archambault-Bouffard <archambault.v AT gmail.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Help with a proof
- Date: Thu, 16 Jun 2016 01:02:38 -0400
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=archambault.v AT gmail.com; spf=Pass smtp.mailfrom=archambault.v AT gmail.com; spf=None smtp.helo=postmaster AT mail-it0-f54.google.com
- Ironport-phdr: 9a23:L+fwvx/ZlFS5R/9uRHKM819IXTAuvvDOBiVQ1KB91u8cTK2v8tzYMVDF4r011RmSDdSdu60P27uempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lS8iC0I/nhqibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V0/MlZFK7+Yq4QTLpCDT1gPXpmytfssEz9TA2E630AGkwMmRpBBgLM8RXmG732ryX0v/BxkH2TJ8b2RLU+UCmm8+F1YBDtgSYDcTU+9TeE2YRLkKtHrUf59FREyInObdTNOQ==
Hello,
I am relatively new to Coq and I have a hard time proving something that is true by definition.
Here is a (simplified) working example :
Require Import Coq.Program.Wf.
Require Import Omega.
Inductive Foo : Set :=
| CFoo : Foo -> Foo
| CInt : nat -> Foo
.
(* This will serve as the measure to convince coq that compose terminates. *)
Fixpoint foo_size (s : Foo) : nat :=
match s with
| CFoo s' => 1 + foo_size s'
| CInt _ => 1
end.
Program Fixpoint compose (s1 s2 : Foo)
{measure (foo_size s1 + foo_size s2)} : Foo :=
match s1, s2 with
| CInt 0, _ => s2
| CInt (S n1), CInt n2 => CInt (S n1 + n2)
| CInt (S n1), CFoo s3 => compose (CInt n1) s3
| CFoo s, _ => CFoo (compose s s2)
end
.
Theorem ko : forall n1 s1,
compose (CInt (S n1)) (CFoo s1) = compose (CInt n1) s1.
Proof.
??????
This is true by definition (3rd pattern in the match in the definition of compose)
Yet I cannot convince Coq that it is true
I tried reflexivity, destruct n1, s1, induction. I just don’t know how to translate “by definition” in Coq. Usually reflexivity does the job but not this time.
Thank you for your help.
Vincent
- [Coq-Club] Help with a proof, Vincent Archambault-Bouffard, 06/16/2016
- Re: [Coq-Club] Help with a proof, Pierre Casteran, 06/16/2016
- Re: [Coq-Club] Help with a proof, Pierre Courtieu, 06/16/2016
- Re: [Coq-Club] Help with a proof, Pierre Casteran, 06/16/2016
- Re: [Coq-Club] Help with a proof, Pierre Courtieu, 06/16/2016
- Re: [Coq-Club] Help with a proof, Pierre Casteran, 06/16/2016
- Re: [Coq-Club] Help with a proof, Vincent Archambault-Bouffard, 06/16/2016
- Re: [Coq-Club] Help with a proof, Pierre Courtieu, 06/16/2016
- Re: [Coq-Club] Help with a proof, Pierre Casteran, 06/16/2016
Archive powered by MHonArc 2.6.18.