Documentation

HexPrimality.Table

Exclusive upper bound of the committed prime table. The accepted 100000 policy is the largest measured candidate inside the fresh-replay build budget; primeTable lists every prime below it.

Equations
Instances For

    Every prime below primeTableBound, ascending. A committed literal; mem_primeTable_prime and mem_primeTable_of_prime are the two membership directions, so the generator that produced the literal is untrusted.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Adjacent strict ascent of a list, structurally: true iff consecutive entries strictly increase.

      Equations
      Instances For
        theorem Hex.Nat.primeTable_sorted :
        List.Pairwise (fun (x1 x2 : Nat) => x1 < x2) primeTable.toList

        The committed table is strictly ascending.

        def Hex.Nat.binSearchGo (a : Array Nat) (n : Nat) :
        NatNatNatBool

        Fuel-bounded binary search for n in the sorted array a over the half-open index range [lo, hi).

        Equations
        Instances For

          Membership in the committed prime table, by binary search.

          Equations
          Instances For

            A binary-search hit is table membership, and conversely: the lemma that lets a caller conclude anything from a lookup.

            Every table entry is prime: the committed literal read back through the verified sieve run.

            Every prime below the bound is a table entry: completeness through the sieve's completeness direction, which is what lets a caller conclude anything from a failed lookup.

            def Hex.Nat.primesIn (lo hi : Nat) :

            The primes in [lo, hi), ascending. Runtime decision through the isPrimeTrial-backed Decidable instance; the committed table plays no role, so the range is unrestricted.

            Equations
            Instances For
              theorem Hex.Nat.mem_primesIn {lo hi n : Nat} :
              n primesIn lo hi lo n n < hi Prime n

              Membership in primesIn lo hi is exactly primality in the half-open interval [lo, hi).