coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Rui Baptista <rpgcbaptista AT gmail.com>
- To: t x <txrev319 AT gmail.com>
- Cc: coq-club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Defining binlen (log)
- Date: Mon, 30 Sep 2013 23:52:21 +0100
The Function command automatically proves a theorem about the equation of the function. Check out bin_len_equation.
Require Import Recdef.
Function bin_len (n: nat) {measure id n} :=
match n with
| 0 => 1
| 1 => 1
| n => 1 + bin_len (div2 n)
end.
Proof. unfold id. intros. subst. apply lem__div2_decr. omega. Qed.
Check bin_len_equation.
On Fri, Sep 27, 2013 at 5:16 PM, t x <txrev319 AT gmail.com> wrote:
Thanks!end.| n => 1 + bin_len (div2 x)match x withIdeally, I wantThus, my question -- is there a way where I can spend a bit more work in my definition of bin_len so that when I need to prove things about it, it's nicer?expands to the nastiness shown in the url).Unfortunately, I find it very very hard to reason with (in particular,"binlen 0 <= binlen 1"
unfold bin_len in "bin_len x" ==>
| 0 => 1
| 1 => 1
- Re: [Coq-Club] Defining binlen (log), Rui Baptista, 10/01/2013
Archive powered by MHonArc 2.6.18.