Definition wring (sz : nat) : ring_theory (wzero sz) (wone sz) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (@eq _) :=
mk_rt _ _ _ _ _ _ _
(@wplus_unit _) (@wplus_comm _) (@wplus_assoc _)
(@wmult_unit _) (@wmult_comm _) (@wmult_assoc _)
(@wmult_plus_distr _) (@wminus_def _) (@wminus_inv _).

(* Specifications: *)
Theorem weqb_sound : forall sz (x y : word sz), weqb x y = true -> x = y.
Arguments weqb_sound : clear implicits.
Lemma weqb_eq: forall sz (a b: word sz), a = b -> weqb a b = true.
Lemma weqb_false: forall sz (a b: word sz), weqb a b = false -> a <> b.
Ltac is_nat_cst n :=
match eval hnf in n with
| O => constr:(true)
| S ?n' => is_nat_cst n'
| _ => constr:(false)
end.