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

« back to all changes in this revision

Viewing changes to theories/Program/Combinators.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
(* $Id: Combinators.v 11709 2008-12-20 11:42:15Z msozeau $ *)
 
9
 
 
10
(** Proofs about standard combinators, exports functional extensionality.
 
11
 
 
12
   Author: Matthieu Sozeau
 
13
   Institution: LRI, CNRS UMR 8623 - UniversitÃcopyright Paris Sud
 
14
   91405 Orsay, France *)
 
15
 
 
16
Require Import Coq.Program.Basics.
 
17
Require Export FunctionalExtensionality.
 
18
 
 
19
Open Scope program_scope.
 
20
 
 
21
(** Composition has [id] for neutral element and is associative. *)
 
22
 
 
23
Lemma compose_id_left : forall A B (f : A -> B), id ∘ f = f.
 
24
Proof.
 
25
  intros.
 
26
  unfold id, compose.
 
27
  symmetry. apply eta_expansion.
 
28
Qed.
 
29
 
 
30
Lemma compose_id_right : forall A B (f : A -> B), f ∘ id = f.
 
31
Proof.
 
32
  intros.
 
33
  unfold id, compose.
 
34
  symmetry ; apply eta_expansion.
 
35
Qed.
 
36
 
 
37
Lemma compose_assoc : forall A B C D (f : A -> B) (g : B -> C) (h : C -> D), 
 
38
  h ∘ g ∘ f = h ∘ (g ∘ f).
 
39
Proof.
 
40
  intros.
 
41
  reflexivity.
 
42
Qed.
 
43
 
 
44
Hint Rewrite @compose_id_left @compose_id_right : core.
 
45
Hint Rewrite <- @compose_assoc : core.
 
46
 
 
47
(** [flip] is involutive. *)
 
48
 
 
49
Lemma flip_flip : forall A B C, @flip A B C ∘ flip = id.
 
50
Proof.
 
51
  unfold flip, compose.
 
52
  intros.
 
53
  extensionality x ; extensionality y ; extensionality z.
 
54
  reflexivity.
 
55
Qed.
 
56
 
 
57
(** [prod_curry] and [prod_uncurry] are each others inverses. *)
 
58
 
 
59
Lemma prod_uncurry_curry : forall A B C, @prod_uncurry A B C ∘ prod_curry = id.
 
60
Proof.
 
61
  simpl ; intros.
 
62
  unfold prod_uncurry, prod_curry, compose.
 
63
  extensionality x ; extensionality y ; extensionality z.
 
64
  reflexivity.
 
65
Qed.
 
66
 
 
67
Lemma prod_curry_uncurry : forall A B C, @prod_curry A B C ∘ prod_uncurry = id.
 
68
Proof.
 
69
  simpl ; intros.
 
70
  unfold prod_uncurry, prod_curry, compose.
 
71
  extensionality x ; extensionality p.
 
72
  destruct p ; simpl ; reflexivity.
 
73
Qed.