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

« back to all changes in this revision

Viewing changes to contrib/setoid_ring/Ring_equiv.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
Require Import Setoid_ring_theory.
 
2
Require Import LegacyRing_theory.
 
3
Require Import Ring_theory.
 
4
 
 
5
Set Implicit Arguments.
 
6
 
 
7
Section Old2New.
 
8
 
 
9
Variable A : Type.
 
10
 
 
11
Variable Aplus : A -> A -> A.
 
12
Variable Amult : A -> A -> A.
 
13
Variable Aone : A.
 
14
Variable Azero : A.
 
15
Variable Aopp : A -> A.
 
16
Variable Aeq : A -> A -> bool.
 
17
Variable R : Ring_Theory Aplus Amult Aone Azero Aopp Aeq.
 
18
 
 
19
Let Aminus := fun x y => Aplus x (Aopp y).
 
20
 
 
21
Lemma ring_equiv1 :
 
22
  ring_theory Azero Aone Aplus Amult Aminus Aopp (eq (A:=A)).
 
23
Proof.
 
24
destruct R.
 
25
split;  eauto.
 
26
Qed.
 
27
 
 
28
End Old2New.
 
29
 
 
30
Section New2OldRing.
 
31
 Variable R : Type.
 
32
 Variable (rO rI : R) (radd rmul rsub: R->R->R) (ropp : R -> R).
 
33
 Variable Rth : ring_theory rO rI radd rmul rsub ropp (eq (A:=R)).
 
34
 
 
35
 Variable reqb : R -> R -> bool.
 
36
 Variable reqb_ok : forall x y, reqb x y = true -> x = y.
 
37
 
 
38
 Lemma ring_equiv2 :
 
39
   Ring_Theory radd  rmul rI rO ropp reqb.
 
40
Proof.
 
41
elim Rth; intros; constructor;  eauto.
 
42
intros.
 
43
apply reqb_ok.
 
44
destruct (reqb x y); trivial; intros.
 
45
elim H.
 
46
Qed.
 
47
 
 
48
 Definition default_eqb : R -> R -> bool := fun x y => false.
 
49
 Lemma default_eqb_ok : forall x y, default_eqb x y = true -> x = y.
 
50
Proof.
 
51
discriminate 1.
 
52
Qed.
 
53
 
 
54
End New2OldRing.
 
55
 
 
56
Section New2OldSemiRing.
 
57
 Variable R : Type.
 
58
 Variable (rO rI : R) (radd rmul: R->R->R).
 
59
 Variable SRth : semi_ring_theory rO rI radd rmul (eq (A:=R)).
 
60
 
 
61
 Variable reqb : R -> R -> bool.
 
62
 Variable reqb_ok : forall x y, reqb x y = true -> x = y.
 
63
 
 
64
 Lemma sring_equiv2 :
 
65
   Semi_Ring_Theory radd rmul rI rO reqb.
 
66
Proof.
 
67
elim SRth; intros; constructor;  eauto.
 
68
intros.
 
69
apply reqb_ok.
 
70
destruct (reqb x y); trivial; intros.
 
71
elim H.
 
72
Qed.
 
73
 
 
74
End New2OldSemiRing.