coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Courtieu <pierre.courtieu AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] problem with goal and environment
- Date: Tue, 22 Sep 2020 09:41:01 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-io1-f48.google.com
- Ironport-phdr: 9a23:CgYDwh1NiYp1bb3bsmDT+DRfVm0co7zxezQtwd8ZseMXLfad9pjvdHbS+e9qxAeQG9mCtLQd0KGP6fqoGTRZp8rY7jZaKN0EfiRGoP1epxYnDs+BBB+zB9/RRAt+Iv5/UkR49WqwK0lfFZW2TVTTpnqv8WxaQU2nZkJ6KevvB4Hdkdm82fys9J3PeQVIgye2ba9vIBmsogjdq8sbjZF/Jqs/xRfFv2VEd/pLzm9sOV6fggzw68it8JNi6Shcp+4t+8tdWqjmYqo0SqBVAi47OG4v/s3rshfDTQqL5nQCV2gdjwRFDQvY4hzkR5n9qiT1uPZz1ymcJs32UKs7WS++4KdxSR/nkzkIOjgk+2zKkMNwjaZboBW8pxxjxoPffY+YOOZicq7bYNgXXnRKUNpPWCNdA4O8d4oPAPQHPeZEtIn2ul8CoQKjCQWwGO/jzzlFjWL006InyeQsCQ7J3AIiENwOvnrar8j7OrkOXu6616TI0SzDYulK1Tvh9ITFcBYsquyMU7JqdsrRzFEiGRnEjlqOs4zlJS2a3fkTvmic8upgT/6vi285pAFsvzOiwd8siojXiYIP0FDL6z91z5oyJd2lUk57fd+kH4VNtyyBOIt2R9ktQ2BsuCog1rIGvpu7cTEMxZ86yBHRd+aJfJKU4hL/SumROzF4iWp7db6hhxi/8VWtxvHgW8e70FtHszZIn9jSu30D2BHd5cqKRud880ql1ziDyR3f5+NKL00pmqTVK4Mtz6Mzm5cct0nIAyz4mF3ugaOIakkp/vKk5ufnb7n8u5ORNo55hhvxP6ktnMG0HP42PRIUX2eB/OSxzL3j8lP9QLVNlvA2l7PWsJHeJcgCp665BBJZ3p8t6xuwDDqqytsYnX4ALFJKfBKIkZLlNE3JIPD9Ffu/glKsnyl3x/3eILHtHpHAImLAnbrhZ7px9k9RxQspwd1Q5J9YErQBL+jyWk/1utzYFBg5Mwmszub/CdVyyJkeWXiRDaODLKzStkKI5vgzI+mNeoAVpS3wK/cg5/H0jH85nUURcrWu3ZsScHy4BOhpI12FYXrwhdcMCXsFvg0nTODzlFKCVSNTaG2pUqIn5jA7DZqmAp3ZSoCshryBxia7EYdMamBIEFDfWUvvIq6DQr8nbD+YaptqlSVBXry8Qacg0wuvvUn00ew0APDT/3ggtJ/5ztU9zOrOjw0z+CE8W9yc3nuXQid/mX4SWz47wYhwpEV8zhGI1q0u0K8QLsBa+/4cClRyDpXb1eEvTomqAlucLOfMc06vR5CdOR90Tt81xIVTMUN0GtHnjxeamiT2U/kakLuEAJFy+aXZjSCodpRNjk3e3axktGEIB85GNGmonKl6rlGBCIvAkkHfnKGvJ/1FgHz9sVybxG/Lh3l2FRZqWPycD38ab0rS69/+4xGaQg==
Hi,
Several remarks:
1) Please give the complete file. Here you seem to be inside a section
(which is the problem, see below) but you did not give the context of
this section.
2) Sections do not work the way you think. Section variables are
considered as constants inside the section. This explains the strange
message you get.
Check eq_succ.
eq_succ
: n = m -> S n = S m
See? n and m are not quantified in this statement (they will be only
after closing the section). To apply eq_succ you need EXACTLY the
hypothesis n=m, not just something of the form (foo=bar). Sine H0 has
not exactly this type you get the message:
Check (eq_succ H0).
The term "H0" has type "m = S m" while it is expected to have type "n = m".
My advice: don't use sections if you are a beginner: putting "forall n
m" in all your statements is much clearer.
3) I don't know what you are trying with the proof of le_to_eq_or_lt
but it probably needs rethinking. For the least: consider using
"destruct" instead of "induction" when you just need case splitting.
Using "rewrite" instead of "induction" is also probably a good idea.
Hope this helps.
Pierre
Le mar. 22 sept. 2020 à 08:47, Patricia Peratto
<psperatto AT vera.com.uy> a écrit :
>
> I have the following definitions:
>
>
> Theorem lt_n_S : (lt n (S n)).
> unfold lt.
> exact (le_n (S n)).
> Qed.
>
>
> Theorem eq_succ : (n=m) -> (S n = S m).
> intro.
> rewrite -> H.
> reflexivity.
> Qed.
>
>
> I'm proving the following theorem:
>
>
> Theorem le_to_eq_or_lt :
> (le n m) -> (or(n=m) (lt n m)).
> intro.
> induction H.
> apply or_introl.
> reflexivity.
> induction IHle.
> induction H0.
> induction H.
> exact (or_intror lt_n_S).
> induction IHle.
>
> The following environment:
>
>
> A, B : Prop
> x, y, z : A
> P : A -> Prop
> f : A -> B
> n, p, m : nat
> H : le n m
> H0 : m = S m
> ______________________________________(1/3)
> S m = S (S m) \/ lt (S m) (S (S m))
> ______________________________________(2/3)
> S m = S (S m) \/ lt (S m) (S (S m))
> ______________________________________(3/3)
> n = S m \/ lt n (S m)
>
>
> when I want to solve it with:
>
> exact (or_introl (eq_succ H0)).
>
> I get the following message:
>
>
> In environment
> A, B : Prop
> x, y, z : A
> P : A -> Prop
> f : A -> B
> n, p, m : nat
> H : le n m
> H0 : m = S m
> The term "H0" has type "m = S m"
> while it is expected to have type
> "n = m".
>
>
> There is something wrong.
> The goal is (S m) = (S (S m)).
>
>
> Regards,
> Patricia
>
>
>
- [Coq-Club] problem with goal and environment, Patricia Peratto, 09/19/2020
- Re: [Coq-Club] problem with goal and environment, Pierre Courtieu, 09/22/2020
Archive powered by MHonArc 2.6.19+.