Definition NPEpow x n :=
  match n with
  | N0 => 1
  | Npos p =>
    if (p =? 1)%positive then x else
    match x with
    | PEc c =>
      if (c =? 1)%coef then 1
      else if (c =? 0)%coef then 0
      else PEc (pow_pos cmul c p)
    | _ => x ^ n
    end
  end%poly.Infix "^^" := NPEpow (at level 35, right associativity).Infix "**" := NPEmul (at level 40, left associativity).

(* Specifications: *)
Theorem PEsimp_ok e : (PEsimp e === e)%poly.