~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to contrib/funind/Recdef.v

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
(************************************************************************)
 
8
Require Compare_dec.
 
9
Require Wf_nat.
 
10
 
 
11
Section Iter.
 
12
Variable A : Type.
 
13
 
 
14
Fixpoint iter (n : nat) : (A -> A) -> A -> A :=
 
15
  fun (fl : A -> A) (def : A) =>
 
16
  match n with
 
17
  | O => def
 
18
  | S m => fl (iter m fl def)
 
19
  end.
 
20
End Iter.
 
21
 
 
22
Theorem SSplus_lt : forall p p' : nat, p < S (S (p + p')).
 
23
  intro p; intro p'; change (S p <= S (S (p + p'))); 
 
24
    apply le_S; apply Gt.gt_le_S; change (p < S (p + p')); 
 
25
    apply Lt.le_lt_n_Sm; apply Plus.le_plus_l.
 
26
Qed.
 
27
 
 
28
 
 
29
Theorem Splus_lt : forall p p' : nat, p' < S (p + p').
 
30
  intro p; intro p'; change (S p' <= S (p + p')); 
 
31
    apply Gt.gt_le_S; change (p' < S (p + p')); apply Lt.le_lt_n_Sm;
 
32
       apply Plus.le_plus_r.
 
33
Qed.
 
34
 
 
35
Theorem le_lt_SS : forall x y, x <= y -> x < S (S y).
 
36
intro x; intro y; intro H; change (S x <= S (S y)); 
 
37
    apply le_S; apply Gt.gt_le_S; change (x < S y); 
 
38
    apply Lt.le_lt_n_Sm; exact H.
 
39
Qed.
 
40
 
 
41
Inductive max_type (m n:nat) : Set :=
 
42
  cmt : forall v, m <= v -> n <= v -> max_type m n.
 
43
 
 
44
Definition max : forall m n:nat, max_type m n.
 
45
intros m n; case (Compare_dec.le_gt_dec m n).
 
46
intros h; exists n; [exact h | apply le_n].
 
47
intros h; exists m; [apply le_n | apply Lt.lt_le_weak; exact h].
 
48
Defined.