coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Ilmārs Cīrulis <ilmars.cirulis AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Fwd: [Coq-Club] Problems when writing function from proof to proof.
- Date: Tue, 2 Jul 2013 11:44:28 +0300
Apologies to Pierre Casteran for accidentally answering to his email.
---------- Forwarded message ----------
From: Ilmārs Cīrulis <ilmars.cirulis AT gmail.com>
Date: Tue, Jul 2, 2013 at 11:36 AM
Subject: Re: [Coq-Club] Problems when writing function from proof to proof.
To: Pierre Casteran <pierre.casteran AT labri.fr>
From: Ilmārs Cīrulis <ilmars.cirulis AT gmail.com>
Date: Tue, Jul 2, 2013 at 11:36 AM
Subject: Re: [Coq-Club] Problems when writing function from proof to proof.
To: Pierre Casteran <pierre.casteran AT labri.fr>
Here's example of what I want to make.
Function example has error that I want to fix:Theorem ttt (m n:nat) (p: m<=n): (pred m) <= n.Theorem _3_14: 3<=14. repeat constructor. Qed.
Proof. destruct m. assumption. simpl. apply le_S_n. inversion p; auto. Qed.
Eval simpl in (ttt 3 14 _3_14).
Fixpoint example (m n: nat) (p: m<=n): list nat :=
match m with
| O => nil
| S m' => cons m (example m' n (ttt m n p))
end.
In environment
example : forall m n : nat, m <= n -> list nat
m : nat
n : nat
p : m <= n
m' : nat
The term "ttt m n p" has type "pred m <= n" while it is expected to have type
"m' <= n".
On Mon, Jul 1, 2013 at 7:42 PM, Pierre Casteran <pierre.casteran AT labri.fr> wrote:
Hi,
I don't understand what you want exactly to get.
By Coq's typing rules, a proof of pred 3 <= 14 is ***already*** a proof of 2 <=14.Require Import Arith.
Theorem ttt (m n:nat) (p: m<=n): (pred m) <= n.
Proof.
destruct m. assumption. simpl. apply le_S_n. inversion p; auto.
Qed.
Example E1 : 3 <= 14.
auto with arith. Qed.
Check ttt _ _ E1 : 2 <= 14.
Pierre
Quoting Ilmārs Cīrulis <ilmars.cirulis AT gmail.com>:
I tried to make function (?) that's transforming proof of m<=n to proof of
(pred m)<=n.
My try was:
Theorem ttt (m n:nat) (p: m<=n): (pred m) <= n.
Proof.
destruct m. assumption. simpl. apply le_S_n. inversion p; auto.
Qed.
But it always gives proof of (pred m)<=n. For example, proof of 3<=14 is
transformed to (pred 3)<=14. I don't know how to simplify it to 2<=14
(using the same function).
Is it possible?
- [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/01/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Jason Gross, 07/01/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Pierre Casteran, 07/01/2013
- Message not available
- Fwd: [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/02/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Cedric Auger, 07/02/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/02/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/02/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Adam Chlipala, 07/02/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., AUGER Cédric, 07/03/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/03/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Kristopher Micinski, 07/11/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/02/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/02/2013
- Re: [Coq-Club] Problems when writing function from proof to proof., Cedric Auger, 07/02/2013
- Fwd: [Coq-Club] Problems when writing function from proof to proof., Ilmārs Cīrulis, 07/02/2013
- Message not available
Archive powered by MHonArc 2.6.18.