coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Joachim Breitner <mail AT joachim-breitner.de>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Existential variables or holes in Lemma types
- Date: Wed, 16 May 2018 12:25:18 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mail AT joachim-breitner.de; spf=Neutral smtp.mailfrom=mail AT joachim-breitner.de; spf=None smtp.helo=postmaster AT hermes.serverama.de
- Ironport-phdr: 9a23:zuemtB+9IWFSSf9uRHKM819IXTAuvvDOBiVQ1KB42ukcTK2v8tzYMVDF4r011RmVBd6ds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+55Pebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRhz1hikHKTA3/mPYisJsg6xcrx2svBN/z5LObYyPLvdyYqfQcNUHTmRBRMZRUClBD5u4YYsIFeUOIeZYr4j4p1ATsBa+HxejBOLzyj9OmHD2x7Ax3uMkEQ7c3QwgG8kDsHbTrNrvKKgSUeG1zKzRwTrYdfNZxzb96JTOch8/u/GAR69/ftTIxEQpCgjLgFKQqYn/MDOU0OQAq2mb7+x6VeKukWErsQ9xoiK3yscujYnGnJ4aylDF9SV82Yo6Pse4R1B6Yd64FptfqTuaO5FrTcw8RWxjpSU0yqUetJKmfiUHyY4ryhrFZ/CZboSF7AjvWPufLDp2gn9uZaixiAyo8Ue6z+3xTsm030hOripCitTMtm4C1wbW6seZUftx5Fyh1iiV1wDN9O5EO1o7la/BJJI737E/iIIfsUXFHiDohEX7lLKae0cl9+Sy7+nreKvqqoKSOoNulw3zPKojltS6AesiMwgOW2ab+f671L3m5UD5Ra9FjvwykqTCspDaIt4UqbK5Aw9U14Yv8g2wDy2439QZgXkHKkxKeAidg4f0JV7COOr4Auung1SwjDdrwOjLMaHmApXUN3TMjLPhfatm5ENH0woyzdVf54pOBb0bIfLzXFXxtN3CARMjPQy02bWvNNIo3YQHHGmLH6WxMaXIsFbO6Ph8DfOLYdo3vz/2K/kgr9T0gH4ln1IHNf2s1JoTQHK/F/9mIkDca2Dhg8sHHH1MsgdoH7+is0GLTTMGPyX6ZKk7/DxuUNv3X7eGfZikhfm65An+G5RXYm5cDVXWSCXqcIyPW/YJLSiIL859lDEeE7SsGdV4iUOe8TTiwr8iFdL6vzUCvMi6htpy7ubTlBR3/yZ5Dtib3nvLQ2wmxjpVFQ9z57h2pAlG8nnG0aV8hKYBR9xe/fZESUEhOITCwvZzDtm0Vg+TJto=
Hi,
Am Mittwoch, den 16.05.2018, 11:55 -0400 schrieb ikdc:
> The Derive extension does what you want.
>
> https://coq.inria.fr/refman/addendum/miscellaneous-extensions.html
>
thanks for the hint. It works great in a small example:
Require Import Coq.derive.Derive.
Section foo.
Variable (P : nat -> Prop).
Derive HTy
SuchThat (forall (H : HTy), forall n, P n)
As nat_ind.
Proof.
intros.
pose proof H as IH1. eapply proj1 in IH1. eapply proj2 in H.
rename H into IH2.
induction n.
* refine IH1.
* revert n IHn. refine IH2.
Qed.
End foo.
I can even fix the type to no longer mention HTy:
Definition nat_ind' :=
ltac:(let ty := type of nat_ind in
let ty' := eval unfold HTy in ty in
exact (nat_ind : ty')).
Check nat_ind'.
(* nat_ind'
: forall P : nat -> Prop, P 0 /\ (forall n : nat, P n -> P (S n)) ->
forall n : nat, P n
*)
Unfortunately, when when I do it in my real, big example, I get this:
Anomaly "the kernel does not support existential variables." Please
report at http://coq.inria.fr/bugs/.
And I am not sure what aspect is causing that (surely not just size).
Tangentially, it would be even more useful if I could define more than
one at the same time:
Section foo.
Variable (P : nat -> Prop).
Derive H1Ty H2Ty
SuchThat (forall (Hbase : H1Ty) (Hstep : H2Ty), forall n, P n)
As nat_ind.
Proof.
intros.
induction n.
* refine Hbase.
* revert n IHn. refine Hstep.
Qed.
End foo.
Cheers,
Joachim
--
Joachim Breitner
mail AT joachim-breitner.de
http://www.joachim-breitner.de/
Attachment:
signature.asc
Description: This is a digitally signed message part
- [Coq-Club] Existential variables or holes in Lemma types, Joachim Breitner, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, ikdc, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, Pierre Courtieu, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, Joachim Breitner, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, Pierre Courtieu, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, Joachim Breitner, 05/18/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, Joachim Breitner, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, Joachim Breitner, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, Pierre Courtieu, 05/16/2018
- Re: [Coq-Club] Existential variables or holes in Lemma types, ikdc, 05/16/2018
Archive powered by MHonArc 2.6.18.