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 (**************************************************************************)
17 include "nat/times.ma".
18 include "nat/orders.ma".
22 inductive L (T:Type):Type:=
26 inductive eq (T:Type) : L T → L T → Prop :=
27 eq_refl:∀x:T. eq T (j ? x) (j ? x).
29 notation "hvbox(a break ≡ b)"
30 non associative with precedence 45
31 for @{ 'equiv $a $b }.
33 interpretation "uguaglianza parziale" 'equiv x y = (eq _ x y).
35 coercion cic:/matita/tests/decl/L.ind#xpointer(1/1/2).
37 lemma sim: ∀T:Type. ∀x,y:T. (j ? x) ≡ (j ? y) → (j ? y) ≡ (j ? x).
44 lemma trans: ∀T:Type. ∀x,y,z:T.
45 (j ? x) ≡ (j ? y) → (j ? y) ≡ (j ? z) → (j ? x) ≡ (j ? z).
56 axiom Rplus: L R→L R→L R.
57 axiom Rmult: L R→L R→L R.(*
58 axiom Rdiv: L R→L R→L R.*)
60 axiom Relev: L R→L R→L R.
61 axiom Rle: L R→L R→Prop.
62 axiom Rge: L R→L R→Prop.
64 interpretation "real plus" 'plus x y = (Rplus x y).
66 interpretation "real leq" 'leq x y = (Rle x y).
68 interpretation "real geq" 'geq x y = (Rge x y).
70 let rec elev (x:L R) (n:nat) on n: L R ≝
72 [O ⇒ match x with [bottom ⇒ bottom ? | j y ⇒ (j ? R1)]
73 | S n ⇒ Rmult x (elev x n)
76 let rec real_of_nat (n:nat) : L R ≝
79 | S n ⇒ real_of_nat n + (j ? R1)
82 coercion cic:/matita/tests/decl/real_of_nat.con.
84 axiom Rplus_commutative: ∀x,y:R. (j ? x) + (j ? y) ≡ (j ? y) + (j ? x).
85 axiom R0_neutral: ∀x:R. (j ? x) + (j ? R0) ≡ (j ? x).
86 axiom Rmult_commutative: ∀x,y:R. Rmult (j ? x) (j ? y) ≡ Rmult (j ? y) (j ? x).
87 axiom R1_neutral: ∀x:R. Rmult (j ? x) (j ? R1) ≡ (j ? x).
90 ∀x:R. ¬((j ? x) ≡ (j ? R0)) → Rmult (Rinv (j ? x)) (j ? x) ≡ (j ? R1).
91 definition is_defined :=
92 λ T:Type. λ x:L T. ∃y:T. x = (j ? y).
93 axiom Rinv_ok2: ∀x:L R. ¬(x = bottom ?) → ¬(x ≡ (j ? R0)) → is_defined ? (Rinv x).
96 λ x,y:L R. Rmult x (Rinv y).
99 lemma pippo: ∀x:R. ¬((j ? x) ≡ (j ? R0)) → Rdiv (j ? R1) (j ? x) ≡ Rinv (j ? x).
102 elim (Rinv_ok2 ? ? H).
104 rewrite > Rmult_commutative.
108 axiom Rdiv_le: ∀x,y:R. (j ? R1) ≤ (j ? y) → Rdiv (j ? x) (j ? y) ≤ (j ? x).
109 axiom R2_1: (j ? R1) ≤ S (S O).
112 axiom Rdiv_pos: ∀ x,y:R.
113 (j ? R0) ≤ (j ? x) → (j ? R1) ≤ (j ? y) → (j ? R0) ≤ Rdiv (j ? x) (j ? y).
114 axiom Rle_R0_R1: (j ? R0) ≤ (j ? R1).
115 axiom div: ∀x:R. (j ? x) = Rdiv (j ? x) (S (S O)) → (j ? x) = O.