coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Nicolas Magaud <magaud AT unistra.fr>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] unexpected behaviour of the tactic inversion
- Date: Thu, 8 Jun 2017 15:16:12 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=magaud AT unistra.fr; spf=Pass smtp.mailfrom=magaud AT unistra.fr; spf=None smtp.helo=postmaster AT mailhost.u-strasbg.fr
- Ironport-phdr: 9a23:YlxRGxUDAL1iUpDIDjkJZP9Ry97V8LGtZVwlr6E/grcLSJyIuqrYYxWFt8tkgFKBZ4jH8fUM07OQ6PG/HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjSwbLdwIRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmijoINyQh/W7LhcN+kaJVrxCvqRJwwIDUbp+bOv1lc6PBZNMaQHZNXsZNWyFDBI63cosBD/AGPeZdt4Tzv1oOoge5BQmoHuzv0SJDiHjs0q01yeshDBzJ1xEnEtILqnvUo8/6NLoPXu2u0anIyzTDb+hK2Tfn8ofEaB4hoeuVUL92bMHfylEvGhvYglietYDpJTGY2+AXv2SF8eZsS/ijh3A6pw1sujSj28khhpXTio8Xzl3I7zl1zJw0KNC4TkNwfMSqH4FKty6AMot7WsMiTH9suCY90rAGvIS0fCkOyJQnwB7fcOCHf5KV4h76T+aRPS14i2h+eL2kiBa+60agyvfkWsm11lZFsDZFn8HRun0DyxDf8MqKR/9n8ku/xzqDyRrf5v9ZLUwpjabbLoQuwr80lpodq0TDGSr2lV3zjKCMeUUr4PWo5Pn8b7X7oJ+cNpR0ih3kMqs0gMC/D/44PhAUX2eH4eS8yKHj/UrhTbpWif02i7DVv4zeJcQGvaG0GBRV04Ym6xanFTiqytUYnX8dLFJEYh2LlYbpO0udaMz/WPy4mhGnlCph7/HAJLzoRJvXfVbZl7K0W7d27EpV00IWxN9W+p4cXrQIL/vuVmfsst3DEgUwdQKulbW0QO5h358TDDrcSpSSN7nf5AeF
Dear Gaetan Gilbert,
I made a mistake and meant to write this code (which is the one written in
the attached file) :
Lemma u : forall p q:nat, p=q -> TS p -> TS q.
Proof.
intros p q Hpq Hts; inversion Hpq.
Restart.
intros p q Hpq; rewrite Hpq; auto.
Qed.
Cheers,
Nicolas Magaud
> On 08 Jun 2017, at 15:11, Gaetan Gilbert
> <gaetan.gilbert AT ens-lyon.fr>
> wrote:
>
> In Lemma t you do inversion on the [Hnm : n=m] hypothesis
> In Lemma u you do inversion on the [Hts : TS p] hypothesis
> The difference has nothing to do with parameters vs variables.
>
> Gaëtan Gilbert
>
> On 08/06/2017 15:07, Nicolas Magaud wrote:
>> Dear all,
>>
>> Using the tactic inversion, I face a strange behaviour :
>>
>> 1/ If I have the 2 following parameters :
>>
>> Parameter TS : nat -> Type.
>> Parameter n m:nat.
>>
>> And try to prove this lemma :
>>
>> Lemma t : n=m -> TS n -> TS m.
>>
>> I can proceed by using inversion
>>
>> intros Hnm Hts; inversion Hnm.
>>
>> The goal is then TS n, which is proved easily using assumption.
>>
>> 2/ If I try to prove
>>
>> Lemma u : forall p q:nat, p=q -> TS p -> TS q.
>>
>> intros p q Hpq Hts; inversion Hts.
>>
>> does not help at all (q is not replaced by p).
>> Of course, I can do rewrite before introducing the 2nd hypothesis "TS p”.
>> But I would expect inversion to do the job.
>>
>> 3/ As you can see in the file attached below (Lemma v), I can print the
>> proof term generated by inversion in the first lemma t and use it (with
>> the tactic exact) to prove the expected lemma (Lemma v).
>>
>> My question is: why inversion does not work the same when n and m are
>> parameters (as in Lemma t) or introduced universally-quantified variables
>> (as in Lemma u) ?
>>
>> Thanks in advance.
>>
>> Nicolas Magaud
>>
- [Coq-Club] unexpected behaviour of the tactic inversion, Nicolas Magaud, 06/08/2017
- Re: [Coq-Club] unexpected behaviour of the tactic inversion, Gaetan Gilbert, 06/08/2017
- Re: [Coq-Club] unexpected behaviour of the tactic inversion, Nicolas Magaud, 06/08/2017
- Re: [Coq-Club] unexpected behaviour of the tactic inversion, Gaetan Gilbert, 06/08/2017
Archive powered by MHonArc 2.6.18.