Record power_theory : Prop := mkpow_th {
    rpow_pow_N : forall r n,  (rpow r (Cp_phi n))== (pow_N r n)
  }.Record power_theory : Prop := mkpow_th {
    rpow_pow_N : forall r n,  (rpow r (Cp_phi n))== (pow_N r n)
  }.Record power_theory : Prop := mkpow_th {
    rpow_pow_N : forall r n,  (rpow r (Cp_phi n))== (pow_N r n)
  }.(** evaluation of polynomial expressions towards R *)

Fixpoint PEeval (l:list R) (pe:PExpr C) {struct pe} : R :=
  match pe with
  | PEO => 0
  | PEI => 1
  | PEc c => [c]
  | PEX _ j => nth 0 j l
  | PEadd pe1 pe2 => (PEeval l pe1) + (PEeval l pe2)
  | PEsub pe1 pe2 => (PEeval l pe1) - (PEeval l pe2)
  | PEmul pe1 pe2 => (PEeval l pe1) * (PEeval l pe2)
  | PEopp pe1 => - (PEeval l pe1)
  | PEpow pe1 n => rpow (PEeval l pe1) (Cp_phi n)
  end.Definition mk_X j := mkX j.

Lemma mkX_ok : forall p l, nth 0 p l == (mk_X p) @ l.