Fixpoint countLeadingZerosWord ni no: word ni -> word no :=
match ni return word ni -> word no with
| 0 => fun _ => $ 0
| S m => fun e =>
if (weq (split2 m 1 (nat_cast (fun n => word n) (eq_sym (Nat.add_1_r m)) e)) WO~0)
then $ 1 ^+ @countLeadingZerosWord m no (split1 m 1 (nat_cast (fun n => word n) (eq_sym (Nat.add_1_r m)) e))
else $ 0
end.

Lemma word_cancel_r sz (a b c: word sz):
a = b -> a ^+ c = b ^+ c.