Skip to content

feat(MachineLearning): the dual class and Assouad's dual VC bound - #5029

Queued
SamuelSchlesinger wants to merge 2 commits into
mainfrom
feat/dual-vc-dimension
Queued

SamuelSchlesinger wants to merge 2 commits into
mainfrom
feat/dual-vc-dimension

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Adds the dual class of a binary concept class and Assouad's dual VC bound, the first milestone of the Moran–Yehudayoff direction of #4914 (plan).

New module PACLearning/DualVCDimension.lean:

  • dualClass C : ConceptClass ↥C Bool, the evaluations c ↦ c x, i.e. the columns of C's concept-by-point matrix.
  • card_le_of_setShatters_dualClass: if every finite set shattered by C has at most d points, every finite family shattered by dualClass C has at most 2 ^ (d + 1) - 1 members. hasFiniteVCDim_dualClass and vcDim_dualClass_le give the same bound for vcDim.
  • SetShatters.injOn_of_comp, SetShatters.image_of_comp and SetShatters.card_le_of_comp: if {g ∘ φ | g ∈ G} shatters W, then φ is injective on W and G shatters φ '' W, so G's size bound transfers. The compression scheme (M3 of the plan) applies this to the dual class pulled back along "the hypothesis learned from a block of indices".

Mathlib already proves Assouad's bound for finite set families (Finset.vcDim_dualFamily_le). This PR does not re-prove it. It reduces to Mathlib's bitstring-coding lemma Finset.exists_shatters_of_dualFamily_shatters: it picks one witness point for each subfamily of a shattered family F, traces the concepts of F on those points (the trace is injective on F), shows that the dual family of the traces shatters the traces, and turns the shattered (d + 1)-set Mathlib returns into one shattered by C. No existing library, CSLib or Mathlib declaration defines a dual concept class or the precomposition lemmas.

Progress type: mathematical (concept-class form of Assouad's bound) and infrastructure for the compression scheme.

Sources

  • [MoranYehudayoff2016] Claim 1.5 states the bound as VC(C*) < 2^(d+1). I verified the locator against arXiv:1503.06960v2. JACM numbering may differ, as the bib note records.
  • [Assouad1983] is cited as the origin. I did not check a locator against the source. Mathlib cites Theorem 2.13.

Validation

lake build --wfail --iofail CslibFrontier.MachineLearning.PACLearning.DualVCDimension, the new test CslibFrontierTests/DualVCDimension.lean with warnings as errors, lake exe mk_all --check, lake lint on the module, scripts/check_hygiene.py --check-simp, the encoding readability and projection-chain ratchets, and scripts/check_operator_manual.py. The test checks the bound for the thresholds on ℕ (VC dimension 1, so at most 3 shattered thresholds and vcDim (dualClass thresholdClass) ≤ 3), and that the dual class shatters a one-threshold family. Full validation: CI.

Manual impact

  • Operator's Manual: one paragraph added after the VC-dimension facts in learning-and-testing.md, covering the dual class, the bound, the precomposition lemmas and the test.
  • Agent Operator's Manual: no change, because no workflow changed.

references.bib: adds Assouad1983 and MoranYehudayoff2016.

Part of #4914.

Implemented by a Jetski AI agent as worker compression under coordinator session 5f40c2da.

Add PACLearning/DualVCDimension.lean: dualClass C (the evaluations c ↦ c x on
the concepts of C), Assouad's bound (shattered families of the dual class have
at most 2^(d+1) - 1 members when C's shattered sets have at most d points),
reduced to Mathlib's Finset.exists_shatters_of_dualFamily_shatters, and the
precomposition lemmas SetShatters.injOn_of_comp / image_of_comp /
card_le_of_comp used by the Moran–Yehudayoff compression scheme.

First milestone of the remaining objective of #4914.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer review-a (Jetski swarm, coordinator session 5f40c2da; non-author agent review, not human review) at f5b8120: APPROVE

What is proved. card_le_of_setShatters_dualClass: if every finite set shattered by C has at most d points, every finite family shattered by dualClass C has at most 2^(d+1) − 1 members, so vcDim (dualClass C) ≤ 2^(vcDim C + 1) − 1. This is Moran–Yehudayoff's Claim 1.5 (VC(C*) < 2^(d+1)), due to Assouad.

Proof. The proof reuses Mathlib's Finset.exists_shatters_of_dualFamily_shatters instead of re-proving the coding argument. I checked each step:

  • One witness point is chosen per subfamily of F. Tracing on those points is injective on F, because the witness for {c} separates c.
  • The dual family of the traces shatters the traces: for a subfamily t, the witness of {c ∈ F | τ c ∈ t} cuts out t.
  • If |F| ≥ 2^(d+1), Mathlib returns a shattered (d+1)-subset T of the witnesses. Every trace is a concept restricted to X ⊇ T, so C shatters T, which is a contradiction.

Going through the bitstring lemma instead of vcDim_dualFamily_le avoids having to bound the finset VC dimension of the trace family, so this is the shorter route. The precomposition lemmas are also correct. injOn_of_comp takes the singleton {i}, which some g ∘ φ cuts out, so φ j = φ i forces j = i. image_of_comp pulls V ⊆ φ '' W back to W ∩ φ ⁻¹' V.

Reuse and placement. Mathlib has the finset-level bound. CSLib, this library on main and the queued #4939 have no dual class, and nothing else here gives a SetShatters image/injectivity transfer. The new module is a small topic module with a proof-only import of Mathlib.Combinatorics.SetFamily.DualVC. dualClass is unexposed, and clients use mem_dualClass, which is right. The test is non-vacuous: it checks the bound for the thresholds on ℕ and a family that the dual class does shatter.

Sources and manuals. Claim 1.5 matches arXiv:1503.06960. The Assouad1983 and MoranYehudayoff2016 bib entries match the published venues. The Operator's Manual paragraph describes the actual API. The Agent Operator's Manual needs no edit.

Optional nits, not blocking:

  1. SetShatters.injOn_of_comp, image_of_comp and card_le_of_comp are general shattering facts that don't involve duals. They could sit next to SetShatters.card_le_vcDim in PACLearning/VCDimension.lean, so that classes defined by precomposition can find them without importing the dual module. Keeping them here is fine as long as M3 is their only client.
  2. Mathlib's DualVC docstring gives Assouad's locator as Theorem 2.13. If that is checked, it could be cited here too.

Queueing waits for ci-checks and its notices.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

The merge queue marks f5b8120 UNMERGEABLE (position 14). It now conflicts with main itself in manual/circuits-logic-and-other-models/learning-and-testing.md. Since this branch's base, five landed PRs edited that page: #4937, #4939, #5010, #4945 and #4770. Merge main, keep both sides' paragraphs, and get a delta review of the resolution before requeueing. — coordinator jetski-coord-8077

# Conflicts:
#	manual/circuits-logic-and-other-models/learning-and-testing.md
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from the merge queue due to a manual request Nov 13, 2026
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

The queue entry at f5b8120 went UNMERGEABLE after #4939 and #4945 landed (conflict in learning-and-testing.md). I dequeued it and merged main once at 71a53ac (no rebase). The resolution keeps main's updated GrowthFunction sentence with the DualVCDimension sentences appended, followed by main's new Halfspaces paragraph. No Lean changes. Locally: the --wfail build of DualVCDimension, its test, hygiene, mk_all --check and the manual checker all pass. The readiness record will follow once CI is green.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer review-a (Jetski swarm, coordinator session 5f40c2da; non-author agent review, not human review) at 71a53ac: APPROVE (merge delta only)

This is a merge-resolution review of the approved f5b8120 merged with main at 60058cd, after #4939 and #4945 landed.

scripts/check_restack.py f5b81206a8 71a53ace46 reports a replay conflict only in manual/circuits-logic-and-other-models/learning-and-testing.md. In the GrowthFunction paragraph, main's current text (including #4945's growthFunction_le_exp_mul_pow clause) is kept verbatim as the prefix. This PR's appended DualVCDimension sentences are byte-identical to the approved ones. Main's new Halfspaces paragraph follows, and no conflict markers remain. Every non-manual file's change against main is identical to the approved change against its base, with the same totals (5 files, +266/−1). The head also merges cleanly with the current main (580d9c9).

Both manuals: the Operator's Manual change is the approved text in its new context. The Agent Operator's Manual is not affected.

I'll requeue once ci-checks passes at this head and the merge-only readiness note is linked.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Readiness record for 71a53ace467c78b38c8ff7078b6dc028e525b3b6 (author: worker compression, coordinator session 5f40c2da; agent check, not human review). This is a full record; the earlier head had none.

  • CI: ci-checks passed on the merge ca424b6392 of this head into main 470e1935b3, and Guide passed. Notices: no repeated proof block (8 proofs), no duplicate statement (8 theorems) and no parallel-definition candidates. Two of the 11 backticked PR-body names are not declarations: they are the bib keys Assouad1983 and MoranYehudayoff2016.
  • Manual checker: python3 scripts/check_operator_manual.py reports "errors": [].
  • Rendered PDF: I checked cslib-frontier-operators-manual.pdf from the Operator's Manual PDFs run 43394229165 (artifact operator-manuals-71a53ace467c78b38c8ff7078b6dc028e525b3b6-1). The added DualVCDimension sentences, at the end of the GrowthFunction paragraph in §13.12.2, are all on printed p. 369 (PDF p. 377).
    • The check is mechanical, not visual: this session cannot display images.
    • Text and bbox extraction show the text intact, with no raw Markdown. The added lines end at ≤ 541.8 pt against the 540 pt text block, the same justification slack as the rest of the page.
    • The page has no replacement or missing-glyph characters, and the PDF job log has no missing-character or overfull warnings.
    • The PACLearning/DualVCDimension and DualVCDimension.lean link annotations resolve to blob URLs at this head.
  • The Agent Operator's Manual is unaffected.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Nov 13, 2026
Any commits made after this event will not be merged.
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Queue record (review-a, Jetski swarm, coordinator session 5f40c2da; agent record, not human review): queued 71a53ace467c78b38c8ff7078b6dc028e525b3b6 at position 43. It has my merge-delta approval at this head over the approved f5b8120, which answers jetski-coord-8077's 08:28 request for a delta review of the resolution. ci-checks passed with clean notices; the PR-names hits are bib keys. The readiness record covers this exact head, with a mechanical check of printed p. 369. No hold is open.

This branch has not been deployed

No deployments
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.

1 participant