val lemma_of_uint_zero (n: nat) : Lemma (ensures of_uint_ n 0 == zero)
let lemma_of_uint_zero (n:nat) : Lemma
  (ensures of_uint_ n 0 == zero)
  =
  lemma_bitwise_all ();
  lemma_equal (of_uint_ n 0) zero
val lemma_of_uint_zero (n: nat) : Lemma (ensures of_uint_ n 0 == zero)
let lemma_of_uint_zero (n: nat) : Lemma (ensures of_uint_ n 0 == zero) =
lemma_bitwise_all ();
lemma_equal (of_uint_ n 0) zero
Vale.Math.Poly2.Bits.fst.checked
Vale.Arch.TypesNative.fsti.checked prims.fst.checked FStar.UInt.fsti.checked FStar.Pervasives.fsti.checked FStar.Mul.fst.checked FStar.Classical.fsti.checked
Vale.Math.Poly2.Bits.fst
Prims.nat Vale.Math.Poly2.lemma_equal Vale.Math.Poly2.Bits.of_uint_ Vale.Math.Poly2_s.zero Prims.unit Vale.Math.Poly2.Lemmas.lemma_bitwise_all Prims.l_True Prims.squash Prims.eq2 Vale.Math.Poly2_s.poly Prims.Nil FStar.Pervasives.pattern
module Vale.Math.Poly2.Bits
open FStar.Mul
open Vale.Arch.TypesNative

let lemma_to_of_uint n u =
  let a = of_uint n u in
  let u' = to_uint n a in
  lemma_index a;
  lemma_reverse_define_all ();
  let s = UInt.to_vec #n u in
  let s' = UInt.to_vec #n u' in
  assert (equal s s');
  ()

let rec of_nat x =
  if x = 0 then zero
  else
    let p = shift (of_nat (x / 2)) 1 in
    if x % 2 = 0 then p else p +. one

let rec lemma_of_to_vec_zero (i:nat) (n:nat) : Lemma
  (requires i < n)
  (ensures index (to_vec #n 0) i == false)
  [SMTPat (index (to_vec #n 0) i)]
  =
  if i + 1 < n then lemma_of_to_vec_zero i (n - 1)

let lemma_of_uint_zero (n:nat) : Lemma
  (ensures of_uint_ n 0 == zero)
val lemma_of_uint_zero (n: nat) : Lemma (ensures of_uint_ n 0 == zero)
n: Prims.nat
  -> FStar.Pervasives.Lemma (ensures Vale.Math.Poly2.Bits.of_uint_ n 0 == Vale.Math.Poly2_s.zero)