Documentation

CslibFrontier.Computability.Complexity.RealAlgebraic.RootLabelWitness

Bounded derivative-sign witnesses #

Only the first N entries of the witness are used. A binary index is reduced modulo the source degree bound D and then incremented to a positive derivative order. The sign is read modulo three. Slot zero is the qualifying test, and missing slots have target zero.

Adapted from CodedRootLabelData and CodedRootLabelCorrectness in lean-canny at commit 970f28a5ecefc1327402ade16c068aa4b1b2c183.

A derivative-sign witness entry before its fields are reduced to the allowed ranges.

  • index : ℕ

    Zero-based derivative index, read modulo the degree bound.

  • sign : ℕ

    Target sign, read modulo three as 0, 1, or -1, respectively.

theorem Cslib.Complexity.RealAlgebraic.encRootLabelTestCode_index_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RootLabelTestCode} :
theorem Cslib.Complexity.RealAlgebraic.encRootLabelTestCode_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encNat T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { index := x0 x, sign := x1 x }) encIn encRootLabelTestCode (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

A framed pair containing the binary derivative index followed by the binary sign code.

theorem Cslib.Complexity.RealAlgebraic.encRootLabelTestCode_sign_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RootLabelTestCode} :
@[reducible, inline]

Framed list of derivative-sign entries in test order. Each entry stores the binary index before the binary sign code.

Decode at most N signed derivative indices from an arbitrary binary witness.

Encode each derivative-sign entry directly.

The bounded decoder always yields an allowed number of entries.

Every allowed mathematical label is recovered from its direct encoding.

The direct encoding of a bounded label has bit length linear in its number of entries and in the binary size of the derivative bound.

Convert the bounded prefix into the positive orders read by the sparse label evaluator.

theorem Cslib.Complexity.RealAlgebraic.rootLabelCodeOrders_eq {D : ℕ} (hD : 0 < D) (N : ℕ) (data : List RootLabelTestCode) :
rootLabelCodeOrders D N data = List.map (fun (t : Fin D × SignType) => ↑t.1 + 1) (decodeRootLabel hD N data)

The order program uses the successor of the decoded zero-based derivative index.

Read a target residue by binary slot. Slot zero targets a positive qualifying value. An absent witness entry targets zero.

theorem Cslib.Complexity.RealAlgebraic.rootLabelCodeTarget_cast {p D N : ℕ} (hp : 0 < p) (hD : 0 < D) (data : List RootLabelTestCode) (q b₀ : Polynomial ℤ) (i : Fin (N + 1)) :
↑(rootLabelCodeTarget p data ↑i) = (Int.castRingHom (ZMod p)) ↑(q.sparseRootLabelTests b₀ N (decodeRootLabel hD N data) i).2

The target program agrees with the mathematical label on every used slot, including the qualifying slot and padding. Entries past the prefix cannot affect the label.