Documentation

CslibFrontier.Computability.Complexity.Classes.CountingHierarchy.FirstEventSign

Three-way selection at a bounded first event #

firstEventSign returns 1 if the first event satisfies the positive test, otherwise -1 if it satisfies the negative test, and otherwise 0. Positive has priority when both tests hold. The operation is generic: the test names do not assert any relation to an integer's sign.

Three uniform F_a Boolean evaluators and a polynomial-time binary endpoint give an F_(a+2) signed binary output. The first-event quantifiers are those of firstEventTest; no CRT, approximation or manuscript-specific parameters occur in the operation.

Main definitions #

Main results #

noncomputable def Cslib.Complexity.firstEventSign {α : Type} (event positive negative : α × ℕ → Bool) (r : α → ℕ) (x : α) :

Select 1, -1, or 0 using tests at the first event below r x. The positive test takes priority if both tests hold. This operation alone does not recover an integer's sign; an application must establish what its tests mean.

theorem Cslib.Complexity.firstEventSign_eq_one_iff {α : Type} (event positive negative : α × ℕ → Bool) (r : α → ℕ) (x : α) :
firstEventSign event positive negative r x = 1 ↔ ∃ i < r x, event (x, i) = true ∧ positive (x, i) = true ∧ ∀ j < i, event (x, j) = false

The positive first-event test characterizes output one, regardless of the negative test.

theorem Cslib.Complexity.firstEventSign_eq_neg_one_iff {α : Type} (event positive negative : α × ℕ → Bool) (r : α → ℕ) (x : α) :
firstEventSign event positive negative r x = -1 ↔ (¬∃ i < r x, event (x, i) = true ∧ positive (x, i) = true ∧ ∀ j < i, event (x, j) = false) ∧ ∃ i < r x, event (x, i) = true ∧ negative (x, i) = true ∧ ∀ j < i, event (x, j) = false

Output minus one requires the negative first-event test and failure of the positive one.

theorem Cslib.Complexity.firstEventSign_eq_zero_iff {α : Type} (event positive negative : α × ℕ → Bool) (r : α → ℕ) (x : α) :
firstEventSign event positive negative r x = 0 ↔ (¬∃ i < r x, event (x, i) = true ∧ positive (x, i) = true ∧ ∀ j < i, event (x, j) = false) ∧ ¬∃ i < r x, event (x, i) = true ∧ negative (x, i) = true ∧ ∀ j < i, event (x, j) = false

Output zero means that neither test accepts the first event, including when no event exists.

Three uniform F_a Boolean evaluators give signed binary first-event selection in F_(a+2). No semantic sign-correctness premise is needed for this computational certificate.