]> 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 (* ITERATED FUNCTION FOR POSITIVE INTEGERS **********************************)
19
20 (* Note: see also: lib/arithemetics/bigops.ma *)
21 rec definition piter (p:pnat) (A:Type[0]) (f:A→A) (a:A) ≝
22 match p with
23 [ punit   ⇒ f a
24 | psucc q ⇒ f (piter q A f a)
25 ].
26
27 interpretation
28   "iterated function (positive integers)"
29   'Exp A f p = (piter p A f).
30
31 (* Basic constructions ******************************************************)
32
33 lemma piter_unit (A) (f) (a): f a = (f^{A}𝟏) a.
34 // qed.
35
36 lemma piter_succ (A) (f) (p) (a): f (f^p a) = f^{A}(↑p) a.
37 // qed.
38
39 (* Advanced constructions ***************************************************)
40
41 lemma piter_appl (A) (f) (p) (a): f (f^p a) = f^{A}p (f a).
42 #A #f #p elim p -p //
43 #p #IH #a <piter_succ <piter_succ //
44 qed.