[codex] add bitmap overlap symmetry theorem#6
Conversation
Review Summary by QodoAdd bitmap overlap symmetry and maximal-invariant theorem
WalkthroughsDescription• Added BitmapSymmetry.lean module defining query-stabilizer group action on bitmap documents • Proved query-stabilizer permutations preserve literal overlap and constant weight • Established that equal-cardinality bitmaps with same overlap lie in same query-stabilizer orbit • Proved maximal-invariant theorem: query-stabilizer-invariant statistics factor through overlap • Integrated new module into verification suite and updated documentation Diagramflowchart LR
QS["Query Stabilizer<br/>Permutations"]
OVL["Bitmap Overlap<br/>Invariant"]
ORBIT["Query-Stabilizer<br/>Orbits"]
FACTOR["Maximal-Invariant<br/>Factorization"]
QS -->|"Preserve"| OVL
OVL -->|"Classify"| ORBIT
ORBIT -->|"Enable"| FACTOR
File Changes1. OrdvecFormalization/BitmapSymmetry.lean
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new file BitmapSymmetry.lean which formalizes the group-theoretic symmetry layer for constant-weight bitmap overlap. It defines coordinate permutations, query stabilizers, and proves that query-stabilizer permutations preserve literal overlap. It also shows that query-stabilizer orbits correspond to same-overlap classes, and that any query-stabilizer-invariant statistic factors through literal overlap. The new definitions and theorems are integrated into the verification tests and documentation. The review feedback suggests significant simplifications to the proofs of mem_permuteBitmap_iff and bitmapOverlap_queryStabilizer_eq by leveraging existing algebraic properties and simplification lemmas.
There was a problem hiding this comment.
Pull request overview
Adds a group-theoretic “bitmap symmetry / maximal invariant” layer establishing that (for constant-weight bitmaps) query-overlap is invariant under the query-stabilizer action and classifies equal-cardinality documents up to that orbit, then exposes the main theorems in the public verification surface and documentation.
Changes:
- Introduces
BitmapSymmetry.leandefining the query stabilizer subgroup, the induced bitmap permutation action, and key invariance/orbit-classification/maximal-invariant theorems. - Wires the new module into the root import surface and
Verify.lean(#check+#print axioms). - Updates README and reviewer/theorem-map docs to include the new symmetry layer and exported theorem names.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new bitmap symmetry/maximal-invariant theorems and updates scope text accordingly. |
| OrdvecFormalization/Verify.lean | Adds public API #checks and axiom audit #print axioms entries for the new symmetry layer. |
| OrdvecFormalization/BitmapSymmetry.lean | New module: defines query-stabilizer action on bitmaps; proves overlap invariance, orbit classification (under card constraint), and factor-through result for invariant statistics on constant-weight space. |
| OrdvecFormalization.lean | Imports OrdvecFormalization.BitmapSymmetry into the top-level module surface. |
| docs/theorem-map.md | Extends theorem map to include the symmetry layer and its dependency placement. |
| docs/reviewer-brief.md | Updates reviewer brief to mention the new symmetry layer and its non-claims. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed the bot findings in
Validated with |
What changed
BitmapSymmetry.lean, defining the query stabilizer action on bitmap documents.Why
This adds the algebraic justification for the ordinal quotient: in the bitmap setting, overlap is not an ad hoc popcount, but the orbit classifier for the natural query-preserving symmetry group.
Impact
The existing Bayes/MLR spine remains unchanged. The new layer explains why overlap is the canonical invariant feeding that decision-theoretic theorem.
Validation
make buildmake verifymake auditmake lint