1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* This file was automatically generated: do not edit *********************)
19 (* $Id: Qsec.v,v 1.7 2004/04/08 08:20:35 lcf Exp $ *)
21 (*#* printing Q %\ensuremath{\mathbb{Q}}% *)
23 (*#* printing QZERO %\ensuremath{0_\mathbb{Q}}% #0<sub>Q</sub># *)
25 (*#* printing QONE %\ensuremath{1_\mathbb{Q}}% #1<sub>Q</sub># *)
27 (*#* printing QTWO %\ensuremath{2_\mathbb{Q}}% #2<sub>Q</sub># *)
29 (*#* printing QFOUR %\ensuremath{4_\mathbb{Q}}% #4<sub>Q</sub># *)
31 include "algebra/CLogic.ma".
33 include "model/structures/Zsec.ma".
37 We define the structure of rational numbers as follows. First of all,
38 it consists of the set of rational numbers, defined as the set of
39 pairs $\langle a,n\rangle$#⟨a,n⟩# with [a:Z] and
40 [n:positive]. Intuitively, $\langle a,n\rangle$#⟨a,n⟩#
41 represents the rational number [a[/]n]. Then there is the equality on
42 [Q]: $\langle a,m\rangle=\langle
43 b,n\rangle$#⟨a,m⟩=⟨b,n⟩# iff [an [=] bm]. We
44 also define apartness, order, addition, multiplication, opposite,
45 inverse an de constants 0 and 1. *)
51 inline procedural "cic:/CoRN/model/structures/Qsec/Q.ind".
53 inline procedural "cic:/CoRN/model/structures/Qsec/Qeq.con" as definition.
55 inline procedural "cic:/CoRN/model/structures/Qsec/Qap.con" as definition.
57 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt.con" as definition.
59 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus.con" as definition.
61 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult.con" as definition.
63 inline procedural "cic:/CoRN/model/structures/Qsec/Qopp.con" as definition.
65 inline procedural "cic:/CoRN/model/structures/Qsec/QZERO.con" as definition.
67 inline procedural "cic:/CoRN/model/structures/Qsec/QONE.con" as definition.
69 inline procedural "cic:/CoRN/model/structures/Qsec/Qinv.con" as definition.
76 Infix "{=Q}" := Qeq (no associativity, at level 90).
80 Infix "{#Q}" := Qap (no associativity, at level 90).
84 Infix "{<Q}" := Qlt (no associativity, at level 90).
88 Infix "{+Q}" := Qplus (no associativity, at level 85).
92 Infix "{*Q}" := Qmult (no associativity, at level 80).
96 Notation "{-Q}" := Qopp (at level 1, left associativity).
102 inline procedural "cic:/CoRN/model/structures/Qsec/QTWO.con" as definition.
104 inline procedural "cic:/CoRN/model/structures/Qsec/QFOUR.con" as definition.
107 Here we prove that [QONE] is #<i>#%\emph{%not equal%}%#</i># to [QZERO]:
110 inline procedural "cic:/CoRN/model/structures/Qsec/ONEQ_neq_ZEROQ.con" as theorem.
112 inline procedural "cic:/CoRN/model/structures/Qsec/refl_Qeq.con" as theorem.
114 inline procedural "cic:/CoRN/model/structures/Qsec/sym_Qeq.con" as theorem.
116 inline procedural "cic:/CoRN/model/structures/Qsec/trans_Qeq.con" as theorem.
119 The equality is decidable:
122 inline procedural "cic:/CoRN/model/structures/Qsec/dec_Qeq.con" as theorem.
127 inline procedural "cic:/CoRN/model/structures/Qsec/Q_non_zero.con" as lemma.
129 inline procedural "cic:/CoRN/model/structures/Qsec/ap_Q_irreflexive0.con" as lemma.
131 inline procedural "cic:/CoRN/model/structures/Qsec/ap_Q_symmetric0.con" as lemma.
133 inline procedural "cic:/CoRN/model/structures/Qsec/ap_Q_cotransitive0.con" as lemma.
135 inline procedural "cic:/CoRN/model/structures/Qsec/ap_Q_tight0.con" as lemma.
140 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus_simpl.con" as theorem.
143 Addition is associative:
146 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus_assoc.con" as theorem.
149 [QZERO] as the neutral element for addition:
152 inline procedural "cic:/CoRN/model/structures/Qsec/QZERO_right.con" as theorem.
155 Commutativity of addition:
158 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus_sym.con" as theorem.
160 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus_strext0.con" as lemma.
162 inline procedural "cic:/CoRN/model/structures/Qsec/ZEROQ_as_rht_unit0.con" as lemma.
164 inline procedural "cic:/CoRN/model/structures/Qsec/ZEROQ_as_lft_unit0.con" as lemma.
166 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus_is_commut0.con" as lemma.
169 [{-Q}] is a well defined unary operation:
172 inline procedural "cic:/CoRN/model/structures/Qsec/Qopp_simpl.con" as lemma.
175 The group equation for [{-Q}]
178 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus_inverse_r.con" as theorem.
180 (*#* ***Multiplication
181 Next we shall prove the properties of multiplication. First we prove
182 that [{*Q}] is well-defined
185 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_simpl.con" as theorem.
188 and it is associative:
191 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_assoc.con" as theorem.
194 [QONE] is the neutral element for multiplication:
197 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_n_1.con" as theorem.
200 The commutativity for [{*Q}]:
203 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_sym.con" as theorem.
205 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_plus_distr_r.con" as theorem.
208 And a property of multiplication which says if [x [~=] Zero] and [xy [=] Zero] then [y [=] Zero]:
211 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_eq.con" as theorem.
213 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_strext0.con" as lemma.
215 inline procedural "cic:/CoRN/model/structures/Qsec/nonZero.con" as lemma.
220 inline procedural "cic:/CoRN/model/structures/Qsec/Qinv_strext.con" as lemma.
222 inline procedural "cic:/CoRN/model/structures/Qsec/Qinv_is_inv.con" as lemma.
227 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_wd_right.con" as lemma.
229 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_wd_left.con" as lemma.
231 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_eq_gt_dec.con" as lemma.
233 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_is_transitive_unfolded.con" as lemma.
235 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_strext_unfolded.con" as lemma.
237 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_is_irreflexive_unfolded.con" as lemma.
239 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_is_antisymmetric_unfolded.con" as lemma.
241 inline procedural "cic:/CoRN/model/structures/Qsec/Qplus_resp_Qlt.con" as lemma.
243 inline procedural "cic:/CoRN/model/structures/Qsec/Qmult_resp_pos_Qlt.con" as lemma.
245 inline procedural "cic:/CoRN/model/structures/Qsec/Qlt_gives_apartness.con" as lemma.
247 (*#* ***Miscellaneous
248 We consider the injection [inject_Z] from [Z] to [Q] as a coercion.
251 inline procedural "cic:/CoRN/model/structures/Qsec/inject_Z.con" as definition.
254 cic:/matita/CoRN-Procedural/model/structures/Qsec/inject_Z.con
257 inline procedural "cic:/CoRN/model/structures/Qsec/injz_plus.con" as lemma.
259 inline procedural "cic:/CoRN/model/structures/Qsec/injZ_One.con" as lemma.
261 (*#* We can always find a natural number that is bigger than a given rational
265 inline procedural "cic:/CoRN/model/structures/Qsec/Q_is_archemaedian0.con" as theorem.