Section Iteration.
Variable T : Type.
Implicit Types m n : nat.
Implicit Types x y : T.
Implicit Types S : {pred T}.
Definition iter n f x :=
let fix loop m := if m is i.+1 then f (loop i) else x in loop n.
Definition iteri n f x :=
let fix loop m := if m is i.+1 then f i (loop i) else x in loop n.
Definition iterop n op x :=
let f i y := if i is 0 then x else op x y in iteri n f.
#[deprecated(since="mathcomp 1.13.0", note="Use ltn_fact instead")]
Notation fact_smonotone := ltn_fact.
(* Parity and bits. *)
Coercion nat_of_bool (b : bool) := if b then 1 else 0.

Lemma sub1b (b : bool) : 1 - b = ~~ b. Proof. by case: b. Qed.