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 wplus_wplus_pow2 sz (x1 x2 y1 y2: word (sz + 1)):
x1 = y1 ^+ $(pow2 sz) ->
x2 = y2 ^+ $(pow2 sz) ->
x1 ^+ x2 = y1 ^+ y2.