Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)

Require Import Wf_nat.
Require Import BinInt.
Require Import Zcompare.
Require Import Zorder.
Require Import Bool.
Local Open Scope Z_scope.

(**********************************************************************)
Iterators
nth iteration of the function f
Notation iter := @Z.iter (only parsing).


forall (n : Z) (A : Type) (f : A -> A) (x : A), 0 <= n -> Z.iter n f x = nat_rect (fun _ : nat => A) x (fun _ : nat => f) (Z.abs_nat n)

forall (n : Z) (A : Type) (f : A -> A) (x : A), 0 <= n -> Z.iter n f x = nat_rect (fun _ : nat => A) x (fun _ : nat => f) (Z.abs_nat n)
n:Z
A:Type
f:A -> A
x:A

forall p : positive, 0 <= Z.pos p -> Z.iter (Z.pos p) f x = nat_rect (fun _ : nat => A) x (fun _ : nat => f) (Z.abs_nat (Z.pos p))
n:Z
A:Type
f:A -> A
x:A
forall p : positive, 0 <= Z.neg p -> Z.iter (Z.neg p) f x = nat_rect (fun _ : nat => A) x (fun _ : nat => f) (Z.abs_nat (Z.neg p))
n:Z
A:Type
f:A -> A
x:A

forall p : positive, 0 <= Z.neg p -> Z.iter (Z.neg p) f x = nat_rect (fun _ : nat => A) x (fun _ : nat => f) (Z.abs_nat (Z.neg p))
intros p abs; case abs; trivial. Qed.