Documentation

Complexitylib.Metacomplexity.MCSP.AntiChecker.Counting

Anti-checker survivor counts #

The constructive Anti-Checker Lemma builds a sample prefix while estimating the number of encoded small circuits still consistent with its target labels. This module exposes that exact finite count, its monotonicity under adding samples, and its specialization to the canonical bounded circuit enumeration.

For canonical candidates, reaching zero survivors is exactly the anti-checker condition. Approximate counters can therefore target this quantity without any gap between encoded-circuit and typed-circuit semantics.

theorem Complexity.AntiChecker.survivorCount_nil {arity : } (target : BitString arityBool) (codes : Finset (List Bool)) :
survivorCount target [] codes = codes.card

Before any samples are chosen, every candidate code survives.

theorem Complexity.AntiChecker.survivorCount_cons {arity : } (target : BitString arityBool) (input : BitString arity) (inputs : List (BitString arity)) (codes : Finset (List Bool)) :
survivorCount target (input :: inputs) codes = {xConsistentCodes target inputs codes | CodeAgreesAt target x input}.card

Adding one input counts the previous survivors that agree with its target label.

theorem Complexity.AntiChecker.survivorCount_le_card {arity : } (target : BitString arityBool) (inputs : List (BitString arity)) (codes : Finset (List Bool)) :
survivorCount target inputs codes codes.card

A survivor count never exceeds the original candidate-set size.

theorem Complexity.AntiChecker.survivorCount_samples_anti {arity : } {target : BitString arityBool} {first second : List (BitString arity)} {codes : Finset (List Bool)} (hsub : inputfirst, input second) :
survivorCount target second codes survivorCount target first codes

Adding possible samples can only decrease the survivor count.

theorem Complexity.AntiChecker.survivorCount_eq_zero_iff {arity : } (target : BitString arityBool) (inputs : List (BitString arity)) (codes : Finset (List Bool)) :
survivorCount target inputs codes = 0 ConsistentCodes target inputs codes =

A survivor count is zero exactly when its survivor set is empty.

theorem Complexity.AntiChecker.candidateSurvivorCount_nil {arity threshold : } (target : BitString arityBool) :
candidateSurvivorCount target threshold [] = (candidateCodes arity threshold).card

The initial canonical survivor count is the size of the bounded circuit enumeration.

theorem Complexity.AntiChecker.candidateSurvivorCount_cons {arity threshold : } (target : BitString arityBool) (input : BitString arity) (inputs : List (BitString arity)) :
candidateSurvivorCount target threshold (input :: inputs) = {xConsistentCodes target inputs (candidateCodes arity threshold) | CodeAgreesAt target x input}.card

Adding one input to the canonical sample prefix filters precisely the previous canonical survivors.

theorem Complexity.AntiChecker.candidateSurvivorCount_le_card {arity threshold : } (target : BitString arityBool) (inputs : List (BitString arity)) :
candidateSurvivorCount target threshold inputs (candidateCodes arity threshold).card

Canonical survivors are bounded by the canonical candidate domain.

theorem Complexity.AntiChecker.candidateSurvivorCount_samples_anti {arity threshold : } {target : BitString arityBool} {first second : List (BitString arity)} (hsub : inputfirst, input second) :
candidateSurvivorCount target threshold second candidateSurvivorCount target threshold first

Adding possible samples can only decrease the canonical survivor count.

theorem Complexity.AntiChecker.candidateSurvivorCount_eq_zero_iff_isFor {arity threshold : } [NeZero arity] (target : BitString arityBool) (inputs : List (BitString arity)) :
candidateSurvivorCount target threshold inputs = 0 IsFor target threshold inputs

For the canonical candidate domain, zero survivors is exactly the typed anti-checker condition.