1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
9
(*i $Id: BigN.v 11576 2008-11-10 19:13:15Z msozeau $ i*)
11
(** * Natural numbers in base 2^31 *)
14
Author: Arnaud Spiwack
18
Require Import CyclicAxioms.
19
Require Import Cyclic31.
21
Require Import NSigNAxioms.
25
Module BigN <: NType := NMake.Make Int31Cyclic.
27
(** Module [BigN] implements [NAxiomsSig] *)
29
Module Export BigNAxiomsMod := NSig_NAxioms BigN.
30
Module Export BigNSubPropMod := NSubPropFunct BigNAxiomsMod.
32
(** Notations about [BigN] *)
34
Notation bigN := BigN.t.
36
Delimit Scope bigN_scope with bigN.
37
Bind Scope bigN_scope with bigN.
38
Bind Scope bigN_scope with BigN.t.
39
Bind Scope bigN_scope with BigN.t_.
41
Notation Local "0" := BigN.zero : bigN_scope. (* temporary notation *)
42
Infix "+" := BigN.add : bigN_scope.
43
Infix "-" := BigN.sub : bigN_scope.
44
Infix "*" := BigN.mul : bigN_scope.
45
Infix "/" := BigN.div : bigN_scope.
46
Infix "?=" := BigN.compare : bigN_scope.
47
Infix "==" := BigN.eq (at level 70, no associativity) : bigN_scope.
48
Infix "<" := BigN.lt : bigN_scope.
49
Infix "<=" := BigN.le : bigN_scope.
50
Notation "x > y" := (BigN.lt y x)(only parsing) : bigN_scope.
51
Notation "x >= y" := (BigN.le y x)(only parsing) : bigN_scope.
52
Notation "[ i ]" := (BigN.to_Z i) : bigN_scope.
54
Open Scope bigN_scope.
56
(** Example of reasoning about [BigN] *)
58
Theorem succ_pred: forall q:bigN,
59
0 < q -> BigN.succ (BigN.pred q) == q.
61
intros; apply succ_pred.
62
intro H'; rewrite H' in H; discriminate.
65
(** [BigN] is a semi-ring *)
68
semi_ring_theory BigN.zero BigN.one BigN.add BigN.mul BigN.eq.
78
exact mul_add_distr_r.
81
Add Ring BigNr : BigNring.
83
(** Todo: tactic translating from [BigN] to [Z] + omega *)
85
(** Todo: micromega *)