Documentation

CslibFrontier.Computability.Complexity.Classes.CountingHierarchy.DyadicFirstFlag

Classifying the first dyadic flag #

dyadicFirstFlagSign d B r N classifies the first numerator in the flag window with margin 1/d, below the exclusive endpoint r. It returns one below one half, minus one above, and zero when neither case occurs. This is a classifier of supplied dyadic values, not sign recovery for an implicit integer. The operation is total for every natural parameter.

Binary polynomial-time margin denominator and endpoint, unary polynomial-time precision, and a uniform F_a numerator evaluator give an F_(a+2) signed binary output. The semantic bridge to FirstCircleFlag needs only 0 < d, with no CRT or approximation assumption.

Main definitions #

Main results #

noncomputable def Cslib.Complexity.dyadicFirstFlagSign (d B r : ℕ) (N : ℕ → ℕ) :

Classify the first dyadic flag with margin denominator d, below r. The classifier uses natural arithmetic only; no represented integer or CRT data is an input.

theorem Cslib.Complexity.dyadicFirstFlagSign_eq_one_iff {d B r : ℕ} (hd : 0 < d) (N : ℕ → ℕ) :
dyadicFirstFlagSign d B r N = 1 ↔ ∃ k < r, FirstCircleFlag (1 / ↑d) (fun (j : ℕ) => ↑(N j) / 2 ^ B) k ∧ ↑(N k) / 2 ^ B < 1 / 2

Output one means that a first circle flag below the endpoint lies below one half.

theorem Cslib.Complexity.dyadicFirstFlagSign_eq_neg_one_iff {d B r : ℕ} (hd : 0 < d) (N : ℕ → ℕ) :
dyadicFirstFlagSign d B r N = -1 ↔ ∃ k < r, FirstCircleFlag (1 / ↑d) (fun (j : ℕ) => ↑(N j) / 2 ^ B) k ∧ 1 / 2 < ↑(N k) / 2 ^ B

Output minus one means that the first circle flag lies above one half. Uniqueness of the first flag rules out the competing positive test.

theorem Cslib.Complexity.dyadicFirstFlagSign_eq_zero_iff {d B r : ℕ} (hd : 0 < d) (N : ℕ → ℕ) :
dyadicFirstFlagSign d B r N = 0 ↔ (¬∃ k < r, FirstCircleFlag (1 / ↑d) (fun (j : ℕ) => ↑(N j) / 2 ^ B) k ∧ ↑(N k) / 2 ^ B < 1 / 2) ∧ ¬∃ k < r, FirstCircleFlag (1 / ↑d) (fun (j : ℕ) => ↑(N j) / 2 ^ B) k ∧ 1 / 2 < ↑(N k) / 2 ^ B

Output zero means that neither strict side occurs at a first flag. In particular, a first value exactly one half gives zero.

Classifying the first dyadic flag costs two function levels beyond its numerator evaluator. The binary margin denominator, unary precision, binary endpoint, scale and all arithmetic tests are charged. This is a classifier certificate and assumes no integer sign-correctness property.