Library HoTT.Foundations.MLTT.Nat

This file is part of https://github.com/mjub/hott.

Require Export Foundations.MLTT.Init.

Martin-LΓΆf Type Theory, Part III: The Natural Numbers

Definition


Inductive β„• : π‘ˆβ‚€ := zero | succ : β„• β†’ β„•.

Notation "0" := zero.

Notation "n + 1" := (succ n)
  (at level 2, left associativity, format "n + 1").
Notation "n + 2" := (succ (succ n))
  (at level 2, left associativity, format "n + 2").
Notation "n + 3" := (succ (succ (succ n)))
  (at level 2, left associativity, format "n + 3").

Elimination principles for the natural numbers.

Fixpoint ind_β„• (C : β„• β†’ π‘ˆ) (cβ‚€ : C 0) (cβ‚› : ∏ n, C n β†’ C (n + 1)) n :=
  match n with
  | 0 β‡’ cβ‚€
  | k + 1 β‡’ cβ‚› k (ind_β„• _ cβ‚€ cβ‚› k)
  end.

Fixpoint rec_β„• {C : π‘ˆ} (cβ‚€ : C) (cβ‚› : ∏ n, C β†’ C) n :=
  match n with
  | 0 β‡’ cβ‚€
  | k + 1 β‡’ cβ‚› k (rec_β„• cβ‚€ cβ‚› k)
  end.

Dirty hack

I am not smart enough to understand how to use Number Notation...

Notation "1" := (succ 0).
Notation "2" := (succ 1).
Notation "3" := (succ 2).
Notation "4" := (succ 3).
Notation "5" := (succ 4).
Notation "6" := (succ 5).
Notation "7" := (succ 6).
Notation "8" := (succ 7).
Notation "9" := (succ 8).