Skip to content

Commit e94effe

Browse files
tcoratgerclaude
andauthored
docs(slot): list only reachable justifiable-slot examples (#1125)
The inline comments for the perfect-square and pronic rules listed delta values (1, 2, 4) that the immediate-window early return catches first, so they never reach those checks. Annotate that the small values are handled by Rule 1 and show the first delta that actually reaches each rule (square 9, pronic 6). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a8b0320 commit e94effe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/lean_spec/spec/forks/lstar

src/lean_spec/spec/forks/lstar/slot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ def is_justifiable_after(self, finalized_slot: "Slot") -> bool:
6060

6161
# Rule 2: Slots at perfect square distances are justifiable.
6262
#
63-
# Examples: delta = 1, 4, 9, 16, 25, 36, 49, 64, ...
63+
# Smaller squares 1 and 4 already returned under Rule 1.
64+
# First square that reaches here is 9: delta = 9, 16, 25, 36, 49, 64, ...
6465
# Check: integer square root squared equals delta
6566
if math.isqrt(delta) ** 2 == delta:
6667
return True
6768

6869
# Rule 3: Slots at pronic number distances are justifiable.
6970
#
7071
# Pronic numbers have the form n(n+1): 2, 6, 12, 20, 30, 42, 56, ...
72+
# The smallest pronic 2 already returned under Rule 1.
73+
# First pronic that reaches here is 6: delta = 6, 12, 20, 30, 42, 56, ...
7174
# Mathematical insight: For pronic delta = n(n+1), we have:
7275
# 4*delta + 1 = 4n(n+1) + 1 = (2n+1)^2
7376
# Check: 4*delta+1 is an odd perfect square

0 commit comments

Comments
 (0)