Skip to content

feat(communication): nondeterministic complexity of equality, disjointness and inner product - #1962

Merged
SamuelSchlesinger merged 36 commits into
cslib-community:mainfrom
ott2:nondeterministic-functions
Oct 31, 2026
Merged

SamuelSchlesinger merged 36 commits into
cslib-community:mainfrom
ott2:nondeterministic-functions

Conversation

@ott2

@ott2 ott2 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Change

Third PR of #1599; builds on #1913 (merged). Adds Complexity/Computability/Communication/Nondeterministic/Functions.lean: N¹(EQ_v) = v [K&N, Example 2.5, with the fooling set of their Example 1.21; the upper bound here is the cover by diagonal singletons], N¹(DISJ_v) = v [K&N, Example 1.23, for the fooling set] and N⁰(NDISJ_v) = v (fooling sets of diagonal and complementary pairs; explicit covers by 2 ^ v rectangles), and N¹(IP_v) ≥ v - 1 and N⁰(IP_v) ≥ v. Here DISJ is disjointness of arbitrary subsets of [v], not the DISJ_k of [K&N, Example 2.12]. The IP bounds count pairs against the existing Lindsey bound BitString.card_mul_le_two_pow_of_dotProduct_eq (Lindsey's lemma [Jukna 2012, Appendix A, p. 579] applied to the Hadamard matrix (-1)^(x ⬝ᵥ y); for 0-monochromatic rectangles this is also [K&N, Example 1.25], over 𝔽₂, and 1-monochromatic ones reduce to that case by translation); the constants v - 1 and v were derived for this formalisation. Existing notions considered: equality, disjointness, isFoolingSet_equality, isFoolingSet_disjointness, dotProduct on BitString, the Hadamard rectangle bound.

Tests (ComplexityTests/NondeterministicFunctions.lean): N⁰(IP_1) = 1 (explicit cover), the IP bound at v = 2, the first case where it is positive, and deterministic lower bounds for EQ, DISJ and IP through ecomplexityFun_le_protocol.

Validation

Local, on 0bb64f56a (current main merged in): lake build --wfail --iofail of the new module, its test and the test of #1913; lake exe mk_all --check; lake exe lint-style; python3 scripts/check_hygiene.py. All pass. Not run locally, since they need the whole library built: the full lake build, lake test over the whole suite, lake lint, checkInitImports and check_changed_files.py; see this PR's CI run. Batteries #lint on the new declarations is clean. An independent agent review checked the definitions and statements against Kushilevitz–Nisan and this repository's conventions; its findings were applied before this revision.

AI assistance

Written with Claude Code (Claude Opus 5.5) at the request of András Z. Salamon, who reviewed the design and statements. The Lean kernel checks the proofs; an independent AI review compared the statements and API with the mathematics and this repository's conventions, and its findings were applied (agent review, not human review).

🤖 Generated with Claude Code

ott2 and others added 30 commits October 31, 2026 01:01
Nondeterministic.ecomplexity z R A B for relations (least k with a z-cover by 2^k rectangles) and
ecomplexityFun at the graph of a function, relation-first as agreed in cslib-community#1599; fooling-set and
rectangle-size bounds, negation, monotonicity, and N^z <= D. Second PR of cslib-community#1599.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tness and inner product

N^1(EQ_v) = N^1(DISJ_v) = N^0(NDISJ_v) = v; N^1(IP_v) >= v - 1 and N^0(IP_v) >= v via Lindsey's
lemma. Third PR of cslib-community#1599; stacked on nondeterministic-communication.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the rounding

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… generalised rectangle bound

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IsCover/HasCover take the answer first, as ecomplexity does; hasCover_of_solves becomes
Protocol.Solves.hasCover; the rectangle-size bound holds on any finite domain; @[expose] only on
IsCover, HasCover and ecomplexityFun; tests on proper subdomains and for a negated relation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… product

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n equality

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers spend no bits on the answer; with both players learning it, as in Protocol, a cover by 2^k
rectangles gives a protocol of cost k + 2 (k + 1 if one player suffices).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dsey's lemma and over F2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gle bound

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate it from the extension

Their definition is for a Boolean function on all of X × Y; the domain sets and relations are
the extension made here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cover number

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ative to the source

They extend Definition 2.1 in the usual way for promise problems; relations in general are the
subject of Kushilevitz–Nisan Chapter 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…llegal inputs

Their Definition 5.2 asks for correctness on legal inputs only, and they note the alternative of
allowing every answer on illegal pairs; here, as for Protocol.ecomplexity, every pair must be
answered, which agrees with theirs on that extension.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kushilevitz–Nisan remark that N¹(R) is less interesting for relations with arbitrary answers;
with Boolean answers a relation is a partial Boolean function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions

It covers partial Boolean functions, the relations with Boolean answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… with Boolean answers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ott2 and others added 6 commits October 31, 2026 03:55
…el for partial functions

Adds GoosPitassiWatson2018Landscape to references.bib.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions

# Conflicts:
#	Complexity/Computability/Communication/Nondeterministic/Basic.lean

Copy link
Copy Markdown
Collaborator

reviewer-codex-edemaine (independent non-author worker): reviewing 0bb64f5. Checking the complete Functions/test layer, actual nondeterministic certificate convention, fooling sets and inner-product counting, with source locators and abstract impact.

@edemaine edemaine left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewer-codex-edemaine — independent non-author agent review: APPROVE 0bb64f5. No blocking findings in the complete three-file layer.

Read the actual IsCover/ecomplexityFun, fooling sets, function definitions, Hadamard rectangle bound and pair-count theorem. Cost is the least integer k admitting 2^k rectangles: guessed certificate bits, without charging an answer bit. Diagonal singleton covers and complementary-set rectangles give the EQ/DISJ upper bounds; the reused fooling sets give matching lower bounds. Negation correctly transfers DISJ to N⁰(NDISJ). For IP, monochromatic area ≤2^v and the unequal positive/negative pair counts yield the stated integer bounds v−1 and v, including v=0. These statements correctly distinguish this convention from unrounded log-cover cost and deterministic protocols.

The checked IP₁ zero-cover is nonvacuous. Independent enumeration verified 5,461 pair/fooling/cover cases, 556 maximal-side monochromatic rectangle cases, and exact minimum cover counts for all four functions at dimensions 0–2. Definitions and general bounds are reused in the appropriate nondeterministic client module. Whitespace/aggregate inclusion pass; no curated-abstract or rendering impact.

Source limits: verified K&N Examples 1.21 and 1.23 in the publisher's excerpt, and Lindsey's statement in Jukna's author-hosted early draft, Appendix A, printed p.564. I could not directly verify K&N Examples 2.5/1.25 or the final-edition p.579 locator; the mathematical mapping is sound independently.

At the single CI inspection, title passed and Lean/Guide were running. Author reports focused strict compilation and lint/hygiene checks; full gates remain with CI. No reviewer Lean build. Live head/history rechecked before submission. Agent review, not human approval.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 31, 2026
Merged via the queue into cslib-community:main with commit 99de582 Oct 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants