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

« back to all changes in this revision

Viewing changes to theories/Sets/Permut.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
 
 
9
(*i $Id: Permut.v 10616 2008-03-04 17:33:35Z letouzey $ i*)
 
10
 
 
11
(* G. Huet 1-9-95 *)
 
12
 
 
13
(** We consider a Set [U], given with a commutative-associative operator [op],
 
14
    and a congruence [cong]; we show permutation lemmas *)
 
15
 
 
16
Section Axiomatisation.
 
17
 
 
18
  Variable U : Type.
 
19
  Variable op : U -> U -> U.
 
20
  Variable cong : U -> U -> Prop.
 
21
 
 
22
  Hypothesis op_comm : forall x y:U, cong (op x y) (op y x).
 
23
  Hypothesis op_ass : forall x y z:U, cong (op (op x y) z) (op x (op y z)).
 
24
 
 
25
  Hypothesis cong_left : forall x y z:U, cong x y -> cong (op x z) (op y z).
 
26
  Hypothesis cong_right : forall x y z:U, cong x y -> cong (op z x) (op z y).
 
27
  Hypothesis cong_trans : forall x y z:U, cong x y -> cong y z -> cong x z.
 
28
  Hypothesis cong_sym : forall x y:U, cong x y -> cong y x.
 
29
 
 
30
  (** Remark. we do not need: [Hypothesis cong_refl : (x:U)(cong x x)]. *)
 
31
 
 
32
  Lemma cong_congr :
 
33
    forall x y z t:U, cong x y -> cong z t -> cong (op x z) (op y t).
 
34
  Proof.
 
35
    intros; apply cong_trans with (op y z).
 
36
    apply cong_left; trivial.
 
37
    apply cong_right; trivial.
 
38
  Qed.
 
39
  
 
40
  Lemma comm_right : forall x y z:U, cong (op x (op y z)) (op x (op z y)).
 
41
  Proof.
 
42
    intros; apply cong_right; apply op_comm.
 
43
  Qed.
 
44
  
 
45
  Lemma comm_left : forall x y z:U, cong (op (op x y) z) (op (op y x) z).
 
46
  Proof.
 
47
    intros; apply cong_left; apply op_comm.
 
48
  Qed.
 
49
  
 
50
  Lemma perm_right : forall x y z:U, cong (op (op x y) z) (op (op x z) y).
 
51
  Proof.
 
52
    intros.
 
53
    apply cong_trans with (op x (op y z)).
 
54
    apply op_ass.
 
55
    apply cong_trans with (op x (op z y)). 
 
56
    apply cong_right; apply op_comm.
 
57
    apply cong_sym; apply op_ass.
 
58
  Qed.
 
59
 
 
60
  Lemma perm_left : forall x y z:U, cong (op x (op y z)) (op y (op x z)).
 
61
  Proof.
 
62
    intros.
 
63
    apply cong_trans with (op (op x y) z).
 
64
    apply cong_sym; apply op_ass.
 
65
    apply cong_trans with (op (op y x) z).
 
66
    apply cong_left; apply op_comm.
 
67
    apply op_ass.
 
68
  Qed.
 
69
  
 
70
  Lemma op_rotate : forall x y z t:U, cong (op x (op y z)) (op z (op x y)).
 
71
  Proof.
 
72
    intros; apply cong_trans with (op (op x y) z).
 
73
    apply cong_sym; apply op_ass.
 
74
    apply op_comm.
 
75
  Qed.
 
76
 
 
77
  (** Needed for treesort ... *)
 
78
  Lemma twist :
 
79
    forall x y z t:U, cong (op x (op (op y z) t)) (op (op y (op x t)) z).
 
80
  Proof.
 
81
    intros.
 
82
    apply cong_trans with (op x (op (op y t) z)).
 
83
    apply cong_right; apply perm_right.
 
84
    apply cong_trans with (op (op x (op y t)) z).
 
85
    apply cong_sym; apply op_ass.
 
86
    apply cong_left; apply perm_left.
 
87
  Qed.
 
88
 
 
89
End Axiomatisation.
 
 
b'\\ No newline at end of file'