Skip to content
Snippets Groups Projects
Commit 70a21632 authored by Ralf Jung's avatar Ralf Jung
Browse files

add Nat_iter_mul

parent bcebd707
No related branches found
No related tags found
1 merge request!227add Nat_iter_mul
......@@ -100,6 +100,12 @@ Proof. induction n; by f_equal/=. Qed.
Lemma Nat_iter_add {A} n1 n2 (f : A A) x :
Nat.iter (n1 + n2) f x = Nat.iter n1 f (Nat.iter n2 f x).
Proof. induction n1; by f_equal/=. Qed.
Lemma Nat_iter_mul {A} n1 n2 (f : A A) x :
Nat.iter (n1 * n2) f x = Nat.iter n1 (Nat.iter n2 f) x.
Proof.
intros. induction n1 as [|n1 IHn1]; [done|].
simpl. by rewrite Nat_iter_add, IHn1.
Qed.
Lemma Nat_iter_ind {A} (P : A Prop) f x k :
P x ( y, P y P (f y)) P (Nat.iter k f x).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment