]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/Q/q/qinv.ma
updating the structures for sorts
[helm.git] / helm / software / matita / library / Q / q / qinv.ma
1 (**************************************************************************)
2 (*       ___                                                                *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||       A.Asperti, C.Sacerdoti Coen,                          *)
8 (*      ||A||       E.Tassi, S.Zacchiroli                                 *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU Lesser General Public License Version 2.1         *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "Q/q/q.ma".
16 include "Q/ratio/rinv.ma".
17
18 definition Qinv : Q → Q ≝
19  λp.
20   match p with
21    [ OQ ⇒ OQ  (* arbitrary value *)
22    | Qpos r ⇒ Qpos (rinv r)
23    | Qneg r ⇒ Qneg (rinv r)
24    ].
25
26 theorem Qinv_Qinv: ∀q. Qinv (Qinv q) = q.
27  intro;
28  elim q;
29   [ reflexivity
30   |*:simplify;
31     rewrite > rinv_rinv;
32     reflexivity]
33 qed.