AFTD Auto-Formalizing Theoretical Domains

algebraic_bipartite_graph_is_bipartite

theoremverified

For any natural number $k$ and commutative ring $R$, the algebraic bipartite graph $\Lambda_{k, R}$ is bipartite, having a proper 2-coloring.

Statement

theorem algebraic_bipartite_graph_is_bipartite (k : ℕ) (R : Type*) [CommRing R] :
    (algebraic_bipartite_graph k R).Colorable 2
Source
arXiv:2611.32201
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • algebraic_bipartite_graphThe algebraic bipartite graph $\Lambda_{k, R}$ with left vertices $\{l \in R^{k+1} \mid l_1 = l_2 \text{ if } 2 \le k\}$ and right…

Read back from the Lean

For every natural number $k$ and every commutative ring $R$, the simple graph algebraic_bipartite_graph k R is 2-colorable (admits a proper 2-coloring).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

To show that $\Lambda_{k, R}$ is bipartite (2-colorable), we construct an explicit 2-coloring assigning color 0 to left vertices and color 1 to right vertices. By the definition of the graph, edges can only exist between a left vertex and a right vertex, with no edges within either partition. Therefore, every edge connects vertices in opposite partitions, which receive distinct colors ($0 \ne 1$), confirming the coloring is proper.

  1. To show that the graph is 2-colorable, it suffices to verify that assigning color 0 to left vertices and color 1 to right vertices defines a proper coloring.

    We provide an explicit 2-coloring via `SimpleGraph.Coloring.mk`. Because the vertex set of $\Lambda_{k, R}$ is the disjoint sum of a left set $L$ and a right set $R$, we define the coloring by sending left vertices (`Sum.inl _`) to $0 \in \mathrm{Fin}\ 2$ and right vertices (`Sum.inr _`) to $1 \in \mathrm{Fin}\ 2$. It remains to prove that adjacent vertices receive different colors.

    lines 4–6

    uses SimpleGraph.Coloring.mk

      refine ⟨SimpleGraph.Coloring.mk (fun x => match x with
        | Sum.inl _ => (0 : Fin 2)
        | Sum.inr _ => (1 : Fin 2)) ?_⟩
  2. If $v$ belongs to the left partition, any vertex $w$ adjacent to $v$ receives a different color from $v$.

    We assume $v$ and $w$ are adjacent vertices with edge $h$. Since $v = \mathrm{inl}\ l$ is in the left partition, we split into cases on $w$: - If $w = \mathrm{inl}\ l'$ is also in the left partition, this is impossible: by definition of $\Lambda_{k, R}$, adjacency between two left vertices is `False`, so $h$ yields a contradiction. - If $w = \mathrm{inr}\ r$ is in the right partition, the assigned colors are $0$ and $1$, which are distinct ($0 \ne 1$).

    lines 7–12

      intro v w h
      cases v with
      | inl l =>
        cases w with
        | inl l' => exact absurd h (by simp [algebraic_bipartite_graph])
        | inr r => simp
  3. If $v$ belongs to the right partition, any vertex $w$ adjacent to $v$ receives a different color from $v$.

    Similarly, when $v = \mathrm{inr}\ r$ is in the right partition, we split into cases on $w$: - If $w = \mathrm{inl}\ l$ is in the left partition, the colors are $1$ and $0$, which are distinct ($1 \ne 0$). - If $w = \mathrm{inr}\ r'$ is also in the right partition, this is impossible because adjacency between two right vertices in $\Lambda_{k, R}$ is `False`, contradicting the assumed edge $h$.

    lines 13–16

      | inr r =>
        cases w with
        | inl l => simp
        | inr r' => exact absurd h (by simp [algebraic_bipartite_graph])
SimpleGraph.Coloring.mk
Given a coloring function on vertices and a proof that adjacent vertices receive distinct colors, constructs a valid graph coloring.

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

/-- The algebraic bipartite graph Lambda_{k, R} is bipartite (2-colorable). -/theorem algebraic_bipartite_graph_is_bipartite (k : ℕ) (R : Type*) [CommRing R] :    (algebraic_bipartite_graph k R).Colorable 2 := by  refine ⟨SimpleGraph.Coloring.mk (fun x => match x with    | Sum.inl _ => (0 : Fin 2)    | Sum.inr _ => (1 : Fin 2)) ?_⟩  intro v w h  cases v with  | inl l =>    cases w with    | inl l' => exact absurd h (by simp [algebraic_bipartite_graph])    | inr r => simp  | inr r =>    cases w with    | inl l => simp    | inr r' => exact absurd h (by simp [algebraic_bipartite_graph])
See it in the graphDiscuss this resultChallenge it