coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: <michael.soegtrop AT intel.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Very strange induction principle for records with assigned elements
- Date: Wed, 19 Nov 2014 14:50:40 +0100
Dear Coq users,
for records with only assigned elements, the automatically generated induction
principles work, but when I print them it looks like they have an application
of a non function in them. Also if I try to feed the printed term back into
Coq it won't accept it with exectly that error message, which confuses me
quite a bit. Please have a look at the following example:
(* A record with an assigned element. Only one instance of this record exists
*)
Record A:=mkA
{
a := 1
}.
(* The induction principle for this actually works *)
Lemma TestIndA : forall x:A, a x =1.
Proof.
induction x.
reflexivity.
Qed.
(* But when I print the induction principle, I get this *)
Print A_rect.
A_rect =
fun (P : A -> Type) (f : let a := 1 in P mkA) (a : A) =>
match a as a0 return (P a0) with
| {| a := x |} => f x
end
: forall P : A -> Type, (let a := 1 in P mkA) -> forall a : A, P a
Here the term f in f x is not a function, so I wonder what f x is supposed to
mean. Also if I try to feed this term into Coq like this:
Definition A_rect :=
(fun (P : A -> Type) (f : let a := 1 in P mkA) (a : A) =>
match a as a0 return (P a0) with
| {| a := x |} => f x
end)
: forall P : A -> Type, (let a := 1 in P mkA) -> forall a : A, P a
.
I get the error message:
Error: Illegal application (Non-functional construction):
The expression "f" of type "let a := 1 in P mkA"
cannot be applied to the term
"x0" : "nat"
Can someone shed some light on this behaviour? In case this is of interest: I
am using Coq 8.4pl4.
Best regards,
Michael
- [Coq-Club] Very strange induction principle for records with assigned elements, michael.soegtrop, 11/19/2014
- Re: [Coq-Club] Very strange induction principle for records with assigned elements, Guillaume Melquiond, 11/19/2014
- Re: [Coq-Club] Very strange induction principle for records with assigned elements, michael.soegtrop, 11/19/2014
- Re: [Coq-Club] Very strange induction principle for records with assigned elements, Guillaume Melquiond, 11/19/2014
Archive powered by MHonArc 2.6.18.