Global Instance loopVariantPureCR (f: R -> R -> R):
LoopVariant (PureCR f) (R : Type) :=
{
evalAtIx (purecr: PureCR f) (n: nat) := (purecr_to_cr purecr) # n
}.

(* Specifications: *)
(** Evaluation of pureCR at 0 *)
Lemma evalPureCR_zero:
forall `{Ring R}
(bop: R -> R -> R)
(r: R)
(pcr': PureCR bop),
(PureCRRec r pcr') # 0 = r.
(** Step the evaluation of a pure CR *)
Lemma evalPureCR_step:
forall `{Ring R}
(n: nat)
(bop: R -> R -> R)
(r: R)
(pcr': PureCR bop),
(PureCRRec r pcr') # (S n) =
bop ((PureCRRec r pcr') # n) (pcr' # (S n)).