proposition: Theorem posToWord_nat : forall p sz, posToWord sz p = natToWord sz (nat_of_P p).
proof: Proof. induction p as [ p IHp | p IHp | ]; destruct sz; simpl; intuition; f_equal; try rewrite wzero'_def in *. rewrite ZL6. destruct (ZL4 p) as [x Heq]; rewrite Heq; simpl. replace (x + S x) with (S (2 * x)) by lia. symmetry; apply mod2_S_double. rewrite IHp. rewrite ZL6. destruct (nat_of_P p); simpl; intuition. replace (n + S n) with (S (2 * n)) by lia. rewrite div2_S_double; auto. unfold nat_of_P; simpl. rewrite ZL6. replace (nat_of_P p + nat_of_P p) with (2 * nat_of_P p) by lia. symmetry; apply mod2_double. rewrite IHp. unfold nat_of_P; simpl. rewrite ZL6. replace (nat_of_P p + nat_of_P p) with (2 * nat_of_P p) by lia. rewrite Nat.div2_double. auto. auto. 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