Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Is it possible to rewrite under binders?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Is it possible to rewrite under binders?


Chronological Thread 
  • From: Pierre-Yves Strub <pierre-yves AT strub.nu>
  • To: coq-club AT inria.fr, Hugo Carvalho <hugoccomp AT gmail.com>
  • Subject: Re: [Coq-Club] Is it possible to rewrite under binders?
  • Date: Wed, 27 Jan 2016 00:47:49 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=pierre-yves AT strub.nu; spf=Pass smtp.mailfrom=pierre-yves AT strub.nu; spf=None smtp.helo=postmaster AT mail-vk0-f54.google.com
  • Ironport-phdr: 9a23:oXUyERE4yawLXN8ivsWb951GYnF86YWxBRYc798ds5kLTJ75oMSwAkXT6L1XgUPTWs2DsrQf27WQ6/mrADNIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/niKbqotaKPE1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvdKMhCLdcET4OMmYv5cStuwOHBSuS6XxUeWwMjBNMAw+NuBHnUZD6uSz/rsJy3SCbOYv9SrViChq46KI+cB7lkj0Kcg8n/XqfsdBqkagT9AqgqgZlzsvFfoyOHOFiZL7XO9UHEzkSFv1NXjBMV9vvJ7AECPAMaL5V

You should also look at section 27.3.1 of the reference manual -
although it doesn't help for your unprovable goal.

Best,
-- Pierre-Yves.

2016-01-26 23:42 GMT+01:00 Emilio Jesús Gallego Arias
<e+coq-club AT x80.org>:
> Hi Hugo!
>
> Hugo Carvalho
> <hugoccomp AT gmail.com>
> writes:
>
>> This other goal doesn't look as provable:
>>
>> Example e2: (fun x => x + 1) = (fun x => S x).
>>
>> Doesn't seem like you can rewrite "x+1" into "S x" (since you can't
>> introduce "x" into the context, you can't refer to it in order to
>> instantiate an equality you'd use to rewrite)... Is this the case? Is this
>> goal unprovable without relying on axioms (functional extensionality does
>> the trick, of course)?
>
> Indeed, I think this goal is not probable in Coq, (beware that I'm not a
> type theorist).
>
> However, under certain restricted function spaces, "function
> extensionality" can be made to hold in Coq.
>
> For instance, if the domain of the function is finite (and decidable),
> then you can represent the function as a canonically ordered list and
> extensionality holds. This saved me from using the funext axiom in a
> few occasions.
>
> The best example I know is the finfun type provided by mathcomp:
>
> https://github.com/math-comp/math-comp/blob/master/mathcomp/ssreflect/finfun.v
>
> using this library, a (bounded) version of your lemma can be proven:
>
> 8<--------------------------------------------------------------------8<
> From mathcomp.ssreflect
> Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice fintype
> finfun.
>
> Example e2 n : [ffun x : 'I_n => x + 1] = [ffun x : 'I_n => S x].
> Proof. by apply/ffunP=> ?; rewrite !ffunE addn1. Qed.
> 8<--------------------------------------------------------------------8<
>
> [I'm afraid I don't know if there's a similar machinery in the standard
> library of Coq]
>
> For instance, this allows to carry environments as ffuns provided you
> add a bit of dependently typed syntax bounding the number of variables,
> etc...
>
> Best regards,
> Emilio



Archive powered by MHonArc 2.6.18.

Top of Page