Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Destruct vs. inversion

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Destruct vs. inversion


chronological Thread 
  • From: Paolo Herms <paolo.herms AT cea.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Destruct vs. inversion
  • Date: Thu, 7 Apr 2011 14:20:03 +0200

On Thursday 07 April 2011 09:45:24 Guillaume Melquiond wrote:
> Here is a short answer that encompasses the ones you already got:
> Whenever using dependent types, inversion looks at the dependency to
> keep only meaningful cases, while case/destruct generates all of the
> branches. 

But Benjamin doesn't like to talk about dependent types, he just uses them.
So an easier example is this one:

Goal forall x, x ≤ 0 → x = 0.
  destruct 1.
   (* leads to two subgoals, of which the second one is unprovable *)
  Undo.  
  inversion 1.
   (* leads to one trivial subgoal *)

Why? Because "destruct" generalises the subterm "0" to some "m" that all 
information about is lost. You can still solve the goal with "destruct" but 
you need to keep the information that "m" is equal to 0:

  Undo.
  remember 0 as m. destruct 1.
   (* leads to two subgoals, of which the second one is provable by absurd. *)

This is what "inversion" does, discharging the absurd second subgoal 
automatically.

-- 
Paolo Herms
PhD Student - CEA-LIST Software Safety Lab. / INRIA ProVal Project
Paris, France





Archive powered by MhonArc 2.6.16.

Top of Page