File: Mathlib/Logic/Function/Iterate.lean

full_name: Nat.iterate
code: /-- Iterate a function. -/
def Nat.iterate {α : Sort u} (op : α → α) : ℕ → α → α
  
goal: ℕ → α → α

full_name: _aux_Mathlib_Logic_Function_Iterate___unexpand_Nat_iterate_1
code: @[inherit_doc Nat.iterate]
notation:max f "^["n"]" => Nat.iterate f n
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Logic_Function_Iterate___macroRules_term_^[_]_1»
code: @[inherit_doc Nat.iterate]
notation:max f "^["n"]" => Nat.iterate f n
goal: Lean.Macro

full_name: Function.iterate_zero
code: @[simp]
theorem iterate_zero : f^[0] = id 
goal: f^[0] = id

full_name: Function.iterate_zero_apply
code: theorem iterate_zero_apply (x : α) : f^[0] x = x 
goal: f^[0] x = x

full_name: Function.iterate_succ
code: @[simp]
theorem iterate_succ (n : ℕ) : f^[n.succ] = f^[n] ∘ f 
goal: f^[n.succ] = f^[n] ∘ f

full_name: Function.iterate_succ_apply
code: theorem iterate_succ_apply (n : ℕ) (x : α) : f^[n.succ] x = f^[n] (f x) 
goal: f^[n.succ] x = f^[n] (f x)

full_name: Function.iterate_id
code: @[simp]
theorem iterate_id (n : ℕ) : (id : α → α)^[n] = id 
goal: id^[n] = id

full_name: Function.iterate_add
code: theorem iterate_add (m : ℕ) : ∀ n : ℕ, f^[m + n] = f^[m] ∘ f^[n]
  
goal: f^[m + n] = f^[m] ∘ f^[n]

full_name: Function.iterate_add_apply
code: theorem iterate_add_apply (m n : ℕ) (x : α) : f^[m + n] x = f^[m] (f^[n] x) 
goal: f^[m + n] x = f^[m] (f^[n] x)

full_name: Function.iterate_one
code: @[simp high]
theorem iterate_one : f^[1] = f 
goal: f^[1] = f

full_name: Function.iterate_mul
code: theorem iterate_mul (m : ℕ) : ∀ n, f^[m * n] = f^[m]^[n]
  
goal: f^[m * n] = f^[m]^[n]

full_name: Function.iterate_fixed
code: theorem iterate_fixed {x} (h : f x = x) (n : ℕ) : f^[n] x = x 
goal: f^[n] x = x

full_name: Function.Injective.iterate
code: theorem Injective.iterate (Hinj : Injective f) (n : ℕ) : Injective f^[n] 
goal: Function.Injective f^[n]

full_name: Function.Surjective.iterate
code: theorem Surjective.iterate (Hsurj : Surjective f) (n : ℕ) : Surjective f^[n] 
goal: Function.Surjective f^[n]

full_name: Function.Bijective.iterate
code: theorem Bijective.iterate (Hbij : Bijective f) (n : ℕ) : Bijective f^[n] 
goal: Function.Bijective f^[n]

full_name: Function.Semiconj.iterate_right
code: theorem iterate_right {f : α → β} {ga : α → α} {gb : β → β} (h : Semiconj f ga gb) (n : ℕ) :
    Semiconj f ga^[n] gb^[n] 
goal: Function.Semiconj f ga^[n] gb^[n]

full_name: Function.Semiconj.iterate_left
code: theorem iterate_left {g : ℕ → α → α} (H : ∀ n, Semiconj f (g n) (g <| n + 1)) (n k : ℕ) :
    Semiconj f^[n] (g k) (g <| n + k) 
goal: Function.Semiconj f^[n] (g k) (g (n + k))

full_name: Function.Commute.iterate_right
code: theorem iterate_right (h : Commute f g) (n : ℕ) : Commute f g^[n] 
goal: Function.Commute f g^[n]

full_name: Function.Commute.iterate_left
code: theorem iterate_left (h : Commute f g) (n : ℕ) : Commute f^[n] g 
goal: Function.Commute f^[n] g

full_name: Function.Commute.iterate_iterate
code: theorem iterate_iterate (h : Commute f g) (m n : ℕ) : Commute f^[m] g^[n] 
goal: Function.Commute f^[m] g^[n]

full_name: Function.Commute.iterate_eq_of_map_eq
code: theorem iterate_eq_of_map_eq (h : Commute f g) (n : ℕ) {x} (hx : f x = g x) :
    f^[n] x = g^[n] x 
goal: f^[n] x = g^[n] x

full_name: Function.Commute.comp_iterate
code: theorem comp_iterate (h : Commute f g) (n : ℕ) : (f ∘ g)^[n] = f^[n] ∘ g^[n] 
goal: (f ∘ g)^[n] = f^[n] ∘ g^[n]

full_name: Function.Commute.iterate_self
code: theorem iterate_self (n : ℕ) : Commute f^[n] f 
goal: Function.Commute f^[n] f

full_name: Function.Commute.self_iterate
code: theorem self_iterate (n : ℕ) : Commute f f^[n] 
goal: Function.Commute f f^[n]

full_name: Function.Commute.iterate_iterate_self
code: theorem iterate_iterate_self (m n : ℕ) : Commute f^[m] f^[n] 
goal: Function.Commute f^[m] f^[n]

full_name: Function.Semiconj₂.iterate
code: theorem Semiconj₂.iterate {f : α → α} {op : α → α → α} (hf : Semiconj₂ f op op) (n : ℕ) :
    Semiconj₂ f^[n] op op 
goal: Function.Semiconj₂ f^[n] op op

full_name: Function.iterate_succ'
code: theorem iterate_succ' (n : ℕ) : f^[n.succ] = f ∘ f^[n] 
goal: f^[n.succ] = f ∘ f^[n]

full_name: Function.iterate_succ_apply'
code: theorem iterate_succ_apply' (n : ℕ) (x : α) : f^[n.succ] x = f (f^[n] x) 
goal: f^[n.succ] x = f (f^[n] x)

full_name: Function.iterate_pred_comp_of_pos
code: theorem iterate_pred_comp_of_pos {n : ℕ} (hn : 0 < n) : f^[n.pred] ∘ f = f^[n] 
goal: f^[n.pred] ∘ f = f^[n]

full_name: Function.comp_iterate_pred_of_pos
code: theorem comp_iterate_pred_of_pos {n : ℕ} (hn : 0 < n) : f ∘ f^[n.pred] = f^[n] 
goal: f ∘ f^[n.pred] = f^[n]

full_name: Function.Iterate.rec
code: /-- A recursor for the iterate of a function. -/
def Iterate.rec (p : α → Sort*) {f : α → α} (h : ∀ a, p a → p (f a)) {a : α} (ha : p a) (n : ℕ) :
    p (f^[n] a) 
goal: p (f^[n] a)

full_name: Function.Iterate.rec_zero
code: theorem Iterate.rec_zero (p : α → Sort*) {f : α → α} (h : ∀ a, p a → p (f a)) {a : α} (ha : p a) :
    Iterate.rec p h ha 0 = ha 
goal: Function.Iterate.rec p h ha 0 = ha

full_name: Function.LeftInverse.iterate
code: theorem LeftInverse.iterate {g : α → α} (hg : LeftInverse g f) (n : ℕ) :
    LeftInverse g^[n] f^[n] 
goal: Function.LeftInverse g^[n] f^[n]

full_name: Function.RightInverse.iterate
code: theorem RightInverse.iterate {g : α → α} (hg : RightInverse g f) (n : ℕ) :
    RightInverse g^[n] f^[n] 
goal: Function.RightInverse g^[n] f^[n]

full_name: Function.iterate_comm
code: theorem iterate_comm (f : α → α) (m n : ℕ) : f^[n]^[m] = f^[m]^[n] 
goal: f^[n]^[m] = f^[m]^[n]

full_name: Function.iterate_commute
code: theorem iterate_commute (m n : ℕ) : Commute (fun f : α → α ↦ f^[m]) fun f ↦ f^[n] 
goal: Function.Commute (fun f => f^[m]) fun f => f^[n]

full_name: Function.iterate_add_eq_iterate
code: lemma iterate_add_eq_iterate (hf : Injective f) : f^[m + n] a = f^[n] a ↔ f^[m] a = a 
goal: f^[m + n] a = f^[n] a ↔ f^[m] a = a

full_name: Function.iterate_cancel
code: lemma iterate_cancel (hf : Injective f) (ha : f^[m] a = f^[n] a) : f^[m - n] a = a 
goal: f^[m - n] a = a

full_name: Function.involutive_iff_iter_2_eq_id
code: theorem involutive_iff_iter_2_eq_id {α} {f : α → α} : Involutive f ↔ f^[2] = id 
goal: Function.Involutive f ↔ f^[2] = id

full_name: List.foldl_const
code: theorem foldl_const (f : α → α) (a : α) (l : List β) :
    l.foldl (fun b _ ↦ f b) a = f^[l.length] a 
goal: List.foldl (fun b x => f b) a l = f^[l.length] a

full_name: List.foldr_const
code: theorem foldr_const (f : β → β) (b : β) : ∀ l : List α, l.foldr (fun _ ↦ f) b = f^[l.length] b
  
goal: List.foldr (fun x => f) b l = f^[l.length] b