Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Power function in Coq standard library?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Power function in Coq standard library?


Chronological Thread 
  • From: Frédéric Besson <frederic.besson AT inria.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Power function in Coq standard library?
  • Date: Tue, 27 Feb 2018 00:24:32 +0100
  • Organization: Inria

Hello,

On Mon, 2018-02-26 at 18:04 -0500, Cao Qinxiang wrote:
> Is power function like the following one defined in Coq standard
> library?
>
> Fixpoint pow_func {A : Type} (f : A -> A) (n : nat) (a : A) : A :=
> match n with
> | O => a
> | S n => f (pow_func f n a)
> end.

There is a iter_nat notation.

Require Import Arith.
Locate iter_nat.
Notation Coq.Arith.Wf_nat.iter_nat
Print iter_nat
Notation iter_nat n A f x := (nat_rect (fun _ => A) x (fun _ => f) n)

Best,
--
Frédéric



Archive powered by MHonArc 2.6.18.

Top of Page