Documentation

HexPrimality.PMinusOne

The three semantically distinct stage-1 gcd outcomes.

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

      The result of one counted deterministic stage-1 call. A call is one attempt on every terminal gcd outcome. Pollard p - 1 draws no randomness, so the returned generator is exactly the supplied state; carrying it here lets randomized callers resume through the same boundary as rho.

      • The terminal gcd outcome.

      • attempts : Nat

        Semantic stage-1 calls executed; always one at this boundary.

      • rand : Rand

        The unchanged generator state.

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

            Accepted stage-1 smoothness cap. It remains inside the complete table range, but is independent of later table-policy growth so search cost and retry-ladder coverage do not change as a side effect of a larger certification table.

            Equations
            Instances For
              def Hex.Nat.smoothBound (bound : Nat) :

              Clamp a requested stage-1 bound to the complete committed-table range.

              Equations
              Instances For
                @[simp]

                One deterministic Pollard p - 1 stage-1 attempt. Invalid bases or moduli return noFactor; a gcd equal to the modulus is reported separately as whole. The effective smoothness bound is smoothBound bound, never an incomplete extension beyond the committed prime table.

                Equations
                Instances For

                  One counted, resumable Pollard p - 1 stage-1 attempt. The deterministic primitive consumes no generator words, but every call costs exactly one search attempt whether it returns noFactor, a proper factor, or whole.

                  Equations
                  Instances For
                    theorem Hex.Nat.pMinusOneStage1_bound (n base bound : Nat) :
                    pMinusOneStage1 n base bound = pMinusOneStage1 n base (smoothBound bound)

                    Requests beyond the complete prime-table range are exactly capped.

                    theorem Hex.Nat.pMinusOneStage1_spec {n base bound d : Nat} (h : pMinusOneStage1 n base bound = PMinusOneResult.factor d) :
                    1 < d d < n d n

                    Every reported factor is a dynamically checked proper divisor.

                    theorem Hex.Nat.pMinusOneStage1Counted_spec {n base bound d : Nat} {r : Rand} (h : (pMinusOneStage1Counted n base bound r).result = PMinusOneResult.factor d) :
                    1 < d d < n d n

                    A proper factor returned through the counted boundary satisfies the same dynamically checked contract as the compatibility result.