1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* This file was automatically generated: do not edit *********************)
19 (*#**********************************************************************)
21 (* v * The Coq Proof Assistant / The Coq Development Team *)
23 (* <O___,, * INRIA-Rocquencourt & LRI-CNRS-Orsay *)
25 (* \VV/ *************************************************************)
27 (* // * This file is distributed under the terms of the *)
29 (* * GNU Lesser General Public License Version 2.1 *)
31 (*#**********************************************************************)
33 (*i $Id: Div2.v,v 1.15 2003/11/29 17:28:28 herbelin Exp $ i*)
35 include "Arith/Lt.ma".
37 include "Arith/Plus.ma".
39 include "Arith/Compare_dec.ma".
41 include "Arith/Even.ma".
44 Open Local Scope nat_scope.
48 Implicit Type n : nat.
51 (*#* Here we define [n/2] and prove some of its properties *)
53 inline procedural "cic:/Coq/Arith/Div2/div2.con" as definition.
55 (*#* Since [div2] is recursively defined on [0], [1] and [(S (S n))], it is
56 useful to prove the corresponding induction principle *)
58 inline procedural "cic:/Coq/Arith/Div2/ind_0_1_SS.con" as lemma.
60 (*#* [0 <n => n/2 < n] *)
62 inline procedural "cic:/Coq/Arith/Div2/lt_div2.con" as lemma.
65 Hint Resolve lt_div2: arith.
68 (*#* Properties related to the parity *)
70 inline procedural "cic:/Coq/Arith/Div2/even_odd_div2.con" as lemma.
72 (*#* Specializations *)
74 inline procedural "cic:/Coq/Arith/Div2/even_div2.con" as lemma.
76 inline procedural "cic:/Coq/Arith/Div2/div2_even.con" as lemma.
78 inline procedural "cic:/Coq/Arith/Div2/odd_div2.con" as lemma.
80 inline procedural "cic:/Coq/Arith/Div2/div2_odd.con" as lemma.
83 Hint Resolve even_div2 div2_even odd_div2 div2_odd: arith.
86 (*#* Properties related to the double ([2n]) *)
88 inline procedural "cic:/Coq/Arith/Div2/double.con" as definition.
91 Hint Unfold double: arith.
94 inline procedural "cic:/Coq/Arith/Div2/double_S.con" as lemma.
96 inline procedural "cic:/Coq/Arith/Div2/double_plus.con" as lemma.
99 Hint Resolve double_S: arith.
102 inline procedural "cic:/Coq/Arith/Div2/even_odd_double.con" as lemma.
104 (*#* Specializations *)
106 inline procedural "cic:/Coq/Arith/Div2/even_double.con" as lemma.
108 inline procedural "cic:/Coq/Arith/Div2/double_even.con" as lemma.
110 inline procedural "cic:/Coq/Arith/Div2/odd_double.con" as lemma.
112 inline procedural "cic:/Coq/Arith/Div2/double_odd.con" as lemma.
115 Hint Resolve even_double double_even odd_double double_odd: arith.
119 - if [n] is even then there is a [p] such that [n = 2p]
120 - if [n] is odd then there is a [p] such that [n = 2p+1]
122 (Immediate: it is [n/2]) *)
124 inline procedural "cic:/Coq/Arith/Div2/even_2n.con" as lemma.
126 inline procedural "cic:/Coq/Arith/Div2/odd_S2n.con" as lemma.