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

« back to all changes in this revision

Viewing changes to theories/Logic/ProofIrrelevanceFacts.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
(** This defines the functor that build consequences of proof-irrelevance *)
 
10
 
 
11
Require Export EqdepFacts.
 
12
 
 
13
Module Type ProofIrrelevance.
 
14
 
 
15
  Axiom proof_irrelevance : forall (P:Prop) (p1 p2:P), p1 = p2.
 
16
 
 
17
End ProofIrrelevance.
 
18
 
 
19
Module ProofIrrelevanceTheory (M:ProofIrrelevance).
 
20
 
 
21
  (** Proof-irrelevance implies uniqueness of reflexivity proofs *)
 
22
 
 
23
  Module Eq_rect_eq.
 
24
    Lemma eq_rect_eq : 
 
25
      forall (U:Type) (p:U) (Q:U -> Type) (x:Q p) (h:p = p), 
 
26
        x = eq_rect p Q x p h.
 
27
    Proof.
 
28
      intros; rewrite M.proof_irrelevance with (p1:=h) (p2:=refl_equal p).
 
29
      reflexivity.
 
30
    Qed.
 
31
  End Eq_rect_eq.
 
32
 
 
33
  (** Export the theory of injective dependent elimination *)
 
34
 
 
35
  Module EqdepTheory := EqdepTheory(Eq_rect_eq).
 
36
  Export EqdepTheory.
 
37
 
 
38
  Scheme eq_indd := Induction for eq Sort Prop.
 
39
 
 
40
  (** We derive the irrelevance of the membership property for subsets *)
 
41
 
 
42
  Lemma subset_eq_compat :
 
43
    forall (U:Set) (P:U->Prop) (x y:U) (p:P x) (q:P y),
 
44
      x = y -> exist P x p = exist P y q.
 
45
  Proof.
 
46
    intros.
 
47
    rewrite M.proof_irrelevance with (p1:=q) (p2:=eq_rect x P p y H).
 
48
    elim H using eq_indd.
 
49
    reflexivity.
 
50
  Qed.
 
51
 
 
52
  Lemma subsetT_eq_compat :
 
53
    forall (U:Type) (P:U->Prop) (x y:U) (p:P x) (q:P y),
 
54
      x = y -> existT P x p = existT P y q.
 
55
  Proof.
 
56
    intros.
 
57
    rewrite M.proof_irrelevance with (p1:=q) (p2:=eq_rect x P p y H).
 
58
    elim H using eq_indd.
 
59
    reflexivity.
 
60
  Qed.
 
61
 
 
62
End ProofIrrelevanceTheory.