]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/Q/fraction/finv.ma
Preparing for 0.5.9 release.
[helm.git] / helm / software / matita / library / Q / fraction / finv.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 "Z/plus.ma".
16 include "Q/fraction/fraction.ma".
17
18 let rec finv f ≝                                               
19   match f with
20   [ pp n ⇒ nn n
21   | nn n ⇒ pp n
22   | cons x g ⇒ cons (Zopp x) (finv g)].
23
24 theorem finv_finv: ∀f. finv (finv f) = f.
25  intro; 
26  elim f;
27   [1,2: reflexivity
28   | simplify;
29     rewrite > H;
30     rewrite > Zopp_Zopp;
31     reflexivity
32   ]
33 qed.