diff --git a/theories/numbers.v b/theories/numbers.v index 72ca465cd587fcc1bfe09d801112469d55013360..86bc1a5538ef55aac0b04068cfec6547a93cf5cc 100644 --- a/theories/numbers.v +++ b/theories/numbers.v @@ -82,7 +82,7 @@ Proof. intros. destruct (Nat_mul_split_l n x2 x1 y2 y1); auto with lia. Qed. Notation lcm := Nat.lcm. Notation divide := Nat.divide. Notation "( x | y )" := (divide x y) : nat_scope. -Instance divide_dec x y : Decision (x | y). +Instance Nat_divide_dec x y : Decision (x | y). Proof. refine (cast_if (decide (lcm x y = y))); by rewrite Nat.divide_lcm_iff. Defined. @@ -94,6 +94,11 @@ Hint Extern 0 (_ | _) => reflexivity. Lemma Nat_divide_ne_0 x y : (x | y) → y ≠0 → x ≠0. Proof. intros Hxy Hy ->. by apply Hy, Nat.divide_0_l. Qed. +Lemma Nat_iter_S {A} n (f: A → A) x : Nat.iter (S n) f x = f (Nat.iter n f x). +Proof. done. Qed. +Lemma Nat_iter_S_r {A} n (f: A → A) x : Nat.iter (S n) f x = Nat.iter n f (f x). +Proof. induction n; f_equal/=; auto. Qed. + (** * Notations and properties of [positive] *) Open Scope positive_scope.