Documentation

CslibFrontier.Computability.Complexity.RealAlgebraic.SignLabelEvaluation

Modular evaluation of an integer sign label #

The dyadic test evaluations contribute three counting levels. The denominator products and the sum of squares range over the unary number of tests, so they stay at that level. Products with one denominator omitted are evaluated directly, including when a denominator is zero.

The weighted fingerprint label uses binary-length addresses for its denominator products. Its evaluator agrees with the integer label at every prime. Beyond the dyadic tests it uses three levels for the products and one further level for the weighted sum.

Adapted from RootLabelModularEvaluation, RootLabelModularCorrectness, RootLabelEvaluation, FingerprintModularCorrectness, and FingerprintModularEvaluation in lean-canny at commit 970f28a5ecefc1327402ade16c068aa4b1b2c183, using the precisions of the integer labels.

noncomputable def Cslib.Complexity.RealAlgebraic.signLabelResidue (p B m : ℕ) (value target : ℕ → ℕ) :

Evaluate the cleared sign label from addressed test values and target residues. A zero input modulus is treated as one to keep the modular aggregation total.

A unary number of cleared tests preserves the level F_(a+3) of the dyadic evaluations.

theorem Cslib.Complexity.RealAlgebraic.signLabelResidue_cast {p m : ℕ} [Fact (Nat.Prime p)] (B : ℕ) (g : Fin m → Polynomial ℤ) (t : Fin m → SignType) (x : ZMod p) (value target : ℕ → ℕ) (hv : ∀ (i : Fin m), ↑(value ↑i) = Polynomial.eval₂ (Int.castRingHom (ZMod p)) x (g i)) (ht : ∀ (i : Fin m), ↑(target ↑i) = ↑↑(t i)) :

At every prime, the evaluator agrees with the integer sign label, including when some cleared denominators vanish. Only test and target values at genuine indices are needed.

noncomputable def Cslib.Complexity.RealAlgebraic.fingerprintLabelResidue (p B M m : ℕ) (value weight : ℕ → ℕ) (target : ℕ) :

Evaluate the cleared fingerprint label from addressed test residues. The test at index zero qualifies the point and weight i attaches to test i + 1. Both the common denominator and its omitted-factor products use binary factor counts. A zero modulus is treated as one.

theorem Cslib.Complexity.RealAlgebraic.fingerprintLabelResidue_cast {p m : ℕ} [Fact (Nat.Prime p)] (B M : ℕ) (g : Fin (m + 1) → Polynomial ℤ) (w : Fin m → ℕ) (target : ℤ) (x : ZMod p) (value weight : ℕ → ℕ) (targetValue : ℕ) (hv : ∀ (i : Fin (m + 1)), ↑(value ↑i) = Polynomial.eval₂ (Int.castRingHom (ZMod p)) x (g i)) (hw : ∀ (i : Fin m), ↑(weight ↑i) = ↑(w i)) (ht : ↑targetValue = ↑target) :
↑(fingerprintLabelResidue p B M m value weight targetValue) = Polynomial.eval₂ (Int.castRingHom (ZMod p)) x (Polynomial.fingerprintLabelPolynomial B M g w target)

At every prime the addressed residue evaluator gives the integer fingerprint label. Only genuine test and weight indices need correct values, and denominators may vanish.

The full fingerprint evaluator is in CountingFunction (a + 7). The modulus, precision, weight budget, and number of weighted tests are polynomial-time binary parameters. Test residues are addressed at level a. The weights and target residue can be supplied at level a + 6, the level of the cleared numerator products.