coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gaëtan Gilbert <gaetan.gilbert AT skyskimmer.net>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion
- Date: Wed, 3 Apr 2019 15:39:39 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT skyskimmer.net; spf=Pass smtp.mailfrom=gaetan.gilbert AT skyskimmer.net; spf=None smtp.helo=postmaster AT relay1-d.mail.gandi.net
- Ironport-phdr: 9a23:kz6BDhFMp24LpR+sugtmL51GYnF86YWxBRYc798ds5kLTJ7zoMmwAkXT6L1XgUPTWs2DsrQY0rOQ6/urAj1Ioc7Y9ixbKNoUD15NoP5VtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blItdaz6FYHIksu4yf259YHNbAVUnjq9Zq55IAmroQnLucQanJZuJrwtxhbHrXdFdeBbzn5sKV6Pghrw/Mi98IN//yhKp/4t68tMWrjmcqolSrBVEC4oOH0v6s3xshnDQwqP5n8CXWgTjxFFHQvL4gzkU5noqif1ufZz1yecPc3tULA7Qi+i4LtxSB/pkygIKTg0+3zKh8NqjaJbpBWhpwFjw4PRfYqYOuZycr/bcNgHQ2dKQ8RfWDFbAo6kcoUBEeQBM+ZboYfzqVQBohmxChWjCu701j9FhWX70bEm3+kvEwzL2hErEdIUsHTTqdX4LKYcXvqpy6nU1zrDaetZ1zb86IjMaR8uv+uMXa5tesfWxkkgDR3KjkmKpozjJT+V2eUNs2yA4OV+T+Kvl3Uqqxpyojmv3ccsiYjJhocQyl/a7yV12oA1KsOkSENiZ9OvDZVetyafN4RsQ8MiRXlluDs8yr0Hp563ZS8KyI4jxxHBcfOHdZOI7gjtVOaLJzpzmXFreKqnihqs7EStyPfwW8uo3FpQsyZIkdfBumoQ2xHX5MWLUuVx8lqv1DqVygze6v9ILVopmafaNpIt2KA8moYVvE/eBCH5gl/2g7WTdkg8+uin9eDnYrL+q5+GKYB0jhvxM6QzlsCmHOs0KA0OUHKa+eS4zrHj8lf2QLNXgf03iKXZto7VJdgDqq64BQ9azJoj5g6hAzu70tkUh3sKIE5fdB6ajIXkNUvCLO38APqxm1islS1kx/HCPr3vGJXNKX3Dna/ufbln9UFc1BA8zdZF65JbC7EBJOn8VVHrtNzEFRI5KA+0wub8CNV+14MeXGePDbGDMK/It1+H+P4vL/GWZIAJoDb9N+Ql5/n2gHAlnl8dZLCl0ocTaHClBftrOF6ZYHrpgtcZC2gGpAs+TOrwiF2DSzFffXiyX7hvrg08XYmhFMLIQp2nqL2HxiayWJNMNU5cDVXZPn5ra4yCbNgNbCifONMpxjMNWKSoTcku1BWkuRXm46FkP/HX+ygduIil0tVpsb6A3Sou/CB5WpzOm1qGSHt5yztRFm0GmZtnqEk48W+tlK1xgvhWD9tWvq0bSQQrLp3dyul3EZb0Vx6TJ47VGmbjec2vBHQKdvx028UHOhgvANazlRPC2i+nGfkTmqDZXMVpoJKZ5GD4IoNG81iD1KQliAN7ENFCMWS33+tzsQ3aBoqPnEyfm6fsc6kAjnbA
The Equations plugin should be able to do it today
or you can "dependent induction x" today, however this uses an axiom
Gaëtan Gilbert
On 03/04/2019 15:22, Frédéric Dabrowski wrote:
Thanks Vincent and Gaetan
So it is because of Integer that I can’t perform a dependent inversion.
Do you thinks there is any chance that dependent inversion will be able to deal with this some day?
Best regards,
F.
======================================================
Dr. Frédéric Dabrowski
Laboratoire d’Informatique Fondamentale d’Orléans <https://www.univ-orleans.fr/lifo/>
======================================================
Maître de conférences, Université d’Orléans, LIFO
Responsable. de l’équipe Langages Modèles et Vérification <http://www.univ-orleans.fr/lifo/equipes/LMV/?Home> (LMV)
Site web : http://www.univ-orleans.fr/lifo/Members/Frederic.Dabrowski/
Téléphone :+33 (0)2 38 49 27 51 <tel:+33(0)238492751>
======================================================
Associate Professor, University of Orléans, LIFO
Head of the team Languages Models and Verification <http://www.univ-orleans.fr/lifo/equipes/LMV/?Home>(LMV)
Home : http://www.univ-orleans.fr/lifo/Members/Frederic.Dabrowski/
Phone : +33 (0)2 38 49 27 51 <tel:+33(0)238492751>
======================================================
Le 3 avr. 2019 à 15:13, Gaëtan Gilbert <gaetan.gilbert AT skyskimmer.net <mailto:gaetan.gilbert AT skyskimmer.net>> a écrit :
Coq will automatically do small inversion when pattern matching, so this works:
Definition a (x:unop Integer) : x = Neg :=
match x with Neg => eq_refl end.
you can "Print a." to see what it generates
If you want to do it by hand the idea is to generalize your statement so that the thing you match on has indices which are independent variables, and when instantiated properly it implies what you want
For instance
Lemma a : forall x : unop Integer, x = Neg.
Proof.
assert (forall t (x:unop t), x = match t with Integer => Neg | Boolean => Not end).
{ intros t x;destruct x;reflexivity. }
intros x;apply (H Integer).
Qed.
or
Lemma a : forall x : unop Integer, x = Neg.
Proof.
assert (forall t (x:unop t), match t with Integer => fun x => x = Neg | Boolean => fun _ => True end x).
{ intros t x;destruct x;reflexivity. }
intros x;apply (H Integer).
Qed.
Gaëtan Gilbert
On 03/04/2019 15:01, Frédéric Dabrowski wrote:
Dear all,
I’m stuck with the following simple example for which I did not expect to spend more than 5 seconds …
How do I remove this ugly Admitted?
Best regards,
Inductive eType : Set := Integer | Boolean.
Inductive unop : eType -> Type :=
Neg : unop Integer
| Not : unop Boolean.
Lemma a : forall x : unop Integer, x = Neg.
Proof.
Admitted.
======================================================
Dr. Frédéric Dabrowski
Laboratoire d’Informatique Fondamentale d’Orléans <https://www.univ-orleans.fr/lifo/>
======================================================
Maître de conférences, Université d’Orléans, LIFO
Responsable. de l’équipe Langages Modèles et Vérification <http://www.univ-orleans.fr/lifo/equipes/LMV/?Home> (LMV)
Site web : http://www.univ-orleans.fr/lifo/Members/Frederic.Dabrowski/
Téléphone :+33 (0)2 38 49 27 51 <tel:+33(0)238492751>
======================================================
Associate Professor, University of Orléans, LIFO
Head of the team Languages Models and Verification <http://www.univ-orleans.fr/lifo/equipes/LMV/?Home>(LMV)
Home : http://www.univ-orleans.fr/lifo/Members/Frederic.Dabrowski/
Phone : +33 (0)2 38 49 27 51 <tel:+33(0)238492751>
======================================================
- [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Frédéric Dabrowski, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Gaëtan Gilbert, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Frédéric Dabrowski, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Gaëtan Gilbert, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Yannick Forster, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Frédéric Dabrowski, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Yannick Forster, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Gaëtan Gilbert, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Frédéric Dabrowski, 04/03/2019
- Re: [Coq-Club] Stuck with (at first glance) obvious dependent inversion, Gaëtan Gilbert, 04/03/2019
Archive powered by MHonArc 2.6.18.