AFTD Auto-Formalizing Theoretical Domains

op309_girth9_block_ring_rich_coloring

theoremverified

For every k, the k-block ring of the explicit 132-vertex girth-nine graph (copy j's vertex 36 joined to copy j+1's vertex 39 in place of the edge 36-39) has a proper five-colouring of its line graph, lifted from the base graph, in which every edge of the triple-star forest R is rich, so the colouring is rich-neighbour.

Statement

theorem op309_girth9_block_ring_rich_coloring (k : ℕ)
    (G : SimpleGraph (Fin (132 * k))) [DecidableRel G.Adj]
    (hG : ∀ u v : Fin (132 * k), G.Adj u v ↔
      let outside : List (ℕ × ℕ) := [(0,34), (1,6), (1,67), (2,10), (2,91), (3,31), (4,29), (4,88), (5,23), (5,71), (7,21), (7,65), (8,30), (8,125), (9,31), (10,116), (11,13), (11,113), (12,37), (13,79), (14,16), (14,85), (15,35), (16,106), (17,18), (17,115), (19,28), (19,124), (20,22), (20,38), (22,46), (23,110), (24,32), (25,94), (25,97), (26,89), (26,104), (27,34), (28,112), (29,62), (32,35), (33,130), (36,39), (37,53), (38,88), (40,61), (40,71), (41,44), (41,116), (42,45), (43,62), (43,103), (44,73), (46,80), (47,95), (47,118), (48,51), (49,77), (49,115), (50,92), (50,98), (52,124), (52,128), (53,104), (54,57), (55,103), (55,119), (56,64), (56,113), (58,89), (58,127), (59,67), (59,76), (60,63), (61,128), (64,100), (65,85), (66,69), (68,109), (68,131), (70,80), (70,122), (72,75), (73,121), (74,119), (74,131), (76,94), (77,79), (78,81), (82,97), (82,110), (83,91), (83,127), (84,87), (86,92), (86,122), (90,93), (95,109), (96,99), (98,107), (100,130), (101,118), (101,125), (102,105), (106,121), (107,112), (108,111), (114,117), (120,123), (126,129)]
      let base : ℕ → ℕ → Prop := fun a b =>
        (a ≠ b ∧ a / 3 = b / 3 ∧ (a % 3 = 0 ∨ b % 3 = 0)) ∨ (a, b) ∈ outside ∨ (b, a) ∈ outside
      (u.val / 132 = v.val / 132 ∧ base (u.val % 132) (v.val % 132) ∧
        ¬ (u.val % 132 = 36 ∧ v.val % 132 = 39) ∧ ¬ (u.val % 132 = 39 ∧ v.val % 132 = 36)) ∨
      (u.val % 132 = 36 ∧ v.val % 132 = 39 ∧ v.val / 132 = (u.val / 132 + 1) % k) ∨
      (u.val % 132 = 39 ∧ v.val % 132 = 36 ∧ u.val / 132 = (v.val / 132 + 1) % k))
    (R : Finset G.edgeSet)
    (hR : ∀ e : G.edgeSet, e ∈ R ↔ ∃ a b : Fin (132 * k), e.1 = s(a,b) ∧ a ≠ b ∧
      a.val / 3 = b.val / 3 ∧ (a.val % 3 = 0 ∨ b.val % 3 = 0)) :
    ∃ c : G.lineGraph.Coloring (Fin 5),
      simple_graph_is_rich_neighbor_coloring G c ∧ ∀ e ∈ R, simple_graph_edge_is_rich G c e
Source
OP-309 girth-nine block-ring construction (experiment 42423, its edge colouring): helper for op309_girth9_acyclic_source_unbounded_switch_cost.
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 6
Used by 1

The proof, explained

The k-block ring of the 132-vertex girth-9 graph admits a proper 5-edge-coloring (proper coloring of its line graph) where every edge of the triple-star forest R is rich, making the coloring rich-neighbour. The coloring is constructed by projecting each vertex to its residue modulo 132 and applying an explicit 5-coloring table from the 132-vertex base graph. Because the projection is a graph homomorphism that is locally injective on neighborhoods, the base coloring's properness and richness—both verified computationally by Lean's kernel—lift directly to the ring graph. Finally, an established combinatorial property shows that R dominates the line graph, ensuring that every edge has a rich neighbor.

  1. The base coloring function is symmetric: in1267_col a b = in1267_col b a.

    Unfolding the definition of in1267_col, the claim reduces to in1267_cab (min a b) (max a b) % 5 = in1267_cab (min b a) (max b a) % 5, which follows immediately by rewriting with the commutativity of min and max.

    lines 14–16

    uses min_comm, max_comm

    theorem in1267_col_comm (a b : ℕ) : in1267_col a b = in1267_col b a := by
      unfold in1267_col
      rw [min_comm, max_comm]
  2. The coloring on the 132-vertex base graph is proper at every vertex. automation

    Lean's kernel computational reflection decider evaluates the coloring table over all 132 vertices and all pairs of distinct incident edges to verify that they receive different colors modulo 5.

    lines 18–20

    uses in1267_col_proper

    theorem in1267_col_proper : ∀ a, a < 132 → ∀ i, i < 3 → ∀ j, j < 3 → i ≠ j →
        in1267_col a (in1267_nb a i) ≠ in1267_col a (in1267_nb a j) := by
      decide +kernel
  3. The coloring on the 132-vertex base graph satisfies the richness property for every triple-star edge. automation

    Lean's kernel computational reflection decider verifies that for all non-center vertices x < 132 and their star centers c = 3*(x/3), any incident edge at x other than (x,c) has a different color modulo 5 from any incident edge at c other than (c,x).

    lines 22–25

    uses in1267_col_rich

    theorem in1267_col_rich : ∀ x, x < 132 → x % 3 ≠ 0 → ∀ i, i < 3 → ∀ j, j < 3 →
        in1267_nb x i ≠ 3 * (x / 3) → in1267_nb (3 * (x / 3)) j ≠ x →
        in1267_col x (in1267_nb x i) ≠ in1267_col (3 * (x / 3)) (in1267_nb (3 * (x / 3)) j) := by
      decide +kernel
  4. Any neighbor of a given as 0, 1, or 2 can be expressed as in1267_nb a i for some index i < 3.

    Case analysis on the three-way disjunction, providing 0, 1, or 2 respectively as the witness index i.

    lines 27–33

    uses in1267_nb_ex

    theorem in1267_nb_ex {a y : ℕ} (h : y = in1267_nb a 0 ∨ y = in1267_nb a 1 ∨ y = in1267_nb a 2) :
        ∃ i, i < 3 ∧ y = in1267_nb a i := by
      rcases h with h | h | h
      · exact ⟨0, by norm_num, h⟩
      · exact ⟨1, by norm_num, h⟩
      · exact ⟨2, by norm_num, h⟩
    
  5. The projection modulo 132 from the k-block ring to the base graph is a graph homomorphism and is locally injective.

    Using the simplified adjacency characterization hA from in1267_ring_hA, lemma in1267_ring_hom shows that any neighbor of v projects modulo 132 to one of the three base neighbors of v % 132, and in1267_ring_inj shows that distinct neighbors of v project to distinct values modulo 132. The bound v % 132 < 132 is also recorded via Nat.mod_lt.

    lines 49–52

    uses in1267_ring_hA, in1267_ring_hom, in1267_ring_inj, Nat.mod_lt

      have hA := in1267_ring_hA k G hG
      have hhom := in1267_ring_hom k G hA
      have hinj := in1267_ring_inj k G hA
      have hm : ∀ v : Fin (132 * k), v.val % 132 < 132 := fun v => Nat.mod_lt _ (by norm_num)
  6. A 5-coloring col on the edges of G is well-defined by evaluating the base coloring modulo 132.

    We define f(u, w) = in1267_col (u % 132) (w % 132) as an element of Fin 5. Since in1267_col is symmetric by in1267_col_comm, f lifts to unordered pairs via Sym2.lift, giving an edge coloring col whose value on s(v, y) is in1267_col (v % 132) (y % 132).

    lines 53–60

    uses in1267_col_comm, Fin.ext, Sym2.lift_mk, Nat.mod_lt

      let f : Fin (132 * k) → Fin (132 * k) → Fin 5 := fun u w =>
        ⟨in1267_col (u.val % 132) (w.val % 132), Nat.mod_lt _ (by norm_num)⟩
      have hf : ∀ u w, f u w = f w u := fun u w => Fin.ext (in1267_col_comm _ _)
      let col : G.edgeSet → Fin 5 := fun e => Sym2.lift ⟨f, hf⟩ e.1
      have hcol : ∀ (e : G.edgeSet) (v y : Fin (132 * k)), e.1 = s(v, y) →
          (col e).val = in1267_col (v.val % 132) (y.val % 132) := by
        intro e v y h
        simp only [col, h, Sym2.lift_mk, f]
  7. Every vertex v in an edge e has a neighbor y such that e = s(v, y).

    An element v in the unordered pair e.1 must be paired with some vertex y; since e is an edge of G, v and y are adjacent in G by SimpleGraph.mem_edgeSet.

    lines 61–67

    uses SimpleGraph.mem_edgeSet

      have hat : ∀ (e : G.edgeSet) (v : Fin (132 * k)), v ∈ e.1 → ∃ y, e.1 = s(v, y) ∧ G.Adj v y := by
        intro e v hv
        obtain ⟨y, hy⟩ := Sym2.mem_iff_exists.1 hv
        refine ⟨y, hy, ?_⟩
        have h2 := e.2
        rw [hy] at h2
        exact (SimpleGraph.mem_edgeSet G).1 h2
  8. Distinct edges incident to the same vertex receive distinct colors.

    For any vertex v and distinct neighbors y1 ≠ y2, the homomorphism property gives neighbor indices i, j < 3 such that y1 % 132 = in1267_nb (v % 132) i and y2 % 132 = in1267_nb (v % 132) j. By local injectivity, y1 ≠ y2 forces i ≠ j. Then in1267_col_proper implies that the edges have different colors.

    lines 68–77

    uses in1267_nb_ex, in1267_col_proper

      have hdist : ∀ (v y1 y2 : Fin (132 * k)), G.Adj v y1 → G.Adj v y2 → y1 ≠ y2 →
          in1267_col (v.val % 132) (y1.val % 132) ≠ in1267_col (v.val % 132) (y2.val % 132) := by
        intro v y1 y2 h1 h2 hne
        obtain ⟨i, hi, e1⟩ := in1267_nb_ex (hhom v y1 h1)
        obtain ⟨j, hj, e2⟩ := in1267_nb_ex (hhom v y2 h2)
        have hij : i ≠ j := by
          rintro rfl
          exact hne (hinj v y1 y2 h1 h2 (e1.trans e2.symm))
        rw [e1, e2]
        exact in1267_col_proper _ (hm v) i hi j hj hij
  9. The edge coloring col defines a proper coloring c of the line graph of G.

    Adjacent edges in the line graph share a vertex v. Writing them as s(v, y1) and s(v, y2), the edges are distinct so y1 ≠ y2. By hdist, they receive distinct colors. Thus SimpleGraph.Coloring.mk produces a valid proper coloring c of the line graph.

    lines 78–88

    uses SimpleGraph.Coloring.mk, Subtype.ext

      let c : G.lineGraph.Coloring (Fin 5) := SimpleGraph.Coloring.mk col (by
        intro e g hadj hc
        obtain ⟨hne, v, hve, hvg⟩ := SimpleGraph.lineGraph_adj_iff_exists.1 hadj
        obtain ⟨y1, e1, h1⟩ := hat e v hve
        obtain ⟨y2, e2, h2⟩ := hat g v hvg
        have hy : y1 ≠ y2 := by
          rintro rfl
          exact hne (Subtype.ext (e1.trans e2.symm))
        exact hdist v y1 y2 h1 h2 hy (by rw [← hcol e v y1 e1, ← hcol g v y2 e2, hc]))
      have hcv : ∀ (e : G.edgeSet) (v y : Fin (132 * k)), e.1 = s(v, y) →
          (c e).val = in1267_col (v.val % 132) (y.val % 132) := hcol
  10. Edges incident to opposite ends of a triple-star edge receive distinct colors (the cross lemma).

    For a triple-star edge e = s(x, cc) with leaf x and center cc = 3*(x/3), any incident edge f ≠ e at x leaves along neighbor y1 ≠ cc, and any incident edge g ≠ e at cc leaves along neighbor y2 ≠ x. By local injectivity, y1 % 132 ≠ cc % 132 and y2 % 132 ≠ x % 132. The base richness lemma in1267_col_rich then shows that col(f) ≠ col(g).

    lines 89–115

    uses in1267_rep, SimpleGraph.mem_edgeSet, Subtype.ext, Sym2.eq_swap, in1267_nb_ex, in1267_col_rich

      have hrich : ∀ e ∈ R, simple_graph_edge_is_rich G c e := by
        intro e he
        obtain ⟨x, cc, hx, hc, hxc⟩ := in1267_rep hR he
        have hxcadj : G.Adj x cc := by
          have h2 := e.2
          rw [hxc] at h2
          exact (SimpleGraph.mem_edgeSet G).1 h2
        have hpc : cc.val % 132 = 3 * (x.val % 132 / 3) := by omega
        have hpx : x.val % 132 % 3 ≠ 0 := by omega
        -- an edge f ≠ e through x (resp. cc) leaves along a neighbour other than cc (resp. x)
        have cross : ∀ (f g : G.edgeSet) (y1 y2 : Fin (132 * k)), f.1 = s(x, y1) → g.1 = s(cc, y2) →
            G.Adj x y1 → G.Adj cc y2 → e ≠ f → e ≠ g → (c f).val ≠ (c g).val := by
          intro f g y1 y2 ef eg a1 a2 nf ng
          have hy1 : y1 ≠ cc := by
            rintro rfl
            exact nf (Subtype.ext (hxc.trans ef.symm))
          have hy2 : y2 ≠ x := by
            rintro rfl
            exact ng (Subtype.ext (hxc.trans (eg.trans (Sym2.eq_swap)).symm))
          obtain ⟨i, hi, e1⟩ := in1267_nb_ex (hhom x y1 a1)
          obtain ⟨j, hj, e2⟩ := in1267_nb_ex (hhom cc y2 a2)
          have n1 : y1.val % 132 ≠ cc.val % 132 := fun h => hy1 (hinj x y1 cc a1 hxcadj h)
          have n2 : y2.val % 132 ≠ x.val % 132 := fun h => hy2 (hinj cc y2 x a2 hxcadj.symm h)
          rw [hcv f x y1 ef, hcv g cc y2 eg, e1, e2, hpc]
          rw [e1, hpc] at n1
          rw [e2, hpc] at n2
          exact in1267_col_rich _ (hm x) hpx i hi j hj n1 n2
  11. Every edge in the triple-star forest R is rich in the line graph.

    Let e ∈ R and let f, g be two distinct edges adjacent to e in the line graph. Each of f and g shares an endpoint with e, which is either the leaf x or the center cc. If both share x or both share cc, they have distinct colors by hdist. If one shares x and the other shares cc, they have distinct colors by the cross lemma. Therefore, all neighbors of e have distinct colors, meaning e is rich.

    lines 116–134

    uses congrArg, Subtype.ext

        intro f g hf hg hfg hcfg
        obtain ⟨nf, v1, hv1e, hv1f⟩ := SimpleGraph.lineGraph_adj_iff_exists.1 hf
        obtain ⟨ng, v2, hv2e, hv2g⟩ := SimpleGraph.lineGraph_adj_iff_exists.1 hg
        rw [hxc] at hv1e hv2e
        obtain ⟨y1, ef, a1⟩ := hat f v1 hv1f
        obtain ⟨y2, eg, a2⟩ := hat g v2 hv2g
        have hcfg' : (c f).val = (c g).val := congrArg Fin.val hcfg
        rcases Sym2.mem_iff.1 hv1e with h1 | h1 <;> rcases Sym2.mem_iff.1 hv2e with h2 | h2 <;>
          rw [h1] at ef a1 <;> rw [h2] at eg a2
        · have hy : y1 ≠ y2 := by
            rintro rfl
            exact hfg (Subtype.ext (ef.trans eg.symm))
          exact hdist x y1 y2 a1 a2 hy (by rw [← hcv f x y1 ef, ← hcv g x y2 eg]; exact hcfg')
        · exact cross f g y1 y2 ef eg a1 a2 nf ng hcfg'
        · exact cross g f y2 y1 eg ef a2 a1 ng nf hcfg'.symm
        · have hy : y1 ≠ y2 := by
            rintro rfl
            exact hfg (Subtype.ext (ef.trans eg.symm))
          exact hdist cc y1 y2 a1 a2 hy (by rw [← hcv f cc y1 ef, ← hcv g cc y2 eg]; exact hcfg')
  12. Every block star edge is an edge of G.

    For distinct vertices a, b with a/3 = b/3 and at least one divisible by 3, a and b lie in the same 132-block and are adjacent in the base graph by in1267_blk_fwd. Since triple-star edges are within blocks and do not use the deleted edge (36, 39), the ring adjacency hA holds.

    lines 135–141

    uses Fin.ext, Or.inl, in1267_blk_fwd

      have hstar : ∀ a b : Fin (132 * k), a ≠ b → a.val / 3 = b.val / 3 →
          (a.val % 3 = 0 ∨ b.val % 3 = 0) → G.Adj a b := by
        intro a b hab h3 h0
        have hab' : a.val ≠ b.val := fun h => hab (Fin.ext h)
        rw [hA]
        refine Or.inl ⟨by omega, ?_, by omega, by omega⟩
        exact in1267_blk_fwd _ (hm a) _ (hm b) ⟨by omega, by omega, by omega⟩
  13. The coloring c is rich-neighbor, completing the proof.

    By op309_triple_star_forest_properties, R is a dominating set in the line graph of G: every edge e of G is adjacent in the line graph to some edge g ∈ R. Since every edge in R is rich (hrich), every edge of G has a rich neighbor, proving that c is a rich-neighbor coloring.

    lines 142–146

    uses op309_triple_star_forest_properties

      have hdom := (op309_triple_star_forest_properties (132 * k) ⟨44 * k, by ring⟩ G hstar R hR).2.2.2
      refine ⟨c, ?_, hrich⟩
      intro e _
      obtain ⟨g, hgR, hadj⟩ := hdom e
      exact ⟨g, hadj, hrich g hgR⟩
min_comm
Commutativity of the minimum function: min a b = min b a.
max_comm
Commutativity of the maximum function: max a b = max b a.
in1267_col_proper
In the 132-vertex base graph, the three incident edges at each vertex receive distinct colors modulo 5.
in1267_col_rich
In the 132-vertex base graph, for any leaf x of a triple star and its center c = 3*(x/3), incident edges other than (x, c) receive distinct colors.
in1267_nb_ex
If y is neighbor 0, 1, or 2 of a, then y = in1267_nb a i for some index i < 3.
in1267_ring_hA
Rewrites the ring graph adjacency relation G.Adj u v in terms of the explicit neighbor function in1267_nb.
in1267_ring_hom
Projection modulo 132 is a graph homomorphism: if u and v are adjacent in G, then v % 132 is one of the three neighbors of u % 132.
in1267_ring_inj
Projection modulo 132 is locally injective on the neighborhood of every vertex in G.
Nat.mod_lt
For any positive divisor y, x % y < y.
Fin.ext
Two Fin elements are equal if their underlying natural values are equal.
in1267_col_comm
The base edge coloring function is symmetric: in1267_col a b = in1267_col b a.
Sym2.lift_mk
Evaluating Sym2.lift on an unordered pair s(a, b) yields f(a, b).
SimpleGraph.mem_edgeSet
An unordered pair s(v, w) is in G.edgeSet if and only if v and w are adjacent in G.
SimpleGraph.Coloring.mk
Constructs a valid graph coloring from an assignment that gives distinct colors to adjacent elements.
Subtype.ext
Subtype values are equal if their underlying values are equal.
in1267_rep
Every edge in R can be written as s(x, c) where x is a leaf (x % 3 ≠ 0) and c is its center (c = 3*(x/3)).
Sym2.eq_swap
Unordered pairs are symmetric: s(a, b) = s(b, a).
congrArg
Congruence of functions with respect to equality: a = b implies f(a) = f(b).
Or.inl
Left injection into a disjunction: a implies a ∨ b.
in1267_blk_fwd
In the base graph, any two distinct vertices in the same 3-block where at least one is a center are adjacent.
op309_triple_star_forest_properties
In any graph containing all block star edges where 3 divides n, the triple-star forest R dominates the line graph.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

set_option synthInstance.maxSize 200000set_option synthInstance.maxHeartbeats 800000def in1267_CT : ℕ := 232393660599430572681724170620904006347697980114613523413201167604734886184128245715104673436736421550027862712915817389102516414817997725540616505621480784916475331682681555522245511621102108155770037473598857813131889599629076205983529187847735747445884396952528496523998254892656160826400783142915145115980654043116230652115027805566291739105765551112913def in1267_ct (a i : ℕ) : ℕ := (in1267_CT >>> (3 * (3 * a + i))) % 8def in1267_cab (a b : ℕ) : ℕ :=  if b = in1267_nb a 0 then in1267_ct a 0  else if b = in1267_nb a 1 then in1267_ct a 1 else in1267_ct a 2def in1267_col (a b : ℕ) : ℕ := in1267_cab (min a b) (max a b) % 5theorem in1267_col_comm (a b : ℕ) : in1267_col a b = in1267_col b a := by  unfold in1267_col  rw [min_comm, max_comm]theorem in1267_col_proper : ∀ a, a < 132 → ∀ i, i < 3 → ∀ j, j < 3 → i ≠ j →    in1267_col a (in1267_nb a i) ≠ in1267_col a (in1267_nb a j) := by  decide +kerneltheorem in1267_col_rich : ∀ x, x < 132 → x % 3 ≠ 0 → ∀ i, i < 3 → ∀ j, j < 3 →    in1267_nb x i ≠ 3 * (x / 3) → in1267_nb (3 * (x / 3)) j ≠ x →    in1267_col x (in1267_nb x i) ≠ in1267_col (3 * (x / 3)) (in1267_nb (3 * (x / 3)) j) := by  decide +kerneltheorem in1267_nb_ex {a y : ℕ} (h : y = in1267_nb a 0 ∨ y = in1267_nb a 1 ∨ y = in1267_nb a 2) :    ∃ i, i < 3 ∧ y = in1267_nb a i := by  rcases h with h | h | h  · exact ⟨0, by norm_num, h⟩  · exact ⟨1, by norm_num, h⟩  · exact ⟨2, by norm_num, h⟩theorem op309_girth9_block_ring_rich_coloring (k : ℕ)    (G : SimpleGraph (Fin (132 * k))) [DecidableRel G.Adj]    (hG : ∀ u v : Fin (132 * k), G.Adj u v ↔      let outside : List (ℕ × ℕ) := [(0,34), (1,6), (1,67), (2,10), (2,91), (3,31), (4,29), (4,88), (5,23), (5,71), (7,21), (7,65), (8,30), (8,125), (9,31), (10,116), (11,13), (11,113), (12,37), (13,79), (14,16), (14,85), (15,35), (16,106), (17,18), (17,115), (19,28), (19,124), (20,22), (20,38), (22,46), (23,110), (24,32), (25,94), (25,97), (26,89), (26,104), (27,34), (28,112), (29,62), (32,35), (33,130), (36,39), (37,53), (38,88), (40,61), (40,71), (41,44), (41,116), (42,45), (43,62), (43,103), (44,73), (46,80), (47,95), (47,118), (48,51), (49,77), (49,115), (50,92), (50,98), (52,124), (52,128), (53,104), (54,57), (55,103), (55,119), (56,64), (56,113), (58,89), (58,127), (59,67), (59,76), (60,63), (61,128), (64,100), (65,85), (66,69), (68,109), (68,131), (70,80), (70,122), (72,75), (73,121), (74,119), (74,131), (76,94), (77,79), (78,81), (82,97), (82,110), (83,91), (83,127), (84,87), (86,92), (86,122), (90,93), (95,109), (96,99), (98,107), (100,130), (101,118), (101,125), (102,105), (106,121), (107,112), (108,111), (114,117), (120,123), (126,129)]      let base : ℕ → ℕ → Prop := fun a b =>        (a ≠ b ∧ a / 3 = b / 3 ∧ (a % 3 = 0 ∨ b % 3 = 0)) ∨ (a, b) ∈ outside ∨ (b, a) ∈ outside      (u.val / 132 = v.val / 132 ∧ base (u.val % 132) (v.val % 132) ∧        ¬ (u.val % 132 = 36 ∧ v.val % 132 = 39) ∧ ¬ (u.val % 132 = 39 ∧ v.val % 132 = 36)) ∨      (u.val % 132 = 36 ∧ v.val % 132 = 39 ∧ v.val / 132 = (u.val / 132 + 1) % k) ∨      (u.val % 132 = 39 ∧ v.val % 132 = 36 ∧ u.val / 132 = (v.val / 132 + 1) % k))    (R : Finset G.edgeSet)    (hR : ∀ e : G.edgeSet, e ∈ R ↔ ∃ a b : Fin (132 * k), e.1 = s(a,b) ∧ a ≠ b ∧      a.val / 3 = b.val / 3 ∧ (a.val % 3 = 0 ∨ b.val % 3 = 0)) :    ∃ c : G.lineGraph.Coloring (Fin 5),      simple_graph_is_rich_neighbor_coloring G c ∧ ∀ e ∈ R, simple_graph_edge_is_rich G c e := by  have hA := in1267_ring_hA k G hG  have hhom := in1267_ring_hom k G hA  have hinj := in1267_ring_inj k G hA  have hm : ∀ v : Fin (132 * k), v.val % 132 < 132 := fun v => Nat.mod_lt _ (by norm_num)  let f : Fin (132 * k) → Fin (132 * k) → Fin 5 := fun u w =>    ⟨in1267_col (u.val % 132) (w.val % 132), Nat.mod_lt _ (by norm_num)⟩  have hf : ∀ u w, f u w = f w u := fun u w => Fin.ext (in1267_col_comm _ _)  let col : G.edgeSet → Fin 5 := fun e => Sym2.lift ⟨f, hf⟩ e.1  have hcol : ∀ (e : G.edgeSet) (v y : Fin (132 * k)), e.1 = s(v, y) →      (col e).val = in1267_col (v.val % 132) (y.val % 132) := by    intro e v y h    simp only [col, h, Sym2.lift_mk, f]  have hat : ∀ (e : G.edgeSet) (v : Fin (132 * k)), v ∈ e.1 → ∃ y, e.1 = s(v, y) ∧ G.Adj v y := by    intro e v hv    obtain ⟨y, hy⟩ := Sym2.mem_iff_exists.1 hv    refine ⟨y, hy, ?_⟩    have h2 := e.2    rw [hy] at h2    exact (SimpleGraph.mem_edgeSet G).1 h2  have hdist : ∀ (v y1 y2 : Fin (132 * k)), G.Adj v y1 → G.Adj v y2 → y1 ≠ y2 →      in1267_col (v.val % 132) (y1.val % 132) ≠ in1267_col (v.val % 132) (y2.val % 132) := by    intro v y1 y2 h1 h2 hne    obtain ⟨i, hi, e1⟩ := in1267_nb_ex (hhom v y1 h1)    obtain ⟨j, hj, e2⟩ := in1267_nb_ex (hhom v y2 h2)    have hij : i ≠ j := by      rintro rfl      exact hne (hinj v y1 y2 h1 h2 (e1.trans e2.symm))    rw [e1, e2]    exact in1267_col_proper _ (hm v) i hi j hj hij  let c : G.lineGraph.Coloring (Fin 5) := SimpleGraph.Coloring.mk col (by    intro e g hadj hc    obtain ⟨hne, v, hve, hvg⟩ := SimpleGraph.lineGraph_adj_iff_exists.1 hadj    obtain ⟨y1, e1, h1⟩ := hat e v hve    obtain ⟨y2, e2, h2⟩ := hat g v hvg    have hy : y1 ≠ y2 := by      rintro rfl      exact hne (Subtype.ext (e1.trans e2.symm))    exact hdist v y1 y2 h1 h2 hy (by rw [← hcol e v y1 e1, ← hcol g v y2 e2, hc]))  have hcv : ∀ (e : G.edgeSet) (v y : Fin (132 * k)), e.1 = s(v, y) →      (c e).val = in1267_col (v.val % 132) (y.val % 132) := hcol  have hrich : ∀ e ∈ R, simple_graph_edge_is_rich G c e := by    intro e he    obtain ⟨x, cc, hx, hc, hxc⟩ := in1267_rep hR he    have hxcadj : G.Adj x cc := by      have h2 := e.2      rw [hxc] at h2      exact (SimpleGraph.mem_edgeSet G).1 h2    have hpc : cc.val % 132 = 3 * (x.val % 132 / 3) := by omega    have hpx : x.val % 132 % 3 ≠ 0 := by omega    -- an edge f ≠ e through x (resp. cc) leaves along a neighbour other than cc (resp. x)    have cross : ∀ (f g : G.edgeSet) (y1 y2 : Fin (132 * k)), f.1 = s(x, y1) → g.1 = s(cc, y2) →        G.Adj x y1 → G.Adj cc y2 → e ≠ f → e ≠ g → (c f).val ≠ (c g).val := by      intro f g y1 y2 ef eg a1 a2 nf ng      have hy1 : y1 ≠ cc := by        rintro rfl        exact nf (Subtype.ext (hxc.trans ef.symm))      have hy2 : y2 ≠ x := by        rintro rfl        exact ng (Subtype.ext (hxc.trans (eg.trans (Sym2.eq_swap)).symm))      obtain ⟨i, hi, e1⟩ := in1267_nb_ex (hhom x y1 a1)      obtain ⟨j, hj, e2⟩ := in1267_nb_ex (hhom cc y2 a2)      have n1 : y1.val % 132 ≠ cc.val % 132 := fun h => hy1 (hinj x y1 cc a1 hxcadj h)      have n2 : y2.val % 132 ≠ x.val % 132 := fun h => hy2 (hinj cc y2 x a2 hxcadj.symm h)      rw [hcv f x y1 ef, hcv g cc y2 eg, e1, e2, hpc]      rw [e1, hpc] at n1      rw [e2, hpc] at n2      exact in1267_col_rich _ (hm x) hpx i hi j hj n1 n2    intro f g hf hg hfg hcfg    obtain ⟨nf, v1, hv1e, hv1f⟩ := SimpleGraph.lineGraph_adj_iff_exists.1 hf    obtain ⟨ng, v2, hv2e, hv2g⟩ := SimpleGraph.lineGraph_adj_iff_exists.1 hg    rw [hxc] at hv1e hv2e    obtain ⟨y1, ef, a1⟩ := hat f v1 hv1f    obtain ⟨y2, eg, a2⟩ := hat g v2 hv2g    have hcfg' : (c f).val = (c g).val := congrArg Fin.val hcfg    rcases Sym2.mem_iff.1 hv1e with h1 | h1 <;> rcases Sym2.mem_iff.1 hv2e with h2 | h2 <;>      rw [h1] at ef a1 <;> rw [h2] at eg a2    · have hy : y1 ≠ y2 := by        rintro rfl        exact hfg (Subtype.ext (ef.trans eg.symm))      exact hdist x y1 y2 a1 a2 hy (by rw [← hcv f x y1 ef, ← hcv g x y2 eg]; exact hcfg')    · exact cross f g y1 y2 ef eg a1 a2 nf ng hcfg'    · exact cross g f y2 y1 eg ef a2 a1 ng nf hcfg'.symm    · have hy : y1 ≠ y2 := by        rintro rfl        exact hfg (Subtype.ext (ef.trans eg.symm))      exact hdist cc y1 y2 a1 a2 hy (by rw [← hcv f cc y1 ef, ← hcv g cc y2 eg]; exact hcfg')  have hstar : ∀ a b : Fin (132 * k), a ≠ b → a.val / 3 = b.val / 3 →      (a.val % 3 = 0 ∨ b.val % 3 = 0) → G.Adj a b := by    intro a b hab h3 h0    have hab' : a.val ≠ b.val := fun h => hab (Fin.ext h)    rw [hA]    refine Or.inl ⟨by omega, ?_, by omega, by omega⟩    exact in1267_blk_fwd _ (hm a) _ (hm b) ⟨by omega, by omega, by omega⟩  have hdom := (op309_triple_star_forest_properties (132 * k) ⟨44 * k, by ring⟩ G hstar R hR).2.2.2  refine ⟨c, ?_, hrich⟩  intro e _  obtain ⟨g, hgR, hadj⟩ := hdom e  exact ⟨g, hadj, hrich g hgR⟩
See it in the graphDiscuss this resultChallenge it