coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Paul Tarau <paul.tarau AT gmail.com>
- To: Guillaume Brunerie <guillaume.brunerie AT gmail.com>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] applying a function definition
- Date: Sat, 28 May 2011 12:14:41 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=Mm9PnAp9nCoPUw+TAK4CMjLRRnCq703C2ayXzN+nON9jEhozgM+qsUchPQy05e1cWr B+6smY5VHjTUF5+B4YA7NmyEqI/HG0lolMFF9R64nnCemb8a6XkkvYXKH9+X+vRpl2H2 +dqCeRBKt/idogFY3X0J33bJLgGLWNs5Y4ojo=
Thanks - that explains the magic indeed! After adding a matching successor function and showing that sx <> e, I have: Inductive B : Set := | e : B | o : B -> B | i : B -> B. Delimit Scope b_scope with B. Bind Scope b_scope with B. Arguments Scope o [b_scope]. Arguments Scope i [b_scope]. Fixpoint p (x : B) : B := match x with | e => e (* this should rather be undefined or an exception *) | o e => e | o a => i (p a) | i a => o a end. Fixpoint s (x : B) : B := match x with | e => o e | o a => i a | i a => o (s a) end. Lemma po_ip : forall n:B, n<>e -> p (o n) = i (p n). Proof. intros n H. simpl. case_eq n; firstorder. Qed. Lemma s_discr : forall x:B, x <> s x. Proof. destruct x; discriminate. Qed. Lemma pos_ips : forall x:B, p (o (s x)) = i (p (s x)). Proof. intros. case_eq x;firstorder. Qed. Lemma psi_os : forall n:B, p (s (i n)) = p (o (s n)). Proof. intro n; auto. Qed. Eval compute in p (p (s (s e))). Lemma sp_inv : forall n:B, p (s n) = n. Proof. intros. case_eq n;firstorder. Show. (* which gives: n : B b : B H : n = i b ============================ p (s (i b)) = i b I would like Coq to reason along the following equations: p (s (i b)) = p (o (s b)) = i (p (s b)) = i b where I want to use, as an inductive hypothesis, that p (s b) = b holds. I tried "apply psi_os" (that I just proved) but it seems to want both sides of an equation - is there any way to make it just rewrite p (s (i b)) as p (o (s b)) according to Lemma psi_os? > apply psi_os. > ^^^^^^ Error: Impossible to unify "p (s (i ?55)) = p (o (s ?55))" with "p (s (i b)) = i b". Paul *) On May 28, 2011, at 10:52 AM, Guillaume Brunerie wrote: 2011/5/28 Paul Tarau <paul.tarau AT gmail.com> |
- [Coq-Club] applying a function definition, paul . tarau
- Re: [Coq-Club] applying a function definition,
Guillaume Brunerie
- Re: [Coq-Club] applying a function definition,
Paul Tarau
- Re: [Coq-Club] applying a function definition,
Guillaume Brunerie
- Re: [Coq-Club] applying a function definition, Paul Tarau
- Re: [Coq-Club] applying a function definition,
Guillaume Brunerie
- Re: [Coq-Club] applying a function definition, Paul Tarau
- Re: [Coq-Club] applying a function definition,
Guillaume Brunerie
- Re: [Coq-Club] applying a function definition, Paul Tarau
- Re: [Coq-Club] applying a function definition,
Guillaume Brunerie
- Re: [Coq-Club] applying a function definition,
Paul Tarau
- Re: [Coq-Club] applying a function definition,
Guillaume Brunerie
Archive powered by MhonArc 2.6.16.