From 7b64e1d3b368bca3c8b4ebe2ccacdf6d79eef815 Mon Sep 17 00:00:00 2001 From: letouzey Date: Thu, 5 May 2011 15:12:40 +0000 Subject: Wf.iter_nat becomes Peano.nat_iter (with an implicit arg) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14103 85f007b7-540e-0410-9357-904b9bb8a0f7 --- theories/Arith/Wf_nat.v | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'theories/Arith') diff --git a/theories/Arith/Wf_nat.v b/theories/Arith/Wf_nat.v index d3d7b5835..b4468dd1b 100644 --- a/theories/Arith/Wf_nat.v +++ b/theories/Arith/Wf_nat.v @@ -258,30 +258,6 @@ Qed. Unset Implicit Arguments. -(** [n]th iteration of the function [f] *) - -Fixpoint iter_nat (n:nat) (A:Type) (f:A -> A) (x:A) : A := - match n with - | O => x - | S n' => f (iter_nat n' A f x) - end. - -Theorem iter_nat_plus : - forall (n m:nat) (A:Type) (f:A -> A) (x:A), - iter_nat (n + m) A f x = iter_nat n A f (iter_nat m A f x). -Proof. - induction n; simpl; trivial. - intros. now f_equal. -Qed. - -(** Preservation of invariants : if [f : A->A] preserves the invariant [Inv], - then the iterates of [f] also preserve it. *) - -Theorem iter_nat_invariant : - forall (n:nat) (A:Type) (f:A -> A) (Inv:A -> Prop), - (forall x:A, Inv x -> Inv (f x)) -> - forall x:A, Inv x -> Inv (iter_nat n A f x). -Proof. - induction n; simpl; trivial. - intros A f Inv Hf x Hx. apply Hf, IHn; trivial. -Qed. +Notation iter_nat := @nat_iter (only parsing). +Notation iter_nat_plus := @nat_iter_plus (only parsing). +Notation iter_nat_invariant := @nat_iter_invariant (only parsing). -- cgit v1.2.3