proposition: Theorem wordToNat_minus_one: forall sz n, n <> natToWord sz 0 -> wordToNat (n ^- natToWord sz 1) = wordToNat n - 1.
proof: Proof. intros. erewrite Nat.succ_inj with (n2 := wordToNat (n ^- (natToWord sz 1))); auto. rewrite wordToNat_minus_one'; auto. assert (wordToNat n <> 0). intuition. erewrite <- roundTrip_0 with (sz := sz) in H0. apply wordToNat_inj in H0; tauto. lia. Qed.
imports: Coq.Classes.Morphisms Coq.Classes.Morphisms_Prop Coq.Classes.Equivalence Coq.Arith.PeanoNat Coq.ZArith.BinInt  Coq.Arith.Arith Coq.NArith.NArith Coq.Bool.Bool Coq.ZArith.ZArith Coq.Logic.Eqdep_dec Coq.Logic.EqdepFacts Coq.Program.Tactics Coq.Program.Equality Coq.setoid_ring.Ring Coq.setoid_ring.Ring_polynom bbv.Nomega bbv.ZLib bbv.NatLib bbv.NLib bbv.N_Z_nat_conversions bbv.DepEq bbv.DepEqNat bbv.ReservedNotations Coq.micromega.Lia