Corollary unsigned_add_either:
  forall x y,
  unsigned (add x y) = unsigned x + unsigned y
  \/ unsigned (add x y) = unsigned x + unsigned y - modulus.

(* Specifications: *)
Theorem neg_repr: forall z, neg (repr z) = repr (-z).
Theorem neg_zero: neg zero = zero.
Theorem neg_involutive: forall x, neg (neg x) = x.
Theorem neg_add_distr: forall x y, neg(add x y) = add (neg x) (neg y).
Theorem sub_zero_l: forall x, sub x zero = x.
Theorem sub_zero_r: forall x, sub zero x = neg x.
Theorem sub_add_opp: forall x y, sub x y = add x (neg y).
Theorem sub_idem: forall x, sub x x = zero.
Theorem sub_add_l: forall x y z, sub (add x y) z = add (sub x z) y.
Theorem sub_add_r: forall x y z, sub x (add y z) = add (sub x z) (neg y).
Theorem sub_shifted: forall x y z, sub (add x z) (add y z) = sub x y.
Theorem sub_signed: forall x y, sub x y = repr (signed x - signed y).
Theorem unsigned_sub_borrow: forall x y, unsigned (sub x y) = unsigned x - unsigned y + unsigned (sub_borrow x y zero) * modulus.
Theorem mul_commut: forall x y, mul x y = mul y x.
Theorem mul_zero: forall x, mul x zero = zero.
Theorem mul_one: forall x, mul x one = x.
Theorem mul_mone: forall x, mul x mone = neg x.
Theorem mul_assoc: forall x y z, mul (mul x y) z = mul x (mul y z).
Theorem mul_add_distr_l: forall x y z, mul (add x y) z = add (mul x z) (mul y z).
Theorem mul_add_distr_r: forall x y z, mul x (add y z) = add (mul x y) (mul x z).
Theorem neg_mul_distr_l: forall x y, neg(mul x y) = mul (neg x) y.
Theorem neg_mul_distr_r: forall x y, neg(mul x y) = mul x (neg y).
Theorem mul_signed: forall x y, mul x y = repr (signed x * signed y).
Lemma modu_divu_Euclid: forall x y, y <> zero -> x = add (mul (divu x y) y) (modu x y).
Theorem modu_divu: forall x y, y <> zero -> modu x y = sub x (mul (divu x y) y).
Lemma mods_divs_Euclid: forall x y, x = add (mul (divs x y) y) (mods x y).
Theorem mods_divs: forall x y, mods x y = sub x (mul (divs x y) y).
Theorem divu_one: forall x, divu x one = x.
Theorem divs_one: forall x, zwordsize > 1 -> divs x one = x.
Theorem modu_one: forall x, modu x one = zero.
Theorem divs_mone: forall x, divs x mone = neg x.
Theorem mods_mone: forall x, mods x mone = zero.
Theorem divmodu2_divu_modu: forall n d, d <> zero -> divmodu2 zero n d = Some (divu n d, modu n d).
Lemma unsigned_signed: forall n, unsigned n = if lt n zero then signed n + modulus else signed n.
Theorem divmods2_divs_mods: forall n d, d <> zero -> n <> repr min_signed \/ d <> mone -> divmods2 (if lt n zero then mone else zero) n d = Some (divs n d, mods n d).
Theorem neg_repr: forall z, neg (repr z) = repr (-z).
Theorem neg_zero: neg zero = zero.
Theorem neg_involutive: forall x, neg (neg x) = x.
Theorem neg_add_distr: forall x y, neg(add x y) = add (neg x) (neg y).
Theorem sub_zero_l: forall x, sub x zero = x.
Theorem sub_zero_r: forall x, sub zero x = neg x.
Theorem sub_add_opp: forall x y, sub x y = add x (neg y).
Theorem sub_idem: forall x, sub x x = zero.
Theorem sub_add_l: forall x y z, sub (add x y) z = add (sub x z) y.
Theorem sub_add_r: forall x y z, sub x (add y z) = add (sub x z) (neg y).
Theorem sub_shifted: forall x y z, sub (add x z) (add y z) = sub x y.
Theorem sub_signed: forall x y, sub x y = repr (signed x - signed y).
Theorem unsigned_sub_borrow: forall x y, unsigned (sub x y) = unsigned x - unsigned y + unsigned (sub_borrow x y zero) * modulus.
Theorem mul_commut: forall x y, mul x y = mul y x.
Theorem mul_zero: forall x, mul x zero = zero.
Theorem mul_one: forall x, mul x one = x.
Theorem mul_mone: forall x, mul x mone = neg x.
Theorem mul_assoc: forall x y z, mul (mul x y) z = mul x (mul y z).
Theorem mul_add_distr_l: forall x y z, mul (add x y) z = add (mul x z) (mul y z).
Theorem mul_add_distr_r: forall x y z, mul x (add y z) = add (mul x y) (mul x z).
Theorem neg_mul_distr_l: forall x y, neg(mul x y) = mul (neg x) y.
Theorem neg_mul_distr_r: forall x y, neg(mul x y) = mul x (neg y).
Theorem mul_signed: forall x y, mul x y = repr (signed x * signed y).
Lemma modu_divu_Euclid: forall x y, y <> zero -> x = add (mul (divu x y) y) (modu x y).
Theorem modu_divu: forall x y, y <> zero -> modu x y = sub x (mul (divu x y) y).
Lemma mods_divs_Euclid: forall x y, x = add (mul (divs x y) y) (mods x y).
Theorem mods_divs: forall x y, mods x y = sub x (mul (divs x y) y).
Theorem divu_one: forall x, divu x one = x.
Theorem divs_one: forall x, zwordsize > 1 -> divs x one = x.
Theorem modu_one: forall x, modu x one = zero.
Theorem divs_mone: forall x, divs x mone = neg x.
Theorem mods_mone: forall x, mods x mone = zero.
Theorem divmodu2_divu_modu: forall n d, d <> zero -> divmodu2 zero n d = Some (divu n d, modu n d).
Lemma unsigned_signed: forall n, unsigned n = if lt n zero then signed n + modulus else signed n.
Theorem divmods2_divs_mods: forall n d, d <> zero -> n <> repr min_signed \/ d <> mone -> divmods2 (if lt n zero then mone else zero) n d = Some (divs n d, mods n d).