Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Inductive elimination scheme

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Inductive elimination scheme


chronological Thread 
  • From: Nadeem Abdul Hamid <nadeem AT acm.org>
  • To: coq-club AT pauillac.inria.fr
  • Subject: [Coq-Club] Inductive elimination scheme
  • Date: Tue, 12 Feb 2008 23:38:57 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer:sender; b=s2bxYA3D7NNCiwF5ryP+j/tnz9XRJGBgiSfhMjlNzPr7zivvjQe8Wp2x1feWBQvC9jDdO95YciajvD6q4e/ozXK4NsF9eHUbVo7uCJYMw9ZcLOf2gO6S9jV1tbm0/pU5YG6PTtn/Ce5zkQrNNQ39D294V2Mo+lvisOPuyqrCCrk=
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

What is happening here with the following two definitions? As you can see, the elimination operator for stuff1 provides for a proper inductive hypothesis, but stuff2 doesn't. For some reason, Coq doesn't derive the proper scheme for using the 'induction' tactic if I have an occurrence of the inductive type being described combined with 'and' or 'exists', for example? Is there an easy way in general to get this to be defined properly? My inductive definitions are actually a lot more complex than these: the occurrence of the recursive definition is under an implication, exists, and conjunction.

Thanks in advance for your help/ideas/clarification!

--- nadeem


Inductive stuff1 : Prop :=
  | s1a : stuff1
  | s1b : True -> stuff1 -> stuff1.

Inductive stuff2 : Prop :=
  | s2a : stuff2
  | s2b : True /\ stuff2 -> stuff2.

Print stuff1_ind.

(*
stuff1_ind =
fun (P : Prop) (f : P) (f0 : True -> stuff1 -> P -> P) =>
fix F (s : stuff1) : P :=
  match s with
  | s1a => f
  | s1b t s0 => f0 t s0 (F s0)
  end
     : forall P : Prop, P -> (True -> stuff1 -> P -> P) -> stuff1 -> P
*)

Print stuff2_ind.

(*
stuff2_ind =
fun (P : Prop) (f : P) (f0 : True /\ stuff2 -> P) (s : stuff2) =>
match s with
| s2a => f
| s2b x => f0 x
end
     : forall P : Prop, P -> (True /\ stuff2 -> P) -> stuff2 -> P
*)

(* I can define my own elimination scheme by hand; does this make sense? *)
Definition stuff2_myind
  : forall P : Prop, P -> (True /\ stuff2 -> P -> P) -> stuff2 -> P
    := fun (P : Prop) (f : P) (f0 : True /\ stuff2 -> P -> P) =>
fix F (s : stuff2) : P :=
  match s with
  | s2a => f
  | s2b X => match X with conj t s0 => f0 (conj t s0) (F s0) end
  end.

(* then I could potentially use 'elim H using stuff2_myind.' as a
   tactic instead of just induction H,  where (H:stuff2) ? *)





Archive powered by MhonArc 2.6.16.

Top of Page