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

« back to all changes in this revision

Viewing changes to theories/Logic/JMeq.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: JMeq.v 9849 2007-05-22 20:40:04Z herbelin $ i*)
 
10
 
 
11
(** John Major's Equality as proposed by Conor McBride
 
12
 
 
13
  Reference:
 
14
 
 
15
  [McBride] Elimination with a Motive, Proceedings of TYPES 2000,
 
16
  LNCS 2277, pp 197-216, 2002.
 
17
 
 
18
*)
 
19
 
 
20
Set Implicit Arguments.
 
21
 
 
22
Unset Elimination Schemes.
 
23
 
 
24
Inductive JMeq (A:Type) (x:A) : forall B:Type, B -> Prop :=
 
25
    JMeq_refl : JMeq x x.
 
26
 
 
27
Set Elimination Schemes.
 
28
 
 
29
Hint Resolve JMeq_refl.
 
30
 
 
31
Lemma sym_JMeq : forall (A B:Type) (x:A) (y:B), JMeq x y -> JMeq y x.
 
32
destruct 1; trivial.
 
33
Qed.
 
34
 
 
35
Hint Immediate sym_JMeq.
 
36
 
 
37
Lemma trans_JMeq :
 
38
 forall (A B C:Type) (x:A) (y:B) (z:C), JMeq x y -> JMeq y z -> JMeq x z.
 
39
destruct 1; trivial.
 
40
Qed.
 
41
 
 
42
Axiom JMeq_eq : forall (A:Type) (x y:A), JMeq x y -> x = y.
 
43
 
 
44
Lemma JMeq_ind : forall (A:Type) (x y:A) (P:A -> Prop), P x -> JMeq x y -> P y.
 
45
intros A x y P H H'; case JMeq_eq with (1 := H'); trivial.
 
46
Qed.
 
47
 
 
48
Lemma JMeq_rec : forall (A:Type) (x y:A) (P:A -> Set), P x -> JMeq x y -> P y.
 
49
intros A x y P H H'; case JMeq_eq with (1 := H'); trivial.
 
50
Qed.
 
51
 
 
52
Lemma JMeq_rect : forall (A:Type) (x y:A) (P:A->Type), P x -> JMeq x y -> P y.
 
53
intros A x y P H H'; case JMeq_eq with (1 := H'); trivial.
 
54
Qed.
 
55
 
 
56
Lemma JMeq_ind_r :
 
57
 forall (A:Type) (x y:A) (P:A -> Prop), P y -> JMeq x y -> P x.
 
58
intros A x y P H H'; case JMeq_eq with (1 := sym_JMeq H'); trivial.
 
59
Qed.
 
60
 
 
61
Lemma JMeq_rec_r :
 
62
 forall (A:Type) (x y:A) (P:A -> Set), P y -> JMeq x y -> P x.
 
63
intros A x y P H H'; case JMeq_eq with (1 := sym_JMeq H'); trivial.
 
64
Qed.
 
65
 
 
66
Lemma JMeq_rect_r :
 
67
 forall (A:Type) (x y:A) (P:A -> Type), P y -> JMeq x y -> P x.
 
68
intros A x y P H H'; case JMeq_eq with (1 := sym_JMeq H'); trivial.
 
69
Qed.
 
70
 
 
71
(** [JMeq] is equivalent to [eq_dep Type (fun X => X)] *)
 
72
 
 
73
Require Import Eqdep.
 
74
 
 
75
Lemma JMeq_eq_dep_id :
 
76
 forall (A B:Type) (x:A) (y:B), JMeq x y -> eq_dep Type (fun X => X) A x B y.
 
77
Proof.
 
78
destruct 1.
 
79
apply eq_dep_intro.
 
80
Qed.
 
81
 
 
82
Lemma eq_dep_id_JMeq :
 
83
 forall (A B:Type) (x:A) (y:B), eq_dep Type (fun X => X) A x B y -> JMeq x y.
 
84
Proof.
 
85
destruct 1.
 
86
apply JMeq_refl.
 
87
Qed.
 
88
 
 
89
(** [eq_dep U P p x q y] is strictly finer than [JMeq (P p) x (P q) y] *)
 
90
 
 
91
Lemma eq_dep_JMeq :
 
92
 forall U P p x q y, eq_dep U P p x q y -> JMeq x y.
 
93
Proof.
 
94
destruct 1.
 
95
apply JMeq_refl.
 
96
Qed.
 
97
 
 
98
Lemma eq_dep_strictly_stronger_JMeq :
 
99
 exists U, exists P, exists p, exists q, exists x, exists y,
 
100
  JMeq x y /\ ~ eq_dep U P p x q y.
 
101
Proof.
 
102
exists bool. exists (fun _ => True). exists true. exists false.
 
103
exists I. exists I.
 
104
split.
 
105
trivial.
 
106
intro H.
 
107
assert (true=false) by (destruct H; reflexivity).
 
108
discriminate.
 
109
Qed.