Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] unexpected behaviour of the tactic inversion

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] unexpected behaviour of the tactic inversion


Chronological Thread 
  • From: Gaetan Gilbert <gaetan.gilbert AT ens-lyon.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] unexpected behaviour of the tactic inversion
  • Date: Thu, 8 Jun 2017 15:11:34 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT ens-lyon.fr; spf=Neutral smtp.mailfrom=gaetan.gilbert AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
  • Ironport-phdr: 9a23:FPrWghDsZu07dlcXuDTuUyQJP3N1i/DPJgcQr6AfoPdwSPv+osbcNUDSrc9gkEXOFd2CrakV1KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fdbghMhjexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJKiA38G/XhMJzgqxUrh2uqB5jzIDbe4yVKPlzc7nBcd8GS2dMXMBcXDFBDIOmaIsPCvIMM+dCoIbju1sBtx2+DhStCuPuzj9HnWH53bcm0+88FgzG0xYvEMwSsHvOqtX5LqgSUeGxzKbT0zrDde9W1Czj54jOaRAtuPWMXLJ3ccrX00UvGRnFg0yWpIf4PD2VzvwAv3WU4uZ8T+6iiWwqpxtsrjWuxMogkJfFipwLxlzc9Ch13pw5KcCkREJle9KoDZRduiKAO4drQc4vR2dlszsgxLIco560Zi0KxYwnxxHBb/yHdJCF4hb5W+mKOjh3mmhpd6y5hxap6ESgzu39Vs6y0FpQoCpFiMHAtnEL1xPN9siKUuZx80i91TqV1Q3e6PtILV01mKfZMZIt3KA8moQLvUTGBCD2mUH2jKGMdkUj/+il8+vnba/4qZ+ALYB0jBvyMqsvmsy7Gus3LBIOX3SA9Oui0r3j5lT1QLFKj/0xlKnVqp7aJd4Dqq6jHwBVypoj6wq4Dzq+zNsYmmAHIEtZdxKDkojmIErDIOv4DPe6m1Sjii1nx/HAPr37A5XCNGLPkLn7feU110kJww0qiNtb+ph8C7cbIfu1VFWimsbfC0oWOgGoyuCvJ9R53I4ERSrbDaaULKrU91CJ4ugiOfWkaYkO/TLsLP5j6eS43ixxokMUYaT8hchfU3u/BPkze0g=

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





Archive powered by MHonArc 2.6.18.

Top of Page