]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/pnat_iter.ma
arithmetics for λδ
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / pnat_iter.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground/notation/functions/exp_3.ma".
16 include "ground/arith/pnat.ma".
17
18 (* POSITIVE INTEGERS ********************************************************)
19
20 rec definition piter (p:pnat) (A:Type[0]) (f:A→A) (a:A) ≝
21 match p with
22 [ punit   ⇒ f a
23 | psucc q ⇒ f (piter q A f a)
24 ].
25
26 interpretation
27   "iterated function (positive integers)"
28   'Exp A f p = (piter p A f).
29
30 (* Basic rewrites ***********************************************************)
31
32 lemma piter_unit (A) (f) (a): f a = (f^{A}𝟏) a.
33 // qed.
34
35 lemma piter_succ (A) (f) (p) (a): f (f^p a) = f^{A}(↑p) a.
36 // qed.
37
38 (* Advanced rewrites ********************************************************)
39
40 lemma piter_appl (A) (f) (p) (a): f (f^p a) = f^{A}p (f a).
41 #A #f #p elim p -p //
42 #p #IH #a <piter_succ <piter_succ //
43 qed.