Hint Resolve mul_mul_br_mul_br : Recurrence.
Hint Rewrite @mul_mul_br_mul_br : Recurrence.
End BR_BR.
Hint Resolve add_add_br_add_br: Recurrence.
Hint Rewrite @add_add_br_add_br: Recurrence.
Opaque evalBR.
End BR.
(** I need to define the notation outside again as wel **)
Notation "'{{' const ',' bop ',' fn  '}}'" :=
(mkBR const bop fn) (at level 30): recurrence_scope.
(** Define a chain of recurrences *)
Section CR.
Open Scope recurrence_scope.
Inductive CR :=
| liftBRToCR: BR -> CR
| recurCR: R -> (R -> R -> R) -> CR -> CR
.
(** Interpret a CR as nested BRs as described in section 2 - Chains of Recurrences *)
Fixpoint CR_to_BR (cr: CR): BR :=
match cr with
| liftBRToCR br =>  br
| recurCR r0 bop cr' => mkBR r0 bop (evalAtIx (CR_to_BR cr'))
end.
Definition evalCR(cr: CR) (n: nat): R := (CR_to_BR cr) # n.

(* Specifications: *)
Lemma evalBR_CR_to_BR: forall (cr: CR) (n: nat),
evalBR (CR_to_BR cr) n = evalCR cr n.