coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Dominique Larchey-Wendling <dominique.larchey-wendling AT loria.fr>
- To: coq-club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Beginner question: 0 - 1 = 0?
- Date: Sun, 23 Jul 2023 17:04:47 +0200 (CEST)
- Authentication-results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=dominique.larchey-wendling AT loria.fr; spf=None smtp.helo=postmaster AT zcs-store7.inria.fr
This is from the definition of "minus" in Coq with infix notation "x - y".
"Print minus" will give you the fixpoint definition.
If a <= b then a-b = 0. You can prove this.
You just have to be aware that this is not the usual subtraction
operation which would be a partial operation on natural numbers
(positive integers), ie a-b should be undefined when a < b.
a - b has the "usual" meaning if (and only if) a >= b.
This is enough to get (a + b) - b = a for instance
But (a - b) + b is not equal to a, unless a >= b.
Best,
Dominique
----- Mail original -----
> De: "Frank Schwidom" <schwidom AT gmx.net>
> À: "coq-club" <coq-club AT inria.fr>
> Envoyé: Dimanche 23 Juillet 2023 16:53:35
> Objet: [Coq-Club] Beginner question: 0 - 1 = 0?
> Hi,
>
> what puzzles me is that I can obviously get a wromg result from the view of
> the
> natural understanding:
>
> Coq < Compute 0 - 1.
> = 0
> : nat
>
> How can it be clear that this makes no problems in proofs?
>
> Regards,
> Frank
- [Coq-Club] Beginner question: 0 - 1 = 0?, Frank Schwidom, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Dominique Larchey-Wendling, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Sylvain Boulmé, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Ana Borges, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Castéran Pierre, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Qinshi Wang, 07/24/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Hugo Herbelin, 07/26/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Qinshi Wang, 07/24/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Castéran Pierre, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Tadeusz Litak, 07/24/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Ana Borges, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Sylvain Boulmé, 07/23/2023
- Re: [Coq-Club] Beginner question: 0 - 1 = 0?, Dominique Larchey-Wendling, 07/23/2023
Archive powered by MHonArc 2.6.19+.