Iterations of a function #
In this file we prove simple properties of Nat.iterate f n
a.k.a. f^[n]
:
iterate_zero
,iterate_succ
,iterate_succ'
,iterate_add
,iterate_mul
: formulas forf^[0]
,f^[n+1]
(two versions),f^[n+m]
, andf^[n*m]
;iterate_id
:id^[n]=id
;Injective.iterate
,Surjective.iterate
,Bijective.iterate
: iterates of an injective/surjective/bijective function belong to the same class;LeftInverse.iterate
,RightInverse.iterate
,Commute.iterate_left
,Commute.iterate_right
,Commute.iterate_iterate
: some properties of pairs of functions survive under iterationsiterate_fixed
,Function.Semiconj.iterate_*
,Function.Semiconj₂.iterate
: iff
fixes a point (resp., semiconjugates unary/binary operations), then so doesf^[n]
.
theorem
Function.Surjective.iterate
{α : Type u}
{f : α → α}
(Hsurj : Function.Surjective f)
(n : ℕ)
:
theorem
Function.Semiconj.iterate_right
{α : Type u}
{β : Type v}
{f : α → β}
{ga : α → α}
{gb : β → β}
(h : Function.Semiconj f ga gb)
(n : ℕ)
:
Function.Semiconj f ga^[n] gb^[n]
theorem
Function.Semiconj.iterate_left
{α : Type u}
{f : α → α}
{g : ℕ → α → α}
(H : ∀ (n : ℕ), Function.Semiconj f (g n) (g (n + 1)))
(n : ℕ)
(k : ℕ)
:
Function.Semiconj f^[n] (g k) (g (n + k))
theorem
Function.Commute.iterate_right
{α : Type u}
{f : α → α}
{g : α → α}
(h : Function.Commute f g)
(n : ℕ)
:
Function.Commute f g^[n]
theorem
Function.Commute.iterate_left
{α : Type u}
{f : α → α}
{g : α → α}
(h : Function.Commute f g)
(n : ℕ)
:
Function.Commute f^[n] g
theorem
Function.Commute.iterate_iterate
{α : Type u}
{f : α → α}
{g : α → α}
(h : Function.Commute f g)
(m : ℕ)
(n : ℕ)
:
Function.Commute f^[m] g^[n]
theorem
Function.Commute.iterate_iterate_self
{α : Type u}
(f : α → α)
(m : ℕ)
(n : ℕ)
:
Function.Commute f^[m] f^[n]
theorem
Function.Semiconj₂.iterate
{α : Type u}
{f : α → α}
{op : α → α → α}
(hf : Function.Semiconj₂ f op op)
(n : ℕ)
:
Function.Semiconj₂ f^[n] op op
def
Function.Iterate.rec
{α : Type u}
(p : α → Sort u_1)
{f : α → α}
(h : (a : α) → p a → p (f a))
{a : α}
(ha : p a)
(n : ℕ)
:
A recursor for the iterate of a function.
Equations
- Function.Iterate.rec p h ha 0 = ha
- Function.Iterate.rec p h ha m.succ = Function.Iterate.rec p h (h a ha) m
Instances For
theorem
Function.Iterate.rec_zero
{α : Type u}
(p : α → Sort u_1)
{f : α → α}
(h : (a : α) → p a → p (f a))
{a : α}
(ha : p a)
:
Function.Iterate.rec p h ha 0 = ha
theorem
Function.LeftInverse.iterate
{α : Type u}
{f : α → α}
{g : α → α}
(hg : Function.LeftInverse g f)
(n : ℕ)
:
theorem
Function.RightInverse.iterate
{α : Type u}
{f : α → α}
{g : α → α}
(hg : Function.RightInverse g f)
(n : ℕ)
:
theorem
Function.iterate_commute
{α : Type u}
(m : ℕ)
(n : ℕ)
:
Function.Commute (fun (f : α → α) => f^[m]) fun (f : α → α) => f^[n]
theorem
Function.involutive_iff_iter_2_eq_id
{α : Sort u_1}
{f : α → α}
:
Function.Involutive f ↔ f^[2] = id
theorem
List.foldl_const
{α : Type u}
{β : Type v}
(f : α → α)
(a : α)
(l : List β)
:
List.foldl (fun (b : α) (x : β) => f b) a l = f^[l.length] a
theorem
List.foldr_const
{α : Type u}
{β : Type v}
(f : β → β)
(b : β)
(l : List α)
:
List.foldr (fun (x : α) => f) b l = f^[l.length] b