diff options
author | pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-12-21 21:47:43 +0000 |
---|---|---|
committer | pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-12-21 21:47:43 +0000 |
commit | ec8332223b1f6716e49bbf78e0489881ca7bfa2b (patch) | |
tree | 95c23e65916507f8442e3d5f1ac11e675fca52b8 /theories/NArith/Nnat.v | |
parent | e9428d3127ca159451437c2abbc6306e0c31f513 (diff) |
nat_iter n f x -> nat_rect _ x (fun _ => f) n
It is much beter for everything (includind guard condition and simpl refolding)
excepts typeclasse inference because unification does not recognize
(fun x => f x b) a when it sees f a b ...
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16112 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/NArith/Nnat.v')
-rw-r--r-- | theories/NArith/Nnat.v | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/theories/NArith/Nnat.v b/theories/NArith/Nnat.v index 1b7e2f241..346169e7f 100644 --- a/theories/NArith/Nnat.v +++ b/theories/NArith/Nnat.v @@ -113,7 +113,7 @@ Proof. Qed. Lemma inj_iter a {A} (f:A->A) (x:A) : - N.iter a f x = nat_iter (N.to_nat a) f x. + N.iter a f x = nat_rect (fun _ => A) x (fun _ => f) (N.to_nat a). Proof. destruct a as [|a]. trivial. apply Pos2Nat.inj_iter. Qed. @@ -194,7 +194,7 @@ Lemma inj_max n n' : Proof. nat2N. Qed. Lemma inj_iter n {A} (f:A->A) (x:A) : - nat_iter n f x = N.iter (N.of_nat n) f x. + nat_rect (fun _ => A) x (fun _ => f) n = N.iter (N.of_nat n) f x. Proof. now rewrite N2Nat.inj_iter, !id. Qed. End Nat2N. |