The work limit or unsuccessful search stage reported when certificate search cannot complete a primality proof.
- inputBits : Resource
- depth : Resource
- candidates : Resource
- roots : Resource
- nonresidues : Resource
- points : Resource
- factorWork : Resource
- scalarWork : Resource
- outputBits : Resource
- memo : Resource
- portfolio : Resource
- screening : Resource
- nonresidueRetries : Resource
- pointRetries : Resource
- rows : Resource
- nodes : Resource
- factorPolicy : Resource
- polynomialWork : Resource
- rootWork : Resource
Instances For
Equations
- Hex.ECPP.instReprResource = { reprPrec := Hex.ECPP.instReprResource.repr }
Equations
- One or more equations did not get rendered due to their size.
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.inputBits prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.inputBits")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.depth prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.depth")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.roots prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.roots")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.points prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.points")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.memo prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.memo")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.portfolio prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.portfolio")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.screening prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.screening")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.rows prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.rows")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.nodes prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.nodes")).group prec✝
- Hex.ECPP.instReprResource.repr Hex.ECPP.Resource.rootWork prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.ECPP.Resource.rootWork")).group prec✝
Instances For
Equations
Equations
- Hex.ECPP.instBEqResource.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Limits for finding an elliptic curve primality certificate. The counters bound the entire search, including recursive proofs of auxiliary primes; trying another curve does not restore work already spent. Retry limits also bound the number of choices tried on each curve. Neither a bit-length limit nor the other allowances guarantee that search succeeds for every prime.
- maxBits : Nat
Maximum subject bit length.
- maxDepth : Nat
Maximum recursive certificate depth.
- maxCandidates : Nat
Shared discriminant and order candidate allowance.
- maxRoots : Nat
Shared modular-root call allowance.
- maxNonresidues : Nat
Shared nonresidue-draw allowance.
- maxPoints : Nat
Shared point-draw allowance.
- maxFactorWork : Nat
Shared reserved factor-attempt packages.
- maxScalarWork : Nat
Shared maximum scalar additions, including checker replays.
- maxOutputBits : Nat
Maximum literal bits per retained certificate.
- maxMemo : Nat
Maximum retained successful certificates.
- pointRetries : Nat
Local retries are also charged to the shared allocations.
- nonresidueRetries : Nat
Local nonresidue draws, also charged to the shared allowance.
- terminal : Option Nat.ConstructionBudget
Select a finite terminal package; omission retains the 256-bit policy.
- order : Option Nat.FactorSearchBudget
Select a finite order package; its attempt limit must be explicit.
Public output limits include ancestral rows and embedded terminal nodes.
Total nodes include the ECPP base wrapper.
- backtrackOutput : Bool
Reject oversized candidates locally, retaining all charged work.
- extendedCM : Bool
Opt in to the attributed fixed linear/quadratic class polynomial table.
- maxPolynomialWork : Nat
Shared reserved polynomial-root modular operations.
- maxRootWork : Nat
Per-call modular-operation ceiling; closed-form roots need no splits.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fixed per-attempt ceiling for terminal construction. It is deliberately
smaller than the full primality? route used by capability comparisons.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fixed partial-factor package for one CM order.
Equations
Instances For
Larger search policy for integers through 512 bits, with additional
fixed complex multiplication class polynomials. Select it explicitly;
produce defaults to the 256-bit policy. Search can still fail within this
size range. Use public512Budget when the result must fit the public proof
commands' certificate limits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The 512-bit search policy used by the public tactic and export command. It restricts output to 20 elliptic rows and 32 total certificate nodes, including the wrapper and all nodes of the last HexPrimality certificate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Explicit output-bounded 256-bit allocation for mixed factor completion. The ordinary producer and existing Native 256-bit policy retain their defaults.
Equations
Instances For
Equations
- Hex.ECPP.instReprSearchError = { reprPrec := Hex.ECPP.instReprSearchError.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Cumulative charged work and backtracking diagnostics.
- candidates : Nat
Charged discriminant and order candidates.
- roots : Nat
Charged modular-root calls.
- nonresidues : Nat
Charged nonresidue draws.
- points : Nat
Charged point draws.
- factorWork : Nat
Reserved factor-work units, never refunded.
- scalarWork : Nat
Reserved scalar additions, never refunded.
- backtracks : Nat
Checked proposals rejected when their recursive child could not be built.
- terminalCalls : Nat
Terminal package invocations and their checked successes.
- terminalSuccesses : Nat
- terminalBitRejects : Nat
Terminal calls outside the selected package's subject limit.
Last unproved terminal obligation, distinct from CM child failures.
- norms : Nat
Successful norm equations, orders and eligible large prime factors.
- orders : Nat
- largeFactors : Nat
- proposals : Nat
Checked elliptic step proposals, before recursive child construction.
- outputRejects : Nat
Output candidates rejected after their search work was charged.
Actual last literal-bit count;
nonerecords traversal exhaustion.- polynomialWork : Nat
Reserved modular-operation bounds for class polynomial roots.
- polynomialRoots : Nat
Checked j-roots admitted from the class polynomial table.
- unresolved : Option SearchError
Retained failure. Smaller unresolved children and complete portfolios supersede local retries.
- lastRetry : Option SearchError
Last local retry exhaustion, retained even when the final diagnosis is portfolio exhaustion.
Instances For
Equations
- Hex.ECPP.instReprSearchStats = { reprPrec := Hex.ECPP.instReprSearchStats.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
The advanced random stream, cumulative counters and checked success memo.
- rand : Rand
Advanced deterministic random stream.
- stats : SearchStats
Cumulative counters and diagnostics; stateful callers can reset them independently of the memo.
Only successes are cached; a failed branch may depend on remaining depth.
Instances For
Equations
- Hex.ECPP.instReprSearchState = { reprPrec := Hex.ECPP.instReprSearchState.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Search errors preserve the advanced random stream, memo and charged work.
Instances For
Charge before running any work; no backtracking restores counters.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Count terminal literal bits under an explicit traversal fuel. Exhaustion is explicit and cannot bypass a caller's larger output allocation.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ECPP.primeBits 0 x✝ = none
- Hex.ECPP.primeBits n.succ (Hex.Nat.PrimeCert.small n_1) = some (1 + HexArith.bitLength n_1)
Instances For
Count raw chain bits, including a terminal within the fixed leaf-depth profile. Reject deeper supplied terminals instead of undercounting them.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ECPP.certBitsAt terminalFuel (Hex.ECPP.Cert.base c) = Option.map (fun (x : Nat) => 1 + x) (Hex.ECPP.primeBits terminalFuel c)
Instances For
Literal bits under the original terminal profile.
Equations
Instances For
Embedded terminal node count and height; exhaustion rejects the candidate.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ECPP.primeShape 0 x✝ = none
- Hex.ECPP.primeShape n.succ (Hex.Nat.PrimeCert.small n_1) = some (1, 1)
Instances For
Rows, total nodes (including the base wrapper), and terminal height.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ECPP.certShape terminalFuel (Hex.ECPP.Cert.base c) = do let __x ← Hex.ECPP.primeShape terminalFuel c match __x with | (nodes, height) => pure (0, 1 + nodes, height)
Instances For
Maximum scalar additions performed by a complete checker replay.
Equations
- Hex.ECPP.replayWork (Hex.ECPP.Cert.base c) = 0
- Hex.ECPP.replayWork (Hex.ECPP.Cert.step n a b x_1 y d ws child) = 2 * HexArith.bitLength child.subject + Hex.ECPP.replayWork child
Instances For
Structurally bounded recursion; failure of a child resumes the parent's
remaining CM orders, without resetting any allocation or random state.
This stateful worker requires a memo of previously checked successes admitted
under the same allocations and sufficient remaining depth. Caller-supplied
states are not validated here; produce starts fresh and checks its result.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ECPP.search budget 0 x✝ = do Hex.ECPP.unresolved✝ x✝ Hex.ECPP.Resource.depth pure none
Instances For
The outcome of certificate search, together with its final random state and statistics. An error reports an unsuccessful attempt, not a proof that the input is composite.
- result : Except SearchError Cert
A complete checked primality certificate, or the integer and reason for which the search stopped.
- state : SearchState
Final random stream, counters and successful memo.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Search for a primality certificate for n, using seed to choose the
deterministic random sequence and budget to limit the work. Return a
certificate and search statistics, or an error explaining why search stopped.
Every .ok c result satisfies checkAt n c = true; failure to find a
certificate does not imply that n is composite.
The default policy admits inputs through 256 bits. native512Budget and
public512Budget explicitly select 512-bit search. For a theorem of
Mathlib's Nat.Prime n, use HexECPPTheory.Native or apply the companion's
soundness theorem to a kernel-checked checker equation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Freeze only replay inputs. Each row uses the already found q-order point
and cofactor one, so conversion need not repeat any CM or factor search.
The stored t = n + 1 - q is an encoding field, not a Frobenius trace.
Equations
- Hex.ECPP.frozenRows c = match Hex.ECPP.rows✝ c with | [] => toString c.subject | rows => "[" ++ ",".intercalate rows ++ "]"