Skip to Content.
Sympa Menu

coq-club - [Coq-Club] proofs involving variables appeared from matching

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] proofs involving variables appeared from matching


chronological Thread 
  • From: Andrei Popescu <uuomul AT yahoo.com>
  • To: "coq-club AT pauillac.inria.fr" <coq-club AT pauillac.inria.fr>
  • Subject: [Coq-Club] proofs involving variables appeared from matching
  • Date: Sun, 27 Apr 2008 19:51:20 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=nBwnTk5w2WjIR+SngbBLfpCty4bUgXYTfUvmSYxzYFzqjG7VWQlXffymkIo7b7VGu3uKjKp+6TvW9QzFYp7y9K3xRRZE3x55cYBuYK9LxzvlbNBWZHPFTHc+DCTDsrZpSf1kZ68oCB/oN8jNkr4VlMKK8N+6P0ycBRZfayXObxg=;
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

I apologize for the potential amount of ignorance in this question, justified by the fact that I am a beginner with Coq.
 
Consider the definition:
 
Definition Less n := {j | j < n}.
 
And the following part of definition (some code is omitted)
 
Fixpoint SupL (n:nat) (f:Less n -> nat) {struct n} : nat :=
  match n with 
    ...
    |S n' =>  ... f (exist (fun j => j < n) n' (lt_n_Sn n')))...                      
  end.
 
where
 
lt_n_Sn: forall n : nat, n < S n
 
The function SupL n f tries to compute the supremum of {f 0, f 1,...,f (n-1)}, and employs the lemma le_n_Sn in an attempt to build the necessary proof of n' <  n.  However,
the definition of SupL does not type check, because (I quote):
 
<< The term "lt_n_Sn n' " has type "n' < S n' " while it is expected to have type
 "(fun j : nat => j < n) n' " >>
 
Even though I understand pragmatically what the problem is (n is not identified to S n' ), I do not know how to fix it, since I do not know how to produce a proof that the "volatile" n' is less than n.  My more general question is: after a match is performed, what facts are available about the matched term and the matching pattern? 
 
Thank you in advance for any hint on this,
   Andrei Popescu


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.


Archive powered by MhonArc 2.6.16.

Top of Page