Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Non standard natural numbers

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Non standard natural numbers


Chronological Thread 
  • From: roux cody <cody.roux AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Non standard natural numbers
  • Date: Thu, 3 Jun 2021 12:13:31 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=cody.roux AT gmail.com; spf=Pass smtp.mailfrom=cody.roux AT gmail.com; spf=None smtp.helo=postmaster AT mail-ua1-f42.google.com
  • Ironport-hdrordr: A9a23:9TrIm6hUiuu8gzAHS7wyNbDELnBQXuMji2hC6mlwRA09TyX4rbHWoB1/73XJYVkqKRQdcLy7Scu9qDbnhP1ICOoqXItKPjOW3FdARbsKheDfKn/bexEWndQtspuIHZIObuEYzmIXsS852mSF+hobr+VvOZrHudvj
  • Ironport-phdr: A9a23:Ck14ARw+xm0JfG3XCzLvylBlVkEcU1XcAAcZ59Idhq5Udez7ptK+ZR2Zv6Q8xw+ZFazgqNt8w9LMtK7hXWFSqb2gi1slNKJ2ahkelM8NlBYhCsPWQWfyLfrtcjBoVJ8aDAwt8H60K1VaF9jjbFPOvHKy8SQSGhLiPgZpO+j5AIHfg9mz2uyo5ZHeZwFFiDW+bL5xMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhygJNzE78G/ZhM9+gr9Frh29vBFw2ZLYbZuPOfZiYq/Qf9UXTndBUMZLUCxBB5uxb5EID+ocMudTspXyp1wTohq+GAKhA//gyjhViX72x6E6yeMhERzJ3QE7ENIOtW7brNTxNKsITe+1y6zIwCzFYvhL1jjz9JLGfQo9ofGQQ71wa8zRxFErGg7EgVudppLoMy2J2+gRrmWW7+RuWP6yhmApqgx8vDuiytsth4fHhI8YyEzI+Tt6zYopO9C1RlB2bNGgHZdOsSyRKoh4Qts6Tm12pCo3zqcKtJ27cSQQ1pgr2QDTZ+aIfoSW5B/oSfyfLi1ihH1/fbKynxay/lakyu37TsS01UxFritBktXVq3ACzQHf5tGJSvZy4EutwzmP1wfU6uFLJUA7i7DXJIImwr41jpYTsELDETHqmEjukqOaakEp9vKr5unneLnquIGQO5FuhgzxLKgigsm/Dv45MggKUWib4+O81Lj78ELlR7VFk/03nrPDsJDdOMQaqbW0AwBQ0ok56ha/Cy2q38gfnXkCNF5FYg6Ij5D1O1HSJ/D1Feuwg1O1kDty2//GOqDhDY7WI3jYkLbheK595FRGxAoyy9Bf/ZNUBasbLPL9QE+i/ODfWxQ+Kkm/x/vtINR7zIIXH2yVUYGDN6aHq1iV9qokJOWdLNsevzrsbeIi+u7GgnowmFtbdq6si8hEIEukF+hrdh3KKUHnhc0MRD9iVuUWQ+njiVnEWjlWNS/at0MU4zg6DMe7BN6GSNz3xrOG2yi/E9tdYWUUUjhk9F/ncoyFX7EHbyfAeqdc

Sadly, it is possible to compute non-standard numbers in Coq without axioms. Here is an example:


Fixpoint Ack m := fix A_m n :=
  match m with
    | 0 => n + 1
    | S pm =>
      match n with
        | 0 => Ack pm 1
        | S pn => Ack pm (A_m pn)
      end
  end.

Definition c : nat := Ack 5 5.

Indeed adding axioms like c_gt0, c_gtS0, ... (as many as you like!) will all be consistent.

In practice, though, you can pretend that such numbers do not exist, and things will go on relatively undisturbed.

Best,
Cody


On Thu, Jun 3, 2021 at 10:16 AM Vincent Semeria <vincent.semeria AT gmail.com> wrote:
Hi Eddy, 

On the contrary, I would like to avoid non standard numbers, so that the normalization property of Coq does mean that every computation of a nat term terminates.

But since we established that Coq cannot refute non standard nat terms, I am trying to measure the risk that I accidentally try to compute a non standard nat (without any axioms posed). 

On Thu, Jun 3, 2021, 16:06 Eddy Westbrook <westbrook AT galois.com> wrote:
Vincent,

There are certainly non-standard models of Coq (Gödel ensures us of that), but they are bound to be a lot more complicated than non-standard models of Peano arithmetic, which is where the notion of non-standard naturals comes from. The reason for this is that Coq can express a general notion of well-foundedness and induction in the logic (this is in fact the heart of Evan’s answer, that you can use induction in Coq), whereas Peano arithmetic cannot.

If what you really want is non-standard models of Peano arithmetic, then you will probably have to formalize Peano arithmetic, or at least a simpler form of it. I would guess that there are formalizations of it in Coq out there, but am not sure. A simpler form of Peano arithmetic might just be to define a signature (or, better, a type class) of types that have a 0 and successor but not necessarily induction.

If what you want is just infinite natural numbers, maybe you should look at Coq’s coinductive types? These let you define a Coq type that can contain infinite sequences of successors.

Hope this helps,
-Eddy

On Jun 3, 2021, at 6:53 AM, Vincent Semeria <vincent.semeria AT gmail.com> wrote:

How do these non standard integers cope with the normalization property of Coq? A non standard integer would compute to an infinite sequence of successors, so it does not terminate.

Is it a property of Coq that all definable nat terms are standard? If so, how is "standard" defined? 

On Wed, Jun 2, 2021, 22:25 roux cody <cody.roux AT gmail.com> wrote:
Sure, I mean your notional proof that the axiom schema is consistent.

On Wed, Jun 2, 2021 at 4:10 PM Evan Marzion <emarzion AT gmail.com> wrote:
By induction, c is greater than n for all n.  Thus, c > c, a contradiction.

On Wed, Jun 2, 2021 at 2:53 PM Vincent Semeria <vincent.semeria AT gmail.com> wrote:
Dear Coq club,

Is it possible to axiomatize a term c : nat, such as c is greater than all standard natural numbers ? The first 2 lines are easy,
Axiom c : nat.
Axiom c_gt0 : 0 < c.

But then, could we consistently add this axiom ?
Axiom c_non_standard : forall n:nat, n < c -> S n < c.

If the last axiom is not consistent, we could modify Coq's type checker to interpret all names of the form c_gtSSSS...S0 as closed terms of the corresponding types SSSS...S0 < c. I am pretty sure that these terms are consistent, because if they introduced a proof of False, that proof would be a finite lambda-term with only a finite number of these c_gt terms. Then c could be replaced by the greatest of these terms, and we would obtain a proof of False in basic Coq.




Archive powered by MHonArc 2.6.19+.

Top of Page