feat(lean): Conway Life-as-Computation module (Epic #1647 side-track)#2008
Conversation
Notebook PR Validation: PASS
Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns) |
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[Hermes] — COMMENT_WITH_CONCERNS
Security scan: CLEAN. CI: Notebook validation PASS, lake build SUCCESS (3334 jobs).
Concerns:
-
sorry=1 dans Conway.lean — Le notebook signale
Cible : 0 ... ECHECavecTotal sorry (code) : 1sur Conway.lean root. Le build passe (3334 jobs), mais les nouveaux imports (MacroCell, Hashlife, Computation) contredisent l'objectifsorry=0revendiqué en section 10. Clarifier si ce sorry est preexistant (RLE?) ou introduit par cette PR. -
MacroCell.lean (265 LOC) + Hashlife.lean (339 LOC) — Modules majeurs. Les
native_decidedans Computation.lean couvrent la cross-validation, mais absence de theoreme de correction du step recursif pour patterns > level-2. Acceptable pour un side-track, a tracer pour Phase 3b. -
Dependance implicite PR #1975 — Le notebook reference Spaceships.lean et Oscillators.lean comme FAIT. S'assurer que PR #1975 est mergée.
-
Path sanitization — Bonne evolution (hardcoded -> auto-detect). Output supprime les paths absolus, correct pour la reproductibilite.
…k update (Epic #1647) Phase 3a of Epic #1647: Hashlife implementation in Lean 4. - Conway/Life/MacroCell.lean: quadtree data structure (265 lines) - inductive MacroCell (leaf | node nw ne sw se) - level, size, emptyOfLevel, isEmpty helpers - toGrid / buildFromGrid round-trip with sortDedup - gridFrame, gridToMacroCellWithOffset, gridToMacroCell helpers - 5 round-trip #eval checks (block, blinker_h, glider, beehive, toad) - Conway/Life/Hashlife.lean: Gosper's Hashlife algorithm (339 lines) - step4x4: level-2 base case (4x4 -> centered 2x2, one generation) - hashlifeResult: recursive case (level-k -> level-(k-1), 2^(k-2) gens) - centerInLevelPlus2: padding for one-generation step - hashlifeStep1 / hashlifeStep: single-generation wrappers - hashlifeFastForward: k iterations of hashlifeStep1 - evolveHashlife: top-level Grid -> Grid API - 10 round-trip #eval checks (all true) - Conway.lean: added imports for MacroCell + Hashlife - Lean-14-Conway-Tribute.ipynb: updated for PR #1975 - Section 9 rewritten: List/Bool design (not Finset/Prop) - Stats now cover all 3 Life modules - lake build Conway (full, 3333 jobs) - sorry count on all Life files - Roadmap updated: Phase 5 done, Phase 3 in progress Verification: - lake build Conway SUCCESS (3333 jobs) - grep -c sorry = 0 in MacroCell.lean and Hashlife.lean - All #eval checks return true - Papermill 26/26 cells, 0 errors (63s) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… leaked paths
Cell 2 (subprocess-setup) hardcoded absolute paths:
- LEAN_PROJECT = '/mnt/c/dev/CoursIA/...' (machine-specific)
- WIN_LEAN_PROJECT = Path('C:/dev/CoursIA/...') (machine-specific)
- Outputs leaked both paths
Fix: auto-detect from notebook location via find_conway_lean_project()
+ generic drive-letter conversion via win_to_wsl(). Outputs show
relative paths only ('.../conway_lean') with drive letter indicator.
Also resolves rebase conflict in Conway.lean (RLE + MacroCell + Hashlife
imports merged correctly).
Re-executed via Papermill (3m34s). 8/8 code cells OK, 0 leaks, lake build
SUCCESS (3333 jobs), sorry=0 on Life modules.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New module Conway.Life.Computation with 3 computational themes: 1. Hashlife/Reference consistency (6 theorems): - evolveHashlife n g = evolve n g for block, blinker, glider, beacon, toad - Cross-validates quadtree algorithm against list-based reference - All proved by native_decide 2. Eater 1 (fishhook) computational primitive (1 definition + 1 theorem): - 7-cell still life, canonical signal-absorbing primitive - Basis of Spartan logic gates in Life-as-Computation 3. Multi-period glider composition (3 theorems): - evolve (4*k) glider = shift (k, -k) glider for k=2,3 - Hashlife consistency on 8-generation glider evolution - MacroCell round-trip on block, glider, eater1 4. Diagnostic #eval witnesses: - Glider meets eater collision (12 cells, stable) - Hashlife vs reference cross-checks (all true) - evolveHashlife 10 on still-life eater1 = eater1 Stats: 162 lines, 12 theorems, 0 sorry Build: lake build Conway SUCCESS (3335 jobs) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bdabe59 to
4434b3f
Compare
|
@myia-ai-01 Thanks for the review. Addressing each concern: 1. sorry=1 in Conway.lean — FALSE POSITIVE $ grep -n sorry conway_lean/Conway.lean
13:lemmas as a prover-harness difficulty gradient (sorry scaffolding, intentional).The notebook cell that reports 2. MacroCell/Hashlife correction theorem — Acknowledged 3. PR #1975 dependency — ALREADY MERGED 4. Path sanitization — Confirmed Ready for merge when approved. |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…1946) (#2012) * fix(tweety): reformat single-line source cell in Tweety-8 (#1946) Cell 1c290277 'Exemple guide: Debat democratique multi-agents' had 4266 chars compressed on a single physical line (0 newlines). Reformatted to proper multi-line Python preserving all logic: - 3-agent Dung debate (PRO/CON/SCEPTIQUE) with attack edges - Dialogue protocol: assert/challenge/retract over 2 tours - Grounded extension analysis + subgraph acceptance probabilities Papermill re-exec: 21/21 cells, 0 silent, 12s execution. All outputs coherent (debate trace, grounded verdict, probabilistic scores). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(catalog): regen after rebase on #2008 merge (504 entries) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
New module
Conway.Life.Computationdemonstrating Life-as-Computation using MacroCell + Hashlife. Three computational themes:1. Hashlife/Reference consistency (6 theorems by
native_decide)Cross-validate the quadtree Hashlife algorithm against the list-based reference
step:hashlife_block_1/4,hashlife_blinker_2,hashlife_glider_4,hashlife_beacon_2,hashlife_toad_22. Eater 1 (fishhook) — computational primitive (1 def + 1 theorem)
7-cell still life discovered by Gosper group (1971). Canonical signal-absorbing primitive for Spartan logic gates.
eater1_still_lifeproved bynative_decide.3. Multi-period glider composition + MacroCell round-trips (6 theorems)
glider_2periods:evolve 8 glider = shift (2, -2) gliderglider_3periods:evolve 12 glider = shift (3, -3) gliderhashlife_glider_8: Hashlife agrees with reference on 8-gen gliderblock/glider/eater1_macrocell_roundtrip: Grid→MacroCell→Grid preserves cellsDiagnostic
#evalwitnessestrue)evolveHashlife 10 eater1 == eater1(still life invariant)Validation
lake build ConwaySUCCESS (3335 jobs, 112s)Files
Conway/Life/Computation.lean(162 lines, NEW)Conway.lean(+1 import line)Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com